diff --git a/packages/cosmos/src/client.rs b/packages/cosmos/src/client.rs index cf063e9..e42b581 100644 --- a/packages/cosmos/src/client.rs +++ b/packages/cosmos/src/client.rs @@ -1516,6 +1516,7 @@ impl TxBuilder { if !self.skip_code_check && res.code != 0 { return Err(crate::Error::TransactionFailed { code: res.code.into(), + txhash: res.txhash.clone(), raw_log: res.raw_log, action: Action::Broadcast(self.clone()).into(), grpc_url, @@ -1531,6 +1532,7 @@ impl TxBuilder { if !self.skip_code_check && res.code != 0 { return Err(crate::Error::TransactionFailed { code: res.code.into(), + txhash: res.txhash.clone(), raw_log: res.raw_log, action: Action::Broadcast(self.clone()).into(), grpc_url, @@ -1555,13 +1557,14 @@ impl TxBuilder { match retry_with_price(amount).await { Err(crate::Error::TransactionFailed { code: CosmosSdkError::InsufficientFee, + txhash, raw_log, action: _, grpc_url: _, stage: _, }) => { tracing::debug!( - "Insufficient gas in attempt #{}, retrying. Raw log: {raw_log}", + "Insufficient gas in attempt #{}, retrying {txhash}. Raw log: {raw_log}", attempt_number + 1 ); } diff --git a/packages/cosmos/src/error.rs b/packages/cosmos/src/error.rs index c54e9b9..8d0c4ac 100644 --- a/packages/cosmos/src/error.rs +++ b/packages/cosmos/src/error.rs @@ -202,9 +202,10 @@ pub enum Error { path: PathBuf, source: std::io::Error, }, - #[error("Transaction failed ({grpc_url}) during {stage} with {code} and log: {raw_log}. Action: {action}.")] + #[error("Transaction {txhash} failed (on {grpc_url}) during {stage} with {code} and log: {raw_log}. Action: {action}.")] TransactionFailed { code: CosmosSdkError, + txhash: String, raw_log: String, action: Arc, grpc_url: Arc,