fetchai / ledger-subquery

This is the Fetch Ledger SubQuery project, an indexer for the Fetch network.
MIT License
2 stars 10 forks source link

Account for fees in NativeBalanceChange events #89

Closed bryanchriswhite closed 2 years ago

bryanchriswhite commented 2 years ago

Background

@daeMOn63 pointed out in #88:

Also worth noting that fee spendings are actually not tracked by coin_spent events for some reason. I've asked on cosmos Discord to see if this is intended

and

On tracking fees, there's an event tracking the fees we could grab, but it's been added in cosmos-sdk v0.45.8, so we'll have to wait for our chain to use this version to have it. (see: https://github.com/cosmos/cosmos-sdk/blob/v0.45.8/x/auth/ante/fee.go#L121-L123)

Acceptance Criteria

  1. NativeBalanceChange events include the fee for the transaction to which they're related in their amount.
  2. An end-to-end test covers this behavior.

Proposal

Perhaps while we wait for cosmos-sdk v0.45.8, we can reference fees from the related transaction in the event handler.