Skip to content

Commit

Permalink
fix: masp tx check result
Browse files Browse the repository at this point in the history
  • Loading branch information
Fraccaman committed Sep 4, 2024
1 parent fcc1230 commit 4d01071
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 6 deletions.
11 changes: 9 additions & 2 deletions src/tasks/tx_shielded_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,15 @@ impl Task for TxShieldedTransfer {
self.fetch_info(sdk, &mut storage).await;

if Self::is_tx_rejected(&transfer_tx, &tx) {
let errors = Self::get_tx_errors(&transfer_tx, &tx.unwrap()).unwrap_or_default();
return Ok(StepResult::fail(errors));
match tx {
Ok(tx) => {
let errors = Self::get_tx_errors(&transfer_tx, &tx).unwrap_or_default();
return Ok(StepResult::fail(errors));
}
Err(e) => {
return Ok(StepResult::fail(e.to_string()));
}
}
}

let Ok(ProcessTxResponse::Applied(TxResponse { height, .. })) = &tx else {
Expand Down
11 changes: 9 additions & 2 deletions src/tasks/tx_shielding_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,15 @@ impl Task for TxShieldingTransfer {
self.fetch_info(sdk, &mut storage).await;

if Self::is_tx_rejected(&transfer_tx, &tx) {
let errors = Self::get_tx_errors(&transfer_tx, &tx.unwrap()).unwrap_or_default();
return Ok(StepResult::fail(errors));
match tx {
Ok(tx) => {
let errors = Self::get_tx_errors(&transfer_tx, &tx).unwrap_or_default();
return Ok(StepResult::fail(errors));
}
Err(e) => {
return Ok(StepResult::fail(e.to_string()));
}
}
}

let Ok(ProcessTxResponse::Applied(TxResponse { height, .. })) = &tx else {
Expand Down
11 changes: 9 additions & 2 deletions src/tasks/tx_unshielding_transfer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,15 @@ impl Task for TxUnshieldingTransfer {
self.fetch_info(sdk, &mut storage).await;

if Self::is_tx_rejected(&transfer_tx, &tx) {
let errors = Self::get_tx_errors(&transfer_tx, &tx.unwrap()).unwrap_or_default();
return Ok(StepResult::fail(errors));
match tx {
Ok(tx) => {
let errors = Self::get_tx_errors(&transfer_tx, &tx).unwrap_or_default();
return Ok(StepResult::fail(errors));
}
Err(e) => {
return Ok(StepResult::fail(e.to_string()));
}
}
}

let Ok(ProcessTxResponse::Applied(TxResponse { height, .. })) = &tx else {
Expand Down

0 comments on commit 4d01071

Please sign in to comment.