Skip to content

Commit

Permalink
fix timeout bug
Browse files Browse the repository at this point in the history
  • Loading branch information
colin-axner committed Dec 18, 2020
1 parent 4e7c5e9 commit fd31baf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion x/ibc/core/04-channel/keeper/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (k Keeper) GetPacketReceipt(ctx sdk.Context, portID, channelID string, sequ
// SetPacketReceipt sets an empty packet receipt to the store
func (k Keeper) SetPacketReceipt(ctx sdk.Context, portID, channelID string, sequence uint64) {
store := ctx.KVStore(k.storeKey)
store.Set(host.PacketReceiptKey(portID, channelID, sequence), []byte(""))
store.Set(host.PacketReceiptKey(portID, channelID, sequence), []byte{byte(1)})
}

// GetPacketCommitment gets the packet commitment hash from the store
Expand Down
9 changes: 5 additions & 4 deletions x/ibc/core/04-channel/keeper/keeper_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,12 +166,13 @@ func (suite KeeperTestSuite) TestGetAllPacketState() {
ack3 := types.NewPacketState(channelA1.PortID, channelA1.ID, 1, []byte("ack"))

// create channel 0 receipts
rec1 := types.NewPacketState(channelA0.PortID, channelA0.ID, 1, []byte(""))
rec2 := types.NewPacketState(channelA0.PortID, channelA0.ID, 2, []byte(""))
receipt := string([]byte{byte(1)})
rec1 := types.NewPacketState(channelA0.PortID, channelA0.ID, 1, []byte(receipt))
rec2 := types.NewPacketState(channelA0.PortID, channelA0.ID, 2, []byte(receipt))

// channel 1 receipts
rec3 := types.NewPacketState(channelA1.PortID, channelA1.ID, 1, []byte(""))
rec4 := types.NewPacketState(channelA1.PortID, channelA1.ID, 2, []byte(""))
rec3 := types.NewPacketState(channelA1.PortID, channelA1.ID, 1, []byte(receipt))
rec4 := types.NewPacketState(channelA1.PortID, channelA1.ID, 2, []byte(receipt))

// channel 0 packet commitments
comm1 := types.NewPacketState(channelA0.PortID, channelA0.ID, 1, []byte("hash"))
Expand Down
2 changes: 1 addition & 1 deletion x/ibc/core/04-channel/keeper/packet_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ func (suite *KeeperTestSuite) TestRecvPacket() {
} else {
suite.Require().Equal(uint64(1), nextSeqRecv, "sequence incremented for UNORDERED channel")
suite.Require().True(receiptStored, "packet receipt not stored after RecvPacket in UNORDERED channel")
suite.Require().Equal("", receipt, "packet receipt is not empty string")
suite.Require().Equal(string([]byte{byte(1)}), receipt, "packet receipt is not empty string")
}
} else {
suite.Require().Error(err)
Expand Down

0 comments on commit fd31baf

Please sign in to comment.