Skip to content

Commit

Permalink
Merge branch 'main' into e2e-test-ics27-host-params
Browse files Browse the repository at this point in the history
  • Loading branch information
crodriguezvega authored Apr 2, 2024
2 parents 77054a4 + d23a21f commit 8c29111
Show file tree
Hide file tree
Showing 12 changed files with 120 additions and 27 deletions.
8 changes: 8 additions & 0 deletions .github/mergify.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ pull_request_rules:
backport:
branches:
- release/v7.3.x
- name: backport patches to v7.4.x branch
conditions:
- base=main
- label=backport-to-v7.4.x
actions:
backport:
branches:
- release/v7.4.x
- name: backport patches to v8.0.x branch
conditions:
- base=main
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/markdown-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: tj-actions/changed-files@v43
- uses: tj-actions/changed-files@v44
id: changed-files
with:
files: '**/*.md'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper) {
}
```

The above calls into the the 09-localhost `UpdateState` method of the `ClientState` .
The above calls into the 09-localhost `UpdateState` method of the `ClientState` .
It retrieves the current block height from the application context and sets the `LatestHeight` of the 09-localhost client.

```go
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type MsgPayPacketFee struct{
```

The `Fee` message contained in this synchronous fee payment method configures different fees which will be paid out for `MsgRecvPacket`, `MsgAcknowledgement`, and `MsgTimeout`/`MsgTimeoutOnClose`.
The amount of fees escrowed in total is the denomwise maxiumum of `RecvFee + AckFee` and `TimeoutFee`. This is because we do not know whether the packet will be successfully received and acknowledged or whether it will timeout.
The amount of fees escrowed in total is the denomwise maximum of `RecvFee + AckFee` and `TimeoutFee`. This is because we do not know whether the packet will be successfully received and acknowledged or whether it will timeout.

```go
type Fee struct {
Expand Down
2 changes: 1 addition & 1 deletion e2e/testsuite/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func UnmarshalMsgResponses(txResp sdk.TxResponse, msgs ...codec.ProtoMarshaler)
// MustProtoMarshalJSON provides an auxiliary function to return Proto3 JSON encoded
// bytes of a message. This function should be used when marshalling a proto.Message
// from the e2e tests. This function strips out unknown fields. This is useful for
// backwards compatibility tests where the the types imported by the e2e package have
// backwards compatibility tests where the types imported by the e2e package have
// new fields that older versions do not recognize.
func MustProtoMarshalJSON(msg proto.Message) []byte {
anyResolver := codectypes.NewInterfaceRegistry()
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/29-fee/ica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func SetupPath(path *ibctesting.Path, owner string) error {
return path.EndpointB.ChanOpenConfirm()
}

// RegisterInterchainAccount invokes the the InterchainAccounts entrypoint, routes a new MsgChannelOpenInit to the appropriate handler,
// RegisterInterchainAccount invokes the InterchainAccounts entrypoint, routes a new MsgChannelOpenInit to the appropriate handler,
// commits state changes and updates the testing endpoint accordingly
func RegisterInterchainAccount(endpoint *ibctesting.Endpoint, owner string) error {
portID, err := icatypes.NewControllerPortID(owner)
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/client/cli/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"github.com/cosmos/ibc-go/v8/modules/apps/transfer/types"
)

// GetCmdQueryDenomTrace defines the command to query a a denomination trace from a given trace hash or ibc denom.
// GetCmdQueryDenomTrace defines the command to query a denomination trace from a given trace hash or ibc denom.
func GetCmdQueryDenomTrace() *cobra.Command {
cmd := &cobra.Command{
Use: "denom-trace [hash/denom]",
Expand Down
2 changes: 1 addition & 1 deletion modules/apps/transfer/keeper/relay.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (k Keeper) OnRecvPacket(ctx sdk.Context, packet channeltypes.Packet, data t
return nil
}

// OnAcknowledgementPacket responds to the the success or failure of a packet
// OnAcknowledgementPacket responds to the success or failure of a packet
// acknowledgement written on the receiving chain. If the acknowledgement
// was a success then nothing occurs. If the acknowledgement failed, then
// the sender is refunded their tokens using the refundPacketToken function.
Expand Down
2 changes: 1 addition & 1 deletion modules/capability/capability_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (suite *CapabilityTestSuite) TestInitializeMemStore() {
newKeeper := keeper.NewKeeper(suite.cdc, suite.storeKey, suite.mockMemStoreKey)
newModule := capability.NewAppModule(suite.cdc, *newKeeper, true)

// reassign the scoped keeper, this will inherit the the mock memstore key used above
// reassign the scoped keeper, this will inherit the mock memstore key used above
scopedKeeper = newKeeper.ScopeToModule(banktypes.ModuleName)

// seal the new keeper and ensure the in-memory store is not initialized
Expand Down
37 changes: 37 additions & 0 deletions modules/core/04-channel/keeper/grpc_query.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,13 @@ func (k Keeper) PacketCommitment(c context.Context, req *types.QueryPacketCommit

ctx := sdk.UnwrapSDKContext(c)

if !k.HasChannel(ctx, req.PortId, req.ChannelId) {
return nil, status.Error(
codes.NotFound,
errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", req.PortId, req.ChannelId).Error(),
)
}

commitmentBz := k.GetPacketCommitment(ctx, req.PortId, req.ChannelId, req.Sequence)
if len(commitmentBz) == 0 {
return nil, status.Error(codes.NotFound, "packet commitment hash not found")
Expand All @@ -238,6 +245,12 @@ func (k Keeper) PacketCommitments(c context.Context, req *types.QueryPacketCommi

ctx := sdk.UnwrapSDKContext(c)

if !k.HasChannel(ctx, req.PortId, req.ChannelId) {
return nil, status.Error(
codes.NotFound,
errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", req.PortId, req.ChannelId).Error(),
)
}
var commitments []*types.PacketState
store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.PacketCommitmentPrefixPath(req.PortId, req.ChannelId)))

Expand Down Expand Up @@ -281,6 +294,12 @@ func (k Keeper) PacketReceipt(c context.Context, req *types.QueryPacketReceiptRe

ctx := sdk.UnwrapSDKContext(c)

if !k.HasChannel(ctx, req.PortId, req.ChannelId) {
return nil, status.Error(
codes.NotFound,
errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", req.PortId, req.ChannelId).Error(),
)
}
_, recvd := k.GetPacketReceipt(ctx, req.PortId, req.ChannelId, req.Sequence)

selfHeight := clienttypes.GetSelfHeight(ctx)
Expand All @@ -303,6 +322,12 @@ func (k Keeper) PacketAcknowledgement(c context.Context, req *types.QueryPacketA

ctx := sdk.UnwrapSDKContext(c)

if !k.HasChannel(ctx, req.PortId, req.ChannelId) {
return nil, status.Error(
codes.NotFound,
errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", req.PortId, req.ChannelId).Error(),
)
}
acknowledgementBz, found := k.GetPacketAcknowledgement(ctx, req.PortId, req.ChannelId, req.Sequence)
if !found || len(acknowledgementBz) == 0 {
return nil, status.Error(codes.NotFound, "packet acknowledgement hash not found")
Expand All @@ -324,6 +349,12 @@ func (k Keeper) PacketAcknowledgements(c context.Context, req *types.QueryPacket

ctx := sdk.UnwrapSDKContext(c)

if !k.HasChannel(ctx, req.PortId, req.ChannelId) {
return nil, status.Error(
codes.NotFound,
errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", req.PortId, req.ChannelId).Error(),
)
}
var acks []*types.PacketState
store := prefix.NewStore(ctx.KVStore(k.storeKey), []byte(host.PacketAcknowledgementPrefixPath(req.PortId, req.ChannelId)))

Expand Down Expand Up @@ -486,6 +517,12 @@ func (k Keeper) UnreceivedAcks(c context.Context, req *types.QueryUnreceivedAcks

ctx := sdk.UnwrapSDKContext(c)

if !k.HasChannel(ctx, req.PortId, req.ChannelId) {
return nil, status.Error(
codes.NotFound,
errorsmod.Wrapf(types.ErrChannelNotFound, "port ID (%s) channel ID (%s)", req.PortId, req.ChannelId).Error(),
)
}
var unreceivedSequences []uint64

for i, seq := range req.PacketAckSequences {
Expand Down
84 changes: 66 additions & 18 deletions modules/core/04-channel/keeper/grpc_query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,31 @@ func (suite *KeeperTestSuite) TestQueryPacketCommitment() {
},
false,
},
{
"commitment not found",
func() {
path := ibctesting.NewPath(suite.chainA, suite.chainB)
path.Setup()
expCommitment = []byte("hash")
suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetPacketCommitment(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, 1, expCommitment)
req = &types.QueryPacketCommitmentRequest{
PortId: path.EndpointA.ChannelConfig.PortID,
ChannelId: path.EndpointA.ChannelID,
Sequence: 2,
}
},
false,
},
{
"invalid ID",
func() {
req = &types.QueryPacketCommitmentRequest{
PortId: "",
ChannelId: "test-channel-id",
}
},
false,
},
{
"success",
func() {
Expand Down Expand Up @@ -732,21 +757,14 @@ func (suite *KeeperTestSuite) TestQueryPacketCommitments() {
false,
},
{
"success, empty res",
"channel not found",
func() {
expCommitments = []*types.PacketState(nil)

req = &types.QueryPacketCommitmentsRequest{
PortId: "test-port-id",
ChannelId: "test-channel-id",
Pagination: &query.PageRequest{
Key: nil,
Limit: 2,
CountTotal: true,
},
}
},
true,
false,
},
{
"success",
Expand Down Expand Up @@ -849,6 +867,17 @@ func (suite *KeeperTestSuite) TestQueryPacketReceipt() {
},
false,
},
{
"channel not found",
func() {
req = &types.QueryPacketReceiptRequest{
PortId: "test-port-id",
ChannelId: "test-channel-id",
Sequence: 1,
}
},
false,
},
{
"success: receipt not found",
func() {
Expand Down Expand Up @@ -956,6 +985,22 @@ func (suite *KeeperTestSuite) TestQueryPacketAcknowledgement() {
},
false,
},
{
"ack not found",
func() {
path := ibctesting.NewPath(suite.chainA, suite.chainB)
path.Setup()
expAck = []byte("hash")
suite.chainA.App.GetIBCKeeper().ChannelKeeper.SetPacketAcknowledgement(suite.chainA.GetContext(), path.EndpointA.ChannelConfig.PortID, path.EndpointA.ChannelID, 1, expAck)

req = &types.QueryPacketAcknowledgementRequest{
PortId: path.EndpointA.ChannelConfig.PortID,
ChannelId: path.EndpointA.ChannelID,
Sequence: 2,
}
},
false,
},
{
"channel not found",
func() {
Expand Down Expand Up @@ -1036,21 +1081,14 @@ func (suite *KeeperTestSuite) TestQueryPacketAcknowledgements() {
false,
},
{
"success, empty res",
"channel not found",
func() {
expAcknowledgements = []*types.PacketState(nil)

req = &types.QueryPacketAcknowledgementsRequest{
PortId: "test-port-id",
ChannelId: "test-channel-id",
Pagination: &query.PageRequest{
Key: nil,
Limit: 2,
CountTotal: true,
},
}
},
true,
false,
},
{
"success, filtered res",
Expand Down Expand Up @@ -1398,6 +1436,16 @@ func (suite *KeeperTestSuite) TestQueryUnreceivedAcks() {
},
false,
},
{
"channel not found",
func() {
req = &types.QueryUnreceivedAcksRequest{
PortId: "test-port-id",
ChannelId: "test-channel-id",
}
},
false,
},
{
"invalid seq",
func() {
Expand Down
2 changes: 1 addition & 1 deletion modules/light-clients/06-solomachine/proof.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"github.com/cosmos/cosmos-sdk/types/tx/signing"
)

// VerifySignature verifies if the the provided public key generated the signature
// VerifySignature verifies if the provided public key generated the signature
// over the given data. Single and Multi signature public keys are supported.
// The signature data type must correspond to the public key type. An error is
// returned if signature verification fails or an invalid SignatureData type is
Expand Down

0 comments on commit 8c29111

Please sign in to comment.