Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tx hash to mintCompleted event #885

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,11 @@ benchmarks! {
));

let validator: T::AccountId = account("Alice", 0, 0);
}: _(RawOrigin::Signed(validator), tx_id, target.clone(), amount)
}: _(RawOrigin::Signed(validator), tx_id.clone(), target.clone(), amount)
verify {
let block = System::<T>::block_number();
let mint_tx = MintTransaction { amount, target, block, votes: 3 };
assert_last_event::<T>(Event::MintCompleted(mint_tx).into());
assert_last_event::<T>(Event::MintCompleted(mint_tx, tx_id).into());
}

// propose_burn_transaction_or_add_sig
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