Skip to content

Commit

Permalink
Merge pull request #225 from multiversx/set_status_event_improvement
Browse files Browse the repository at this point in the history
set_status_event improvement
  • Loading branch information
iulianpascalau authored Oct 14, 2024
2 parents 339dc23 + 6e91104 commit a1413f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions esdt-safe/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ pub trait EsdtSafe:
match tx_status {
TransactionStatus::Executed => {}
TransactionStatus::Rejected => {
let addr = ManagedAddress::try_from(tx.from).unwrap();
let addr = ManagedAddress::try_from(tx.from.clone()).unwrap();
self.mark_refund(&addr, &tx.token_identifier, &tx.amount);
}
_ => {
sc_panic!("Transaction status may only be set to Executed or Rejected");
}
}

self.set_status_event(batch_id, tx.nonce, tx_status);
self.set_status_event(batch_id, tx.from, tx.to, tx.token_identifier, tx.amount, tx.nonce, tx_status);
}

self.clear_first_batch(&mut tx_batch);
Expand Down Expand Up @@ -555,6 +555,10 @@ pub trait EsdtSafe:
fn set_status_event(
&self,
#[indexed] batch_id: u64,
#[indexed] from: ManagedBuffer,
#[indexed] to: ManagedBuffer,
#[indexed] token_id: TokenIdentifier,
#[indexed] amount: BigUint,
#[indexed] tx_id: u64,
#[indexed] tx_status: TransactionStatus,
);
Expand Down

0 comments on commit a1413f3

Please sign in to comment.