CityOfZion / neo-python

Python Node and SDK for the NEO 2.x blockchain. For NEO 3.x go to our successor project neo-mamba
https://neo-python.readthedocs.io/en/latest/
MIT License
313 stars 189 forks source link

fix stack item deserialization for Boolean VM type #994

Closed ixje closed 5 years ago

ixje commented 5 years ago

What current issue(s) does this address, or what feature is it adding? audit of testnet block 2591458 showed a deviation in storage value due to wrong a deserialization of a Boolean VM type. This was caused by the Boolean type receiving an integer as value as opposed to a bool type. This resulted in deserializing the value 44 as opposed to True, leading to a 0x01 0x2c instead of 0x01 0x01.

How did you solve this problem? convert int to bool for stack item deserialization

How did you make sure your solution works? audit of block passes

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

Please check the following, if applicable:

coveralls commented 5 years ago

Coverage Status

Coverage remained the same at 85.28% when pulling 2af702ec337ece55d8e3ca7f19b3cf00b411dfc9 on ixje:fix-boolean-type into a3503880f1c3f7d108655dee01486cf65c04700a on CityOfZion:development.