Revision 5f92df59c8ea01930d2e9e1d238806885fb2d591 authored by Raphaël Proust on 27 June 2019, 00:19:25 UTC, committed by Pierre Boutillier on 21 October 2019, 12:25:24 UTC
The Michelson documentation states that `COMPARE` pushes -1 (resp. 1)
if the top element of the stack is smaller (resp. greater) than the
second. However, the implementation can actually push a negative
number instead of -1 and a positive number instead of 1 depending on
the type and values.

This semantics should not break any code as the result of `COMPARE` is
almost always comsumed by comparison projectors such as `GT` or `LT`
who only care about the sign. However, for the sake of consistency,
this patches makes `COMPARE` return only -1, 0 or 1.

This fixes issue #546
1 parent 36fbc8d
History
File Mode Size
client
daemons
examples
launchers
scripts
tests
tools
.gitignore -rw-r--r-- 43 bytes
Makefile -rw-r--r-- 770 bytes
mypy.ini -rw-r--r-- 81 bytes
pytest.ini -rw-r--r-- 222 bytes
requirements.txt -rw-r--r-- 524 bytes

back to top