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

Return FP strings for getunclaimedgas #1572

Merged
merged 3 commits into from
Dec 9, 2020
Merged

Return FP strings for getunclaimedgas #1572

merged 3 commits into from
Dec 9, 2020

Conversation

fyrchik
Copy link
Contributor

@fyrchik fyrchik commented Nov 30, 2020

Close #1570 .

We use big.Int there, so I've implemented functions in util. They could be used in future in other places.

pkg/util/decimal.go Outdated Show resolved Hide resolved
pkg/util/decimal.go Outdated Show resolved Hide resolved
pkg/util/decimal.go Outdated Show resolved Hide resolved
pkg/util/decimal.go Outdated Show resolved Hide resolved
@@ -25,7 +25,7 @@ type unclaimedGas struct {
func (g UnclaimedGas) MarshalJSON() ([]byte, error) {
gas := &unclaimedGas{
Address: address.Uint160ToString(g.Address),
Unclaimed: g.Unclaimed.String(),
Unclaimed: util.DecimalToString(&g.Unclaimed, 8),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BTW, it's really a question if big.Int is suitable here. Technically, it'd be nice to have GAS values using the same type in every case.

@roman-khimov
Copy link
Member

cbececc has incorrect (after the move) commit message prefix.

But this also allows us to fix neo-project/neo#2082 easily now, let's do that.

@roman-khimov
Copy link
Member

Just noticed that linter isn't happy. We can merge this and then fix neo-project/neo#2082 in a separate PR.

@codecov
Copy link

codecov bot commented Dec 9, 2020

Codecov Report

Merging #1572 (df801a8) into master (8ed1d4d) will increase coverage by 5.16%.
The diff coverage is 96.15%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1572      +/-   ##
==========================================
+ Coverage   76.18%   81.34%   +5.16%     
==========================================
  Files         238      239       +1     
  Lines       18758    18779      +21     
==========================================
+ Hits        14291    15276     +985     
+ Misses       3466     2513     -953     
+ Partials     1001      990      -11     
Impacted Files Coverage Δ
pkg/rpc/response/result/unclaimed_gas.go 62.50% <50.00%> (ø)
cli/flags/fixed8.go 100.00% <100.00%> (ø)
cli/smartcontract/smart_contract.go 87.28% <100.00%> (ø)
cli/wallet/nep17.go 74.33% <100.00%> (ø)
pkg/core/state/notification_event.go 84.48% <100.00%> (ø)
pkg/core/transaction/transaction.go 88.60% <100.00%> (+1.26%) ⬆️
pkg/encoding/fixedn/decimal.go 100.00% <100.00%> (ø)
pkg/encoding/fixedn/fixed8.go 100.00% <100.00%> (ø)
pkg/rpc/client/rpc.go 83.17% <100.00%> (ø)
pkg/rpc/response/result/invoke.go 70.00% <100.00%> (ø)
... and 38 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 8ed1d4d...df801a8. Read the comment docs.

@roman-khimov roman-khimov merged commit d5006c6 into master Dec 9, 2020
@roman-khimov roman-khimov deleted the getunclaimed branch December 9, 2020 11:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rpc RPC server and client
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Return FP strings for getunclaimedgas
2 participants