| 765 | } |
| 766 | |
| 767 | async fn make_transfer<C>( |
| 768 | mw: &TestMiddleware<C>, |
| 769 | to: &TestAccount, |
| 770 | ) -> anyhow::Result<TypedTransaction> |
| 771 | where |
| 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 | } |