Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add TransactionPayment event to Pallet Tranascation Payment #11595

Closed
shawntabrizi opened this issue Jun 5, 2022 · 7 comments · Fixed by #11618 or #11690
Closed

Add TransactionPayment event to Pallet Tranascation Payment #11595

shawntabrizi opened this issue Jun 5, 2022 · 7 comments · Fixed by #11618 or #11690
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.

Comments

@shawntabrizi
Copy link
Member

shawntabrizi commented Jun 5, 2022

There have been many issues from various people, all asking how to get the transaction fee of a Substrate transaction.

Currently, the only events that are emitted are those from the Balances pallet, which are not specific enough to determine the actual transaction fee in all cases.

We should add a simple event to the Transaction Payment Pallet which emits exactly the final transaction fee, tip, and user to clarify all of this.

Something like:

#[pallet::event]
#[pallet::generate_deposit(pub(super) fn deposit_event)]
pub enum Event<T: Config> {
	TransactionPayment { account: T::AccountId, fee: BalanceOf<T>, tip: BalanceOf<T> },
}
@shawntabrizi shawntabrizi added Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be. Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder labels Jun 5, 2022
@hzy1919
Copy link
Contributor

hzy1919 commented Jun 6, 2022

Hi @shawntabrizi , I‘m attempting this issue.

@shawntabrizi
Copy link
Member Author

@hzy1919 great!

@Doordashcon
Copy link
Contributor

would it still be okay if i tried my hand at it? @shawntabrizi

@shawntabrizi
Copy link
Member Author

@Doordashcon I think someone else is already doing it, so lets wait until then.

@shawntabrizi
Copy link
Member Author

shawntabrizi commented Jun 16, 2022

Let's also use this issue to add an event to pallet assets tx payment.

@hzy1919 are you interested to do that too?

@hzy1919
Copy link
Contributor

hzy1919 commented Jun 16, 2022

Let's also use this issue to add an event to pallet assets tx payment.

@hzy1919 are you interested to do that too?

@shawntabrizi Yeah, I would like to continue that .

@shawntabrizi
Copy link
Member Author

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Z1-easy Can be fixed primarily by duplicating and adapting code by an intermediate coder Z6-mentor An easy task where a mentor is available. Please indicate in the issue who the mentor could be.
Projects
None yet
3 participants