Skip to content

Commit

Permalink
Add tx hash to mintCompleted event
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk committed Nov 5, 2023
1 parent 38ea787 commit d8b31c2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions clients/tfchain-client-go/tft_bridge_events.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ type MintTransactionVoted struct {
type MintCompleted struct {
Phase types.Phase
MintTransaction MintTransaction `json:"mint_transaction"`
TxHash string `json:"tx_hash"`
Topics []types.Hash
}

Expand Down
2 changes: 1 addition & 1 deletion substrate-node/pallets/pallet-tft-bridge/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ pub mod pallet {
// Minting events
MintTransactionProposed(Vec<u8>, T::AccountId, u64),
MintTransactionVoted(Vec<u8>),
MintCompleted(MintTransaction<T::AccountId, T::BlockNumber>),
MintCompleted(MintTransaction<T::AccountId, T::BlockNumber>, Vec<u8>),
MintTransactionExpired(Vec<u8>, u64, T::AccountId),
// Burn events
BurnTransactionCreated(u64, T::AccountId, Vec<u8>, u64),
Expand Down
4 changes: 2 additions & 2 deletions substrate-node/pallets/pallet-tft-bridge/src/tft_bridge.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ impl<T: Config> Pallet<T> {
// Insert into executed transactions
let now = <system::Pallet<T>>::block_number();
tx.block = now;
ExecutedMintTransactions::<T>::insert(tx_id, &tx);
ExecutedMintTransactions::<T>::insert(tx_id.clone(), &tx);

Self::deposit_event(Event::MintCompleted(tx));
Self::deposit_event(Event::MintCompleted(tx, tx_id));

Ok(().into())
}
Expand Down

0 comments on commit d8b31c2

Please sign in to comment.