Tezos_protocol_plugin_alpha.Script_native_synthesisSynthesis of a Michelson script for native contracts.
Native contracts have no on-chain Michelson code, so the contract script RPC used to return nothing for them. This module synthesizes, from a native contract's typed interface, a Michelson script that exposes the contract's real entrypoints and the real input/output types of its views, with non-functional placeholder bodies. This lets standard contract tooling discover and validate a native contract's interface as if it were an ordinary contract.
Raised when a native contract's typed interface cannot be derived, so no script can be synthesized. The underlying cause is kept in the error trace.
val of_native :
Tezos_protocol_alpha.Protocol.Alpha_context.context ->
Tezos_protocol_alpha.Protocol.Script_native_repr.t ->
storage:Tezos_protocol_alpha.Protocol.Alpha_context.Script.lazy_expr ->
Tezos_protocol_alpha.Protocol.Alpha_context.Script.michelson_with_storage
Tezos_protocol_alpha.Environment.Error_monad.tzresultof_native ctxt kind ~storage synthesizes a Michelson michelson_with_storage for the native contract kind.
The synthesized code exposes:
storage);The contract code and every view body are non-functional FAILWITH stubs: the result is well-typed (it type-checks) but reproduces none of the native contract's behavior. storage is returned unchanged as the script storage.