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

Ensure that balance/value is checked for as 128 bits and not 64 bits #191

Merged
merged 1 commit into from
Apr 23, 2018

Conversation

axic
Copy link
Member

@axic axic commented Apr 23, 2018

Part of #190.

@axic axic changed the title Ensure that balance/value is checked for as 128 bits and 64 bits Ensure that balance/value is checked for as 128 bits and not 64 bits Apr 23, 2018
@axic axic requested review from chfast and jakelang April 23, 2018 22:27
@axic
Copy link
Member Author

axic commented Apr 23, 2018

@hugo-dc here's a fix if you want to try

@hugo-dc
Copy link
Member

hugo-dc commented Apr 23, 2018

Still getting an error:

InternalError: Value exceeds 128 bits.

It finds a non-zero byte in position 13 here:

if (value.bytes[i])

@axic
Copy link
Member Author

axic commented Apr 23, 2018

As mentioned in the issue there is still an endianess problem.

@axic
Copy link
Member Author

axic commented Apr 23, 2018

The code expects it to be littlebig endian but you're sending biglittle endian. I am confused at this point at what endianess we decided on.

@hugo-dc
Copy link
Member

hugo-dc commented Apr 23, 2018

LoadMemory loads 16 bytes of data into the first 16 bytes of value. When I send this value: \20\a1\07\00\00\00\00\00\00\00\00\00\00\00\00\00, I get the error I mentioned above (found a non-zero byte at position 13), if I send this value: \00\00\00\00\00\00\00\00\00\00\00\00\00\07\a1\20 I get the same error, now indicating that the non-zero byte is in position 0.

i: 0
InternalError: Value exceeds 128 bits.

If I try to call sending 32 bytes it doesn't work either, because LoadMemory only reads 16 bytes (it would read only zeroes).

@axic
Copy link
Member Author

axic commented Apr 23, 2018

I'm merging this because it fixes one problem, 64 -> 128 bits. Lets fix endianess separately.

@axic axic merged commit 91d902f into master Apr 23, 2018
@axic axic deleted the balance-128 branch April 23, 2018 23:32
@axic axic removed the in progress label Apr 23, 2018
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.

3 participants