diff --git a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs index cec29e9c50..4acf61827b 100644 --- a/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs +++ b/common/client-libs/validator-client/src/nyxd/cosmwasm_client/client_traits/signing_client.rs @@ -665,8 +665,7 @@ where CosmWasmClient::broadcast_tx_commit(self, tx_bytes).await } - /// Broadcast a transaction to the network and monitors its inclusion in a block. - async fn sign_and_broadcast( + async fn sign_and_broadcast_inner( &self, signer_address: &AccountId, messages: Vec, @@ -686,6 +685,35 @@ where self.broadcast_tx(tx_bytes, None, None).await } + /// Broadcast a transaction to the network and monitors its inclusion in a block. + async fn sign_and_broadcast( + &self, + signer_address: &AccountId, + messages: Vec, + fee: Fee, + memo: impl Into + Send + 'static, + ) -> Result { + let memo = memo.into(); + loop { + match self + .sign_and_broadcast_inner( + signer_address, + messages.clone(), + fee.clone(), + memo.clone(), + ) + .await + { + Ok(res) => return Ok(res), + Err(err) => { + if !err.to_string().contains("sequence") { + return Err(err); + } + } + } + } + } + async fn sign( &self, signer_address: &AccountId,