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

Function eth_get_transaction_receipt

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

Source from the content-addressed store, hash-verified

145}
146
147pub(crate) fn eth_get_transaction_receipt(module: &mut RpcModule<Context>) -> Result<()> {
148 module.register_async_method(
149 "eth_getTransactionReceipt",
150 move |params, blockchain| async move {
151 let transaction_hash = params.one::<H256>()?;
152 let transaction_receipt = blockchain
153 .lock()
154 .await
155 .get_transaction_receipt(transaction_hash)
156 .await
157 .map_err(|e| Error::Custom(e.to_string()))?;
158
159 Ok(transaction_receipt)
160 },
161 )?;
162
163 Ok(())
164}
165
166pub(crate) fn eth_get_code(module: &mut RpcModule<Context>) -> Result<()> {
167 module.register_async_method("eth_getCode", move |params, blockchain| async move {

Callers 1

serveFunction · 0.85

Calls 1

Tested by

no test coverage detected