Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADR 015 Implementation #5401

Merged
merged 39 commits into from
Jan 14, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
66b5f56
implement in progress
mossid Dec 12, 2019
54d329a
rm unneccessary change under simapp, modify baseapp for codetxbreak
mossid Dec 12, 2019
4ddd022
fix test in progress
mossid Dec 12, 2019
764c02c
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into joon/ad…
mossid Dec 20, 2019
0bc1dd2
fix test error
mossid Dec 20, 2019
70a2ba6
fix golangci
mossid Dec 20, 2019
07f9d57
address minor comments
mossid Jan 2, 2020
4f6e9f0
mv antehandler to ante/, address comments
mossid Jan 2, 2020
1eb8e77
fix GetCommitment => GetData, fix syntax
mossid Jan 3, 2020
43e5cc8
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into joon/ad…
mossid Jan 7, 2020
2ed95bd
Merge branch 'ibc-alpha' of github.com:cosmos/cosmos-sdk into joon/ad…
mossid Jan 7, 2020
df4676e
checkout types/ to ibc-alpha
mossid Jan 7, 2020
c527db2
checkout to origin/ibc-alpha
mossid Jan 7, 2020
974c8ea
fix branch problem
mossid Jan 7, 2020
bc13263
fix syntax error
mossid Jan 7, 2020
3f6b012
recover PacketI interface
mossid Jan 7, 2020
9aee39d
mv recvpacket rest from 20 -> 04
mossid Jan 7, 2020
e1ab431
address minor comments
mossid Jan 8, 2020
12bd7ef
Apply suggestions from code review
mossid Jan 8, 2020
a868338
rm wrong files
mossid Jan 8, 2020
425f9c4
Apply suggestions from code review
fedekunze Jan 8, 2020
e5f6d51
PacketDataI field is now named, not embed
mossid Jan 9, 2020
6cfb61c
Merge branch 'joon/adr-015-impl-3' of github.com:cosmos/cosmos-sdk in…
mossid Jan 9, 2020
84d07cc
add acknowledgement hashing
mossid Jan 9, 2020
82f51c0
rename finalization functiosn
mossid Jan 10, 2020
0d2e9c9
Apply suggestions from code review
cwgoes Jan 10, 2020
568de83
Rename GetCommitment() to GetBytes()
cwgoes Jan 10, 2020
4c5615c
Add recv sequence incr to RecvPacket()
cwgoes Jan 10, 2020
158bd7a
Revert but where is PacketExecuted() called
cwgoes Jan 10, 2020
b483944
Call PacketExecuted(), check seq in RecvPacket()
cwgoes Jan 10, 2020
e42404a
The port is called "bank"
cwgoes Jan 10, 2020
05073c8
Apply suggestions from code review
cwgoes Jan 10, 2020
115fa5e
Update simapp/app.go
cwgoes Jan 10, 2020
415d6da
Remove omitempty
cwgoes Jan 10, 2020
a2d30b6
Add godoc
cwgoes Jan 10, 2020
f358a63
Move events
cwgoes Jan 10, 2020
2c91a6e
set ProofVerificationDecorator on AnteHandler
fedekunze Jan 14, 2020
1339b55
Apply suggestions from code review
cwgoes Jan 14, 2020
4bea0ef
format
fedekunze Jan 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
address minor comments
  • Loading branch information
mossid committed Jan 2, 2020
commit 07f9d57e4e5c0bf8ad89f51087e158b8046588b8
10 changes: 5 additions & 5 deletions x/ibc/04-channel/client/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@ import (
// QueryPacket returns a packet from the store
func QueryPacket(
ctx client.CLIContext, portID, channelID string,
sequence, timeout uint64, queryRoute string,
sequence, timeout uint64, prove bool,
) (types.PacketResponse, error) {
var packetRes types.PacketResponse
fedekunze marked this conversation as resolved.
Show resolved Hide resolved

req := abci.RequestQuery{
Path: "store/ibc/key",
Data: types.KeyPacketCommitment(portID, channelID, sequence),
Prove: true,
Prove: prove,
}

res, err := ctx.QueryABCI(req)
if err != nil {
return packetRes, err
return types.PacketResponse{}, err
}

channel, err := QueryChannel(ctx, portID, channelID, queryRoute, true)
channel, err := QueryChannel(ctx, portID, channelID, "ibc", true)
if err != nil {
return packetRes, err
fedekunze marked this conversation as resolved.
Show resolved Hide resolved
}
Expand Down Expand Up @@ -68,7 +68,7 @@ func QueryChannel(ctx client.CLIContext, portID string, channelID string, queryR

res, err := ctx.QueryABCI(req)
if res.Value == nil || err != nil {
return connRes, err
return types.ChannelResponse{}, err
}

var channel types.Channel
Expand Down
17 changes: 11 additions & 6 deletions x/ibc/04-channel/exported/exported.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
package exported

import (
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
)

type Packet = types.Packet
type PacektDataI = types.PacketDataI
// PacketI defines the standard interface for IBC packets
type PacketI interface {
GetSequence() uint64
GetTimeoutHeight() uint64
GetSourcePort() string
GetSourceChannel() string
GetDestPort() string
GetDestChannel() string
GetData() []byte
ValidateBasic() error
}
9 changes: 5 additions & 4 deletions x/ibc/04-channel/keeper/packet.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
sdk "github.com/cosmos/cosmos-sdk/types"
client "github.com/cosmos/cosmos-sdk/x/ibc/02-client"
connection "github.com/cosmos/cosmos-sdk/x/ibc/03-connection"
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/exported"
"github.com/cosmos/cosmos-sdk/x/ibc/04-channel/types"
commitment "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment"
)
Expand Down Expand Up @@ -187,10 +188,10 @@ func (k Keeper) SendPacket(
// sent on the corresponding channel end on the counterparty chain.
func (k Keeper) RecvPacket(
ctx sdk.Context,
packet types.Packet,
packet exported.PacketI,
proof commitment.ProofI,
proofHeight uint64,
) (types.Packet, error) {
) (exported.PacketI, error) {

channel, found := k.GetChannel(ctx, packet.GetDestPort(), packet.GetDestChannel())
if !found {
Expand Down Expand Up @@ -281,8 +282,8 @@ func (k Keeper) RecvPacket(
// and acted upon.
func (k Keeper) AcknowledgePacket(
ctx sdk.Context,
packet types.Packet,
acknowledgement types.PacketDataI,
packet exported.PacketI,
acknowledgement exported.PacketDataI,
proof commitment.ProofI,
proofHeight uint64,
) (types.Packet, error) {
Expand Down