@agoric/cosmos 0.35.0-u21.0.1 → 0.35.0-u22.1
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.
- package/CHANGELOG.md +16 -186
- package/Makefile +2 -2
- package/ante/ante.go +2 -2
- package/ante/inbound.go +1 -2
- package/ante/inbound_test.go +3 -1
- package/ante/vm_admission.go +1 -2
- package/app/app.go +255 -174
- package/app/encoding.go +6 -3
- package/app/export.go +50 -21
- package/app/genesis.go +7 -5
- package/app/params/encoding.go +1 -1
- package/app/params/proto.go +6 -4
- package/app/sim_test.go +11 -13
- package/app/txconfig/tx_config.go +169 -0
- package/app/upgrade.go +52 -97
- package/app/upgrade_test.go +1 -1
- package/cmd/agd/agvm.go +1 -1
- package/cmd/agd/main.go +1 -1
- package/cmd/libdaemon/main.go +2 -2
- package/daemon/cmd/root.go +99 -30
- package/daemon/cmd/root_test.go +12 -27
- package/daemon/main.go +2 -9
- package/git-revision.txt +1 -1
- package/go.mod +129 -109
- package/go.sum +228 -469
- package/package.json +2 -2
- package/proto/agoric/swingset/msgs.proto +46 -9
- package/proto/agoric/swingset/swingset.proto +7 -2
- package/proto/agoric/vbank/vbank.proto +1 -1
- package/proto/agoric/vibc/msgs.proto +4 -0
- package/tests/e2e/vbank/vbank_test.go +172 -0
- package/tests/integrations/types/aminojson_test.go +214 -0
- package/tests/integrations/vbank/vbank_test.go +348 -0
- package/third_party/proto/amino/amino.proto +6 -1
- package/third_party/proto/cosmos/base/v1beta1/coin.proto +18 -5
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +4 -8
- package/third_party/proto/ibc/core/channel/v1/channel.proto +42 -17
- package/third_party/proto/ibc/core/client/v1/client.proto +48 -40
- package/types/address_hooks.go +2 -2
- package/types/address_hooks_test.go +3 -3
- package/types/ibc_packet.go +3 -3
- package/types/ibc_packet_test.go +3 -3
- package/types/kv_entry_helpers.go +3 -3
- package/types/kv_entry_helpers_test.go +2 -2
- package/types/legacy_address_encoder.go +58 -0
- package/vm/proto_json_test.go +1 -1
- package/vm/server.go +2 -1
- package/x/swingset/abci.go +2 -2
- package/x/swingset/client/cli/tx.go +16 -14
- package/x/swingset/config.go +1 -1
- package/x/swingset/genesis.go +2 -1
- package/x/swingset/handler.go +2 -1
- package/x/swingset/keeper/extension_snapshotter.go +14 -5
- package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
- package/x/swingset/keeper/keeper.go +21 -17
- package/x/swingset/keeper/keeper_test.go +10 -7
- package/x/swingset/keeper/msg_server.go +26 -5
- package/x/swingset/keeper/swing_store_exports_handler.go +1 -1
- package/x/swingset/keeper/swing_store_exports_handler_test.go +1 -1
- package/x/swingset/module.go +20 -22
- package/x/swingset/types/codec.go +10 -5
- package/x/swingset/types/default-params.go +13 -12
- package/x/swingset/types/expected_keepers.go +5 -4
- package/x/swingset/types/msgs.go +50 -36
- package/x/swingset/types/msgs.pb.go +60 -51
- package/x/swingset/types/params_test.go +21 -20
- package/x/swingset/types/swingset.pb.go +67 -61
- package/x/vbank/genesis.go +12 -8
- package/x/vbank/handler.go +2 -1
- package/x/vbank/keeper/grpc_query.go +4 -1
- package/x/vbank/keeper/keeper.go +108 -23
- package/x/vbank/keeper/querier.go +4 -1
- package/x/vbank/keeper/rewards.go +6 -2
- package/x/vbank/module.go +47 -75
- package/x/vbank/types/expected_keepers.go +15 -10
- package/x/vbank/types/key.go +3 -0
- package/x/vbank/types/params.go +4 -3
- package/x/vbank/types/vbank.pb.go +41 -40
- package/x/vbank/vbank.go +25 -10
- package/x/vbank/vbank_test.go +213 -154
- package/x/vibc/handler.go +2 -1
- package/x/vibc/keeper/keeper.go +10 -10
- package/x/vibc/keeper/migrations.go +1 -1
- package/x/vibc/keeper/triggers.go +1 -1
- package/x/vibc/module.go +5 -22
- package/x/vibc/types/codec.go +2 -1
- package/x/vibc/types/expected_keepers.go +7 -5
- package/x/vibc/types/ibc_module.go +5 -5
- package/x/vibc/types/msgs.go +30 -7
- package/x/vibc/types/msgs.pb.go +29 -25
- package/x/vibc/types/receiver.go +2 -2
- package/x/vlocalchain/handler.go +2 -1
- package/x/vlocalchain/keeper/keeper.go +17 -5
- package/x/vlocalchain/keeper/keeper_test.go +3 -2
- package/x/vlocalchain/types/expected_keepers.go +7 -4
- package/x/vlocalchain/vlocalchain_test.go +38 -26
- package/x/vstorage/genesis.go +10 -10
- package/x/vstorage/handler.go +2 -1
- package/x/vstorage/keeper/keeper.go +68 -46
- package/x/vstorage/keeper/keeper_test.go +35 -19
- package/x/vstorage/module.go +27 -13
- package/x/vstorage/testing/queue.go +5 -3
- package/x/vstorage/vstorage.go +2 -1
- package/x/vstorage/vstorage_test.go +21 -17
- package/x/vtransfer/genesis.go +1 -3
- package/x/vtransfer/handler.go +3 -2
- package/x/vtransfer/ibc_middleware.go +5 -5
- package/x/vtransfer/ibc_middleware_test.go +43 -29
- package/x/vtransfer/keeper/keeper.go +35 -33
- package/x/vtransfer/module.go +8 -11
- package/x/vtransfer/types/expected_keepers.go +3 -3
- package/x/vtransfer/utils_test.go +26 -11
- package/coverage.txt +0 -8531
- 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
|
-
|
|
8
|
-
clienttypes "github.com/cosmos/ibc-go/
|
|
9
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
10
|
-
host "github.com/cosmos/ibc-go/
|
|
11
|
-
ibctesting "github.com/cosmos/ibc-go/
|
|
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) (*
|
|
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
|
|
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
|
|
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
|
-
|
|
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
|
|
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
|
|
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
|
|