Skip to content

Commit

Permalink
fix: removed tx length check from IBC transfer fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RiccardoM committed Jan 17, 2022
1 parent b7ba8ae commit ebb2a5d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 99 deletions.
81 changes: 0 additions & 81 deletions cmd/fix/ibc-transfer/blocks.go

This file was deleted.

33 changes: 15 additions & 18 deletions cmd/fix/ibc-transfer/receive.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package blocks
import (
"encoding/hex"
"fmt"

ibchanneltypes "github.com/cosmos/cosmos-sdk/x/ibc/core/04-channel/types"
"github.com/forbole/juno/v2/modules/messages"

Expand Down Expand Up @@ -55,25 +54,23 @@ func refreshIBCReceivePacket(parseCtx *parse.Context, bankModule *bank.Module) e
return err
}

if len(txs) > 1 {
return fmt.Errorf("expecting only one create proposal transaction, found %d", len(txs))
}

// Get the tx details
tx, err := parseCtx.Node.Tx(hex.EncodeToString(txs[0].Tx.Hash()))
if err != nil {
return err
}

// Handle the MsgSubmitProposal messages
for index, msg := range tx.GetMsgs() {
if _, ok := msg.(*ibchanneltypes.MsgRecvPacket); !ok {
continue
for _, transaction := range txs {
// Get the tx details
tx, err := parseCtx.Node.Tx(hex.EncodeToString(transaction.Tx.Hash()))
if err != nil {
return err
}

err = bankModule.HandleMsg(index, msg, tx)
if err != nil {
return fmt.Errorf("error while handling MsgSubmitProposal: %s", err)
// Handle the MsgSubmitProposal messages
for index, msg := range tx.GetMsgs() {
if _, ok := msg.(*ibchanneltypes.MsgRecvPacket); !ok {
continue
}

err = bankModule.HandleMsg(index, msg, tx)
if err != nil {
return fmt.Errorf("error while handling MsgSubmitProposal: %s", err)
}
}
}

Expand Down

0 comments on commit ebb2a5d

Please sign in to comment.