Skip to content

Commit

Permalink
send transaction without config
Browse files Browse the repository at this point in the history
  • Loading branch information
imabdulbasit committed Oct 24, 2023
1 parent 6208124 commit 4fcea98
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions consumer/src/solana.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,31 +297,25 @@ impl Solana {
message,
};

let signature = with_retry!(self.rpc().send_transaction_with_config(
&transaction,
RpcSendTransactionConfig {
skip_preflight: true,
..Default::default()
}
))
.when(|e| {
!matches!(
e.kind,
ClientErrorKind::TransactionError(_) | ClientErrorKind::SigningError(_)
)
})
.notify(|err: &ClientError, dur: Duration| {
error!(
"failed to send transaction retrying error {:?} in {:?}",
err, dur
);
})
.await
.map_err(|e| {
let msg = format!("failed to send transaction: {e}");
error!(msg);
anyhow!(msg)
})?;
let signature = with_retry!(self.rpc().send_transaction(&transaction))
.when(|e| {
!matches!(
e.kind,
ClientErrorKind::TransactionError(_) | ClientErrorKind::SigningError(_)
)
})
.notify(|err: &ClientError, dur: Duration| {
error!(
"failed to send transaction retrying error {:?} in {:?}",
err, dur
);
})
.await
.map_err(|e| {
let msg = format!("failed to send transaction: {e}");
error!(msg);
anyhow!(msg)
})?;

let recent_blockhash = transaction.get_recent_blockhash();

Expand Down

0 comments on commit 4fcea98

Please sign in to comment.