Skip to content
This repository has been archived by the owner on Nov 15, 2021. It is now read-only.

fix BigInteger.ToByteArray() for certain negative values #963

Merged
merged 1 commit into from
Jun 11, 2019
Merged

fix BigInteger.ToByteArray() for certain negative values #963

merged 1 commit into from
Jun 11, 2019

Conversation

ixje
Copy link
Member

@ixje ixje commented Jun 10, 2019

What current issue(s) does this address, or what feature is it adding?
the audit of testnet block 678752 showed a storage deviation caused by a difference in return value for the BigInteger.ToByteArray() method for the number -48335248028225339427907476932896373492484053930

How did you solve this problem?
glanced at the C# source of the BigInteger class and applied somewhat similar logic

How did you make sure your solution works?
test cases + audit now passes for the block

Are there any special changes in the code that we should be aware of?

Please check the following, if applicable:

  • Did you add any tests?
  • Did you run make lint?
  • Did you run make test?
  • Are you making a PR to a feature branch or development rather than master?
  • Did you add an entry to CHANGELOG.rst? (if not, please do)

@coveralls
Copy link

Coverage Status

Coverage increased (+0.009%) to 85.113% when pulling 07095e8 on ixje:fix-bigint-tobytearray into 69a1ef5 on CityOfZion:development.

@ixje ixje merged commit 82594df into CityOfZion:development Jun 11, 2019
@ixje ixje deleted the fix-bigint-tobytearray branch June 11, 2019 06:19
@ixje ixje mentioned this pull request Jun 12, 2019
5 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants