@agoric/cosmos 0.34.2-dev-9f6644d.0 → 0.34.2-dev-0467291.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.
- package/.clang-format +116 -0
- package/Makefile +38 -67
- package/ante/ante.go +2 -2
- package/ante/inbound_test.go +1 -1
- package/app/app.go +173 -142
- package/app/export.go +6 -6
- package/app/genesis.go +4 -0
- package/app/sim_test.go +299 -50
- package/app/upgrade.go +70 -3
- package/cmd/agd/agvm.go +1 -1
- package/cmd/agd/main.go +1 -1
- package/cmd/libdaemon/main.go +1 -1
- package/daemon/cmd/root.go +25 -34
- package/daemon/cmd/root_test.go +5 -4
- package/daemon/cmd/testnet.go +221 -95
- package/daemon/main.go +1 -0
- package/git-revision.txt +1 -1
- package/go.mod +93 -58
- package/go.sum +148 -95
- package/package.json +2 -2
- package/proto/agoric/swingset/genesis.proto +7 -11
- package/proto/agoric/swingset/msgs.proto +56 -75
- package/proto/agoric/swingset/query.proto +7 -10
- package/proto/agoric/swingset/swingset.proto +79 -108
- package/proto/agoric/vbank/genesis.proto +5 -5
- package/proto/agoric/vbank/msgs.proto +1 -2
- package/proto/agoric/vbank/vbank.proto +42 -52
- package/proto/agoric/vibc/msgs.proto +8 -11
- package/proto/agoric/vstorage/genesis.proto +6 -9
- package/proto/agoric/vstorage/query.proto +19 -48
- package/proto/agoric/vstorage/vstorage.proto +4 -10
- package/proto/agoric/vtransfer/genesis.proto +7 -7
- package/proto/buf.gen.gogo.yaml +8 -0
- package/proto/buf.gen.pulsar.yaml +17 -0
- package/proto/buf.gen.swagger.yaml +5 -0
- package/proto/buf.yaml +10 -0
- package/scripts/protocgen.sh +14 -21
- package/third_party/proto/amino/amino.proto +79 -0
- package/third_party/proto/cosmos/base/v1beta1/coin.proto +7 -2
- package/third_party/proto/cosmos/ics23/v1/proofs.proto +243 -0
- package/third_party/proto/cosmos/msg/v1/msg.proto +30 -0
- package/third_party/proto/cosmos/upgrade/v1beta1/upgrade.proto +17 -5
- package/third_party/proto/cosmos_proto/cosmos.proto +16 -1
- package/third_party/proto/gogoproto/gogo.proto +2 -2
- package/third_party/proto/google/protobuf/any.proto +6 -3
- package/third_party/proto/ibc/core/channel/v1/channel.proto +1 -1
- package/third_party/proto/ibc/core/client/v1/client.proto +4 -2
- 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/vm/proto_json.go +2 -2
- package/x/swingset/abci.go +1 -1
- package/x/swingset/alias.go +0 -1
- package/x/swingset/config.go +1 -1
- package/x/swingset/keeper/extension_snapshotter.go +1 -1
- package/x/swingset/keeper/extension_snapshotter_test.go +1 -1
- package/x/swingset/keeper/keeper.go +1 -1
- package/x/swingset/keeper/keeper_test.go +1 -1
- package/x/swingset/keeper/querier.go +1 -30
- 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 +1 -14
- package/x/swingset/types/genesis.pb.go +2 -2
- package/x/swingset/types/msgs.pb.go +4 -3
- package/x/swingset/types/msgs_test.go +1 -1
- package/x/swingset/types/query.pb.go +4 -3
- package/x/swingset/types/swingset.pb.go +2 -2
- package/x/vbank/genesis.go +1 -1
- package/x/vbank/keeper/querier.go +1 -21
- package/x/vbank/module.go +1 -16
- package/x/vbank/types/genesis.pb.go +2 -2
- package/x/vbank/types/msgs.pb.go +3 -2
- package/x/vbank/types/query.pb.go +4 -3
- package/x/vbank/types/vbank.pb.go +2 -2
- package/x/vbank/vbank_test.go +16 -16
- package/x/vibc/keeper/keeper.go +8 -5
- package/x/vibc/keeper/migrations.go +36 -0
- package/x/vibc/keeper/triggers.go +1 -1
- package/x/vibc/module.go +9 -17
- package/x/vibc/types/expected_keepers.go +5 -10
- package/x/vibc/types/ibc_module.go +4 -4
- package/x/vibc/types/msgs.go +1 -1
- package/x/vibc/types/msgs.pb.go +5 -4
- package/x/vibc/types/receiver.go +2 -2
- package/x/vlocalchain/keeper/keeper.go +3 -3
- package/x/vlocalchain/types/vlocalchain.pb.go +1 -1
- package/x/vlocalchain/vlocalchain_test.go +6 -6
- package/x/vstorage/alias.go +0 -1
- package/x/vstorage/client/cli/query.go +1 -1
- package/x/vstorage/genesis.go +1 -1
- package/x/vstorage/keeper/keeper.go +6 -5
- package/x/vstorage/keeper/keeper_test.go +24 -24
- package/x/vstorage/keeper/querier.go +1 -32
- package/x/vstorage/keeper/querier_test.go +41 -6
- package/x/vstorage/module.go +1 -14
- package/x/vstorage/types/genesis.pb.go +2 -2
- package/x/vstorage/types/query.pb.go +8 -5
- package/x/vstorage/types/vstorage.pb.go +2 -2
- package/x/vstorage/vstorage_test.go +3 -3
- package/x/vtransfer/genesis.go +1 -1
- package/x/vtransfer/ibc_middleware.go +4 -4
- package/x/vtransfer/ibc_middleware_test.go +10 -11
- package/x/vtransfer/keeper/keeper.go +5 -5
- package/x/vtransfer/module.go +1 -14
- package/x/vtransfer/types/expected_keepers.go +2 -18
- package/x/vtransfer/types/genesis.pb.go +2 -2
- package/x/vtransfer/utils_test.go +15 -15
- package/daemon/cmd/genaccounts.go +0 -195
|
@@ -6,9 +6,9 @@ package types
|
|
|
6
6
|
import (
|
|
7
7
|
context "context"
|
|
8
8
|
fmt "fmt"
|
|
9
|
-
_ "github.com/
|
|
10
|
-
grpc1 "github.com/
|
|
11
|
-
proto "github.com/
|
|
9
|
+
_ "github.com/cosmos/gogoproto/gogoproto"
|
|
10
|
+
grpc1 "github.com/cosmos/gogoproto/grpc"
|
|
11
|
+
proto "github.com/cosmos/gogoproto/proto"
|
|
12
12
|
_ "google.golang.org/genproto/googleapis/api/annotations"
|
|
13
13
|
grpc "google.golang.org/grpc"
|
|
14
14
|
codes "google.golang.org/grpc/codes"
|
|
@@ -333,6 +333,7 @@ func _Query_State_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
|
|
333
333
|
return interceptor(ctx, in, info, handler)
|
|
334
334
|
}
|
|
335
335
|
|
|
336
|
+
var Query_serviceDesc = _Query_serviceDesc
|
|
336
337
|
var _Query_serviceDesc = grpc.ServiceDesc{
|
|
337
338
|
ServiceName: "agoric.vbank.Query",
|
|
338
339
|
HandlerType: (*QueryServer)(nil),
|
|
@@ -7,8 +7,8 @@ import (
|
|
|
7
7
|
fmt "fmt"
|
|
8
8
|
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
|
9
9
|
types "github.com/cosmos/cosmos-sdk/types"
|
|
10
|
-
_ "github.com/
|
|
11
|
-
proto "github.com/
|
|
10
|
+
_ "github.com/cosmos/gogoproto/gogoproto"
|
|
11
|
+
proto "github.com/cosmos/gogoproto/proto"
|
|
12
12
|
io "io"
|
|
13
13
|
math "math"
|
|
14
14
|
math_bits "math/bits"
|
package/x/vbank/vbank_test.go
CHANGED
|
@@ -10,6 +10,11 @@ import (
|
|
|
10
10
|
"github.com/Agoric/agoric-sdk/golang/cosmos/app/params"
|
|
11
11
|
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
|
|
12
12
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vbank/types"
|
|
13
|
+
dbm "github.com/cometbft/cometbft-db"
|
|
14
|
+
abci "github.com/cometbft/cometbft/abci/types"
|
|
15
|
+
"github.com/cometbft/cometbft/crypto/secp256k1"
|
|
16
|
+
"github.com/cometbft/cometbft/libs/log"
|
|
17
|
+
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
|
13
18
|
"github.com/cosmos/cosmos-sdk/store"
|
|
14
19
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
|
15
20
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
@@ -17,11 +22,6 @@ import (
|
|
|
17
22
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
18
23
|
paramskeeper "github.com/cosmos/cosmos-sdk/x/params/keeper"
|
|
19
24
|
paramstypes "github.com/cosmos/cosmos-sdk/x/params/types"
|
|
20
|
-
abci "github.com/tendermint/tendermint/abci/types"
|
|
21
|
-
"github.com/tendermint/tendermint/crypto/secp256k1"
|
|
22
|
-
"github.com/tendermint/tendermint/libs/log"
|
|
23
|
-
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
|
|
24
|
-
dbm "github.com/tendermint/tm-db"
|
|
25
25
|
)
|
|
26
26
|
|
|
27
27
|
var (
|
|
@@ -560,32 +560,32 @@ func Test_EndBlock_Events(t *testing.T) {
|
|
|
560
560
|
{
|
|
561
561
|
Type: "coin_received",
|
|
562
562
|
Attributes: []abci.EventAttribute{
|
|
563
|
-
{Key:
|
|
564
|
-
{Key:
|
|
563
|
+
{Key: "receiver", Value: addr1},
|
|
564
|
+
{Key: "amount", Value: "500ubld,600urun,700ushmoo"},
|
|
565
565
|
},
|
|
566
566
|
},
|
|
567
567
|
{
|
|
568
568
|
Type: "coin_spent",
|
|
569
569
|
Attributes: []abci.EventAttribute{
|
|
570
|
-
{Key:
|
|
571
|
-
{Key:
|
|
572
|
-
{Key:
|
|
570
|
+
{Key: "spender", Value: addr2},
|
|
571
|
+
{Key: "amount", Value: "500ubld,600urun,700ushmoo"},
|
|
572
|
+
{Key: "other", Value: addr3},
|
|
573
573
|
},
|
|
574
574
|
},
|
|
575
575
|
{
|
|
576
576
|
Type: "something_else",
|
|
577
577
|
Attributes: []abci.EventAttribute{
|
|
578
|
-
{Key:
|
|
579
|
-
{Key:
|
|
580
|
-
{Key:
|
|
578
|
+
{Key: "receiver", Value: addr4},
|
|
579
|
+
{Key: "spender", Value: addr4},
|
|
580
|
+
{Key: "amount", Value: "500ubld,600urun,700ushmoo"},
|
|
581
581
|
},
|
|
582
582
|
},
|
|
583
583
|
{
|
|
584
584
|
Type: "non_modaccount",
|
|
585
585
|
Attributes: []abci.EventAttribute{
|
|
586
|
-
{Key:
|
|
587
|
-
{Key:
|
|
588
|
-
{Key:
|
|
586
|
+
{Key: "receiver", Value: addr3},
|
|
587
|
+
{Key: "spender", Value: addr4},
|
|
588
|
+
{Key: "amount", Value: "100ubld"},
|
|
589
589
|
},
|
|
590
590
|
},
|
|
591
591
|
}
|
package/x/vibc/keeper/keeper.go
CHANGED
|
@@ -9,11 +9,11 @@ import (
|
|
|
9
9
|
|
|
10
10
|
sdkioerrors "cosmossdk.io/errors"
|
|
11
11
|
capability "github.com/cosmos/cosmos-sdk/x/capability/types"
|
|
12
|
-
clienttypes "github.com/cosmos/ibc-go/
|
|
13
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
14
|
-
porttypes "github.com/cosmos/ibc-go/
|
|
15
|
-
host "github.com/cosmos/ibc-go/
|
|
16
|
-
ibcexported "github.com/cosmos/ibc-go/
|
|
12
|
+
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
|
|
13
|
+
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
|
14
|
+
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
|
|
15
|
+
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
|
|
16
|
+
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
|
|
17
17
|
|
|
18
18
|
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
|
|
19
19
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types"
|
|
@@ -31,6 +31,7 @@ type Keeper struct {
|
|
|
31
31
|
|
|
32
32
|
channelKeeper types.ChannelKeeper
|
|
33
33
|
portKeeper types.PortKeeper
|
|
34
|
+
clientKeeper types.ClientKeeper
|
|
34
35
|
|
|
35
36
|
// Filled out by `WithScope`
|
|
36
37
|
scopedKeeper types.ScopedKeeper
|
|
@@ -43,12 +44,14 @@ func NewKeeper(
|
|
|
43
44
|
cdc codec.Codec,
|
|
44
45
|
channelKeeper types.ChannelKeeper,
|
|
45
46
|
portKeeper types.PortKeeper,
|
|
47
|
+
clientKeeper types.ClientKeeper,
|
|
46
48
|
) Keeper {
|
|
47
49
|
|
|
48
50
|
return Keeper{
|
|
49
51
|
cdc: cdc,
|
|
50
52
|
channelKeeper: channelKeeper,
|
|
51
53
|
portKeeper: portKeeper,
|
|
54
|
+
clientKeeper: clientKeeper,
|
|
52
55
|
}
|
|
53
56
|
}
|
|
54
57
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
package keeper
|
|
2
|
+
|
|
3
|
+
import (
|
|
4
|
+
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
5
|
+
|
|
6
|
+
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
|
|
7
|
+
)
|
|
8
|
+
|
|
9
|
+
// Migrator handles in-place store migrations.
|
|
10
|
+
type Migrator struct {
|
|
11
|
+
keeper Keeper
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// NewMigrator returns a new migrator based on the keeper.
|
|
15
|
+
func NewMigrator(keeper Keeper) Migrator {
|
|
16
|
+
return Migrator{keeper: keeper}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// Migrate1to2 migrates from version 1 to 2.
|
|
20
|
+
func (m Migrator) Migrate1to2(ctx sdk.Context) error {
|
|
21
|
+
return m.AddLocalhostParams(ctx)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// explicitly update the IBC 02-client params, adding the localhost client type
|
|
25
|
+
func (m Migrator) AddLocalhostParams(ctx sdk.Context) error {
|
|
26
|
+
params := m.keeper.clientKeeper.GetParams(ctx)
|
|
27
|
+
for _, client := range params.AllowedClients {
|
|
28
|
+
if client == ibcexported.Localhost {
|
|
29
|
+
// Already added, return.
|
|
30
|
+
return nil
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
params.AllowedClients = append(params.AllowedClients, ibcexported.Localhost)
|
|
34
|
+
m.keeper.clientKeeper.SetParams(ctx, params)
|
|
35
|
+
return nil
|
|
36
|
+
}
|
|
@@ -3,7 +3,7 @@ package keeper
|
|
|
3
3
|
import (
|
|
4
4
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
5
5
|
|
|
6
|
-
ibcexported "github.com/cosmos/ibc-go/
|
|
6
|
+
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
|
|
7
7
|
|
|
8
8
|
agtypes "github.com/Agoric/agoric-sdk/golang/cosmos/types"
|
|
9
9
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types"
|
package/x/vibc/module.go
CHANGED
|
@@ -6,6 +6,7 @@ import (
|
|
|
6
6
|
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
|
7
7
|
"github.com/spf13/cobra"
|
|
8
8
|
|
|
9
|
+
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/keeper"
|
|
9
10
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vibc/types"
|
|
10
11
|
|
|
11
12
|
"github.com/cosmos/cosmos-sdk/client"
|
|
@@ -13,8 +14,8 @@ import (
|
|
|
13
14
|
cdctypes "github.com/cosmos/cosmos-sdk/codec/types"
|
|
14
15
|
"github.com/cosmos/cosmos-sdk/types/module"
|
|
15
16
|
|
|
17
|
+
abci "github.com/cometbft/cometbft/abci/types"
|
|
16
18
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
17
|
-
abci "github.com/tendermint/tendermint/abci/types"
|
|
18
19
|
)
|
|
19
20
|
|
|
20
21
|
// type check to ensure the interface is properly implemented
|
|
@@ -83,7 +84,7 @@ func (AppModule) Name() string {
|
|
|
83
84
|
return ModuleName
|
|
84
85
|
}
|
|
85
86
|
|
|
86
|
-
func (AppModule) ConsensusVersion() uint64 { return
|
|
87
|
+
func (AppModule) ConsensusVersion() uint64 { return 2 }
|
|
87
88
|
|
|
88
89
|
// BeginBlock implements the AppModule interface
|
|
89
90
|
func (am AppModule) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) {
|
|
@@ -99,25 +100,16 @@ func (AppModule) RegisterInvariants(ir sdk.InvariantRegistry) {
|
|
|
99
100
|
// TODO
|
|
100
101
|
}
|
|
101
102
|
|
|
102
|
-
// Route implements the AppModule interface
|
|
103
|
-
func (am AppModule) Route() sdk.Route {
|
|
104
|
-
return sdk.NewRoute(RouterKey, NewHandler(am.keeper, am.bankKeeper))
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
// QuerierRoute implements the AppModule interface
|
|
108
|
-
func (AppModule) QuerierRoute() string {
|
|
109
|
-
return ModuleName
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
// LegacyQuerierHandler implements the AppModule interface
|
|
113
|
-
func (am AppModule) LegacyQuerierHandler(*codec.LegacyAmino) sdk.Querier {
|
|
114
|
-
return nil
|
|
115
|
-
}
|
|
116
|
-
|
|
117
103
|
// RegisterServices registers module services.
|
|
118
104
|
func (am AppModule) RegisterServices(cfg module.Configurator) {
|
|
119
105
|
tx := &types.UnimplementedMsgServer{}
|
|
120
106
|
types.RegisterMsgServer(cfg.MsgServer(), tx)
|
|
107
|
+
|
|
108
|
+
m := keeper.NewMigrator(am.keeper)
|
|
109
|
+
err := cfg.RegisterMigration(types.ModuleName, 1, m.Migrate1to2)
|
|
110
|
+
if err != nil {
|
|
111
|
+
panic(err)
|
|
112
|
+
}
|
|
121
113
|
}
|
|
122
114
|
|
|
123
115
|
// InitGenesis performs genesis initialization for the ibc-transfer module. It returns
|
|
@@ -3,10 +3,9 @@ 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
|
-
clienttypes "github.com/cosmos/ibc-go/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
ibcexported "github.com/cosmos/ibc-go/v6/modules/core/exported"
|
|
6
|
+
clienttypes "github.com/cosmos/ibc-go/v7/modules/core/02-client/types"
|
|
7
|
+
channel "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
|
8
|
+
ibcexported "github.com/cosmos/ibc-go/v7/modules/core/exported"
|
|
10
9
|
)
|
|
11
10
|
|
|
12
11
|
type BankKeeper interface {
|
|
@@ -40,12 +39,8 @@ type ChannelKeeper interface {
|
|
|
40
39
|
|
|
41
40
|
// ClientKeeper defines the expected IBC client keeper
|
|
42
41
|
type ClientKeeper interface {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
// ConnectionKeeper defines the expected IBC connection keeper
|
|
47
|
-
type ConnectionKeeper interface {
|
|
48
|
-
GetConnection(ctx sdk.Context, connectionID string) (connection connection.ConnectionEnd, found bool)
|
|
42
|
+
GetParams(ctx sdk.Context) clienttypes.Params
|
|
43
|
+
SetParams(ctx sdk.Context, params clienttypes.Params)
|
|
49
44
|
}
|
|
50
45
|
|
|
51
46
|
// PortKeeper defines the expected IBC port keeper
|
|
@@ -7,11 +7,11 @@ import (
|
|
|
7
7
|
agtypes "github.com/Agoric/agoric-sdk/golang/cosmos/types"
|
|
8
8
|
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
|
|
9
9
|
capability "github.com/cosmos/cosmos-sdk/x/capability/types"
|
|
10
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
11
|
-
porttypes "github.com/cosmos/ibc-go/
|
|
12
|
-
host "github.com/cosmos/ibc-go/
|
|
10
|
+
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
|
11
|
+
porttypes "github.com/cosmos/ibc-go/v7/modules/core/05-port/types"
|
|
12
|
+
host "github.com/cosmos/ibc-go/v7/modules/core/24-host"
|
|
13
13
|
|
|
14
|
-
"github.com/cosmos/ibc-go/
|
|
14
|
+
"github.com/cosmos/ibc-go/v7/modules/core/exported"
|
|
15
15
|
|
|
16
16
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
17
17
|
)
|
package/x/vibc/types/msgs.go
CHANGED
|
@@ -4,7 +4,7 @@ import (
|
|
|
4
4
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
5
5
|
sdkerrors "github.com/cosmos/cosmos-sdk/types/errors"
|
|
6
6
|
|
|
7
|
-
chanTypes "github.com/cosmos/ibc-go/
|
|
7
|
+
chanTypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
|
8
8
|
)
|
|
9
9
|
|
|
10
10
|
const RouterKey = ModuleName // this was defined in your key.go file
|
package/x/vibc/types/msgs.pb.go
CHANGED
|
@@ -7,10 +7,10 @@ import (
|
|
|
7
7
|
context "context"
|
|
8
8
|
fmt "fmt"
|
|
9
9
|
github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types"
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
_ "github.com/cosmos/gogoproto/gogoproto"
|
|
11
|
+
grpc1 "github.com/cosmos/gogoproto/grpc"
|
|
12
|
+
proto "github.com/cosmos/gogoproto/proto"
|
|
13
|
+
types "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
|
14
14
|
grpc "google.golang.org/grpc"
|
|
15
15
|
codes "google.golang.org/grpc/codes"
|
|
16
16
|
status "google.golang.org/grpc/status"
|
|
@@ -223,6 +223,7 @@ func _Msg_SendPacket_Handler(srv interface{}, ctx context.Context, dec func(inte
|
|
|
223
223
|
return interceptor(ctx, in, info, handler)
|
|
224
224
|
}
|
|
225
225
|
|
|
226
|
+
var Msg_serviceDesc = _Msg_serviceDesc
|
|
226
227
|
var _Msg_serviceDesc = grpc.ServiceDesc{
|
|
227
228
|
ServiceName: "agoric.vibc.Msg",
|
|
228
229
|
HandlerType: (*MsgServer)(nil),
|
package/x/vibc/types/receiver.go
CHANGED
|
@@ -7,9 +7,9 @@ import (
|
|
|
7
7
|
|
|
8
8
|
"github.com/Agoric/agoric-sdk/golang/cosmos/types"
|
|
9
9
|
"github.com/Agoric/agoric-sdk/golang/cosmos/vm"
|
|
10
|
-
channeltypes "github.com/cosmos/ibc-go/
|
|
10
|
+
channeltypes "github.com/cosmos/ibc-go/v7/modules/core/04-channel/types"
|
|
11
11
|
|
|
12
|
-
"github.com/cosmos/ibc-go/
|
|
12
|
+
"github.com/cosmos/ibc-go/v7/modules/core/exported"
|
|
13
13
|
|
|
14
14
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
15
15
|
)
|
|
@@ -8,8 +8,8 @@ import (
|
|
|
8
8
|
"strings"
|
|
9
9
|
"unicode"
|
|
10
10
|
|
|
11
|
-
"github.com/
|
|
12
|
-
"github.com/
|
|
11
|
+
"github.com/cosmos/gogoproto/jsonpb"
|
|
12
|
+
"github.com/cosmos/gogoproto/proto"
|
|
13
13
|
|
|
14
14
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
15
15
|
codectypes "github.com/cosmos/cosmos-sdk/codec/types"
|
|
@@ -17,7 +17,7 @@ import (
|
|
|
17
17
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
18
18
|
sdkaddress "github.com/cosmos/cosmos-sdk/types/address"
|
|
19
19
|
|
|
20
|
-
abci "github.com/
|
|
20
|
+
abci "github.com/cometbft/cometbft/abci/types"
|
|
21
21
|
|
|
22
22
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain/types"
|
|
23
23
|
)
|
|
@@ -12,6 +12,7 @@ import (
|
|
|
12
12
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain"
|
|
13
13
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vlocalchain/types"
|
|
14
14
|
|
|
15
|
+
"github.com/cometbft/cometbft/libs/log"
|
|
15
16
|
"github.com/cosmos/cosmos-sdk/baseapp"
|
|
16
17
|
"github.com/cosmos/cosmos-sdk/store"
|
|
17
18
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
|
@@ -19,13 +20,12 @@ import (
|
|
|
19
20
|
authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
|
|
20
21
|
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
|
|
21
22
|
stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types"
|
|
22
|
-
transfertypes "github.com/cosmos/ibc-go/
|
|
23
|
-
"github.com/tendermint/tendermint/libs/log"
|
|
23
|
+
transfertypes "github.com/cosmos/ibc-go/v7/modules/apps/transfer/types"
|
|
24
24
|
|
|
25
|
-
"github.com/
|
|
26
|
-
"github.com/
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
dbm "github.com/cometbft/cometbft-db"
|
|
26
|
+
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
|
27
|
+
"github.com/cosmos/gogoproto/jsonpb"
|
|
28
|
+
"github.com/cosmos/gogoproto/proto"
|
|
29
29
|
)
|
|
30
30
|
|
|
31
31
|
var (
|
package/x/vstorage/alias.go
CHANGED
package/x/vstorage/genesis.go
CHANGED
|
@@ -4,8 +4,8 @@ import (
|
|
|
4
4
|
"fmt"
|
|
5
5
|
|
|
6
6
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/types"
|
|
7
|
+
abci "github.com/cometbft/cometbft/abci/types"
|
|
7
8
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
8
|
-
abci "github.com/tendermint/tendermint/abci/types"
|
|
9
9
|
)
|
|
10
10
|
|
|
11
11
|
func NewGenesisState() *types.GenesisState {
|
|
@@ -12,10 +12,10 @@ import (
|
|
|
12
12
|
|
|
13
13
|
sdkmath "cosmossdk.io/math"
|
|
14
14
|
metrics "github.com/armon/go-metrics"
|
|
15
|
+
db "github.com/cometbft/cometbft-db"
|
|
15
16
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
|
16
17
|
"github.com/cosmos/cosmos-sdk/telemetry"
|
|
17
18
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
18
|
-
db "github.com/tendermint/tm-db"
|
|
19
19
|
|
|
20
20
|
agoric "github.com/Agoric/agoric-sdk/golang/cosmos/types"
|
|
21
21
|
"github.com/Agoric/agoric-sdk/golang/cosmos/x/vstorage/types"
|
|
@@ -124,6 +124,7 @@ func NewKeeper(storeKey storetypes.StoreKey) Keeper {
|
|
|
124
124
|
// to/from the store due to the store's internal implementation.
|
|
125
125
|
var MetricKeyStoreSizeIncrease = []string{"store", "size_increase"}
|
|
126
126
|
var MetricKeyStoreSizeDecrease = []string{"store", "size_decrease"}
|
|
127
|
+
|
|
127
128
|
const MetricLabelStoreKey = "storeKey"
|
|
128
129
|
|
|
129
130
|
// reportStoreSizeMetrics exports store size increase/decrease metrics
|
|
@@ -239,7 +240,7 @@ func (k Keeper) RemoveEntriesWithPrefix(ctx sdk.Context, pathPrefix string) {
|
|
|
239
240
|
|
|
240
241
|
for _, key := range keys {
|
|
241
242
|
rawValue := store.Get(key)
|
|
242
|
-
k.reportStoreSizeMetrics(0, len(key)
|
|
243
|
+
k.reportStoreSizeMetrics(0, len(key)+len(rawValue))
|
|
243
244
|
store.Delete(key)
|
|
244
245
|
}
|
|
245
246
|
|
|
@@ -396,7 +397,7 @@ func (k Keeper) SetStorage(ctx sdk.Context, entry agoric.KVEntry) {
|
|
|
396
397
|
if !entry.HasValue() {
|
|
397
398
|
if !k.HasChildren(ctx, path) {
|
|
398
399
|
// We have no children, can delete.
|
|
399
|
-
k.reportStoreSizeMetrics(0, len(encodedKey)
|
|
400
|
+
k.reportStoreSizeMetrics(0, len(encodedKey)+len(oldRawValue))
|
|
400
401
|
store.Delete(encodedKey)
|
|
401
402
|
} else {
|
|
402
403
|
// We have children, mark as an empty placeholder without deleting.
|
|
@@ -421,7 +422,7 @@ func (k Keeper) SetStorage(ctx sdk.Context, entry agoric.KVEntry) {
|
|
|
421
422
|
break
|
|
422
423
|
}
|
|
423
424
|
encodedAncestor := types.PathToEncodedKey(ancestor)
|
|
424
|
-
k.reportStoreSizeMetrics(0, len(encodedAncestor)
|
|
425
|
+
k.reportStoreSizeMetrics(0, len(encodedAncestor)+len(types.EncodedNoDataValue))
|
|
425
426
|
store.Delete(encodedAncestor)
|
|
426
427
|
}
|
|
427
428
|
} else {
|
|
@@ -433,7 +434,7 @@ func (k Keeper) SetStorage(ctx sdk.Context, entry agoric.KVEntry) {
|
|
|
433
434
|
break
|
|
434
435
|
}
|
|
435
436
|
encodedAncestor := types.PathToEncodedKey(ancestor)
|
|
436
|
-
k.reportStoreSizeMetrics(len(encodedAncestor)
|
|
437
|
+
k.reportStoreSizeMetrics(len(encodedAncestor)+len(types.EncodedNoDataValue), 0)
|
|
437
438
|
store.Set(encodedAncestor, types.EncodedNoDataValue)
|
|
438
439
|
}
|
|
439
440
|
}
|
|
@@ -11,10 +11,10 @@ import (
|
|
|
11
11
|
storetypes "github.com/cosmos/cosmos-sdk/store/types"
|
|
12
12
|
sdk "github.com/cosmos/cosmos-sdk/types"
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
"github.com/
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
dbm "github.com/cometbft/cometbft-db"
|
|
15
|
+
abci "github.com/cometbft/cometbft/abci/types"
|
|
16
|
+
"github.com/cometbft/cometbft/libs/log"
|
|
17
|
+
tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
|
|
18
18
|
)
|
|
19
19
|
|
|
20
20
|
var (
|
|
@@ -227,51 +227,51 @@ func TestStorageNotify(t *testing.T) {
|
|
|
227
227
|
{
|
|
228
228
|
Type: "storage",
|
|
229
229
|
Attributes: []abci.EventAttribute{
|
|
230
|
-
{Key:
|
|
231
|
-
{Key:
|
|
230
|
+
{Key: "path", Value: "notify.legacy"},
|
|
231
|
+
{Key: "value", Value: "legacyValue"},
|
|
232
232
|
},
|
|
233
233
|
},
|
|
234
234
|
{
|
|
235
235
|
Type: "state_change",
|
|
236
236
|
Attributes: []abci.EventAttribute{
|
|
237
|
-
{Key:
|
|
238
|
-
{Key:
|
|
239
|
-
{Key:
|
|
240
|
-
{Key:
|
|
237
|
+
{Key: "store", Value: "vstorage"},
|
|
238
|
+
{Key: "key", Value: "2\x00notify\x00legacy"},
|
|
239
|
+
{Key: "anckey", Value: "\x012\x00notify\x00legacy\x01"},
|
|
240
|
+
{Key: "value", Value: "legacyValue"},
|
|
241
241
|
},
|
|
242
242
|
},
|
|
243
243
|
{
|
|
244
244
|
Type: "storage",
|
|
245
245
|
Attributes: []abci.EventAttribute{
|
|
246
|
-
{Key:
|
|
247
|
-
{Key:
|
|
246
|
+
{Key: "path", Value: "notify.legacy2"},
|
|
247
|
+
{Key: "value", Value: "legacyValue2b"},
|
|
248
248
|
},
|
|
249
249
|
},
|
|
250
250
|
{
|
|
251
251
|
Type: "state_change",
|
|
252
252
|
Attributes: []abci.EventAttribute{
|
|
253
|
-
{Key:
|
|
254
|
-
{Key:
|
|
255
|
-
{Key:
|
|
256
|
-
{Key:
|
|
253
|
+
{Key: "store", Value: "vstorage"},
|
|
254
|
+
{Key: "key", Value: "2\x00notify\x00legacy2"},
|
|
255
|
+
{Key: "anckey", Value: "\x012\x00notify\x00legacy2\x01"},
|
|
256
|
+
{Key: "value", Value: "legacyValue2b"},
|
|
257
257
|
},
|
|
258
258
|
},
|
|
259
259
|
{
|
|
260
260
|
Type: "state_change",
|
|
261
261
|
Attributes: []abci.EventAttribute{
|
|
262
|
-
{Key:
|
|
263
|
-
{Key:
|
|
264
|
-
{Key:
|
|
265
|
-
{Key:
|
|
262
|
+
{Key: "store", Value: "vstorage"},
|
|
263
|
+
{Key: "key", Value: "2\x00notify\x00noLegacy"},
|
|
264
|
+
{Key: "anckey", Value: "\x012\x00notify\x00noLegacy\x01"},
|
|
265
|
+
{Key: "value", Value: "noLegacyValue"},
|
|
266
266
|
},
|
|
267
267
|
},
|
|
268
268
|
{
|
|
269
269
|
Type: "state_change",
|
|
270
270
|
Attributes: []abci.EventAttribute{
|
|
271
|
-
{Key:
|
|
272
|
-
{Key:
|
|
273
|
-
{Key:
|
|
274
|
-
{Key:
|
|
271
|
+
{Key: "store", Value: "vstorage"},
|
|
272
|
+
{Key: "key", Value: "2\x00notify\x00noLegacy2"},
|
|
273
|
+
{Key: "anckey", Value: "\x012\x00notify\x00noLegacy2\x01"},
|
|
274
|
+
{Key: "value", Value: "noLegacyValue2b"},
|
|
275
275
|
},
|
|
276
276
|
},
|
|
277
277
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
package keeper
|
|
2
2
|
|
|
3
3
|
import (
|
|
4
|
-
abci "github.com/
|
|
4
|
+
abci "github.com/cometbft/cometbft/abci/types"
|
|
5
5
|
|
|
6
6
|
sdkioerrors "cosmossdk.io/errors"
|
|
7
7
|
"github.com/cosmos/cosmos-sdk/codec"
|
|
@@ -26,37 +26,6 @@ func getVstorageEntryPath(urlPathSegments []string) (string, error) {
|
|
|
26
26
|
return urlPathSegments[0], nil
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
// NewQuerier returns the function for handling queries routed to this module.
|
|
30
|
-
// It performs its own routing based on the first slash-separated URL path
|
|
31
|
-
// segment (e.g., URL path `/data/foo.bar` is a request for the value associated
|
|
32
|
-
// with vstorage path "foo.bar", and `/children/foo.bar` is a request for the
|
|
33
|
-
// child path segments immediately underneath vstorage path "foo.bar" which may
|
|
34
|
-
// be used to extend it to a vstorage path such as "foo.bar.baz").
|
|
35
|
-
func NewQuerier(keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) sdk.Querier {
|
|
36
|
-
return func(ctx sdk.Context, urlPathSegments []string, req abci.RequestQuery) (res []byte, err error) {
|
|
37
|
-
var queryType string
|
|
38
|
-
if len(urlPathSegments) > 0 {
|
|
39
|
-
queryType = urlPathSegments[0]
|
|
40
|
-
}
|
|
41
|
-
switch queryType {
|
|
42
|
-
case QueryData:
|
|
43
|
-
entryPath, entryPathErr := getVstorageEntryPath(urlPathSegments[1:])
|
|
44
|
-
if entryPathErr != nil {
|
|
45
|
-
return nil, entryPathErr
|
|
46
|
-
}
|
|
47
|
-
return queryData(ctx, entryPath, req, keeper, legacyQuerierCdc)
|
|
48
|
-
case QueryChildren:
|
|
49
|
-
entryPath, entryPathErr := getVstorageEntryPath(urlPathSegments[1:])
|
|
50
|
-
if entryPathErr != nil {
|
|
51
|
-
return nil, entryPathErr
|
|
52
|
-
}
|
|
53
|
-
return queryChildren(ctx, entryPath, req, keeper, legacyQuerierCdc)
|
|
54
|
-
default:
|
|
55
|
-
return nil, sdkioerrors.Wrap(sdkerrors.ErrUnknownRequest, "unknown vstorage query path")
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
29
|
// nolint: unparam
|
|
61
30
|
func queryData(ctx sdk.Context, path string, req abci.RequestQuery, keeper Keeper, legacyQuerierCdc *codec.LegacyAmino) (res []byte, err error) {
|
|
62
31
|
entry := keeper.GetEntry(ctx, path)
|