Skip to content

Conversation

@mattbajorek
Copy link
Contributor

@mattbajorek mattbajorek commented Dec 5, 2021

Description

Fixes rpcclient issue caused by using the rpcclient with bitcoind and expecting an int64, but bitcoind is returning a float64.

Changes

  • Change getnetworkhashps and handlers return type from an int64 to a float64 to be aligned with bitcoin core and to also avoid the overflow

Testing

  • Extended rpcserver integration tests to test client methods GetNetworkHashPS, GetNetworkHashPS2, and GetNetworkHashPS3

@mattbajorek mattbajorek force-pushed the getnetworkhashps-float64 branch from a41daf2 to b6898d7 Compare December 6, 2021 14:39
@mattbajorek mattbajorek changed the title Bugfix: rpcclient: GetNetworkHashPS3 must be float64 rpcclient+rpcserver+integration: GetNetworkHashPS3 must be float64 Dec 6, 2021
@coveralls
Copy link

coveralls commented Dec 7, 2021

Pull Request Test Coverage Report for Build 1545100937

  • 0 of 15 (0.0%) changed or added relevant lines in 2 files are covered.
  • 4 unchanged lines in 1 file lost coverage.
  • Overall coverage decreased (-0.003%) to 52.902%

Changes Missing Coverage Covered Lines Changed/Added Lines %
rpcclient/mining.go 0 5 0.0%
rpcserver.go 0 10 0.0%
Files with Coverage Reduction New Missed Lines %
database/ffldb/blockio.go 4 92.62%
Totals Coverage Status
Change from base Build 1521397128: -0.003%
Covered Lines: 21154
Relevant Lines: 39987

💛 - Coveralls

Copy link
Member

@jcvernaleo jcvernaleo left a comment

Choose a reason for hiding this comment

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

Looks good and thanks for adding tests!

@jcvernaleo jcvernaleo merged commit a1f43e4 into btcsuite:master Dec 14, 2021
@mattbajorek mattbajorek deleted the getnetworkhashps-float64 branch December 15, 2021 18:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

rpcclient: GetNetworkHashPS3 must be float64

3 participants