@agoric/cosmos 0.35.0-u19.2 → 0.35.0-u21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/.clang-format +116 -0
  2. package/CHANGELOG.md +18 -18
  3. package/Makefile +38 -67
  4. package/ante/ante.go +2 -2
  5. package/ante/inbound_test.go +1 -1
  6. package/app/app.go +173 -142
  7. package/app/export.go +6 -6
  8. package/app/genesis.go +4 -0
  9. package/app/sim_test.go +299 -50
  10. package/app/upgrade.go +142 -96
  11. package/app/upgrade_test.go +63 -0
  12. package/cmd/agd/agvm.go +1 -1
  13. package/cmd/agd/main.go +1 -1
  14. package/cmd/libdaemon/main.go +34 -1
  15. package/daemon/cmd/root.go +26 -35
  16. package/daemon/cmd/root_test.go +5 -4
  17. package/daemon/cmd/testnet.go +221 -95
  18. package/daemon/main.go +1 -0
  19. package/git-revision.txt +1 -1
  20. package/go.mod +93 -58
  21. package/go.sum +148 -95
  22. package/package.json +6 -3
  23. package/proto/agoric/swingset/genesis.proto +7 -11
  24. package/proto/agoric/swingset/msgs.proto +56 -75
  25. package/proto/agoric/swingset/query.proto +7 -10
  26. package/proto/agoric/swingset/swingset.proto +79 -108
  27. package/proto/agoric/vbank/genesis.proto +5 -5
  28. package/proto/agoric/vbank/msgs.proto +1 -2
  29. package/proto/agoric/vbank/vbank.proto +42 -52
  30. package/proto/agoric/vibc/msgs.proto +8 -11
  31. package/proto/agoric/vstorage/genesis.proto +6 -9
  32. package/proto/agoric/vstorage/query.proto +19 -48
  33. package/proto/agoric/vstorage/vstorage.proto +4 -10
  34. package/proto/agoric/vtransfer/genesis.proto +7 -7
  35. package/proto/buf.gen.gogo.yaml +8 -0
  36. package/proto/buf.gen.pulsar.yaml +17 -0
  37. package/proto/buf.gen.swagger.yaml +5 -0
  38. package/proto/buf.yaml +10 -0
  39. package/scripts/protocgen.sh +14 -21
  40. package/third_party/proto/amino/amino.proto +79 -0
  41. package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -2
  42. package/third_party/proto/cosmos/ics23/v1/proofs.proto +243 -0
  43. package/third_party/proto/cosmos/msg/v1/msg.proto +30 -0
  44. package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +17 -5
  45. package/third_party/proto/cosmos_proto/cosmos.proto +16 -1
  46. package/third_party/proto/gogoproto/gogo.proto +2 -2
  47. package/third_party/proto/google/protobuf/any.proto +6 -3
  48. package/third_party/proto/ibc/core/channel/v1/channel.proto +1 -1
  49. package/third_party/proto/ibc/core/client/v1/client.proto +4 -2
  50. package/types/address_hooks.go +5 -12
  51. package/types/address_hooks_test.go +34 -34
  52. package/types/codec.go +23 -0
  53. package/types/ibc_packet.go +64 -0
  54. package/types/ibc_packet_test.go +117 -0
  55. package/vm/client.go +32 -7
  56. package/vm/proto_json.go +2 -2
  57. package/x/swingset/abci.go +1 -1
  58. package/x/swingset/alias.go +0 -1
  59. package/x/swingset/config.go +1 -1
  60. package/x/swingset/keeper/extension_snapshotter.go +1 -1
  61. package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
  62. package/x/swingset/keeper/keeper.go +1 -1
  63. package/x/swingset/keeper/keeper_test.go +1 -1
  64. package/x/swingset/keeper/querier.go +1 -30
  65. package/x/swingset/keeper/swing_store_exports_handler.go +1 -1
  66. package/x/swingset/keeper/swing_store_exports_handler_test.go +1 -1
  67. package/x/swingset/module.go +1 -14
  68. package/x/swingset/types/default-params.go +24 -16
  69. package/x/swingset/types/genesis.pb.go +2 -2
  70. package/x/swingset/types/msgs.pb.go +4 -3
  71. package/x/swingset/types/msgs_test.go +1 -1
  72. package/x/swingset/types/query.pb.go +4 -3
  73. package/x/swingset/types/swingset.pb.go +2 -2
  74. package/x/vbank/genesis.go +1 -1
  75. package/x/vbank/keeper/querier.go +1 -21
  76. package/x/vbank/module.go +1 -16
  77. package/x/vbank/types/genesis.pb.go +2 -2
  78. package/x/vbank/types/msgs.pb.go +3 -2
  79. package/x/vbank/types/query.pb.go +4 -3
  80. package/x/vbank/types/vbank.pb.go +2 -2
  81. package/x/vbank/vbank_test.go +95 -16
  82. package/x/vibc/keeper/keeper.go +8 -5
  83. package/x/vibc/keeper/migrations.go +36 -0
  84. package/x/vibc/keeper/triggers.go +6 -32
  85. package/x/vibc/module.go +9 -17
  86. package/x/vibc/types/expected_keepers.go +6 -10
  87. package/x/vibc/types/ibc_module.go +30 -20
  88. package/x/vibc/types/msgs.go +1 -1
  89. package/x/vibc/types/msgs.pb.go +5 -4
  90. package/x/vibc/types/receiver.go +17 -17
  91. package/x/vlocalchain/keeper/keeper.go +3 -3
  92. package/x/vlocalchain/types/vlocalchain.pb.go +1 -1
  93. package/x/vlocalchain/vlocalchain_test.go +6 -6
  94. package/x/vstorage/README.md +0 -8
  95. package/x/vstorage/alias.go +0 -1
  96. package/x/vstorage/client/cli/query.go +1 -1
  97. package/x/vstorage/genesis.go +1 -1
  98. package/x/vstorage/keeper/keeper.go +40 -5
  99. package/x/vstorage/keeper/keeper_test.go +24 -24
  100. package/x/vstorage/keeper/querier.go +1 -32
  101. package/x/vstorage/keeper/querier_test.go +41 -6
  102. package/x/vstorage/module.go +1 -14
  103. package/x/vstorage/types/genesis.pb.go +2 -2
  104. package/x/vstorage/types/path_keys.go +7 -8
  105. package/x/vstorage/types/query.pb.go +8 -5
  106. package/x/vstorage/types/vstorage.pb.go +2 -2
  107. package/x/vstorage/vstorage_test.go +3 -3
  108. package/x/vtransfer/genesis.go +1 -1
  109. package/x/vtransfer/handler.go +4 -2
  110. package/x/vtransfer/ibc_middleware.go +4 -4
  111. package/x/vtransfer/ibc_middleware_test.go +14 -16
  112. package/x/vtransfer/keeper/keeper.go +38 -48
  113. package/x/vtransfer/module.go +1 -14
  114. package/x/vtransfer/types/expected_keepers.go +2 -18
  115. package/x/vtransfer/types/genesis.pb.go +2 -2
  116. package/x/vtransfer/utils_test.go +15 -15
  117. package/daemon/cmd/genaccounts.go +0 -195
  118. package/e2e_test/Makefile +0 -29
  119. package/e2e_test/README.md +0 -100
  120. package/e2e_test/go.mod +0 -239
  121. package/e2e_test/go.sum +0 -1323
  122. package/e2e_test/ibc_conformance_test.go +0 -56
  123. package/e2e_test/pfm_test.go +0 -613
  124. package/e2e_test/util.go +0 -271
@@ -5,7 +5,9 @@ import (
5
5
 
6
6
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/vtransfer/keeper"
7
7
  sdk "github.com/cosmos/cosmos-sdk/types"
8
- sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
8
+
9
+ sdkioerrors "cosmossdk.io/errors"
10
+ sdktypeserrors "github.com/cosmos/cosmos-sdk/types/errors"
9
11
  )
10
12
 
11
13
  // NewHandler returns a handler for "vtransfer" type messages.
@@ -14,7 +16,7 @@ func NewHandler(keeper keeper.Keeper) sdk.Handler {
14
16
  switch msg := msg.(type) {
15
17
  default:
16
18
  errMsg := fmt.Sprintf("Unrecognized vtransfer Msg type: %T", msg)
17
- return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg)
19
+ return nil, sdkioerrors.Wrap(sdktypeserrors.ErrUnknownRequest, errMsg)
18
20
  }
19
21
  }
20
22
  }
@@ -4,10 +4,10 @@ import (
4
4
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/vtransfer/keeper"
5
5
  sdk "github.com/cosmos/cosmos-sdk/types"
6
6
  capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
7
- clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
8
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
9
- porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types"
10
- "github.com/cosmos/ibc-go/v6/modules/core/exported"
7
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
8
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
9
+ porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
10
+ "github.com/cosmos/ibc-go/v7/modules/core/exported"
11
11
  )
12
12
 
13
13
  // IBCMiddleware (https://ibc.cosmos.network/main/ibc/apps/ibcmodule) forwards
@@ -12,31 +12,30 @@ import (
12
12
 
13
13
  app "github.com/Agoric/agoric-sdk/golang/cosmos/app"
14
14
  "github.com/Agoric/agoric-sdk/golang/cosmos/vm"
15
+ dbm "github.com/cometbft/cometbft-db"
16
+ "github.com/cometbft/cometbft/libs/log"
15
17
  "github.com/cosmos/cosmos-sdk/codec"
16
18
  "github.com/cosmos/cosmos-sdk/store"
19
+ "github.com/cosmos/cosmos-sdk/testutil/sims"
17
20
  "github.com/cosmos/cosmos-sdk/testutil/testdata"
18
21
  "github.com/iancoleman/orderedmap"
19
22
  "github.com/stretchr/testify/suite"
20
- "github.com/tendermint/tendermint/libs/log"
21
- dbm "github.com/tendermint/tm-db"
22
23
 
23
24
  "github.com/Agoric/agoric-sdk/golang/cosmos/types"
24
25
  swingsettesting "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/testing"
25
26
  swingsettypes "github.com/Agoric/agoric-sdk/golang/cosmos/x/swingset/types"
26
- vibckeeper "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/keeper"
27
27
  vibctypes "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types"
28
28
 
29
+ tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
29
30
  "github.com/cosmos/cosmos-sdk/baseapp"
30
31
  sdk "github.com/cosmos/cosmos-sdk/types"
31
32
  authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
32
33
  banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
33
- packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v6/packetforward/types"
34
- ibctransfertypes "github.com/cosmos/ibc-go/v6/modules/apps/transfer/types"
35
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
36
- ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
37
- ibctesting "github.com/cosmos/ibc-go/v6/testing"
38
- "github.com/cosmos/ibc-go/v6/testing/simapp"
39
- tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
34
+ packetforwardtypes "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v7/packetforward/types"
35
+ ibctransfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
36
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
37
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
38
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
40
39
  )
41
40
 
42
41
  const (
@@ -110,7 +109,6 @@ func (s *IntegrationTestSuite) nextChannelOffset(instance int) int {
110
109
  func SetupAgoricTestingApp(instance int) TestingAppMaker {
111
110
  return func() (ibctesting.TestingApp, map[string]json.RawMessage) {
112
111
  db := dbm.NewMemDB()
113
- encCdc := app.MakeEncodingConfig()
114
112
  mockController := func(ctx context.Context, needReply bool, jsonRequest string) (jsonReply string, err error) {
115
113
  // fmt.Printf("controller %d got: %s\n", instance, jsonRequest)
116
114
 
@@ -125,7 +123,7 @@ func SetupAgoricTestingApp(instance int) TestingAppMaker {
125
123
  return jsonReply, nil
126
124
  }
127
125
  appd := app.NewAgoricApp(mockController, vm.NewAgdServer(), log.TestingLogger(), db, nil,
128
- true, map[int64]bool{}, app.DefaultNodeHome, simapp.FlagPeriodValue, encCdc, simapp.EmptyAppOptions{}, interBlockCacheOpt())
126
+ true, sims.EmptyAppOptions{}, interBlockCacheOpt())
129
127
  genesisState := app.NewDefaultGenesisState()
130
128
 
131
129
  t := template.Must(template.New("").Parse(`
@@ -653,7 +651,7 @@ func (s *IntegrationTestSuite) TestHops() {
653
651
  expectedRecords := []swingsettypes.InboundQueueRecord{}
654
652
  if tc.receiverIsTarget {
655
653
  expectedRecords = append(expectedRecords, swingsettypes.InboundQueueRecord{
656
- Action: &vibckeeper.WriteAcknowledgementEvent{
654
+ Action: &vibctypes.WriteAcknowledgementEvent{
657
655
  ActionHeader: &vm.ActionHeader{
658
656
  Type: "VTRANSFER_IBC_EVENT",
659
657
  BlockHeight: writeAcknowledgementHeight,
@@ -661,7 +659,7 @@ func (s *IntegrationTestSuite) TestHops() {
661
659
  },
662
660
  Event: "writeAcknowledgement",
663
661
  Target: baseReceiver,
664
- Packet: sendPacket,
662
+ Packet: types.CopyToIBCPacket(sendPacket),
665
663
  Acknowledgement: expectedAck.Acknowledgement(),
666
664
  },
667
665
  Context: swingsettypes.ActionContext{
@@ -765,7 +763,7 @@ func (s *IntegrationTestSuite) TestHops() {
765
763
  expectedRecords := []swingsettypes.InboundQueueRecord{}
766
764
  if tc.senderIsTarget {
767
765
  expectedRecords = append(expectedRecords, swingsettypes.InboundQueueRecord{
768
- Action: &vibckeeper.WriteAcknowledgementEvent{
766
+ Action: &vibctypes.AcknowledgementPacketEvent{
769
767
  ActionHeader: &vm.ActionHeader{
770
768
  Type: "VTRANSFER_IBC_EVENT",
771
769
  BlockHeight: acknowledgementHeight,
@@ -773,7 +771,7 @@ func (s *IntegrationTestSuite) TestHops() {
773
771
  },
774
772
  Event: "acknowledgementPacket",
775
773
  Target: baseSender,
776
- Packet: expectedPacket,
774
+ Packet: types.CopyToIBCPacket(expectedPacket),
777
775
  Acknowledgement: ack.Acknowledgement(),
778
776
  Relayer: s.chainA.SenderAccount.GetAddress(),
779
777
  },
@@ -10,21 +10,23 @@ import (
10
10
  "github.com/cosmos/cosmos-sdk/store/prefix"
11
11
  storetypes "github.com/cosmos/cosmos-sdk/store/types"
12
12
  sdk "github.com/cosmos/cosmos-sdk/types"
13
- sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
13
+
14
+ sdkioerrors "cosmossdk.io/errors"
15
+ sdktypeserrors "github.com/cosmos/cosmos-sdk/types/errors"
14
16
 
15
17
  capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper"
16
18
  capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types"
17
19
 
18
- "github.com/Agoric/agoric-sdk/golang/cosmos/types"
20
+ agtypes "github.com/Agoric/agoric-sdk/golang/cosmos/types"
19
21
  "github.com/Agoric/agoric-sdk/golang/cosmos/vm"
20
22
  "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc"
21
23
  vibctypes "github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types"
22
24
 
23
- clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
24
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
25
- porttypes "github.com/cosmos/ibc-go/v6/modules/core/05-port/types"
26
- host "github.com/cosmos/ibc-go/v6/modules/core/24-host"
27
- ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
25
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
26
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
27
+ porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
28
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
29
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
28
30
  )
29
31
 
30
32
  var _ porttypes.ICS4Wrapper = (*Keeper)(nil)
@@ -92,7 +94,7 @@ func (i4 *ics4Wrapper) SendPacket(
92
94
  }
93
95
 
94
96
  var strippedData []byte
95
- _, err = types.ExtractBaseAddressFromData(i4.k.cdc, data, types.RoleSender, &strippedData)
97
+ _, err = agtypes.ExtractBaseAddressFromData(i4.k.cdc, data, agtypes.RoleSender, &strippedData)
96
98
  if err != nil {
97
99
  return sequence, err
98
100
  }
@@ -105,7 +107,7 @@ func (i4 *ics4Wrapper) SendPacket(
105
107
 
106
108
  // Store the original data if it is hooked for later retrieval by middleware.
107
109
  if !i4.k.debug.DoNotStore && !bytes.Equal(strippedData, data) {
108
- packetStore, packetKey := i4.k.PacketStore(ctx, types.PacketSrc, sourcePort, sourceChannel, sequence)
110
+ packetStore, packetKey := i4.k.PacketStore(ctx, agtypes.PacketSrc, sourcePort, sourceChannel, sequence)
109
111
  packetStore.Set(packetKey, data)
110
112
  }
111
113
 
@@ -118,14 +120,8 @@ func (i4 *ics4Wrapper) WriteAcknowledgement(
118
120
  packet ibcexported.PacketI,
119
121
  ack ibcexported.Acknowledgement,
120
122
  ) error {
121
- origPacket := channeltypes.NewPacket(
122
- packet.GetData(), packet.GetSequence(),
123
- packet.GetSourcePort(), packet.GetSourceChannel(),
124
- packet.GetDestPort(), packet.GetDestChannel(),
125
- clienttypes.MustParseHeight(packet.GetTimeoutHeight().String()),
126
- packet.GetTimeoutTimestamp(),
127
- )
128
- packetStore, packetKey := i4.k.PacketStoreFromOrigin(ctx, types.PacketDst, packet)
123
+ origPacket := agtypes.CopyToIBCPacket(packet)
124
+ packetStore, packetKey := i4.k.PacketStoreFromOrigin(ctx, agtypes.PacketDst, packet)
129
125
  if packetStore.Has(packetKey) {
130
126
  origPacket.Data = packetStore.Get(packetKey)
131
127
  packetStore.Delete(packetKey)
@@ -209,20 +205,20 @@ func sequencePath(sequence uint64) string {
209
205
  // PacketStore returns a new KVStore for storing packet data, and a key for
210
206
  // that store. The KVStore is divided into src or dst PacketOrigins because we
211
207
  // need to record separate data for packets travelling in each direction.
212
- func (k Keeper) PacketStore(ctx sdk.Context, ourOrigin types.PacketOrigin, ourPort string, ourChannel string, sequence uint64) (storetypes.KVStore, []byte) {
208
+ func (k Keeper) PacketStore(ctx sdk.Context, ourOrigin agtypes.PacketOrigin, ourPort string, ourChannel string, sequence uint64) (storetypes.KVStore, []byte) {
213
209
  key := fmt.Sprintf("%s/%s/%s", ourOrigin, channelPath(ourPort, ourChannel), sequencePath(sequence))
214
210
  packetKey := []byte(key)
215
211
  return prefix.NewStore(ctx.KVStore(k.key), []byte(packetDataStoreKeyPrefix)), packetKey
216
212
  }
217
213
 
218
- func (k Keeper) PacketStoreFromOrigin(ctx sdk.Context, ourOrigin types.PacketOrigin, packet ibcexported.PacketI) (storetypes.KVStore, []byte) {
214
+ func (k Keeper) PacketStoreFromOrigin(ctx sdk.Context, ourOrigin agtypes.PacketOrigin, packet ibcexported.PacketI) (storetypes.KVStore, []byte) {
219
215
  var ourPort, ourChannel string
220
216
 
221
217
  switch ourOrigin {
222
- case types.PacketSrc:
218
+ case agtypes.PacketSrc:
223
219
  ourPort = packet.GetSourcePort()
224
220
  ourChannel = packet.GetSourceChannel()
225
- case types.PacketDst:
221
+ case agtypes.PacketDst:
226
222
  ourPort = packet.GetDestPort()
227
223
  ourChannel = packet.GetDestChannel()
228
224
  default:
@@ -236,10 +232,10 @@ func (k Keeper) PacketStoreFromOrigin(ctx sdk.Context, ourOrigin types.PacketOri
236
232
  // Many error acknowledgments are sent synchronously, but most cases instead return nil
237
233
  // to tell the IBC system that acknowledgment is async (i.e., that WriteAcknowledgement
238
234
  // will be called later, after the VM has dealt with the packet).
239
- func (k Keeper) InterceptOnRecvPacket(ctx sdk.Context, ibcModule porttypes.IBCModule, packet channeltypes.Packet, relayer sdk.AccAddress) ibcexported.Acknowledgement {
235
+ func (k Keeper) InterceptOnRecvPacket(ctx sdk.Context, ibcModule porttypes.IBCModule, packet ibcexported.PacketI, relayer sdk.AccAddress) ibcexported.Acknowledgement {
240
236
  // Pass every (stripped-receiver) inbound packet to the wrapped IBC module.
241
- var strippedPacket channeltypes.Packet
242
- _, err := types.ExtractBaseAddressFromPacket(k.cdc, packet, types.RoleReceiver, &strippedPacket)
237
+ var strippedPacket agtypes.IBCPacket
238
+ _, err := agtypes.ExtractBaseAddressFromPacket(k.cdc, packet, agtypes.RoleReceiver, &strippedPacket)
243
239
  if err != nil {
244
240
  return channeltypes.NewErrorAcknowledgement(err)
245
241
  }
@@ -249,16 +245,16 @@ func (k Keeper) InterceptOnRecvPacket(ctx sdk.Context, ibcModule porttypes.IBCMo
249
245
  capName := host.ChannelCapabilityPath(portID, channelID)
250
246
  chanCap, ok := k.vibcKeeper.GetCapability(ctx, capName)
251
247
  if !ok {
252
- err := sdkerrors.Wrapf(channeltypes.ErrChannelCapabilityNotFound, "could not retrieve channel capability at: %s", capName)
248
+ err := sdkioerrors.Wrapf(channeltypes.ErrChannelCapabilityNotFound, "could not retrieve channel capability at: %s", capName)
253
249
  return channeltypes.NewErrorAcknowledgement(err)
254
250
  }
255
251
 
256
252
  if !k.debug.DoNotStore && !bytes.Equal(strippedPacket.GetData(), packet.GetData()) {
257
- packetStore, packetKey := k.PacketStore(ctx, types.PacketDst, portID, channelID, packet.GetSequence())
253
+ packetStore, packetKey := k.PacketStore(ctx, agtypes.PacketDst, portID, channelID, packet.GetSequence())
258
254
  packetStore.Set(packetKey, packet.GetData())
259
255
  }
260
256
 
261
- ack := ibcModule.OnRecvPacket(ctx, strippedPacket, relayer)
257
+ ack := ibcModule.OnRecvPacket(ctx, agtypes.CopyToChannelPacket(strippedPacket), relayer)
262
258
  if ack == nil {
263
259
  // Already declared to be an async ack. Will be cleaned up by ics4Wrapper.WriteAcknowledgement.
264
260
  return nil
@@ -274,23 +270,23 @@ func (k Keeper) InterceptOnRecvPacket(ctx sdk.Context, ibcModule porttypes.IBCMo
274
270
  func (k Keeper) InterceptOnAcknowledgementPacket(
275
271
  ctx sdk.Context,
276
272
  ibcModule porttypes.IBCModule,
277
- packet channeltypes.Packet,
273
+ packet ibcexported.PacketI,
278
274
  acknowledgement []byte,
279
275
  relayer sdk.AccAddress,
280
276
  ) error {
281
- baseSender, err := types.ExtractBaseAddressFromData(k.cdc, packet.GetData(), types.RoleSender, nil)
277
+ baseSender, err := agtypes.ExtractBaseAddressFromData(k.cdc, packet.GetData(), agtypes.RoleSender, nil)
282
278
  if err != nil {
283
279
  return err
284
280
  }
285
281
 
286
- origPacket := packet
287
- packetStore, packetKey := k.PacketStoreFromOrigin(ctx, types.PacketSrc, packet)
282
+ origPacket := agtypes.CopyToIBCPacket(packet)
283
+ packetStore, packetKey := k.PacketStoreFromOrigin(ctx, agtypes.PacketSrc, packet)
288
284
  if packetStore.Has(packetKey) {
289
285
  origPacket.Data = packetStore.Get(packetKey)
290
286
  packetStore.Delete(packetKey)
291
287
  }
292
288
 
293
- modErr := ibcModule.OnAcknowledgementPacket(ctx, packet, acknowledgement, relayer)
289
+ modErr := ibcModule.OnAcknowledgementPacket(ctx, agtypes.CopyToChannelPacket(packet), acknowledgement, relayer)
294
290
 
295
291
  // If the sender is not a watched account, we're done.
296
292
  if !k.targetIsWatched(ctx, baseSender) {
@@ -312,23 +308,23 @@ func (k Keeper) InterceptOnAcknowledgementPacket(
312
308
  func (k Keeper) InterceptOnTimeoutPacket(
313
309
  ctx sdk.Context,
314
310
  ibcModule porttypes.IBCModule,
315
- packet channeltypes.Packet,
311
+ packet ibcexported.PacketI,
316
312
  relayer sdk.AccAddress,
317
313
  ) error {
318
- baseSender, err := types.ExtractBaseAddressFromData(k.cdc, packet.GetData(), types.RoleSender, nil)
314
+ baseSender, err := agtypes.ExtractBaseAddressFromData(k.cdc, packet.GetData(), agtypes.RoleSender, nil)
319
315
  if err != nil {
320
316
  return err
321
317
  }
322
318
 
323
- origPacket := packet
324
- packetStore, packetKey := k.PacketStoreFromOrigin(ctx, types.PacketSrc, packet)
319
+ origPacket := agtypes.CopyToIBCPacket(packet)
320
+ packetStore, packetKey := k.PacketStoreFromOrigin(ctx, agtypes.PacketSrc, packet)
325
321
  if packetStore.Has(packetKey) {
326
322
  origPacket.Data = packetStore.Get(packetKey)
327
323
  packetStore.Delete(packetKey)
328
324
  }
329
325
 
330
326
  // Pass every stripped-sender timeout to the wrapped IBC module.
331
- modErr := ibcModule.OnTimeoutPacket(ctx, packet, relayer)
327
+ modErr := ibcModule.OnTimeoutPacket(ctx, agtypes.CopyToChannelPacket(packet), relayer)
332
328
 
333
329
  // If the sender is not a watched account, we're done.
334
330
  if !k.targetIsWatched(ctx, baseSender) {
@@ -349,16 +345,10 @@ func (k Keeper) InterceptOnTimeoutPacket(
349
345
  // targeted account, and if so, delegates to the VM.
350
346
  func (k Keeper) InterceptWriteAcknowledgement(ctx sdk.Context, chanCap *capabilitytypes.Capability, packet ibcexported.PacketI, ack ibcexported.Acknowledgement) (ibcexported.Acknowledgement, ibcexported.PacketI) {
351
347
  // Get the base receiver from the packet, without computing a stripped packet.
352
- baseReceiver, err := types.ExtractBaseAddressFromPacket(k.cdc, packet, types.RoleReceiver, nil)
353
-
354
- origPacket := channeltypes.NewPacket(
355
- packet.GetData(), packet.GetSequence(),
356
- packet.GetSourcePort(), packet.GetSourceChannel(),
357
- packet.GetDestPort(), packet.GetDestChannel(),
358
- clienttypes.MustParseHeight(packet.GetTimeoutHeight().String()),
359
- packet.GetTimeoutTimestamp(),
360
- )
361
- packetStore, packetKey := k.PacketStoreFromOrigin(ctx, types.PacketDst, packet)
348
+ baseReceiver, err := agtypes.ExtractBaseAddressFromPacket(k.cdc, packet, agtypes.RoleReceiver, nil)
349
+
350
+ origPacket := agtypes.CopyToIBCPacket(packet)
351
+ packetStore, packetKey := k.PacketStoreFromOrigin(ctx, agtypes.PacketDst, packet)
362
352
  if packetStore.Has(packetKey) {
363
353
  origPacket.Data = packetStore.Get(packetKey)
364
354
  packetStore.Delete(packetKey)
@@ -440,7 +430,7 @@ func (k Keeper) Receive(cctx context.Context, jsonRequest string) (jsonReply str
440
430
  case "BRIDGE_TARGET_UNREGISTER":
441
431
  prefixStore.Delete([]byte(msg.Target))
442
432
  default:
443
- return "", sdkerrors.Wrapf(sdkerrors.ErrUnknownRequest, "unknown action type: %s", msg.Type)
433
+ return "", sdkioerrors.Wrapf(sdktypeserrors.ErrUnknownRequest, "unknown action type: %s", msg.Type)
444
434
  }
445
435
  return "true", nil
446
436
  }
@@ -12,8 +12,8 @@ import (
12
12
  cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
13
13
  "github.com/cosmos/cosmos-sdk/types/module"
14
14
 
15
+ abci "github.com/cometbft/cometbft/abci/types"
15
16
  sdk "github.com/cosmos/cosmos-sdk/types"
16
- abci "github.com/tendermint/tendermint/abci/types"
17
17
  )
18
18
 
19
19
  // type check to ensure the interface is properly implemented
@@ -86,19 +86,6 @@ func (AppModule) Name() string {
86
86
 
87
87
  func (am AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {}
88
88
 
89
- func (am AppModule) Route() sdk.Route {
90
- return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper))
91
- }
92
-
93
- func (am AppModule) QuerierRoute() string {
94
- return ModuleName
95
- }
96
-
97
- // LegacyQuerierHandler returns the sdk.Querier for module
98
- func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
99
- return nil
100
- }
101
-
102
89
  func (am AppModule) RegisterServices(cfg module.Configurator) {
103
90
  }
104
91
 
@@ -3,9 +3,8 @@ package types
3
3
  import (
4
4
  sdk "github.com/cosmos/cosmos-sdk/types"
5
5
  capability "github.com/cosmos/cosmos-sdk/x/capability/types"
6
- connection "github.com/cosmos/ibc-go/v6/modules/core/03-connection/types"
7
- channel "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
8
- ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
6
+ channel "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
7
+ ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
9
8
  )
10
9
 
11
10
  // ChannelKeeper defines the expected IBC channel keeper
@@ -21,18 +20,3 @@ type ChannelKeeper interface {
21
20
  ChanCloseInit(ctx sdk.Context, portID, channelID string, chanCap *capability.Capability) error
22
21
  TimeoutExecuted(ctx sdk.Context, channelCap *capability.Capability, packet ibcexported.PacketI) error
23
22
  }
24
-
25
- // ClientKeeper defines the expected IBC client keeper
26
- type ClientKeeper interface {
27
- GetClientConsensusState(ctx sdk.Context, clientID string) (connection ibcexported.ConsensusState, found bool)
28
- }
29
-
30
- // ConnectionKeeper defines the expected IBC connection keeper
31
- type ConnectionKeeper interface {
32
- GetConnection(ctx sdk.Context, connectionID string) (connection connection.ConnectionEnd, found bool)
33
- }
34
-
35
- // PortKeeper defines the expected IBC port keeper
36
- type PortKeeper interface {
37
- BindPort(ctx sdk.Context, portID string) *capability.Capability
38
- }
@@ -6,8 +6,8 @@ package types
6
6
  import (
7
7
  fmt "fmt"
8
8
  github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
9
- _ "github.com/gogo/protobuf/gogoproto"
10
- proto "github.com/gogo/protobuf/proto"
9
+ _ "github.com/cosmos/gogoproto/gogoproto"
10
+ proto "github.com/cosmos/gogoproto/proto"
11
11
  io "io"
12
12
  math "math"
13
13
  math_bits "math/bits"
@@ -5,10 +5,10 @@ import (
5
5
  "strconv"
6
6
 
7
7
  sdk "github.com/cosmos/cosmos-sdk/types"
8
- clienttypes "github.com/cosmos/ibc-go/v6/modules/core/02-client/types"
9
- channeltypes "github.com/cosmos/ibc-go/v6/modules/core/04-channel/types"
10
- host "github.com/cosmos/ibc-go/v6/modules/core/24-host"
11
- ibctesting "github.com/cosmos/ibc-go/v6/testing"
8
+ clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
9
+ channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
10
+ host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
11
+ ibctesting "github.com/cosmos/ibc-go/v7/testing"
12
12
  )
13
13
 
14
14
  // acknowledgePacketWithResult sends a MsgAcknowledgement to the channel associated with the endpoint.
@@ -36,8 +36,8 @@ func ParseAckFromFilteredEvents(events sdk.Events, filteredType string) ([]byte,
36
36
  for _, ev := range events {
37
37
  if ev.Type == filteredType {
38
38
  for _, attr := range ev.Attributes {
39
- if string(attr.Key) == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED
40
- return attr.Value, nil
39
+ if attr.Key == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED
40
+ return []byte(attr.Value), nil
41
41
  }
42
42
  }
43
43
  }
@@ -59,12 +59,12 @@ func ParsePacketFromFilteredEvents(events sdk.Events, filteredType string) (chan
59
59
  if ev.Type == filteredType {
60
60
  packet := channeltypes.Packet{}
61
61
  for _, attr := range ev.Attributes {
62
- switch string(attr.Key) {
62
+ switch attr.Key {
63
63
  case channeltypes.AttributeKeyData: //nolint:staticcheck // DEPRECATED
64
- packet.Data = attr.Value
64
+ packet.Data = []byte(attr.Value)
65
65
 
66
66
  case channeltypes.AttributeKeySequence:
67
- seq, err := strconv.ParseUint(string(attr.Value), 10, 64)
67
+ seq, err := strconv.ParseUint(attr.Value, 10, 64)
68
68
  if err != nil {
69
69
  return channeltypes.Packet{}, err
70
70
  }
@@ -72,19 +72,19 @@ func ParsePacketFromFilteredEvents(events sdk.Events, filteredType string) (chan
72
72
  packet.Sequence = seq
73
73
 
74
74
  case channeltypes.AttributeKeySrcPort:
75
- packet.SourcePort = string(attr.Value)
75
+ packet.SourcePort = attr.Value
76
76
 
77
77
  case channeltypes.AttributeKeySrcChannel:
78
- packet.SourceChannel = string(attr.Value)
78
+ packet.SourceChannel = attr.Value
79
79
 
80
80
  case channeltypes.AttributeKeyDstPort:
81
- packet.DestinationPort = string(attr.Value)
81
+ packet.DestinationPort = attr.Value
82
82
 
83
83
  case channeltypes.AttributeKeyDstChannel:
84
- packet.DestinationChannel = string(attr.Value)
84
+ packet.DestinationChannel = attr.Value
85
85
 
86
86
  case channeltypes.AttributeKeyTimeoutHeight:
87
- height, err := clienttypes.ParseHeight(string(attr.Value))
87
+ height, err := clienttypes.ParseHeight(attr.Value)
88
88
  if err != nil {
89
89
  return channeltypes.Packet{}, err
90
90
  }
@@ -92,7 +92,7 @@ func ParsePacketFromFilteredEvents(events sdk.Events, filteredType string) (chan
92
92
  packet.TimeoutHeight = height
93
93
 
94
94
  case channeltypes.AttributeKeyTimeoutTimestamp:
95
- timestamp, err := strconv.ParseUint(string(attr.Value), 10, 64)
95
+ timestamp, err := strconv.ParseUint(attr.Value, 10, 64)
96
96
  if err != nil {
97
97
  return channeltypes.Packet{}, err
98
98
  }