Skip to content
This repository was archived by the owner on Mar 11, 2025. It is now read-only.

Commit 64abc40

Browse files
committed
token-client: Use the confirm field to decide whether to confirm the sent transaction
1 parent 21cfa98 commit 64abc40

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

token/client/src/client.rs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,19 @@ impl SendTransactionRpc for ProgramRpcClientSendTransaction {
142142
client: &'a RpcClient,
143143
transaction: &'a Transaction,
144144
) -> BoxFuture<'a, ProgramClientResult<Self::Output>> {
145+
let confirm = self.confirm;
145146
Box::pin(async move {
146147
if !transaction.is_signed() {
147148
return Err("Cannot send transaction: not fully signed".into());
148149
}
149150

150-
client
151-
.send_and_confirm_transaction(transaction)
152-
.await
153-
.map(RpcClientResponse::Signature)
154-
.map_err(Into::into)
151+
if confirm {
152+
client.send_and_confirm_transaction(transaction).await
153+
} else {
154+
client.send_transaction(transaction).await
155+
}
156+
.map(RpcClientResponse::Signature)
157+
.map_err(Into::into)
155158
})
156159
}
157160
}

0 commit comments

Comments
 (0)