Natural numbers handling
Description
During the interpretation of the contract sometimes we're trying to optionally produce negative natural numbers
which should return None
, however our interpreter fails with an Exception: arithmetic underflow
Steps to reproduce
stack exec -- morley run --contract .contracts/tezos_examples/opcodes/and_binary.tz --parameter "Unit" --storage "Unit"
stack exec -- morley run --contract contracts/tezos_examples/opcodes/packunpack_rev.tz --parameter "Pair 259 (Pair 6 (Pair \"f0UvxdVHhc\" (Pair 0x68 (Pair 241453638190014775 (Pair False (Pair \"tz3d1qQK4oeQ5pXvjcnVoDcUJYePdXZVaC4Y\" (Pair \"2009-08-12T17:10:18Z\" \"tz1VSyCEKiPZzZp7qCG8e7dp8AoxCwLwNAaP\")))))))" --storage "Unit"
Expected behaviour
Contract are successfully run
Actual behaviour
There is morley: arithmetic underflow
. However, the reference implementation (tezos-client run script
) doesn't fail
Environment
- NixOS 20.03 with stack built binary
- 6f9dada8