Michelson: update the documentation

This commit is contained in:
Benjamin Canou 2018-06-17 03:14:40 +02:00
parent e77edb7964
commit 4f3b591e63

View File

@ -1442,8 +1442,12 @@ Special operations
:: 'S -> timestamp : 'S :: 'S -> timestamp : 'S
Serialization Operations on bytes
~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~
Bytes are used for serializing data, in order to check signatures and
compute hashes on them. They can also be used to incorporate data from
the wild and untyped outside world.
- ``PACK``: Serializes a piece of data to its optimized - ``PACK``: Serializes a piece of data to its optimized
binary representation. binary representation.
@ -1452,12 +1456,26 @@ Serialization
:: 'a : 'S -> bytes : 'S :: 'a : 'S -> bytes : 'S
- ``UNPACK 'a``: Deserializes a piece of data, is valid. - ``UNPACK 'a``: Deserializes a piece of data, if valid.
:: ::
:: bytes : 'S -> option 'a : 'S :: bytes : 'S -> option 'a : 'S
- ``COMPARE``: Lexicographic comparison.
::
:: bytes : bytes : 'S -> int : 'S
> COMPARE / s : t : S => -1 : S
iff s < t
> COMPARE / s : t : S => 0 : S
iff s = t
> COMPARE / s : t : S => 1 : S
iff s > t
Cryptographic primitives Cryptographic primitives
~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~
@ -1472,14 +1490,28 @@ Cryptographic primitives
:: ::
:: 'a : 'S -> string : 'S :: bytes : 'S -> bytes : 'S
- ``SHA256``: Compute a cryptographic hash of the value contents using the
Sha256 cryptographic hash function.
::
:: bytes : 'S -> bytes : 'S
- ``SHA512``: Compute a cryptographic hash of the value contents using the
Sha512 cryptographic hash function.
::
:: bytes : 'S -> bytes : 'S
- ``CHECK_SIGNATURE``: Check that a sequence of bytes has been signed - ``CHECK_SIGNATURE``: Check that a sequence of bytes has been signed
with a given key. with a given key.
:: ::
:: key : signature : string : 'S -> bool : 'S :: key : signature : bytes : 'S -> bool : 'S
- ``COMPARE``: - ``COMPARE``: