ewasm-kernel icon indicating copy to clipboard operation
ewasm-kernel copied to clipboard

fix endianness of getBalance

Open cdetrio opened this issue 7 years ago • 2 comments

The endianness of getBalance was broken, but the test was passing because 0x0500000000000000 in little endian is equal to the first 64 bits of 0x00000000000000056bc75e2d63100000 in big endian.

cdetrio avatar Jan 21 '18 21:01 cdetrio

I think this isn't the right way to do it because the main purpose of the u256 class is to hide endinaness issues. If you change the endinaness for geBalance you need to do the same for getCallValue and all the call/create interfaces.

Actually it seems this commit broke it: https://github.com/ewasm/ewasm-kernel/commit/218378ee81f2cf20c03ed1333553072db9dd4205#diff-efe23f6b663b1ac76c853f19c9362733

The le to be change inu256.js should be reversed.

axic avatar Jan 23 '18 18:01 axic

After reverting the change in https://github.com/ewasm/ewasm-kernel/commit/218378ee81f2cf20c03ed1333553072db9dd4205#diff-efe23f6b663b1ac76c853f19c9362733, I see the following when running the vmTests:

1..1793
# tests 1793
# pass  1726
# fail  67

lrettig avatar May 23 '18 20:05 lrettig