ewasm-kernel
ewasm-kernel copied to clipboard
fix endianness of getBalance
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.
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.
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