Sapling_helpers.Interpreter_helpers
include module type of struct include Common end
val memo_size_of_int :
int ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Sapling.Memo_size.t
val int_of_memo_size :
Mavryk_protocol_alpha.Protocol.Alpha_context.Sapling.Memo_size.t ->
int
val wallet_gen : unit -> wallet
val gen_addr :
int ->
Mavryk_sapling.Core.Client.Viewing_key.t ->
Mavryk_sapling.Core.Client.Viewing_key.address list
val gen_nf : unit -> Mavryk_sapling.Core.Client.Nullifier.t
val gen_cm_cipher :
memo_size:int ->
unit ->
Mavryk_sapling.Core.Client.Commitment.t
* Mavryk_sapling.Core.Client.Ciphertext.t
val client_state_of_diff :
memo_size:int ->
(Mavryk_sapling.Core.Validator.Hash.t
* Mavryk_protocol_alpha.Protocol.Alpha_context.Sapling.diff) ->
Mavryk_sapling.Storage.state
include module type of struct include Contract_helpers end
val init :
unit ->
(Block.t
* Mavryk_protocol_environment_alpha.Signature.Public_key_hash.t
* Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t
* Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
Initializes 2 addresses to do only operations plus one that will be used to bake.
val load_script :
storage:string ->
string ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Script.t
Loads a script from file.
val originate_contract :
string ->
string ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t ->
Block.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
(Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t * Block.t,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val fake_KT1 : Mavryk_protocol_alpha.Protocol.Contract_hash.t
val default_self : Mavryk_protocol_alpha.Protocol.Contract_hash.t
val default_payer : Mavryk_base.TzPervasives.Signature.Public_key_hash.t
val default_sender : Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t
val default_step_constants :
Mavryk_protocol_alpha.Protocol.Script_interpreter.step_constants
val run_script :
Mavryk_raw_protocol_alpha.Alpha_context.t ->
?logger:Mavryk_raw_protocol_alpha.Script_typed_ir.logger ->
?step_constants:
Mavryk_protocol_alpha.Protocol.Script_interpreter.step_constants ->
?internal:bool ->
string ->
?entrypoint:Mavryk_protocol_alpha.Protocol.Alpha_context.Entrypoint.t ->
storage:string ->
parameter:string ->
unit ->
(Mavryk_protocol_alpha.Protocol.Script_interpreter.execution_result
* Mavryk_raw_protocol_alpha.Alpha_context.context)
Mavryk_base.TzPervasives.tzresult
Lwt.t
Helper function that parses and typechecks a script, its initial storage and parameters from strings. It then executes the typed script with the storage and parameters and returns the result.
The step_constants
argument passes in some data which remains constant throughout script's execution, hence the name. This includes addresses of the sender and payer, the address of the smart contract, the amount of Tez transferred to it and so on.
An internal
operation is an operation generated by smart contract's execution rather than by an implicit account.
val originate_contract_from_string_hash :
script:string ->
storage:string ->
source_contract:Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t ->
baker:Mavryk_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
Block.t ->
(Mavryk_protocol_alpha.Protocol.Contract_hash.t
* Mavryk_protocol_alpha.Protocol.Alpha_context.Script.t
* Block.t,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val originate_contract_from_string :
script:string ->
storage:string ->
source_contract:Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t ->
baker:Mavryk_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
Block.t ->
(Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t
* Mavryk_protocol_alpha.Protocol.Alpha_context.Script.t
* Block.t,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val originate_contract_hash :
string ->
string ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t ->
Block.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
(Mavryk_protocol_alpha.Protocol.Contract_hash.t * Block.t * string,
Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
Returns a block in which the contract is originated. Also returns the associated anti-replay string and KT1 address.
val hex_shield : memo_size:int -> wallet -> string -> string
val transac_and_sync :
memo_size:int ->
Block.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Script.lazy_expr ->
int ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Contract.t ->
Mavryk_raw_protocol_alpha.Contract_hash.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.public_key_hash ->
(Block.t * Mavryk_sapling.Storage.state, Mavryk_base.TzPervasives.tztrace)
Stdlib.result
Lwt.t
val shield :
memo_size:int ->
Mavryk_sapling.Forge.Core.Spending_key.t ->
int ->
Mavryk_sapling.Core.Wallet.Viewing_key.t ->
(string -> 'a) ->
string ->
'b list * int
val next_block :
Block.t ->
Mavryk_protocol_alpha.Protocol.Alpha_context.Operation.packed ->
(Block.t, Mavryk_base.TzPervasives.tztrace) Stdlib.result Lwt.t