We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 97f8bd2 commit 0f48d3eCopy full SHA for 0f48d3e
bin/submit_transaction.rs
@@ -69,10 +69,19 @@ async fn main() {
69
70
async fn send_transaction(provider: &HostProvider, recipient_address: Address) {
71
// construct simple transaction to send ETH to a recipient
72
+ let nonce = match provider.get_transaction_count(provider.default_signer_address()).await {
73
+ Ok(count) => count + 1,
74
+ Err(e) => {
75
+ error!(error = ?e, "failed to get transaction count");
76
+ return;
77
+ },
78
+ };
79
+
80
let tx = TransactionRequest::default()
81
.with_from(provider.default_signer_address())
82
.with_to(recipient_address)
83
.with_value(U256::from(1))
84
+ .with_nonce(nonce)
85
.with_gas_limit(30_000);
86
87
// start timer to measure how long it takes to mine the transaction
0 commit comments