@agoric/cosmos 0.35.0-u21.0.1 → 0.35.0-u22.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 (114) hide show
  1. package/CHANGELOG.md +11 -187
  2. package/Makefile +2 -2
  3. package/ante/ante.go +2 -2
  4. package/ante/inbound.go +1 -2
  5. package/ante/inbound_test.go +3 -1
  6. package/ante/vm_admission.go +1 -2
  7. package/app/app.go +255 -174
  8. package/app/encoding.go +6 -3
  9. package/app/export.go +50 -21
  10. package/app/genesis.go +7 -5
  11. package/app/params/encoding.go +1 -1
  12. package/app/params/proto.go +6 -4
  13. package/app/sim_test.go +11 -13
  14. package/app/txconfig/tx_config.go +169 -0
  15. package/app/upgrade.go +52 -97
  16. package/app/upgrade_test.go +1 -1
  17. package/cmd/agd/agvm.go +1 -1
  18. package/cmd/agd/main.go +1 -1
  19. package/cmd/libdaemon/main.go +2 -2
  20. package/daemon/cmd/root.go +99 -30
  21. package/daemon/cmd/root_test.go +12 -27
  22. package/daemon/main.go +2 -9
  23. package/git-revision.txt +1 -1
  24. package/go.mod +129 -109
  25. package/go.sum +228 -469
  26. package/package.json +2 -2
  27. package/proto/agoric/swingset/msgs.proto +46 -9
  28. package/proto/agoric/swingset/swingset.proto +7 -2
  29. package/proto/agoric/vbank/vbank.proto +1 -1
  30. package/proto/agoric/vibc/msgs.proto +4 -0
  31. package/tests/e2e/vbank/vbank_test.go +172 -0
  32. package/tests/integrations/types/aminojson_test.go +214 -0
  33. package/tests/integrations/vbank/vbank_test.go +348 -0
  34. package/third_party/proto/amino/amino.proto +6 -1
  35. package/third_party/proto/cosmos/base/v1beta1/coin.proto +18 -5
  36. package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +4 -8
  37. package/third_party/proto/ibc/core/channel/v1/channel.proto +42 -17
  38. package/third_party/proto/ibc/core/client/v1/client.proto +48 -40
  39. package/types/address_hooks.go +2 -2
  40. package/types/address_hooks_test.go +3 -3
  41. package/types/ibc_packet.go +3 -3
  42. package/types/ibc_packet_test.go +3 -3
  43. package/types/kv_entry_helpers.go +3 -3
  44. package/types/kv_entry_helpers_test.go +2 -2
  45. package/types/legacy_address_encoder.go +58 -0
  46. package/vm/proto_json_test.go +1 -1
  47. package/vm/server.go +2 -1
  48. package/x/swingset/abci.go +2 -2
  49. package/x/swingset/client/cli/tx.go +16 -14
  50. package/x/swingset/config.go +1 -1
  51. package/x/swingset/genesis.go +2 -1
  52. package/x/swingset/handler.go +2 -1
  53. package/x/swingset/keeper/extension_snapshotter.go +14 -5
  54. package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
  55. package/x/swingset/keeper/keeper.go +21 -17
  56. package/x/swingset/keeper/keeper_test.go +10 -7
  57. package/x/swingset/keeper/msg_server.go +26 -5
  58. package/x/swingset/keeper/swing_store_exports_handler.go +1 -1
  59. package/x/swingset/keeper/swing_store_exports_handler_test.go +1 -1
  60. package/x/swingset/module.go +20 -22
  61. package/x/swingset/types/codec.go +10 -5
  62. package/x/swingset/types/default-params.go +13 -12
  63. package/x/swingset/types/expected_keepers.go +5 -4
  64. package/x/swingset/types/msgs.go +50 -36
  65. package/x/swingset/types/msgs.pb.go +60 -51
  66. package/x/swingset/types/params_test.go +21 -20
  67. package/x/swingset/types/swingset.pb.go +67 -61
  68. package/x/vbank/genesis.go +12 -8
  69. package/x/vbank/handler.go +2 -1
  70. package/x/vbank/keeper/grpc_query.go +4 -1
  71. package/x/vbank/keeper/keeper.go +108 -23
  72. package/x/vbank/keeper/querier.go +4 -1
  73. package/x/vbank/keeper/rewards.go +6 -2
  74. package/x/vbank/module.go +47 -75
  75. package/x/vbank/types/expected_keepers.go +15 -10
  76. package/x/vbank/types/key.go +3 -0
  77. package/x/vbank/types/params.go +4 -3
  78. package/x/vbank/types/vbank.pb.go +41 -40
  79. package/x/vbank/vbank.go +25 -10
  80. package/x/vbank/vbank_test.go +213 -154
  81. package/x/vibc/handler.go +2 -1
  82. package/x/vibc/keeper/keeper.go +10 -10
  83. package/x/vibc/keeper/migrations.go +1 -1
  84. package/x/vibc/keeper/triggers.go +1 -1
  85. package/x/vibc/module.go +5 -22
  86. package/x/vibc/types/codec.go +2 -1
  87. package/x/vibc/types/expected_keepers.go +7 -5
  88. package/x/vibc/types/ibc_module.go +5 -5
  89. package/x/vibc/types/msgs.go +30 -7
  90. package/x/vibc/types/msgs.pb.go +29 -25
  91. package/x/vibc/types/receiver.go +2 -2
  92. package/x/vlocalchain/handler.go +2 -1
  93. package/x/vlocalchain/keeper/keeper.go +17 -5
  94. package/x/vlocalchain/keeper/keeper_test.go +3 -2
  95. package/x/vlocalchain/types/expected_keepers.go +7 -4
  96. package/x/vlocalchain/vlocalchain_test.go +38 -26
  97. package/x/vstorage/genesis.go +10 -10
  98. package/x/vstorage/handler.go +2 -1
  99. package/x/vstorage/keeper/keeper.go +68 -46
  100. package/x/vstorage/keeper/keeper_test.go +35 -19
  101. package/x/vstorage/module.go +27 -13
  102. package/x/vstorage/testing/queue.go +5 -3
  103. package/x/vstorage/vstorage.go +2 -1
  104. package/x/vstorage/vstorage_test.go +21 -17
  105. package/x/vtransfer/genesis.go +1 -3
  106. package/x/vtransfer/handler.go +3 -2
  107. package/x/vtransfer/ibc_middleware.go +5 -5
  108. package/x/vtransfer/ibc_middleware_test.go +43 -29
  109. package/x/vtransfer/keeper/keeper.go +35 -33
  110. package/x/vtransfer/module.go +8 -11
  111. package/x/vtransfer/types/expected_keepers.go +3 -3
  112. package/x/vtransfer/utils_test.go +26 -11
  113. package/coverage.txt +0 -8531
  114. package/daemon/cmd/testnet.go +0 -539
@@ -1,19 +1,20 @@
1
1
  package vtransfer_test
2
2
 
3
3
  import (
4
+ "encoding/hex"
4
5
  "fmt"
5
6
  "strconv"
6
7
 
7
- sdk "github.com/cosmos/cosmos-sdk/types"
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"
8
+ abci "github.com/cometbft/cometbft/abci/types"
9
+ clienttypes "github.com/cosmos/ibc-go/v8/modules/core/02-client/types"
10
+ channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types"
11
+ host "github.com/cosmos/ibc-go/v8/modules/core/24-host"
12
+ ibctesting "github.com/cosmos/ibc-go/v8/testing"
12
13
  )
13
14
 
14
15
  // acknowledgePacketWithResult sends a MsgAcknowledgement to the channel associated with the endpoint.
15
16
  // [AGORIC] Would be nice to create a new ibctesting.AcknowledgePacketWithResult
16
- func acknowledgePacketWithResult(endpoint *ibctesting.Endpoint, packet channeltypes.Packet, ack []byte) (*sdk.Result, error) {
17
+ func acknowledgePacketWithResult(endpoint *ibctesting.Endpoint, packet channeltypes.Packet, ack []byte) (*abci.ExecTxResult, error) {
17
18
  // get proof of acknowledgement on counterparty
18
19
  packetKey := host.PacketAcknowledgementKey(packet.GetDestPort(), packet.GetDestChannel(), packet.GetSequence())
19
20
  proof, proofHeight := endpoint.Counterparty.QueryProof(packetKey)
@@ -26,17 +27,24 @@ func acknowledgePacketWithResult(endpoint *ibctesting.Endpoint, packet channelty
26
27
  // ParseAckFromEvents parses events emitted from a MsgRecvPacket and returns the
27
28
  // acknowledgement.
28
29
  // [AGORIC] Signature taken from ibctesting.ParseAckFromEvents
29
- func ParseAckFromEvents(events sdk.Events) ([]byte, error) {
30
+ func ParseAckFromEvents(events []abci.Event) ([]byte, error) {
30
31
  return ParseAckFromFilteredEvents(events, channeltypes.EventTypeWriteAck)
31
32
  }
32
33
 
33
34
  // ParseAckFromFilteredEvents parses events emitted matching filteredType and returns the acknowledgement.
34
35
  // [AGORIC] Would be nice to improve the implementation and upstream it
35
- func ParseAckFromFilteredEvents(events sdk.Events, filteredType string) ([]byte, error) {
36
+ func ParseAckFromFilteredEvents(events []abci.Event, filteredType string) ([]byte, error) {
36
37
  for _, ev := range events {
37
38
  if ev.Type == filteredType {
38
39
  for _, attr := range ev.Attributes {
39
- if attr.Key == channeltypes.AttributeKeyAck { //nolint:staticcheck // DEPRECATED
40
+ switch attr.Key {
41
+ case channeltypes.AttributeKeyAckHex:
42
+ hexAck, err := hex.DecodeString(attr.Value)
43
+ if err != nil {
44
+ return nil, fmt.Errorf("failed to parse hex ack: %w", err)
45
+ }
46
+ return hexAck, nil
47
+ case channeltypes.AttributeKeyAck: //nolint:staticcheck // DEPRECATED
40
48
  return []byte(attr.Value), nil
41
49
  }
42
50
  }
@@ -48,18 +56,25 @@ func ParseAckFromFilteredEvents(events sdk.Events, filteredType string) ([]byte,
48
56
  // ParsePacketFromEvents parses the send_packet type events emitted by the IBC
49
57
  // module and returns the packet.
50
58
  // [AGORIC] Signature taken from ibctesting.ParsePacketFromEvents
51
- func ParsePacketFromEvents(events sdk.Events) (channeltypes.Packet, error) {
59
+ func ParsePacketFromEvents(events []abci.Event) (channeltypes.Packet, error) {
52
60
  return ParsePacketFromFilteredEvents(events, channeltypes.EventTypeSendPacket)
53
61
  }
54
62
 
55
63
  // ParsePacketFromFilteredEvents parses events emitted matching filteredType and returns the packet.
56
64
  // [AGORIC] Would be nice to improve the implementation and upstream it
57
- func ParsePacketFromFilteredEvents(events sdk.Events, filteredType string) (channeltypes.Packet, error) {
65
+ func ParsePacketFromFilteredEvents(events []abci.Event, filteredType string) (channeltypes.Packet, error) {
58
66
  for _, ev := range events {
59
67
  if ev.Type == filteredType {
60
68
  packet := channeltypes.Packet{}
61
69
  for _, attr := range ev.Attributes {
62
70
  switch attr.Key {
71
+ case channeltypes.AttributeKeyDataHex:
72
+ hexData, err := hex.DecodeString(attr.Value)
73
+ if err != nil {
74
+ return channeltypes.Packet{}, fmt.Errorf("failed to parse hex data: %w", err)
75
+ }
76
+ packet.Data = hexData
77
+
63
78
  case channeltypes.AttributeKeyData: //nolint:staticcheck // DEPRECATED
64
79
  packet.Data = []byte(attr.Value)
65
80