Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change ValidatorPower type from BigInt to string #4005

Open
wants to merge 3 commits into
base: 5.4-maintenance
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ Version 5.4.2

To be released.

- (Libplanet.Explorer) Changed `ValidatorPower` type of `VoteType` from
`BigIntGraphType` to `StringGraphType`. [[#4005]]

[#4005]: https://github.com/planetarium/libplanet/pull/4005


Version 5.4.1
-------------
Expand Down
2 changes: 1 addition & 1 deletion test/Libplanet.Explorer.Tests/GraphTypes/BlockTypeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public async void Query()
{ "blockHash", lastVotes[0].BlockHash.ToString() },
{ "timestamp", new DateTimeOffsetGraphType().Serialize(lastVotes[0].Timestamp) },
{ "validatorPublicKey", lastVotes[0].ValidatorPublicKey.ToString() },
{ "validatorPower", lastVotes[0].ValidatorPower },
{ "validatorPower", lastVotes[0].ValidatorPower?.ToString("N0") },
{ "flag", lastVotes[0].Flag.ToString() },
{ "signature", ByteUtil.Hex(lastVotes[0].Signature) },
}
Expand Down
2 changes: 1 addition & 1 deletion test/Libplanet.Explorer.Tests/GraphTypes/VoteTypeTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public async void Query()
Assert.Equal(vote.BlockHash.ToString(), resultData["blockHash"]);
Assert.Equal(new DateTimeOffsetGraphType().Serialize(vote.Timestamp), resultData["timestamp"]);
Assert.Equal(vote.ValidatorPublicKey.ToString(), resultData["validatorPublicKey"]);
Assert.Equal(vote.ValidatorPower, resultData["validatorPower"]);
Assert.Equal(vote.ValidatorPower?.ToString("N0"), resultData["validatorPower"]);
Assert.Equal(vote.Flag.ToString(), resultData["flag"]);
Assert.Equal(ByteUtil.Hex(vote.Signature), resultData["signature"]);
}
Expand Down
4 changes: 2 additions & 2 deletions tools/Libplanet.Explorer/GraphTypes/VoteType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ public VoteType()
"ValidatorPublicKey",
description: "Public key of the validator which is subject of the vote.",
resolve: ctx => ctx.Source.ValidatorPublicKey);
Field<BigIntGraphType>(
Field<StringGraphType>(
"ValidatorPower",
description: "Power of the validator which is subject of the vote.",
resolve: ctx => ctx.Source.ValidatorPower);
resolve: ctx => ctx.Source.ValidatorPower?.ToString("N0"));
Field<NonNullGraphType<VoteFlagType>>(
"Flag",
description: "Flag of the vote",
Expand Down
Loading