From a6241a79f8feb07b9e364796fb1d150122ddb96a Mon Sep 17 00:00:00 2001 From: Nicolas Ayache Date: Wed, 22 Feb 2023 14:59:25 +0100 Subject: [PATCH] Doc/Michelson: redirect operations on timestamps to interactive reference. --- docs/alpha/michelson.rst | 45 +++++----------------------------------- 1 file changed, 5 insertions(+), 40 deletions(-) diff --git a/docs/alpha/michelson.rst b/docs/alpha/michelson.rst index 0f9530a00dba..65358465fb8f 100644 --- a/docs/alpha/michelson.rst +++ b/docs/alpha/michelson.rst @@ -1002,48 +1002,13 @@ Domain specific operations Operations on timestamps ~~~~~~~~~~~~~~~~~~~~~~~~ -Timestamps can be obtained by the ``NOW`` operation, or retrieved from -script parameters or globals. +A detailed description of the following instructions can be found in the `interactive Michelson reference manual `__. - ``ADD`` Increment / decrement a timestamp of the given number of - seconds. - -:: - - :: timestamp : int : 'S -> timestamp : 'S - :: int : timestamp : 'S -> timestamp : 'S - - > ADD / seconds : nat (t) : S => (seconds + t) : S - > ADD / nat (t) : seconds : S => (t + seconds) : S - -- ``SUB`` Subtract a number of seconds from a timestamp. - -:: - - :: timestamp : int : 'S -> timestamp : 'S - - > SUB / seconds : nat (t) : S => (seconds - t) : S - -- ``SUB`` Subtract two timestamps. - -:: - - :: timestamp : timestamp : 'S -> int : 'S - - > SUB / seconds(t1) : seconds(t2) : S => (t1 - t2) : S - -- ``COMPARE``: Timestamp comparison. - -:: - - :: timestamp : timestamp : 'S -> int : 'S - - > COMPARE / seconds(t1) : seconds(t2) : S => -1 : S - iff t1 < t2 - > COMPARE / seconds(t1) : seconds(t2) : S => 0 : S - iff t1 = t2 - > COMPARE / seconds(t1) : seconds(t2) : S => 1 : S - iff t1 > t2 + seconds (`documentation `__). +- ``SUB`` Subtract a number of seconds from a timestamp (`documentation `__). +- ``SUB`` Subtract two timestamps (`documentation `__). +- ``COMPARE``: Timestamp comparison (`documentation `__). Operations on Mutez -- GitLab