Tezt_mavryk.Demo_client
module Time = Mavryk_base.Time.System
Run Mavryk client with commands related to `demo_protocol`.
val activate :
?endpoint:Client.endpoint ->
?fitness:int ->
?key:string ->
?timestamp:Client.timestamp ->
Client.t ->
unit Lwt.t
Run mavkit-client activate protocol
with `demo_protocol`.
If timestamp
is not specified explicitely, it is set to Ago
timestamp_delay
, where timestamp_delay
is 365 days, which allows to bake plenty of blocks before their timestamp reach the present (at which point one would have to wait between each block so that peers do not reject them for being in the future).
val bake : ?msg:string -> Client.t -> unit Lwt.t
Run mavkit-client bake
.
val get_a : Client.t -> int Lwt.t
Run mavkit-client get a
, get the current value of counter `a`.
val get_b : Client.t -> int Lwt.t
Run mavkit-client get a
, get the current value of counter `b`.
val increment_a : Client.t -> unit Lwt.t
Run mavkit-client increment a
, add one to counter `a`.
val increment_b : Client.t -> unit Lwt.t
Run mavkit-client increment b
, add one to counter `a`..
val transfer : Client.t -> int -> unit Lwt.t
Run mavkit-client transfer amount
, when amount
is positive, transfer amount
from counter `a` to counter `b. When amount
is negative, transfer -amount
from `b` to `a`.