DefiantLabs / cosmos-tax-cli

An opensource cosmos tax tool!
https://defiantlabs.net
Apache License 2.0
25 stars 7 forks source link

Patch/parser updates for fixing message parsers #468

Closed pharr117 closed 1 year ago

pharr117 commented 1 year ago

Overview

This PR contains a few bug fixes and parser updates. It also has updates to support fixing old message types that have errors and prevent them from happening in the future.

Parser Updates

MsgWithdrawValidatorCommission

We are using a new event to get the receiver address for Validator commission. The old event was searching for the withdraw_commission event, which was turning up blank in later Osmosis blocks. We now look for the coin_received event to get the proper address.

Fixing this in old blocks will require to run the indexer with the --re-index-message-type "/cosmos.distribution.v1beta1.MsgWithdrawValidatorCommission" option set.

Closes #460

MsgSplitRouteSwapExactAmountIn

This is a complex swap. The parser will gather token in and token out from the event structure.

MsgUnlockAndMigrateSharesToFullRangeConcentratedPosition

This is a delegation action provided in Superfluid. We have decided to ignore Superfluid, so we add this one to the ignore list and only index the fees as normal.

Transaction Indexer DB Loop CreateOrUpdate

The transaction DB loop will now do CreateOrUpdate operations rather than a CreateOrFind. This was an unfinished aspect of the reindexing feature of the application that was preventing updates from happening when reindexing old blocks.

Better Indexer Error Passing

Event GetValueForAttribute Error Raise

The GetValueForAttribute util function will now return an error if the attribute was not found. This was originally silently passing an empty string if the attribute was not found, which was the original cause of the MsgWithdrawValidatorCommission error.

Throw Failed Block when Message Parser or Ignore List Entry Missing

When a parser or ignore list entry was not found for a message (i.e. we have encountered a new message we have never seen before), we would originally just output a Log saying so. This PR changes this so that an error is passed up. This will cause the block to fail and we will be able to track down missing message types easier.

CSV Parsers for Osmosis Pool Manager Swaps

This PR adds CSV parsers for all CSV formats for the Osmosis Pool Manager Swaps.