diff --git a/core/tx.go b/core/tx.go index b1d1481..ca2600d 100644 --- a/core/tx.go +++ b/core/tx.go @@ -138,6 +138,7 @@ var messageTypeIgnorer = map[string]interface{}{ tokenfactory.MsgCreateDenom: nil, tokenfactory.MsgSetBeforeSendHook: nil, tokenfactory.MsgSetDenomMetadata: nil, + tokenfactory.MsgChangeAdmin: nil, //////////////////////////////////////////////////// /////// Possible Taxable Events, future work /////// diff --git a/cosmos/modules/tx/logic.go b/cosmos/modules/tx/logic.go index 83b7be3..f2c903a 100644 --- a/cosmos/modules/tx/logic.go +++ b/cosmos/modules/tx/logic.go @@ -98,8 +98,18 @@ func ParseTransferEvent(evt LogMessageEvent) ([]TransferEvent, error) { return nil, err } - // validate the transfer event - if transferEvent.Recipient == "" || transferEvent.Sender == "" || transferEvent.Amount == "" { + // Osmosis tends to emit large volumes of empty transfer events, just skip these + if transferEvent.Recipient == "" && transferEvent.Sender == "" && transferEvent.Amount == "" { + continue + } + + // We skip empty amounts as well + if transferEvent.Amount == "" { + continue + } + + // we require a transfer actually have addresses + if transferEvent.Recipient == "" || transferEvent.Sender == "" { return nil, errInvalidTransfer } diff --git a/osmosis/modules/poolmanager/types.go b/osmosis/modules/poolmanager/types.go index 69292a0..8775d65 100644 --- a/osmosis/modules/poolmanager/types.go +++ b/osmosis/modules/poolmanager/types.go @@ -132,7 +132,7 @@ func (sf *WrapperMsgSwapExactAmountIn) HandleMsg(msgType string, msg sdk.Msg, lo parsed := false - if tokensSwappedEvt == nil { + if tokensSwappedEvt != nil { // The last route in the hops gives the token out denom and pool ID for the final output lastRoute := sf.OsmosisMsgSwapExactAmountIn.Routes[len(sf.OsmosisMsgSwapExactAmountIn.Routes)-1] @@ -159,7 +159,7 @@ func (sf *WrapperMsgSwapExactAmountIn) HandleMsg(msgType string, msg sdk.Msg, lo // We will attempt to get the last transfer event that executed for the sender // We are scoping it for now so as not to blast all the way to the beginning but to address // poolmanager CosmWasm pool executions that seem to send some small amount to a different address right at the end - for i := len(transferEvents) - 1; !parsed && len(transferEvents)-2 >= 0 && i >= len(transferEvents)-2; i-- { + for i := len(transferEvents) - 1; !parsed && i >= len(transferEvents)-2 && i >= 0; i-- { lastParsedIndex = i transferEvt := &transferEvents[i] diff --git a/osmosis/modules/tokenfactory/types.go b/osmosis/modules/tokenfactory/types.go index e4af181..e6fe0cb 100644 --- a/osmosis/modules/tokenfactory/types.go +++ b/osmosis/modules/tokenfactory/types.go @@ -16,6 +16,7 @@ const ( MsgBurn = "/osmosis.tokenfactory.v1beta1.MsgBurn" MsgSetDenomMetadata = "/osmosis.tokenfactory.v1beta1.MsgSetDenomMetadata" MsgSetBeforeSendHook = "/osmosis.tokenfactory.v1beta1.MsgSetBeforeSendHook" + MsgChangeAdmin = "/osmosis.tokenfactory.v1beta1.MsgChangeAdmin" ) // Create interface definition for MsgMint