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

Decode balance giving strange result #12

Closed
slothbag opened this issue Mar 9, 2016 · 1 comment
Closed

Decode balance giving strange result #12

slothbag opened this issue Mar 9, 2016 · 1 comment
Labels

Comments

@slothbag
Copy link

slothbag commented Mar 9, 2016

The HEX returned from geth = "0x989680" or 0x0000000000000000000000000000000000000000000000000000000000989680 padded.

This should convert to 10000000, but decoding to ulong overflows, and decoding to BigInteger returns -6893242 or something like that.

@slothbag
Copy link
Author

slothbag commented Mar 9, 2016

Can you just reverse the entire array like that or does it need to be done in pairs?

if (BitConverter.IsLittleEndian)
{
    encoded = unpaddedBytes.ToArray().Reverse().ToArray();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants