MCPcopy Create free account
hub / github.com/ddimaria/rust-blockchain-tutorial / eth_send_transaction

Function eth_send_transaction

chain/src/method.rs:110–126  ·  view source on GitHub ↗
(module: &mut RpcModule<Context>)

Source from the content-addressed store, hash-verified

108}
109
110pub(crate) fn eth_send_transaction(module: &mut RpcModule<Context>) -> Result<()> {
111 module.register_async_method(
112 "eth_sendTransaction",
113 move |params, blockchain| async move {
114 let transaction_request = params.one::<TransactionRequest>()?;
115 let transaction_hash = blockchain
116 .lock()
117 .await
118 .send_transaction(transaction_request)
119 .await;
120
121 Ok(transaction_hash?)
122 },
123 )?;
124
125 Ok(())
126}
127
128pub(crate) fn eth_send_raw_transaction(module: &mut RpcModule<Context>) -> Result<()> {
129 module.register_async_method(

Callers 1

serveFunction · 0.85

Calls 1

send_transactionMethod · 0.45

Tested by

no test coverage detected