Evm_node_lib_dev.Services_backend_sig
module type S = sig ... end
module type Backend = sig ... end
Inject transactions with either RPCs or on a websocket connection.
module type Tx_container = sig ... end
Tx_container
is the signature of the module that deals with storing and forwarding transactions. the module type is used by Services.dispatch_request
to request informations about pending transactions.
'f tx_container
is a GADT parametrized by the same type argument as L2_types.chain_family
. It is useful to statically guarantee that the launched tx-container uses types compatible with the chain's chain family.
type 'f tx_container =
| Evm_tx_container : (module Tx_container
with type address = Evm_node_lib_dev_encoding.Ethereum_types.address
and type legacy_transaction_object =
Evm_node_lib_dev_encoding.Ethereum_types.legacy_transaction_object
and type transaction_object = Transaction_object.t) -> Evm_node_lib_dev_encoding.L2_types.evm_chain_family
tx_container
| Michelson_tx_container : (module Tx_container
with type legacy_transaction_object =
Evm_node_lib_dev_tezlink.Tezos_types.Operation.t) -> Evm_node_lib_dev_encoding.L2_types.michelson_chain_family
tx_container
val tx_container_module : 'f tx_container -> (module Tx_container)
Some functions of the Tx_container module, such as add
, have interfaces which actually depend on the chain family but many others, such as clear
don't.
In the former case, we usually know statically the type of the chain family and hence of the tx-container and we can for example invoke add
as follows:
let Evm_tx_container (module Tx_container) = tx_container in
let** hash = Tx_container.add ~next_nonce ~raw_tx tx_obj in
In the latter case, statically knowing the type of the chain family is not required and the following tx_container_module
function can be used to get a Tx_container
module:
let (module Tx_container) = Services_backend_sig.tx_container_module tx_container in
let* () = Tx_container.clear () in