-
Notifications
You must be signed in to change notification settings - Fork 4
Description
Currently I assume that transaction fees are stated for the Withdraw in historicalAccountBalances event. Is this correct?
{
"dBalance": "-280001915",
"event": "Withdraw",
"timestamp": "2022-09-20T05:25:54.609000Z",
"extrinsic": {
"hash": "0x97ffcf9cd062412a44750f561c77170e29be697aa38998ac9484a299ccc0e76a",
"name": "Utility.batch"
},
"id": "0001316033-bb6b4-000003-6vQ7o",
"blockNumber": 1316033,
"assetId": "Ztg",
"accountId": "dE17owFuqybtXatuqm4n4Qu1Gxjdatctj7SY224E19x86vQ7o"
},
{
"dBalance": "-280000856",
"event": "Withdraw",
"timestamp": "2022-09-19T08:41:24.221000Z",
"extrinsic": {
"hash": "0x29936feb67961860a282b15d9b57c63761181994fadfb88f6b4fabab6ba05aae",
"name": "ParachainStaking.delegator_bond_more"
},
"id": "0001310372-c7c6a-000003-6vQ7o",
"blockNumber": 1310372,
"assetId": "Ztg",
"accountId": "dE17owFuqybtXatuqm4n4Qu1Gxjdatctj7SY224E19x86vQ7o"
},
{
"dBalance": "-232000283",
"event": "Withdraw",
"timestamp": "2022-09-17T20:24:12.310000Z",
"extrinsic": {
"hash": "0xb814d9678a96b640c0cffb4f2b9a54c9dda5706452f8553e6b9877daa72b545b",
"name": "Vesting.vest"
},
"id": "0001300631-b5637-000003-6vQ7o",
"blockNumber": 1300631,
"assetId": "Ztg",
"accountId": "dE17owFuqybtXatuqm4n4Qu1Gxjdatctj7SY224E19x86vQ7o"
},It would be cool to be more precise for what the withdraw actually was used. But I think it is okay how it is now, because the transaction-payment pallet does not emit an event directly here (only indirectly over withdraw and deposit (for a refund)). However there is indeed an event called TransactionFeePaid in the transaction payment pallet. But leave this for now, Withdraw events are sufficient for me to recognise transaction fees.
But we need to take a look at how pallet-asset-tx-payment handles this. It emits a different event AssetTxFeePaid, but does it also emit an Withdraw event?
We implement our own OnChargeAssetTransaction here. This means we call orml_tokens here, which ultimately means that we need to catch the events of orml-tokens Withdrawn and Deposited to have an equivalent to the pallet pallet-transaction-payment.
Or we go the other route to index the AssetTxFeePaid event and the TransactionFeePaid properly.
As a result of adding the AssetTxFeePaid and TransactionFeePaid events, the Withdraw, Deposit, Withdrawn and Deposited events are basically a double booking of fees then.
What would you suggest?