MCPcopy Create free account
hub / github.com/ChainSafe/Delorean-Protocol / make_transfer

Function make_transfer

fendermint/eth/api/examples/ethers.rs:767–788  ·  view source on GitHub ↗
(
    mw: &TestMiddleware<C>,
    to: &TestAccount,
)

Source from the content-addressed store, hash-verified

765}
766
767async fn make_transfer<C>(
768 mw: &TestMiddleware<C>,
769 to: &TestAccount,
770) -> anyhow::Result<TypedTransaction>
771where
772 C: JsonRpcClient + 'static,
773{
774 // Create a transaction to transfer 1000 atto.
775 let tx = Eip1559TransactionRequest::new().to(to.eth_addr).value(1000);
776
777 // Set the gas based on the testkit so it doesn't trigger estimation.
778 let mut tx = tx
779 .gas(ENOUGH_GAS)
780 .max_fee_per_gas(0)
781 .max_priority_fee_per_gas(0)
782 .into();
783
784 // Fill in the missing fields like `from` and `nonce` (which involves querying the API).
785 mw.fill_transaction(&mut tx, None).await?;
786
787 Ok(tx)
788}

Callers 1

runFunction · 0.85

Calls 1

toMethod · 0.80

Tested by

no test coverage detected