From 034358b55f0269c538b1250729db366af7b583e9 Mon Sep 17 00:00:00 2001 From: Conor Patrick Date: Fri, 27 Jan 2023 16:51:09 +0000 Subject: [PATCH] wormchain: require addresses to be allowlisted to submit tx --- wormchain/Makefile | 4 +- wormchain/app/app.go | 46 +- wormchain/proto/wormhole/genesis.proto | 4 +- wormchain/proto/wormhole/governance.proto | 2 +- wormchain/proto/wormhole/guardian.proto | 31 + wormchain/proto/wormhole/guardian_key.proto | 9 - wormchain/proto/wormhole/guardian_set.proto | 14 - .../proto/wormhole/guardian_validator.proto | 11 - wormchain/proto/wormhole/query.proto | 33 +- wormchain/proto/wormhole/tx.proto | 24 +- wormchain/testutil/keeper/wormhole.go | 3 +- wormchain/x/wormhole/ante/ante.go | 68 + wormchain/x/wormhole/client/cli/query.go | 2 + .../x/wormhole/client/cli/query_allowlist.go | 80 ++ wormchain/x/wormhole/client/cli/tx.go | 2 + .../x/wormhole/client/cli/tx_allowlist.go | 74 + wormchain/x/wormhole/genesis.go | 4 + wormchain/x/wormhole/handler.go | 6 + wormchain/x/wormhole/keeper/allowlist.go | 86 ++ .../x/wormhole/keeper/grpc_query_allowlist.go | 72 + .../keeper/guardian_validator_test.go | 11 +- .../x/wormhole/keeper/msg_server_allowlist.go | 57 + .../keeper/msg_server_allowlist_test.go | 249 ++++ wormchain/x/wormhole/types/codec.go | 4 + wormchain/x/wormhole/types/genesis.pb.go | 119 +- wormchain/x/wormhole/types/governance.pb.go | 48 +- wormchain/x/wormhole/types/guardian.pb.go | 1109 +++++++++++++++ wormchain/x/wormhole/types/guardian_key.pb.go | 317 ----- wormchain/x/wormhole/types/guardian_set.pb.go | 430 ------ .../x/wormhole/types/guardian_validator.pb.go | 372 ----- wormchain/x/wormhole/types/keys.go | 4 + .../x/wormhole/types/message_allowlist.go | 73 + wormchain/x/wormhole/types/query.pb.go | 1213 +++++++++++++++-- wormchain/x/wormhole/types/query.pb.gw.go | 202 +++ wormchain/x/wormhole/types/tx.pb.go | 782 ++++++++++- 35 files changed, 4211 insertions(+), 1354 deletions(-) create mode 100644 wormchain/proto/wormhole/guardian.proto delete mode 100644 wormchain/proto/wormhole/guardian_key.proto delete mode 100644 wormchain/proto/wormhole/guardian_set.proto delete mode 100644 wormchain/proto/wormhole/guardian_validator.proto create mode 100644 wormchain/x/wormhole/ante/ante.go create mode 100644 wormchain/x/wormhole/client/cli/query_allowlist.go create mode 100644 wormchain/x/wormhole/client/cli/tx_allowlist.go create mode 100644 wormchain/x/wormhole/keeper/allowlist.go create mode 100644 wormchain/x/wormhole/keeper/grpc_query_allowlist.go create mode 100644 wormchain/x/wormhole/keeper/msg_server_allowlist.go create mode 100644 wormchain/x/wormhole/keeper/msg_server_allowlist_test.go create mode 100644 wormchain/x/wormhole/types/guardian.pb.go delete mode 100644 wormchain/x/wormhole/types/guardian_key.pb.go delete mode 100644 wormchain/x/wormhole/types/guardian_set.pb.go delete mode 100644 wormchain/x/wormhole/types/guardian_validator.pb.go create mode 100644 wormchain/x/wormhole/types/message_allowlist.go diff --git a/wormchain/Makefile b/wormchain/Makefile index 11c360a98..813b68a0b 100644 --- a/wormchain/Makefile +++ b/wormchain/Makefile @@ -25,12 +25,12 @@ build/wormchaind: cmd/wormchaind/main.go $(GO_FILES) go build -v $(BUILD_FLAGS) -tags ledger -o $@ $< proto: $(PROTO_FILES) - docker build --target go-export -f Dockerfile.proto -o type=local,dest=. .. + DOCKER_BUILDKIT=1 docker build --target go-export -f Dockerfile.proto -o type=local,dest=. .. vue: $(GO_FILES) proto mkdir -p $@ touch -m $@ - docker build --target vue-export -f Dockerfile.proto -o type=local,dest=. .. + DOCKER_BUILDKIT=1 docker build --target vue-export -f Dockerfile.proto -o type=local,dest=. .. # For now this is a phony target so we just rebuild it each time instead of # tracking dependencies diff --git a/wormchain/app/app.go b/wormchain/app/app.go index b1c49e27b..d6d38f5be 100644 --- a/wormchain/app/app.go +++ b/wormchain/app/app.go @@ -16,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth" @@ -93,6 +94,7 @@ import ( "github.com/wormhole-foundation/wormchain/docs" wormholemodule "github.com/wormhole-foundation/wormchain/x/wormhole" + wormholemoduleante "github.com/wormhole-foundation/wormchain/x/wormhole/ante" wormholeclient "github.com/wormhole-foundation/wormchain/x/wormhole/client" wormholemodulekeeper "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" wormholemoduletypes "github.com/wormhole-foundation/wormchain/x/wormhole/types" @@ -552,7 +554,7 @@ func New( app.SetInitChainer(app.InitChainer) app.SetBeginBlocker(app.BeginBlocker) - anteHandler, err := ante.NewAnteHandler( + anteHandler, err := NewAnteHandler( ante.HandlerOptions{ AccountKeeper: app.AccountKeeper, BankKeeper: app.BankKeeper, @@ -560,6 +562,7 @@ func New( FeegrantKeeper: app.FeeGrantKeeper, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, + app.WormholeKeeper, ) if err != nil { panic(err) @@ -582,6 +585,47 @@ func New( return app } +// Copied from https://github.com/wormhole-foundation/cosmos-sdk/blob/main/x/auth/ante/ante.go#L25 +// I don't think there is currently a way to extend the list used in x/auth without copying it out. +func NewAnteHandler(options ante.HandlerOptions, wormKeeper wormholemodulekeeper.Keeper) (sdk.AnteHandler, error) { + if options.AccountKeeper == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder") + } + + if options.BankKeeper == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "bank keeper is required for ante builder") + } + + if options.SignModeHandler == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "sign mode handler is required for ante builder") + } + + sigGasConsumer := options.SigGasConsumer + if sigGasConsumer == nil { + sigGasConsumer = ante.DefaultSigVerificationGasConsumer + } + + anteDecorators := []sdk.AnteDecorator{ + ante.NewSetUpContextDecorator(), // outermost AnteDecorator. SetUpContext must be called first + ante.NewRejectExtensionOptionsDecorator(), + ante.NewMempoolFeeDecorator(), + ante.NewValidateBasicDecorator(), + ante.NewTxTimeoutHeightDecorator(), + ante.NewValidateMemoDecorator(options.AccountKeeper), + ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), + ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper), + ante.NewSetPubKeyDecorator(options.AccountKeeper), // SetPubKeyDecorator must be called before all signature verification decorators + ante.NewValidateSigCountDecorator(options.AccountKeeper), + ante.NewSigGasConsumeDecorator(options.AccountKeeper, sigGasConsumer), + ante.NewSigVerificationDecorator(options.AccountKeeper, options.SignModeHandler), + ante.NewIncrementSequenceDecorator(options.AccountKeeper), + // our ante handler + wormholemoduleante.NewWormholeAllowlistDecorator(wormKeeper), + } + + return sdk.ChainAnteDecorators(anteDecorators...), nil +} + // Name returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } diff --git a/wormchain/proto/wormhole/genesis.proto b/wormchain/proto/wormhole/genesis.proto index dc15dcaea..2a3b5e01f 100644 --- a/wormchain/proto/wormhole/genesis.proto +++ b/wormchain/proto/wormhole/genesis.proto @@ -1,12 +1,11 @@ syntax = "proto3"; package wormhole_foundation.wormchain.wormhole; -import "wormhole/guardian_set.proto"; +import "wormhole/guardian.proto"; import "wormhole/config.proto"; import "wormhole/replay_protection.proto"; import "wormhole/sequence_counter.proto"; import "wormhole/consensus_guardian_set_index.proto"; -import "wormhole/guardian_validator.proto"; // this line is used by starport scaffolding # genesis/proto/import import "gogoproto/gogo.proto"; @@ -20,5 +19,6 @@ message GenesisState { repeated SequenceCounter sequenceCounterList = 4 [(gogoproto.nullable) = false]; ConsensusGuardianSetIndex consensusGuardianSetIndex = 5; repeated GuardianValidator guardianValidatorList = 6 [(gogoproto.nullable) = false]; + repeated ValidatorAllowedAddress allowedAddresses = 7 [(gogoproto.nullable) = false]; // this line is used by starport scaffolding # genesis/proto/state } diff --git a/wormchain/proto/wormhole/governance.proto b/wormchain/proto/wormhole/governance.proto index d004eafc1..59c6fb709 100644 --- a/wormchain/proto/wormhole/governance.proto +++ b/wormchain/proto/wormhole/governance.proto @@ -1,7 +1,7 @@ syntax = "proto3"; package wormhole_foundation.wormchain.wormhole; -import "wormhole/guardian_set.proto"; +import "wormhole/guardian.proto"; import "gogoproto/gogo.proto"; option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; diff --git a/wormchain/proto/wormhole/guardian.proto b/wormchain/proto/wormhole/guardian.proto new file mode 100644 index 000000000..ad14ad7e6 --- /dev/null +++ b/wormchain/proto/wormhole/guardian.proto @@ -0,0 +1,31 @@ +syntax = "proto3"; +package wormhole_foundation.wormchain.wormhole; + +option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; + +import "gogoproto/gogo.proto"; + +message GuardianKey { + bytes key = 1; +} + +message GuardianValidator { + bytes guardianKey = 1; + bytes validatorAddr = 2; +} + +message GuardianSet { + option (gogoproto.equal) = true; + uint32 index = 1; + repeated bytes keys = 2; + uint64 expirationTime = 3; +} + +message ValidatorAllowedAddress { + // the validator/guardian that controls this entry + string validator_address = 1; + // the allowlisted account + string allowed_address = 2; + // human readable name + string name = 3; +} diff --git a/wormchain/proto/wormhole/guardian_key.proto b/wormchain/proto/wormhole/guardian_key.proto deleted file mode 100644 index 13a660bb5..000000000 --- a/wormchain/proto/wormhole/guardian_key.proto +++ /dev/null @@ -1,9 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -message GuardianKey { - - bytes key = 1; -} diff --git a/wormchain/proto/wormhole/guardian_set.proto b/wormchain/proto/wormhole/guardian_set.proto deleted file mode 100644 index 958b81da2..000000000 --- a/wormchain/proto/wormhole/guardian_set.proto +++ /dev/null @@ -1,14 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -import "gogoproto/gogo.proto"; - - -message GuardianSet { - option (gogoproto.equal) = true; - uint32 index = 1; - repeated bytes keys = 2; - uint64 expirationTime = 3; -} \ No newline at end of file diff --git a/wormchain/proto/wormhole/guardian_validator.proto b/wormchain/proto/wormhole/guardian_validator.proto deleted file mode 100644 index f88d3d14b..000000000 --- a/wormchain/proto/wormhole/guardian_validator.proto +++ /dev/null @@ -1,11 +0,0 @@ -syntax = "proto3"; -package wormhole_foundation.wormchain.wormhole; - -option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; - -message GuardianValidator { - bytes guardianKey = 1; - bytes validatorAddr = 2; - -} - diff --git a/wormchain/proto/wormhole/query.proto b/wormchain/proto/wormhole/query.proto index 1bd42b98d..1b3fe0191 100644 --- a/wormchain/proto/wormhole/query.proto +++ b/wormchain/proto/wormhole/query.proto @@ -3,12 +3,11 @@ package wormhole_foundation.wormchain.wormhole; import "google/api/annotations.proto"; import "cosmos/base/query/v1beta1/pagination.proto"; -import "wormhole/guardian_set.proto"; +import "wormhole/guardian.proto"; import "wormhole/config.proto"; import "wormhole/replay_protection.proto"; import "wormhole/sequence_counter.proto"; import "wormhole/consensus_guardian_set_index.proto"; -import "wormhole/guardian_validator.proto"; // this line is used by starport scaffolding # 1 import "gogoproto/gogo.proto"; @@ -69,9 +68,39 @@ service Query { option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/latest_guardian_set_index"; } + rpc AllowlistAll(QueryAllValidatorAllowlist) returns (QueryAllValidatorAllowlistResponse) { + option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/allowlist"; + } + + rpc Allowlist(QueryValidatorAllowlist) returns (QueryValidatorAllowlistResponse) { + option (google.api.http).get = "/wormhole_foundation/wormchain/wormhole/allowlist/{validator_address}"; + } + // this line is used by starport scaffolding # 2 } +message QueryAllValidatorAllowlist { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// all allowlisted entries by all validators +message QueryAllValidatorAllowlistResponse { + repeated ValidatorAllowedAddress allowed_address = 1; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryValidatorAllowlist { + string validator_address = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// all allowlisted entries by a specific validator +message QueryValidatorAllowlistResponse { + string validator_address = 1; + repeated ValidatorAllowedAddress allowed_address = 2; + cosmos.base.query.v1beta1.PageResponse pagination = 3; +} + message QueryGetGuardianSetRequest { uint32 index = 1; } diff --git a/wormchain/proto/wormhole/tx.proto b/wormchain/proto/wormhole/tx.proto index 580ff15b2..9dcee44a1 100644 --- a/wormchain/proto/wormhole/tx.proto +++ b/wormchain/proto/wormhole/tx.proto @@ -8,9 +8,12 @@ option go_package = "github.com/wormhole-foundation/wormchain/x/wormhole/types"; // Msg defines the Msg service. service Msg { - rpc ExecuteGovernanceVAA(MsgExecuteGovernanceVAA) returns (MsgExecuteGovernanceVAAResponse); + rpc ExecuteGovernanceVAA(MsgExecuteGovernanceVAA) returns (MsgExecuteGovernanceVAAResponse); rpc RegisterAccountAsGuardian(MsgRegisterAccountAsGuardian) returns (MsgRegisterAccountAsGuardianResponse); + rpc CreateAllowlist(MsgCreateAllowlistRequest) returns (MsgAllowlistResponse); + rpc DeleteAllowlist(MsgDeleteAllowlistRequest) returns (MsgAllowlistResponse); + // StoreCode to submit Wasm code to the system rpc StoreCode(MsgStoreCode) returns (MsgStoreCodeResponse); // Instantiate creates a new smart contract instance for the given code id. @@ -19,6 +22,25 @@ service Msg { // this line is used by starport scaffolding # proto/tx/rpc } +message MsgCreateAllowlistRequest { + // signer should be a guardian validator in a current set or future set. + string signer = 1; + // the address to allowlist + string address = 2; + // optional human readable name for the entry + string name = 3; +} + +message MsgDeleteAllowlistRequest { + // signer should be a guardian validator in a current set or future set. + string signer = 1; + // the address allowlist to remove + string address = 2; +} + +message MsgAllowlistResponse { +} + message MsgExecuteGovernanceVAA { bytes vaa = 1; string signer = 2; diff --git a/wormchain/testutil/keeper/wormhole.go b/wormchain/testutil/keeper/wormhole.go index cd6ed0247..2394a990f 100644 --- a/wormchain/testutil/keeper/wormhole.go +++ b/wormchain/testutil/keeper/wormhole.go @@ -115,7 +115,8 @@ func WormholeKeeper(t testing.TB) (*keeper.Keeper, sdk.Context) { supportedFeatures, ) ctx := sdk.NewContext(stateStore, tmproto.Header{ - Time: time.Now(), + Time: time.Now(), + Height: 1, }, false, log.NewNopLogger()) appapp.MountKVStores(keys) appapp.MountTransientStores(tkeys) diff --git a/wormchain/x/wormhole/ante/ante.go b/wormchain/x/wormhole/ante/ante.go new file mode 100644 index 000000000..57c2ad450 --- /dev/null +++ b/wormchain/x/wormhole/ante/ante.go @@ -0,0 +1,68 @@ +package ante + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" +) + +// Reject all messages if we're expecting a software update. +type WormholeAllowlistDecorator struct { + k keeper.Keeper +} + +func NewWormholeAllowlistDecorator(k keeper.Keeper) WormholeAllowlistDecorator { + return WormholeAllowlistDecorator{ + k: k, + } +} + +func (wh WormholeAllowlistDecorator) AnteHandle(request sdk.Request, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Request, err error) { + if request.IsReCheckTx() { + return next(request, tx, simulate) + } + if request.BlockHeight() < 1 { + // Don't reject gen_tx transactions + return next(request, tx, simulate) + } + + verified_addresses := make(map[string]bool) + + // For every message we should check: + // 1. There is an allowlist entry for the signer(s), OR + // 2. The signer(s) are validators in current or future guardian set. + // We cache the result for performance, since this is a ante handler that runs for everything. + for _, msg := range tx.GetMsgs() { + for _, signer := range msg.GetSigners() { + addr := signer.String() + // check for an address we may have already verified + if ok := verified_addresses[addr]; ok { + // ok + continue + } + // check for an allowlist + if wh.k.HasValidatorAllowedAddress(request, addr) { + allowed_entry := wh.k.GetValidatorAllowedAddress(request, addr) + // authenticate that the validator that made the allowlist is still valid + if wh.k.IsAddressValidatorOrFutureValidator(request, allowed_entry.ValidatorAddress) { + // ok + verified_addresses[addr] = true + continue + } + } + + // if allowlist did not pass, check if signer is a current or future validator + if wh.k.IsAddressValidatorOrFutureValidator(request, addr) { + // ok + verified_addresses[addr] = true + continue + } + + // by this point, this signer is not allowlisted or a valid validator. + // not authorized! + return request, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "signer must be current validator or allowlisted by current validator") + } + } + + return next(request, tx, simulate) +} diff --git a/wormchain/x/wormhole/client/cli/query.go b/wormchain/x/wormhole/client/cli/query.go index 7964a4b33..88655b3d7 100644 --- a/wormchain/x/wormhole/client/cli/query.go +++ b/wormchain/x/wormhole/client/cli/query.go @@ -35,6 +35,8 @@ func GetQueryCmd(queryRoute string) *cobra.Command { cmd.AddCommand(CmdListGuardianValidator()) cmd.AddCommand(CmdShowGuardianValidator()) cmd.AddCommand(CmdLatestGuardianSetIndex()) + cmd.AddCommand(CmdListAllowlists()) + cmd.AddCommand(CmdShowAllowlist()) // this line is used by starport scaffolding # 1 diff --git a/wormchain/x/wormhole/client/cli/query_allowlist.go b/wormchain/x/wormhole/client/cli/query_allowlist.go new file mode 100644 index 000000000..0a80620c7 --- /dev/null +++ b/wormchain/x/wormhole/client/cli/query_allowlist.go @@ -0,0 +1,80 @@ +package cli + +import ( + "context" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +func CmdListAllowlists() *cobra.Command { + cmd := &cobra.Command{ + Use: "list-allowlists", + Short: "list all allowlists created by validators", + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + + params := &types.QueryAllValidatorAllowlist{ + Pagination: pageReq, + } + + res, err := queryClient.AllowlistAll(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func CmdShowAllowlist() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-allowlist [validator-address]", + Short: "shows an allowlist owned by a specific validator address", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + pageReq, err := client.ReadPageRequest(cmd.Flags()) + if err != nil { + return err + } + + argValidatorAddress := args[0] + + params := &types.QueryValidatorAllowlist{ + ValidatorAddress: argValidatorAddress, + Pagination: pageReq, + } + + res, err := queryClient.Allowlist(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddPaginationFlagsToCmd(cmd, cmd.Use) + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/wormchain/x/wormhole/client/cli/tx.go b/wormchain/x/wormhole/client/cli/tx.go index 6dc94a418..aee0fba71 100644 --- a/wormchain/x/wormhole/client/cli/tx.go +++ b/wormchain/x/wormhole/client/cli/tx.go @@ -24,6 +24,8 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdRegisterAccountAsGuardian()) cmd.AddCommand(CmdStoreCode()) cmd.AddCommand(CmdInstantiateContract()) + cmd.AddCommand(CmdCreateAllowedAddress()) + cmd.AddCommand(CmdDeleteAllowedAddress()) // this line is used by starport scaffolding # 1 return cmd diff --git a/wormchain/x/wormhole/client/cli/tx_allowlist.go b/wormchain/x/wormhole/client/cli/tx_allowlist.go new file mode 100644 index 000000000..5eb2c557c --- /dev/null +++ b/wormchain/x/wormhole/client/cli/tx_allowlist.go @@ -0,0 +1,74 @@ +package cli + +import ( + "strconv" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + "github.com/spf13/cobra" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +var _ = strconv.Itoa(0) + +// StoreCodeCmd will upload code to be reused. +func CmdCreateAllowedAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "create-allowed-address [wormchain-address] [human-readable-name-of-key]", + Short: "Allowlist an address to be able to submit tx to wormchain. Must be submitted by a validator account.", + Aliases: []string{"allowlist", "allow"}, + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + address := args[0] + name := args[1] + + msg := types.MsgCreateAllowlistRequest{ + Signer: clientCtx.GetFromAddress().String(), + Address: address, + Name: name, + } + + if err = msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} + +// StoreCodeCmd will upload code to be reused. +func CmdDeleteAllowedAddress() *cobra.Command { + cmd := &cobra.Command{ + Use: "delete-allowed-address [wormchain-address]", + Short: "Remove an allowlist. The allowlist must be stale (only valid under old guardian set) or you must be the creator of the allowlist.", + Aliases: []string{"delete-allowlist", "remove-allowlist", "disallow"}, + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + address := args[0] + + msg := types.MsgDeleteAllowlistRequest{ + Signer: clientCtx.GetFromAddress().String(), + Address: address, + } + if err = msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + return cmd +} diff --git a/wormchain/x/wormhole/genesis.go b/wormchain/x/wormhole/genesis.go index 62278c4d0..1a1ec011f 100644 --- a/wormchain/x/wormhole/genesis.go +++ b/wormchain/x/wormhole/genesis.go @@ -36,6 +36,9 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) for _, elem := range genState.GuardianValidatorList { k.SetGuardianValidator(ctx, elem) } + for _, elem := range genState.AllowedAddresses { + k.SetValidatorAllowedAddress(ctx, elem) + } // this line is used by starport scaffolding # genesis/module/init } @@ -58,6 +61,7 @@ func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { genesis.ConsensusGuardianSetIndex = &consensusGuardianSetIndex } genesis.GuardianValidatorList = k.GetAllGuardianValidator(ctx) + genesis.AllowedAddresses = k.GetAllAllowedAddresses(ctx) // this line is used by starport scaffolding # genesis/module/export return genesis diff --git a/wormchain/x/wormhole/handler.go b/wormchain/x/wormhole/handler.go index d3d370f5a..04afa7dcd 100644 --- a/wormchain/x/wormhole/handler.go +++ b/wormchain/x/wormhole/handler.go @@ -29,6 +29,12 @@ func NewHandler(k keeper.Keeper) sdk.Handler { case *types.MsgInstantiateContract: res, err := msgServer.InstantiateContract(sdk.WrapSDKContext(ctx), msg) return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgCreateAllowlistRequest: + res, err := msgServer.CreateAllowlist(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgDeleteAllowlistRequest: + res, err := msgServer.DeleteAllowlist(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) // this line is used by starport scaffolding # 1 default: errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) diff --git a/wormchain/x/wormhole/keeper/allowlist.go b/wormchain/x/wormhole/keeper/allowlist.go new file mode 100644 index 000000000..c1e096db2 --- /dev/null +++ b/wormchain/x/wormhole/keeper/allowlist.go @@ -0,0 +1,86 @@ +package keeper + +import ( + "bytes" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +// SetSequenceCounter set a specific sequenceCounter in the store from its index +func (k Keeper) SetValidatorAllowedAddress(ctx sdk.Context, address types.ValidatorAllowedAddress) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorAllowlistKey)) + b := k.cdc.MustMarshal(&address) + store.Set([]byte(address.AllowedAddress), b) +} + +func (k Keeper) GetValidatorAllowedAddress(ctx sdk.Context, address string) types.ValidatorAllowedAddress { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorAllowlistKey)) + b := store.Get([]byte(address)) + var allowedAddr types.ValidatorAllowedAddress + k.cdc.MustUnmarshal(b, &allowedAddr) + return allowedAddr +} + +func (k Keeper) HasValidatorAllowedAddress(ctx sdk.Context, address string) bool { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorAllowlistKey)) + return store.Has([]byte(address)) +} + +// RemoveSequenceCounter removes a sequenceCounter from the store +func (k Keeper) RemoveValidatorAllowedAddress(ctx sdk.Context, address string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorAllowlistKey)) + store.Delete([]byte(address)) +} + +func (k Keeper) GetAllAllowedAddresses(ctx sdk.Context) (list []types.ValidatorAllowedAddress) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefix(types.ValidatorAllowlistKey)) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.ValidatorAllowedAddress + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} + +// Checks if a given address is registered as a guardian validator and either: +// * Is in the current guardian set, OR +// * Is in a future guardian set +func (k Keeper) IsAddressValidatorOrFutureValidator(ctx sdk.Context, addr string) bool { + currentIndex, _ := k.GetConsensusGuardianSetIndex(ctx) + validators := k.GetAllGuardianValidator(ctx) + addrBz, err := sdk.AccAddressFromBech32(addr) + var matchedValidator *types.GuardianValidator = nil + if err != nil { + return false + } + // look up the guardian validator + for _, val := range validators { + if bytes.Equal(val.ValidatorAddr, addrBz) { + matchedValidator = &val + break + } + } + // if no match, no match + if matchedValidator == nil { + return false + } + // check that the validator is in a current or future guardian set + guardianSets := k.GetAllGuardianSet(ctx) + for _, gSet := range guardianSets { + if gSet.Index >= currentIndex.Index { + for _, gKey := range gSet.Keys { + if bytes.Equal(matchedValidator.GuardianKey, gKey) { + return true + } + } + } + } + return false +} diff --git a/wormchain/x/wormhole/keeper/grpc_query_allowlist.go b/wormchain/x/wormhole/keeper/grpc_query_allowlist.go new file mode 100644 index 000000000..17813c054 --- /dev/null +++ b/wormchain/x/wormhole/keeper/grpc_query_allowlist.go @@ -0,0 +1,72 @@ +package keeper + +import ( + "context" + + "github.com/cosmos/cosmos-sdk/store/prefix" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/query" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +func (k Keeper) AllowlistAll(c context.Context, req *types.QueryAllValidatorAllowlist) (*types.QueryAllValidatorAllowlistResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var allowedAddresses []*types.ValidatorAllowedAddress + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + sequenceCounterStore := prefix.NewStore(store, types.KeyPrefix(types.ValidatorAllowlistKey)) + + pageRes, err := query.Paginate(sequenceCounterStore, req.Pagination, func(key []byte, value []byte) error { + var allowedAddress types.ValidatorAllowedAddress + if err := k.cdc.Unmarshal(value, &allowedAddress); err != nil { + return err + } + + allowedAddresses = append(allowedAddresses, &allowedAddress) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryAllValidatorAllowlistResponse{AllowedAddress: allowedAddresses, Pagination: pageRes}, nil +} + +func (k Keeper) Allowlist(c context.Context, req *types.QueryValidatorAllowlist) (*types.QueryValidatorAllowlistResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var allowedAddresses []*types.ValidatorAllowedAddress + ctx := sdk.UnwrapSDKContext(c) + + store := ctx.KVStore(k.storeKey) + sequenceCounterStore := prefix.NewStore(store, types.KeyPrefix(types.ValidatorAllowlistKey)) + + pageRes, err := query.Paginate(sequenceCounterStore, req.Pagination, func(key []byte, value []byte) error { + var allowedAddress types.ValidatorAllowedAddress + if err := k.cdc.Unmarshal(value, &allowedAddress); err != nil { + return err + } + // this will cause a less then expected amount to be returned in the pagination, + // but the alternative is to rework how pagination works, which is complex. + // this lists are not expected to be long anyways and won't need pagination. + if allowedAddress.ValidatorAddress == req.ValidatorAddress { + allowedAddresses = append(allowedAddresses, &allowedAddress) + } + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + + return &types.QueryValidatorAllowlistResponse{AllowedAddress: allowedAddresses, Pagination: pageRes, ValidatorAddress: req.ValidatorAddress}, nil +} diff --git a/wormchain/x/wormhole/keeper/guardian_validator_test.go b/wormchain/x/wormhole/keeper/guardian_validator_test.go index 9f0b2bb4b..bf1e89656 100644 --- a/wormchain/x/wormhole/keeper/guardian_validator_test.go +++ b/wormchain/x/wormhole/keeper/guardian_validator_test.go @@ -23,8 +23,15 @@ func createNGuardianValidator(keeper *keeper.Keeper, ctx sdk.Context, n int) ([] if err != nil { panic(err) } - addr := crypto.PubkeyToAddress(privKey.PublicKey) - items[i].GuardianKey = addr[:] + guardianAddr := crypto.PubkeyToAddress(privKey.PublicKey) + privKeyValidator, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) + if err != nil { + panic(err) + } + + validatorAddr := crypto.PubkeyToAddress(privKeyValidator.PublicKey) + items[i].GuardianKey = guardianAddr[:] + items[i].ValidatorAddr = validatorAddr[:] privKeys = append(privKeys, privKey) keeper.SetGuardianValidator(ctx, items[i]) diff --git a/wormchain/x/wormhole/keeper/msg_server_allowlist.go b/wormchain/x/wormhole/keeper/msg_server_allowlist.go new file mode 100644 index 000000000..c5803758c --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_allowlist.go @@ -0,0 +1,57 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" +) + +func (k msgServer) CreateAllowlist(goCtx context.Context, msg *types.MsgCreateAllowlistRequest) (*types.MsgAllowlistResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + validator_address := msg.Signer + if !k.IsAddressValidatorOrFutureValidator(ctx, validator_address) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "must be a current or future validator") + } + + // is this already in an active allowlist? + if k.HasValidatorAllowedAddress(ctx, msg.Address) { + allowed := k.GetValidatorAllowedAddress(ctx, msg.Address) + if k.IsAddressValidatorOrFutureValidator(ctx, allowed.ValidatorAddress) { + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "address is already whitelisted") + } + } + + k.SetValidatorAllowedAddress(ctx, types.ValidatorAllowedAddress{ + ValidatorAddress: validator_address, + AllowedAddress: msg.Address, + Name: msg.Name, + }) + + return &types.MsgAllowlistResponse{}, nil +} + +func (k msgServer) DeleteAllowlist(goCtx context.Context, msg *types.MsgDeleteAllowlistRequest) (*types.MsgAllowlistResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + validator_address := msg.Signer + if !k.IsAddressValidatorOrFutureValidator(ctx, validator_address) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "must be a current or future validator") + } + + // is this already in an active allowlist? + if k.HasValidatorAllowedAddress(ctx, msg.Address) { + allowed := k.GetValidatorAllowedAddress(ctx, msg.Address) + if !k.IsAddressValidatorOrFutureValidator(ctx, allowed.ValidatorAddress) { + // permit deleting entries of past validators + } else if allowed.ValidatorAddress != validator_address { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "can only delete allowlist entries you created") + } + } else { + return nil, sdkerrors.ErrKeyNotFound + } + + k.RemoveValidatorAllowedAddress(ctx, msg.Address) + + return &types.MsgAllowlistResponse{}, nil +} diff --git a/wormchain/x/wormhole/keeper/msg_server_allowlist_test.go b/wormchain/x/wormhole/keeper/msg_server_allowlist_test.go new file mode 100644 index 000000000..199b2f247 --- /dev/null +++ b/wormchain/x/wormhole/keeper/msg_server_allowlist_test.go @@ -0,0 +1,249 @@ +package keeper_test + +import ( + "crypto/ecdsa" + "crypto/rand" + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/ethereum/go-ethereum/crypto" + "github.com/stretchr/testify/assert" + keepertest "github.com/wormhole-foundation/wormchain/testutil/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/ante" + "github.com/wormhole-foundation/wormchain/x/wormhole/keeper" + "github.com/wormhole-foundation/wormchain/x/wormhole/types" + "github.com/wormhole-foundation/wormhole/sdk/vaa" +) + +var _ sdk.Tx = &MockTx{} + +type MockTx struct { + Msgs []sdk.Msg +} + +func (tx *MockTx) GetMsgs() []sdk.Msg { + return tx.Msgs +} + +func (tx *MockTx) ValidateBasic() error { + return nil +} +func MockNext(ctx sdk.Context, tx sdk.Tx, simulate bool) (newCtx sdk.Context, err error) { + return ctx, nil +} + +func getSigner(guardianValidator *types.GuardianValidator) string { + return sdk.AccAddress(guardianValidator.ValidatorAddr).String() +} + +func getMsgWithSigner(signer string) sdk.Msg { + // Use any msg, picking on MsgExecuteGovernanceVAA arbitrarily. + return &types.MsgExecuteGovernanceVAA{ + Signer: signer, + } +} + +func getTxWithSigner(signer string) sdk.Tx { + return &MockTx{ + Msgs: []sdk.Msg{getMsgWithSigner(signer)}, + } +} + +func getRandomAddress() string { + privKeyValidator, err := ecdsa.GenerateKey(crypto.S256(), rand.Reader) + if err != nil { + panic(err) + } + validatorAddr := crypto.PubkeyToAddress(privKeyValidator.PublicKey) + return sdk.AccAddress(validatorAddr[:]).String() +} + +func TestAllowlist(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + guardians, _ := createNGuardianValidator(k, ctx, 10) + k.SetConfig(ctx, types.Config{ + GovernanceEmitter: vaa.GovernanceEmitter[:], + GovernanceChain: uint32(vaa.GovernanceChain), + ChainId: uint32(vaa.ChainIDWormchain), + GuardianSetExpiration: 86400, + }) + + createNewGuardianSet(k, ctx, guardians) + k.SetConsensusGuardianSetIndex(ctx, types.ConsensusGuardianSetIndex{ + Index: 0, + }) + + context := sdk.WrapSDKContext(ctx) + msgServer := keeper.NewMsgServerImpl(*k) + + // Test creating allowlist works using a validator + new_address := getRandomAddress() + _, err := msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.NoError(t, err) + // Test creating the same address again is rejected + for _, g := range guardians { + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&g), + Address: new_address, + }) + assert.Error(t, err) + } + + // Test address can be Deleted + _, err = msgServer.DeleteAllowlist(context, &types.MsgDeleteAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.NoError(t, err) + // Can't be deleted again since it doesn't exist + _, err = msgServer.DeleteAllowlist(context, &types.MsgDeleteAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.Error(t, err) + // Can be added again + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.NoError(t, err) + + // another guardian cannot delete an allowlist they did not create + for _, g := range guardians[1:] { + _, err = msgServer.DeleteAllowlist(context, &types.MsgDeleteAllowlistRequest{ + Signer: getSigner(&g), + Address: new_address, + }) + assert.Error(t, err) + } + + // Cannot make allowlist if not a validator + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getRandomAddress(), + Address: getRandomAddress(), + }) + assert.Error(t, err) + + // Cannot make allowlist if the guardian set changes + oldGuardian := guardians[0] + guardians, _ = createNGuardianValidator(k, ctx, 10) + createNewGuardianSet(k, ctx, guardians) + err = k.TrySwitchToNewConsensusGuardianSet(ctx) + assert.NoError(t, err) + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&oldGuardian), + Address: getRandomAddress(), + }) + assert.Error(t, err) + + // still works with new guardian set + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: getRandomAddress(), + }) + assert.NoError(t, err) + + // Anyone can remove stale allowlists + // (new_address list is now stale as it's validator is no longer in validator set) + _, err = msgServer.DeleteAllowlist(context, &types.MsgDeleteAllowlistRequest{ + Signer: getSigner(&guardians[9]), + Address: new_address, + }) + assert.NoError(t, err) + + _ = msgServer + _ = context +} + +func TestAllowlistAnteHandler(t *testing.T) { + k, ctx := keepertest.WormholeKeeper(t) + guardians, privateKeys := createNGuardianValidator(k, ctx, 10) + _ = privateKeys + k.SetConfig(ctx, types.Config{ + GovernanceEmitter: vaa.GovernanceEmitter[:], + GovernanceChain: uint32(vaa.GovernanceChain), + ChainId: uint32(vaa.ChainIDWormchain), + GuardianSetExpiration: 86400, + }) + + createNewGuardianSet(k, ctx, guardians) + k.SetConsensusGuardianSetIndex(ctx, types.ConsensusGuardianSetIndex{ + Index: 0, + }) + + context := sdk.WrapSDKContext(ctx) + msgServer := keeper.NewMsgServerImpl(*k) + + anteHandler := ante.NewWormholeAllowlistDecorator(*k) + + // Test ante handler works with validate validator address + for _, g := range guardians { + msgs := []sdk.Msg{} + for i := 0; i < 5; i += 1 { + msgs = append(msgs, getMsgWithSigner(getSigner(&g))) + } + tx := MockTx{ + Msgs: msgs, + } + _, err := anteHandler.AnteHandle(ctx, &tx, false, MockNext) + assert.NoError(t, err) + } + + // Test ante handler rejects new address + new_address := getRandomAddress() + _, err := anteHandler.AnteHandle(ctx, getTxWithSigner(new_address), false, MockNext) + assert.Error(t, err) + + // Test ante handler accepts new address when whitelisted + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.NoError(t, err) + _, err = anteHandler.AnteHandle(ctx, getTxWithSigner(new_address), false, MockNext) + assert.NoError(t, err) + + // Test ante handler rejects when allowlist is removed + _, err = msgServer.DeleteAllowlist(context, &types.MsgDeleteAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.NoError(t, err) + + _, err = anteHandler.AnteHandle(ctx, getTxWithSigner(new_address), false, MockNext) + assert.Error(t, err) + + // (add back the allowlist) + _, err = msgServer.CreateAllowlist(context, &types.MsgCreateAllowlistRequest{ + Signer: getSigner(&guardians[0]), + Address: new_address, + }) + assert.NoError(t, err) + _, err = anteHandler.AnteHandle(ctx, getTxWithSigner(new_address), false, MockNext) + assert.NoError(t, err) + + // test that the ante handler rejects when a 2nd not-allowed msg is snuck in >:) + _, err = anteHandler.AnteHandle(ctx, &MockTx{ + Msgs: []sdk.Msg{ + // good + getMsgWithSigner(new_address), + // bad + getMsgWithSigner(getRandomAddress()), + }, + }, false, MockNext) + assert.Error(t, err) + + // test ante handler rejects address that is no longer valid + // due to validator set advancing + // 1. new guardian set + guardians, _ = createNGuardianValidator(k, ctx, 10) + createNewGuardianSet(k, ctx, guardians) + err = k.TrySwitchToNewConsensusGuardianSet(ctx) + assert.NoError(t, err) + // 2. expect reject + _, err = anteHandler.AnteHandle(ctx, getTxWithSigner(new_address), false, MockNext) + assert.Error(t, err) +} diff --git a/wormchain/x/wormhole/types/codec.go b/wormchain/x/wormhole/types/codec.go index afacc4867..abca056ca 100644 --- a/wormchain/x/wormhole/types/codec.go +++ b/wormchain/x/wormhole/types/codec.go @@ -13,6 +13,8 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgRegisterAccountAsGuardian{}, "wormhole/RegisterAccountAsGuardian", nil) cdc.RegisterConcrete(&MsgStoreCode{}, "wormhole/StoreCode", nil) cdc.RegisterConcrete(&MsgInstantiateContract{}, "wormhole/InstantiateContract", nil) + cdc.RegisterConcrete(&MsgCreateAllowlistRequest{}, "wormhole/CreateAllowlistRequest", nil) + cdc.RegisterConcrete(&MsgDeleteAllowlistRequest{}, "wormhole/DeleteAllowlistRequest", nil) // this line is used by starport scaffolding # 2 } @@ -21,6 +23,8 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { &MsgExecuteGovernanceVAA{}, &MsgStoreCode{}, &MsgInstantiateContract{}, + &MsgCreateAllowlistRequest{}, + &MsgDeleteAllowlistRequest{}, ) registry.RegisterImplementations((*gov.Content)(nil), &GovernanceWormholeMessageProposal{}, diff --git a/wormchain/x/wormhole/types/genesis.pb.go b/wormchain/x/wormhole/types/genesis.pb.go index 82c8dfc98..dc79e3dae 100644 --- a/wormchain/x/wormhole/types/genesis.pb.go +++ b/wormchain/x/wormhole/types/genesis.pb.go @@ -31,6 +31,7 @@ type GenesisState struct { SequenceCounterList []SequenceCounter `protobuf:"bytes,4,rep,name=sequenceCounterList,proto3" json:"sequenceCounterList"` ConsensusGuardianSetIndex *ConsensusGuardianSetIndex `protobuf:"bytes,5,opt,name=consensusGuardianSetIndex,proto3" json:"consensusGuardianSetIndex,omitempty"` GuardianValidatorList []GuardianValidator `protobuf:"bytes,6,rep,name=guardianValidatorList,proto3" json:"guardianValidatorList"` + AllowedAddresses []ValidatorAllowedAddress `protobuf:"bytes,7,rep,name=allowedAddresses,proto3" json:"allowedAddresses"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -108,6 +109,13 @@ func (m *GenesisState) GetGuardianValidatorList() []GuardianValidator { return nil } +func (m *GenesisState) GetAllowedAddresses() []ValidatorAllowedAddress { + if m != nil { + return m.AllowedAddresses + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "wormhole_foundation.wormchain.wormhole.GenesisState") } @@ -115,34 +123,35 @@ func init() { func init() { proto.RegisterFile("wormhole/genesis.proto", fileDescriptor_9a7ced3fe0304831) } var fileDescriptor_9a7ced3fe0304831 = []byte{ - // 426 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0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 0x7e, 0xbb, 0x37, 0xb5, 0xed, 0xde, 0xd4, 0xee, 0xf7, 0xa6, 0x76, 0x31, - 0x08, 0x31, 0x9f, 0xc5, 0x13, 0xcb, 0xa7, 0x0b, 0x3b, 0xa3, 0x7f, 0x3f, 0x68, 0xdb, 0x4a, 0xdb, - 0x5e, 0xa9, 0x7f, 0x9b, 0xaf, 0x97, 0x88, 0x4d, 0xaa, 0xe2, 0xec, 0xfb, 0x4f, 0x01, 0x00, 0x00, - 0xff, 0xff, 0x40, 0x4b, 0xe8, 0xcd, 0x15, 0x04, 0x00, 0x00, + // 447 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x93, 0x4f, 0x6b, 0xd4, 0x40, + 0x18, 0xc6, 0x13, 0x5b, 0x23, 0x4c, 0x05, 0x65, 0x6c, 0x35, 0xf6, 0x90, 0x2e, 0x1e, 0xa4, 0x20, + 0x26, 0xd0, 0x1e, 0xb4, 0x27, 0xd9, 0x16, 0x2c, 0x82, 0x07, 0x49, 0xc0, 0x83, 0x97, 0x30, 0x4d, + 0xde, 0x66, 0x07, 0xd2, 0x99, 0x6d, 0x66, 0x42, 0xbb, 0x27, 0x3f, 0x80, 0x17, 0x3f, 0xd6, 0x1e, + 0xf7, 0xe8, 0x49, 0x64, 0xf7, 0x8b, 0x48, 0x66, 0x26, 0xb3, 0x7f, 0x8c, 0x90, 0xbd, 0x0d, 0xcf, + 0xbc, 0xef, 0xef, 0x99, 0xf7, 0x79, 0x13, 0xf4, 0xfc, 0x8e, 0x57, 0x37, 0x23, 0x5e, 0x42, 0x54, + 0x00, 0x03, 0x41, 0x45, 0x38, 0xae, 0xb8, 0xe4, 0xf8, 0x75, 0xab, 0xa7, 0xd7, 0xbc, 0x66, 0x39, + 0x91, 0x94, 0xb3, 0xb0, 0xd1, 0xb2, 0x11, 0xa1, 0xfa, 0xd4, 0xdc, 0x1e, 0xbe, 0x58,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 0xd7, 0xbb, 0x92, 0xed, 0xa7, 0x66, 0xb7, 0xfe, 0x43, 0x95, 0xdf, 0x70, + 0x8b, 0xfc, 0xba, 0x41, 0xf1, 0xff, 0x3d, 0x70, 0x8d, 0x0e, 0xda, 0x05, 0x7e, 0x25, 0x25, 0xcd, + 0x89, 0xe4, 0x7a, 0x66, 0x4f, 0xcd, 0x7c, 0xb6, 0xed, 0x87, 0x61, 0x21, 0x66, 0xea, 0x6e, 0x3a, + 0xbe, 0x45, 0x4f, 0x49, 0x59, 0xf2, 0x3b, 0xc8, 0x87, 0x79, 0x5e, 0x81, 0x10, 0x20, 0xfc, 0x47, + 0xca, 0xf1, 0x43, 0x5f, 0x47, 0x0b, 0x1c, 0xae, 0x81, 0x8c, 0xef, 0x3f, 0xf8, 0xf3, 0x64, 0x3a, + 0x0f, 0xdc, 0xd9, 0x3c, 0x70, 0xff, 0xcc, 0x03, 0xf7, 0xe7, 0x22, 0x70, 0x66, 0x8b, 0xc0, 0xf9, + 0xb5, 0x08, 0x9c, 0x6f, 0x67, 0x05, 0x95, 0xa3, 0xfa, 0x2a, 0xcc, 0xf8, 0x4d, 0xd4, 0xe2, 0xdf, + 0x2e, 0xcd, 0x23, 0x6b, 0x1e, 0xdd, 0xdb, 0xfb, 0x48, 0x4e, 0xc6, 0x20, 0xae, 0x3c, 0xf5, 0xa7, + 0x9d, 0xfe, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x77, 0xb5, 0xdb, 0x2c, 0x61, 0x04, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -165,6 +174,20 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AllowedAddresses) > 0 { + for iNdEx := len(m.AllowedAddresses) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedAddresses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } if len(m.GuardianValidatorList) > 0 { for iNdEx := len(m.GuardianValidatorList) - 1; iNdEx >= 0; iNdEx-- { { @@ -297,6 +320,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.AllowedAddresses) > 0 { + for _, e := range m.AllowedAddresses { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -543,6 +572,40 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedAddresses = append(m.AllowedAddresses, ValidatorAllowedAddress{}) + if err := m.AllowedAddresses[len(m.AllowedAddresses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/wormchain/x/wormhole/types/governance.pb.go b/wormchain/x/wormhole/types/governance.pb.go index c685a520e..7fb4bb612 100644 --- a/wormchain/x/wormhole/types/governance.pb.go +++ b/wormchain/x/wormhole/types/governance.pb.go @@ -177,30 +177,30 @@ func init() { func init() { proto.RegisterFile("wormhole/governance.proto", fileDescriptor_ceebda8f8c3f5f74) } var fileDescriptor_ceebda8f8c3f5f74 = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0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0x0a, 0xb9, 0xda, 0x7f, 0x83, 0xb4, 0xab, 0xe7, 0x1d, 0xf3, 0x77, 0x4d, 0xcc, 0x82, 0xb5, - 0x5b, 0x9a, 0x7f, 0x34, 0x15, 0xfb, 0x47, 0xe0, 0xe5, 0xee, 0xcb, 0xac, 0xa9, 0x7c, 0xcd, 0x9a, - 0xa4, 0xf5, 0x46, 0xe8, 0x49, 0x6f, 0x33, 0xd9, 0x5d, 0x1e, 0x71, 0x0d, 0x71, 0xcc, 0xbc, 0xbf, - 0x57, 0x39, 0xa2, 0x15, 0xe6, 0xa4, 0xa2, 0xac, 0x70, 0x60, 0xe7, 0x48, 0xf2, 0x63, 0x74, 0x93, - 0x00, 0xb4, 0x92, 0x41, 0xda, 0xfb, 0x76, 0x8e, 0x64, 0xa2, 0x60, 0xdc, 0x03, 0x71, 0x25, 0x1b, - 0x69, 0xe5, 0xd4, 0x54, 0xa4, 0x54, 0x8d, 0xee, 0x44, 0x6c, 0x1a, 0x20, 0x73, 0xb5, 0x4a, 0x6a, - 0x5d, 0xc3, 0x6d, 0xa7, 0x6e, 0x7f, 0xbe, 0xd4, 0xc9, 0x62, 0xa9, 0x93, 0xcf, 0xa5, 0x4e, 0x9e, - 0x57, 0xba, 0xb2, 0x58, 0xe9, 0xca, 0xfb, 0x4a, 0x57, 0xee, 0x2f, 0x3c, 0x5f, 0x8c, 0x92, 0xa1, - 0xe9, 0xe0, 0xd8, 0x5a, 0xcf, 0x75, 0xb6, 0x1d, 0xd3, 0xda, 0x8c, 0x69, 0x3d, 0x6d, 0x74, 0x4b, - 0x4c, 0x23, 0x88, 0x87, 0x95, 0xf4, 0xc9, 0x3b, 0xdf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x06, 0x0f, - 0x17, 0x16, 0x6a, 0x02, 0x00, 0x00, + // 353 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x51, 0x31, 0x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x9e, 0x77, 0xcc, 0xbf, 0xb5, 0x30, 0x0b, 0xd6, 0x6e, 0x69, 0xf6, 0xd9, 0x54, + 0xec, 0x5f, 0x81, 0x97, 0xbb, 0xaf, 0xd3, 0xa6, 0xf2, 0x3d, 0x6d, 0x92, 0xd6, 0x3b, 0xa1, 0x27, + 0xbd, 0xf5, 0x5c, 0x77, 0x79, 0xc4, 0x35, 0x8b, 0x63, 0xf0, 0xfe, 0x5f, 0xe5, 0x88, 0x56, 0xc0, + 0x49, 0x45, 0x59, 0xe1, 0xc0, 0xce, 0x91, 0xe4, 0x47, 0xe8, 0x26, 0x01, 0xd3, 0x4a, 0x06, 0x69, + 0xef, 0xdb, 0x39, 0x92, 0x89, 0x02, 0xb8, 0xc7, 0xc4, 0x95, 0x6c, 0xa4, 0x95, 0x53, 0x53, 0x91, + 0x52, 0x35, 0xba, 0x13, 0xc1, 0x24, 0x40, 0x70, 0xb5, 0x4a, 0x6a, 0x5d, 0xc1, 0x4d, 0xa7, 0x6e, + 0x7f, 0xb6, 0xd0, 0xc9, 0x7c, 0xa1, 0x93, 0xaf, 0x85, 0x4e, 0x5e, 0x96, 0xba, 0x32, 0x5f, 0xea, + 0xca, 0xc7, 0x52, 0x57, 0xee, 0x2f, 0x3c, 0x5f, 0x0c, 0x93, 0x81, 0xe9, 0xe0, 0xc8, 0x5a, 0xcd, + 0x75, 0xb6, 0x19, 0xd3, 0x5a, 0x8f, 0x69, 0x3d, 0xaf, 0x75, 0x4b, 0x4c, 0x22, 0x16, 0x0f, 0x2a, + 0xe9, 0x93, 0x77, 0x7e, 0x02, 0x00, 0x00, 0xff, 0xff, 0x76, 0x11, 0xd3, 0x39, 0x66, 0x02, 0x00, + 0x00, } func (this *GuardianSetUpdateProposal) Equal(that interface{}) bool { diff --git a/wormchain/x/wormhole/types/guardian.pb.go b/wormchain/x/wormhole/types/guardian.pb.go new file mode 100644 index 000000000..229de73f6 --- /dev/null +++ b/wormchain/x/wormhole/types/guardian.pb.go @@ -0,0 +1,1109 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: wormhole/guardian.proto + +package types + +import ( + bytes "bytes" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type GuardianKey struct { + Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` +} + +func (m *GuardianKey) Reset() { *m = GuardianKey{} } +func (m *GuardianKey) String() string { return proto.CompactTextString(m) } +func (*GuardianKey) ProtoMessage() {} +func (*GuardianKey) Descriptor() ([]byte, []int) { + return fileDescriptor_95afcf26fc23dcb3, []int{0} +} +func (m *GuardianKey) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GuardianKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GuardianKey.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GuardianKey) XXX_Merge(src proto.Message) { + xxx_messageInfo_GuardianKey.Merge(m, src) +} +func (m *GuardianKey) XXX_Size() int { + return m.Size() +} +func (m *GuardianKey) XXX_DiscardUnknown() { + xxx_messageInfo_GuardianKey.DiscardUnknown(m) +} + +var xxx_messageInfo_GuardianKey proto.InternalMessageInfo + +func (m *GuardianKey) GetKey() []byte { + if m != nil { + return m.Key + } + return nil +} + +type GuardianValidator struct { + GuardianKey []byte `protobuf:"bytes,1,opt,name=guardianKey,proto3" json:"guardianKey,omitempty"` + ValidatorAddr []byte `protobuf:"bytes,2,opt,name=validatorAddr,proto3" json:"validatorAddr,omitempty"` +} + +func (m *GuardianValidator) Reset() { *m = GuardianValidator{} } +func (m *GuardianValidator) String() string { return proto.CompactTextString(m) } +func (*GuardianValidator) ProtoMessage() {} +func (*GuardianValidator) Descriptor() ([]byte, []int) { + return fileDescriptor_95afcf26fc23dcb3, []int{1} +} +func (m *GuardianValidator) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GuardianValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GuardianValidator.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GuardianValidator) XXX_Merge(src proto.Message) { + xxx_messageInfo_GuardianValidator.Merge(m, src) +} +func (m *GuardianValidator) XXX_Size() int { + return m.Size() +} +func (m *GuardianValidator) XXX_DiscardUnknown() { + xxx_messageInfo_GuardianValidator.DiscardUnknown(m) +} + +var xxx_messageInfo_GuardianValidator proto.InternalMessageInfo + +func (m *GuardianValidator) GetGuardianKey() []byte { + if m != nil { + return m.GuardianKey + } + return nil +} + +func (m *GuardianValidator) GetValidatorAddr() []byte { + if m != nil { + return m.ValidatorAddr + } + return nil +} + +type GuardianSet struct { + Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` + Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` + ExpirationTime uint64 `protobuf:"varint,3,opt,name=expirationTime,proto3" json:"expirationTime,omitempty"` +} + +func (m *GuardianSet) Reset() { *m = GuardianSet{} } +func (m *GuardianSet) String() string { return proto.CompactTextString(m) } +func (*GuardianSet) ProtoMessage() {} +func (*GuardianSet) Descriptor() ([]byte, []int) { + return fileDescriptor_95afcf26fc23dcb3, []int{2} +} +func (m *GuardianSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GuardianSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GuardianSet.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GuardianSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_GuardianSet.Merge(m, src) +} +func (m *GuardianSet) XXX_Size() int { + return m.Size() +} +func (m *GuardianSet) XXX_DiscardUnknown() { + xxx_messageInfo_GuardianSet.DiscardUnknown(m) +} + +var xxx_messageInfo_GuardianSet proto.InternalMessageInfo + +func (m *GuardianSet) GetIndex() uint32 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *GuardianSet) GetKeys() [][]byte { + if m != nil { + return m.Keys + } + return nil +} + +func (m *GuardianSet) GetExpirationTime() uint64 { + if m != nil { + return m.ExpirationTime + } + return 0 +} + +type ValidatorAllowedAddress struct { + // the validator/guardian that controls this entry + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + // the allowlisted account + AllowedAddress string `protobuf:"bytes,2,opt,name=allowed_address,json=allowedAddress,proto3" json:"allowed_address,omitempty"` + // human readable name + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *ValidatorAllowedAddress) Reset() { *m = ValidatorAllowedAddress{} } +func (m *ValidatorAllowedAddress) String() string { return proto.CompactTextString(m) } +func (*ValidatorAllowedAddress) ProtoMessage() {} +func (*ValidatorAllowedAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_95afcf26fc23dcb3, []int{3} +} +func (m *ValidatorAllowedAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ValidatorAllowedAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ValidatorAllowedAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ValidatorAllowedAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_ValidatorAllowedAddress.Merge(m, src) +} +func (m *ValidatorAllowedAddress) XXX_Size() int { + return m.Size() +} +func (m *ValidatorAllowedAddress) XXX_DiscardUnknown() { + xxx_messageInfo_ValidatorAllowedAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_ValidatorAllowedAddress proto.InternalMessageInfo + +func (m *ValidatorAllowedAddress) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *ValidatorAllowedAddress) GetAllowedAddress() string { + if m != nil { + return m.AllowedAddress + } + return "" +} + +func (m *ValidatorAllowedAddress) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func init() { + proto.RegisterType((*GuardianKey)(nil), "wormhole_foundation.wormchain.wormhole.GuardianKey") + proto.RegisterType((*GuardianValidator)(nil), "wormhole_foundation.wormchain.wormhole.GuardianValidator") + proto.RegisterType((*GuardianSet)(nil), "wormhole_foundation.wormchain.wormhole.GuardianSet") + proto.RegisterType((*ValidatorAllowedAddress)(nil), "wormhole_foundation.wormchain.wormhole.ValidatorAllowedAddress") +} + +func init() { proto.RegisterFile("wormhole/guardian.proto", fileDescriptor_95afcf26fc23dcb3) } + +var fileDescriptor_95afcf26fc23dcb3 = []byte{ + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x5c, 0x51, 0x3f, 0x4f, 0xc2, 0x40, + 0x1c, 0xe5, 0xa0, 0x9a, 0xf0, 0xe3, 0x8f, 0x70, 0x21, 0xa1, 0x71, 0x28, 0x4d, 0x63, 0x90, 0xc4, + 0x48, 0x07, 0x27, 0xdd, 0x70, 0x71, 0x70, 0x2b, 0xc6, 0x41, 0x07, 0x72, 0x70, 0x67, 0xb9, 0x50, + 0x7a, 0xa4, 0x2d, 0x42, 0x67, 0xbf, 0x80, 0x1f, 0xc1, 0x8f, 0xe3, 0xc8, 0xe8, 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46, 0xe5, 0x7d, 0x16, 0x86, 0xf8, 0x02, 0x9a, 0x59, 0xa6, 0x11, 0x49, 0x48, 0x75, + 0xbf, 0xec, 0x34, 0x72, 0x61, 0xa5, 0xf8, 0x1c, 0x4e, 0x48, 0x62, 0xcf, 0xa4, 0x45, 0x25, 0xad, + 0x93, 0xfc, 0x56, 0x0c, 0x9a, 0x4f, 0xf6, 0xa9, 0xca, 0x8e, 0xc2, 0xb7, 0xc3, 0xcf, 0xad, 0x81, + 0x36, 0x5b, 0x03, 0x7d, 0x6f, 0x0d, 0xf4, 0xbe, 0x33, 0x0a, 0x9b, 0x9d, 0x51, 0xf8, 0xda, 0x19, + 0x85, 0xa7, 0x6b, 0x97, 0x47, 0xd3, 0xe5, 0xb8, 0x3f, 0x11, 0x73, 0x3b, 0xed, 0xeb, 0xf2, 0xd0, + 0xa6, 0x9d, 0xb5, 0x69, 0xaf, 0xb3, 0xb9, 0x1d, 0xc5, 0x0b, 0x16, 0x8e, 0x8f, 0x55, 0x8d, 0x57, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0xbe, 0x7b, 0x3d, 0x1f, 0x02, 0x00, 0x00, +} + +func (this *GuardianSet) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*GuardianSet) + if !ok { + that2, ok := that.(GuardianSet) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if this.Index != that1.Index { + return false + } + if len(this.Keys) != len(that1.Keys) { + return false + } + for i := range this.Keys { + if !bytes.Equal(this.Keys[i], that1.Keys[i]) { + return false + } + } + if this.ExpirationTime != that1.ExpirationTime { + return false + } + return true +} +func (m *GuardianKey) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GuardianKey) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GuardianKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.Key))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GuardianValidator) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GuardianValidator) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GuardianValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ValidatorAddr) > 0 { + i -= len(m.ValidatorAddr) + copy(dAtA[i:], m.ValidatorAddr) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.ValidatorAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.GuardianKey) > 0 { + i -= len(m.GuardianKey) + copy(dAtA[i:], m.GuardianKey) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.GuardianKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *GuardianSet) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GuardianSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GuardianSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ExpirationTime != 0 { + i = encodeVarintGuardian(dAtA, i, uint64(m.ExpirationTime)) + i-- + dAtA[i] = 0x18 + } + if len(m.Keys) > 0 { + for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Keys[iNdEx]) + copy(dAtA[i:], m.Keys[iNdEx]) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.Keys[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Index != 0 { + i = encodeVarintGuardian(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *ValidatorAllowedAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ValidatorAllowedAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ValidatorAllowedAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.AllowedAddress) > 0 { + i -= len(m.AllowedAddress) + copy(dAtA[i:], m.AllowedAddress) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.AllowedAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintGuardian(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGuardian(dAtA []byte, offset int, v uint64) int { + offset -= sovGuardian(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GuardianKey) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovGuardian(uint64(l)) + } + return n +} + +func (m *GuardianValidator) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.GuardianKey) + if l > 0 { + n += 1 + l + sovGuardian(uint64(l)) + } + l = len(m.ValidatorAddr) + if l > 0 { + n += 1 + l + sovGuardian(uint64(l)) + } + return n +} + +func (m *GuardianSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Index != 0 { + n += 1 + sovGuardian(uint64(m.Index)) + } + if len(m.Keys) > 0 { + for _, b := range m.Keys { + l = len(b) + n += 1 + l + sovGuardian(uint64(l)) + } + } + if m.ExpirationTime != 0 { + n += 1 + sovGuardian(uint64(m.ExpirationTime)) + } + return n +} + +func (m *ValidatorAllowedAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovGuardian(uint64(l)) + } + l = len(m.AllowedAddress) + if l > 0 { + n += 1 + l + sovGuardian(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovGuardian(uint64(l)) + } + return n +} + +func sovGuardian(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGuardian(x uint64) (n int) { + return sovGuardian(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GuardianKey) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GuardianKey: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GuardianKey: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) + if m.Key == nil { + m.Key = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGuardian(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGuardian + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GuardianValidator) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GuardianValidator: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GuardianValidator: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GuardianKey", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GuardianKey = append(m.GuardianKey[:0], dAtA[iNdEx:postIndex]...) + if m.GuardianKey == nil { + m.GuardianKey = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddr = append(m.ValidatorAddr[:0], dAtA[iNdEx:postIndex]...) + if m.ValidatorAddr == nil { + m.ValidatorAddr = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGuardian(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGuardian + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GuardianSet) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GuardianSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GuardianSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint32(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) + copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) + } + m.ExpirationTime = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ExpirationTime |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGuardian(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGuardian + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ValidatorAllowedAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValidatorAllowedAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValidatorAllowedAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGuardian + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGuardian + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGuardian + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGuardian(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGuardian + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGuardian(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGuardian + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGuardian + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGuardian + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGuardian + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGuardian + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGuardian + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGuardian = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGuardian = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGuardian = fmt.Errorf("proto: unexpected end of group") +) diff --git a/wormchain/x/wormhole/types/guardian_key.pb.go b/wormchain/x/wormhole/types/guardian_key.pb.go deleted file mode 100644 index 34bebb61f..000000000 --- a/wormchain/x/wormhole/types/guardian_key.pb.go +++ /dev/null @@ -1,317 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/guardian_key.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type GuardianKey struct { - Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` -} - -func (m *GuardianKey) Reset() { *m = GuardianKey{} } -func (m *GuardianKey) String() string { return proto.CompactTextString(m) } -func (*GuardianKey) ProtoMessage() {} -func (*GuardianKey) Descriptor() ([]byte, []int) { - return fileDescriptor_87576a0b45454f44, []int{0} -} -func (m *GuardianKey) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GuardianKey) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GuardianKey.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GuardianKey) XXX_Merge(src proto.Message) { - xxx_messageInfo_GuardianKey.Merge(m, src) -} -func (m *GuardianKey) XXX_Size() int { - return m.Size() -} -func (m *GuardianKey) XXX_DiscardUnknown() { - xxx_messageInfo_GuardianKey.DiscardUnknown(m) -} - -var xxx_messageInfo_GuardianKey proto.InternalMessageInfo - -func (m *GuardianKey) GetKey() []byte { - if m != nil { - return m.Key - } - return nil -} - -func init() { - proto.RegisterType((*GuardianKey)(nil), "wormhole_foundation.wormchain.wormhole.GuardianKey") -} - -func init() { proto.RegisterFile("wormhole/guardian_key.proto", fileDescriptor_87576a0b45454f44) } - -var fileDescriptor_87576a0b45454f44 = []byte{ - // 168 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0xcf, 0x4e, - 0xad, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x49, 0xc6, 0xa7, 0xe5, 0x97, 0xe6, - 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0xe9, 0x81, 0xc4, 0x92, 0x33, 0x12, 0x33, 0x21, 0x2c, 0x90, - 0xac, 0x92, 0x3c, 0x17, 0xb7, 0x3b, 0x54, 0xb7, 0x77, 0x6a, 0xa5, 0x90, 0x00, 0x17, 0x73, 0x76, - 0x6a, 0xa5, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0x4f, 0x10, 0x88, 0xe9, 0x14, 0x7c, 0xe2, 0x91, 0x1c, - 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, - 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, - 0xf9, 0xb9, 0xfa, 0x30, 0xf3, 0x74, 0x11, 0xb6, 0xe9, 0xc3, 0x6d, 0xd3, 0xaf, 0x80, 0xcb, 0xeb, - 0x97, 0x54, 0x16, 0xa4, 0x16, 0x27, 0xb1, 0x81, 0x1d, 0x69, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, - 0x63, 0x2f, 0xc8, 0x4a, 0xc3, 0x00, 0x00, 0x00, -} - -func (m *GuardianKey) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GuardianKey) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GuardianKey) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Key) > 0 { - i -= len(m.Key) - copy(dAtA[i:], m.Key) - i = encodeVarintGuardianKey(dAtA, i, uint64(len(m.Key))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGuardianKey(dAtA []byte, offset int, v uint64) int { - offset -= sovGuardianKey(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GuardianKey) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Key) - if l > 0 { - n += 1 + l + sovGuardianKey(uint64(l)) - } - return n -} - -func sovGuardianKey(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGuardianKey(x uint64) (n int) { - return sovGuardianKey(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GuardianKey) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianKey - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GuardianKey: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GuardianKey: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianKey - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGuardianKey - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGuardianKey - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Key = append(m.Key[:0], dAtA[iNdEx:postIndex]...) - if m.Key == nil { - m.Key = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGuardianKey(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGuardianKey - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGuardianKey(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianKey - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianKey - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianKey - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGuardianKey - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGuardianKey - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGuardianKey - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGuardianKey = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGuardianKey = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGuardianKey = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wormchain/x/wormhole/types/guardian_set.pb.go b/wormchain/x/wormhole/types/guardian_set.pb.go deleted file mode 100644 index 6f30a06a1..000000000 --- a/wormchain/x/wormhole/types/guardian_set.pb.go +++ /dev/null @@ -1,430 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/guardian_set.proto - -package types - -import ( - bytes "bytes" - fmt "fmt" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type GuardianSet struct { - Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` - Keys [][]byte `protobuf:"bytes,2,rep,name=keys,proto3" json:"keys,omitempty"` - ExpirationTime uint64 `protobuf:"varint,3,opt,name=expirationTime,proto3" json:"expirationTime,omitempty"` -} - -func (m *GuardianSet) Reset() { *m = GuardianSet{} } -func (m *GuardianSet) String() string { return proto.CompactTextString(m) } -func (*GuardianSet) ProtoMessage() {} -func (*GuardianSet) Descriptor() ([]byte, []int) { - return fileDescriptor_3a6a773f49e89397, []int{0} -} -func (m *GuardianSet) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GuardianSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GuardianSet.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GuardianSet) XXX_Merge(src proto.Message) { - xxx_messageInfo_GuardianSet.Merge(m, src) -} -func (m *GuardianSet) XXX_Size() int { - return m.Size() -} -func (m *GuardianSet) XXX_DiscardUnknown() { - xxx_messageInfo_GuardianSet.DiscardUnknown(m) -} - -var xxx_messageInfo_GuardianSet proto.InternalMessageInfo - -func (m *GuardianSet) GetIndex() uint32 { - if m != nil { - return m.Index - } - return 0 -} - -func (m *GuardianSet) GetKeys() [][]byte { - if m != nil { - return m.Keys - } - return nil -} - -func (m *GuardianSet) GetExpirationTime() uint64 { - if m != nil { - return m.ExpirationTime - } - return 0 -} - -func init() { - proto.RegisterType((*GuardianSet)(nil), "wormhole_foundation.wormchain.wormhole.GuardianSet") -} - -func init() { proto.RegisterFile("wormhole/guardian_set.proto", fileDescriptor_3a6a773f49e89397) } - -var fileDescriptor_3a6a773f49e89397 = []byte{ - // 231 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x2e, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0x2f, 0x4e, - 0x2d, 0xd1, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, 0x49, 0xc6, 0xa7, 0xe5, 0x97, 0xe6, - 0xa5, 0x24, 0x96, 0x64, 0xe6, 0xe7, 0xe9, 0x81, 0xc4, 0x92, 0x33, 0x12, 0x33, 0x21, 0x2c, 0x90, - 0xac, 0x94, 0x48, 0x7a, 0x7e, 0x7a, 0x3e, 0x58, 0x8b, 0x3e, 0x88, 0x05, 0xd1, 0xad, 0x94, 0xca, - 0xc5, 0xed, 0x0e, 0x35, 0x33, 0x38, 0xb5, 0x44, 0x48, 0x84, 0x8b, 0x35, 0x33, 0x2f, 0x25, 0xb5, - 0x42, 0x82, 0x51, 0x81, 0x51, 0x83, 0x37, 0x08, 0xc2, 0x11, 0x12, 0xe2, 0x62, 0xc9, 0x4e, 0xad, - 0x2c, 0x96, 0x60, 0x52, 0x60, 0xd6, 0xe0, 0x09, 0x02, 0xb3, 0x85, 0xd4, 0xb8, 0xf8, 0x52, 0x2b, - 0x0a, 0x32, 0x8b, 0xc0, 0xf6, 0x85, 0x64, 0xe6, 0xa6, 0x4a, 0x30, 0x2b, 0x30, 0x6a, 0xb0, 0x04, - 0xa1, 0x89, 0x5a, 0xb1, 0xbc, 0x58, 0x20, 0xcf, 0xe8, 0x14, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85, - 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, - 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x96, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, - 0xfa, 0x30, 0xb7, 0xea, 0x22, 0x7c, 0xa2, 0x0f, 0xf7, 0x89, 0x7e, 0x05, 0x5c, 0x5e, 0xbf, 0xa4, - 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x05, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, - 0xa8, 0x99, 0x25, 0x1f, 0x01, 0x00, 0x00, -} - -func (this *GuardianSet) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*GuardianSet) - if !ok { - that2, ok := that.(GuardianSet) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Index != that1.Index { - return false - } - if len(this.Keys) != len(that1.Keys) { - return false - } - for i := range this.Keys { - if !bytes.Equal(this.Keys[i], that1.Keys[i]) { - return false - } - } - if this.ExpirationTime != that1.ExpirationTime { - return false - } - return true -} -func (m *GuardianSet) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GuardianSet) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GuardianSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ExpirationTime != 0 { - i = encodeVarintGuardianSet(dAtA, i, uint64(m.ExpirationTime)) - i-- - dAtA[i] = 0x18 - } - if len(m.Keys) > 0 { - for iNdEx := len(m.Keys) - 1; iNdEx >= 0; iNdEx-- { - i -= len(m.Keys[iNdEx]) - copy(dAtA[i:], m.Keys[iNdEx]) - i = encodeVarintGuardianSet(dAtA, i, uint64(len(m.Keys[iNdEx]))) - i-- - dAtA[i] = 0x12 - } - } - if m.Index != 0 { - i = encodeVarintGuardianSet(dAtA, i, uint64(m.Index)) - i-- - dAtA[i] = 0x8 - } - return len(dAtA) - i, nil -} - -func encodeVarintGuardianSet(dAtA []byte, offset int, v uint64) int { - offset -= sovGuardianSet(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GuardianSet) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if m.Index != 0 { - n += 1 + sovGuardianSet(uint64(m.Index)) - } - if len(m.Keys) > 0 { - for _, b := range m.Keys { - l = len(b) - n += 1 + l + sovGuardianSet(uint64(l)) - } - } - if m.ExpirationTime != 0 { - n += 1 + sovGuardianSet(uint64(m.ExpirationTime)) - } - return n -} - -func sovGuardianSet(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGuardianSet(x uint64) (n int) { - return sovGuardianSet(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GuardianSet) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GuardianSet: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GuardianSet: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) - } - m.Index = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.Index |= uint32(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Keys", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGuardianSet - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGuardianSet - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Keys = append(m.Keys, make([]byte, postIndex-iNdEx)) - copy(m.Keys[len(m.Keys)-1], dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationTime", wireType) - } - m.ExpirationTime = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ExpirationTime |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - default: - iNdEx = preIndex - skippy, err := skipGuardianSet(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGuardianSet - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGuardianSet(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianSet - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGuardianSet - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGuardianSet - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGuardianSet - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGuardianSet = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGuardianSet = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGuardianSet = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wormchain/x/wormhole/types/guardian_validator.pb.go b/wormchain/x/wormhole/types/guardian_validator.pb.go deleted file mode 100644 index f98c41462..000000000 --- a/wormchain/x/wormhole/types/guardian_validator.pb.go +++ /dev/null @@ -1,372 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: wormhole/guardian_validator.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type GuardianValidator struct { - GuardianKey []byte `protobuf:"bytes,1,opt,name=guardianKey,proto3" json:"guardianKey,omitempty"` - ValidatorAddr []byte `protobuf:"bytes,2,opt,name=validatorAddr,proto3" json:"validatorAddr,omitempty"` -} - -func (m *GuardianValidator) Reset() { *m = GuardianValidator{} } -func (m *GuardianValidator) String() string { return proto.CompactTextString(m) } -func (*GuardianValidator) ProtoMessage() {} -func (*GuardianValidator) Descriptor() ([]byte, []int) { - return fileDescriptor_a7e08ab792af660a, []int{0} -} -func (m *GuardianValidator) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GuardianValidator) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GuardianValidator.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GuardianValidator) XXX_Merge(src proto.Message) { - xxx_messageInfo_GuardianValidator.Merge(m, src) -} -func (m *GuardianValidator) XXX_Size() int { - return m.Size() -} -func (m *GuardianValidator) XXX_DiscardUnknown() { - xxx_messageInfo_GuardianValidator.DiscardUnknown(m) -} - -var xxx_messageInfo_GuardianValidator proto.InternalMessageInfo - -func (m *GuardianValidator) GetGuardianKey() []byte { - if m != nil { - return m.GuardianKey - } - return nil -} - -func (m *GuardianValidator) GetValidatorAddr() []byte { - if m != nil { - return m.ValidatorAddr - } - return nil -} - -func init() { - proto.RegisterType((*GuardianValidator)(nil), "wormhole_foundation.wormchain.wormhole.GuardianValidator") -} - -func init() { proto.RegisterFile("wormhole/guardian_validator.proto", fileDescriptor_a7e08ab792af660a) } - -var fileDescriptor_a7e08ab792af660a = []byte{ - // 193 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x2c, 0xcf, 0x2f, 0xca, - 0xcd, 0xc8, 0xcf, 0x49, 0xd5, 0x4f, 0x2f, 0x4d, 0x2c, 0x4a, 0xc9, 0x4c, 0xcc, 0x8b, 0x2f, 0x4b, - 0xcc, 0xc9, 0x4c, 0x49, 0x2c, 0xc9, 0x2f, 0xd2, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x83, - 0x29, 0x89, 0x4f, 0xcb, 0x2f, 0xcd, 0x4b, 0x49, 0x2c, 0xc9, 0xcc, 0xcf, 0xd3, 0x03, 0x89, 0x25, - 0x67, 0x24, 0x66, 0x42, 0x58, 0x20, 0x59, 0xa5, 0x68, 0x2e, 0x41, 0x77, 0xa8, 0x19, 0x61, 0x30, - 0x23, 0x84, 0x14, 0xb8, 0xb8, 0x61, 0x06, 0x7b, 0xa7, 0x56, 0x4a, 0x30, 0x2a, 0x30, 0x6a, 0xf0, - 0x04, 0x21, 0x0b, 0x09, 0xa9, 0x70, 0xf1, 0xc2, 0x6d, 0x74, 0x4c, 0x49, 0x29, 0x92, 0x60, 0x02, - 0xab, 0x41, 0x15, 0x74, 0x0a, 0x3e, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, - 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, - 0xcb, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x98, 0x5b, 0x74, 0x11, - 0x2e, 0xd5, 0x87, 0xbb, 0x54, 0xbf, 0x02, 0x2e, 0xaf, 0x5f, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, - 0x06, 0xf6, 0xa0, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x50, 0x80, 0xd5, 0x79, 0x05, 0x01, 0x00, - 0x00, -} - -func (m *GuardianValidator) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GuardianValidator) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GuardianValidator) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ValidatorAddr) > 0 { - i -= len(m.ValidatorAddr) - copy(dAtA[i:], m.ValidatorAddr) - i = encodeVarintGuardianValidator(dAtA, i, uint64(len(m.ValidatorAddr))) - i-- - dAtA[i] = 0x12 - } - if len(m.GuardianKey) > 0 { - i -= len(m.GuardianKey) - copy(dAtA[i:], m.GuardianKey) - i = encodeVarintGuardianValidator(dAtA, i, uint64(len(m.GuardianKey))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintGuardianValidator(dAtA []byte, offset int, v uint64) int { - offset -= sovGuardianValidator(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GuardianValidator) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.GuardianKey) - if l > 0 { - n += 1 + l + sovGuardianValidator(uint64(l)) - } - l = len(m.ValidatorAddr) - if l > 0 { - n += 1 + l + sovGuardianValidator(uint64(l)) - } - return n -} - -func sovGuardianValidator(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGuardianValidator(x uint64) (n int) { - return sovGuardianValidator(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GuardianValidator) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GuardianValidator: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GuardianValidator: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field GuardianKey", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGuardianValidator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGuardianValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.GuardianKey = append(m.GuardianKey[:0], dAtA[iNdEx:postIndex]...) - if m.GuardianKey == nil { - m.GuardianKey = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddr", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGuardianValidator - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthGuardianValidator - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthGuardianValidator - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.ValidatorAddr = append(m.ValidatorAddr[:0], dAtA[iNdEx:postIndex]...) - if m.ValidatorAddr == nil { - m.ValidatorAddr = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGuardianValidator(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGuardianValidator - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGuardianValidator(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianValidator - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianValidator - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGuardianValidator - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGuardianValidator - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGuardianValidator - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGuardianValidator - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGuardianValidator = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGuardianValidator = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGuardianValidator = fmt.Errorf("proto: unexpected end of group") -) diff --git a/wormchain/x/wormhole/types/keys.go b/wormchain/x/wormhole/types/keys.go index 888e50bd4..fbd72ef2b 100644 --- a/wormchain/x/wormhole/types/keys.go +++ b/wormchain/x/wormhole/types/keys.go @@ -33,3 +33,7 @@ const ( const ( ConsensusGuardianSetIndexKey = "ConsensusGuardianSetIndex-value-" ) + +const ( + ValidatorAllowlistKey = "VAK" +) diff --git a/wormchain/x/wormhole/types/message_allowlist.go b/wormchain/x/wormhole/types/message_allowlist.go new file mode 100644 index 000000000..53930f1cf --- /dev/null +++ b/wormchain/x/wormhole/types/message_allowlist.go @@ -0,0 +1,73 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.Msg = &MsgCreateAllowlistRequest{} +var _ sdk.Msg = &MsgDeleteAllowlistRequest{} + +func (msg *MsgCreateAllowlistRequest) Route() string { + return RouterKey +} + +func (msg *MsgCreateAllowlistRequest) Type() string { + return "CreateAllowlistRequest" +} + +func (msg *MsgCreateAllowlistRequest) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + +func (msg *MsgCreateAllowlistRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgCreateAllowlistRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signer address (%s)", err) + } + + _, err = sdk.AccAddressFromBech32(msg.Address) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid allowlist address (%s)", err) + } + + return nil +} + +func (msg *MsgDeleteAllowlistRequest) Route() string { + return RouterKey +} + +func (msg *MsgDeleteAllowlistRequest) Type() string { + return "DeleteAllowlistRequest" +} + +func (msg *MsgDeleteAllowlistRequest) GetSigners() []sdk.AccAddress { + signer, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + panic(err) + } + return []sdk.AccAddress{signer} +} + +func (msg *MsgDeleteAllowlistRequest) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgDeleteAllowlistRequest) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid signer address (%s)", err) + } + return nil +} diff --git a/wormchain/x/wormhole/types/query.pb.go b/wormchain/x/wormhole/types/query.pb.go index 986d22db6..2f6ffc490 100644 --- a/wormchain/x/wormhole/types/query.pb.go +++ b/wormchain/x/wormhole/types/query.pb.go @@ -30,6 +30,216 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type QueryAllValidatorAllowlist struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllValidatorAllowlist) Reset() { *m = QueryAllValidatorAllowlist{} } +func (m *QueryAllValidatorAllowlist) String() string { return proto.CompactTextString(m) } +func (*QueryAllValidatorAllowlist) ProtoMessage() {} +func (*QueryAllValidatorAllowlist) Descriptor() ([]byte, []int) { + return fileDescriptor_273185ecc792fa38, []int{0} +} +func (m *QueryAllValidatorAllowlist) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllValidatorAllowlist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllValidatorAllowlist.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllValidatorAllowlist) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllValidatorAllowlist.Merge(m, src) +} +func (m *QueryAllValidatorAllowlist) XXX_Size() int { + return m.Size() +} +func (m *QueryAllValidatorAllowlist) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllValidatorAllowlist.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllValidatorAllowlist proto.InternalMessageInfo + +func (m *QueryAllValidatorAllowlist) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// all allowlisted entries by all validators +type QueryAllValidatorAllowlistResponse struct { + AllowedAddress []*ValidatorAllowedAddress `protobuf:"bytes,1,rep,name=allowed_address,json=allowedAddress,proto3" json:"allowed_address,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllValidatorAllowlistResponse) Reset() { *m = QueryAllValidatorAllowlistResponse{} } +func (m *QueryAllValidatorAllowlistResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllValidatorAllowlistResponse) ProtoMessage() {} +func (*QueryAllValidatorAllowlistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_273185ecc792fa38, []int{1} +} +func (m *QueryAllValidatorAllowlistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllValidatorAllowlistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllValidatorAllowlistResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryAllValidatorAllowlistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllValidatorAllowlistResponse.Merge(m, src) +} +func (m *QueryAllValidatorAllowlistResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllValidatorAllowlistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllValidatorAllowlistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllValidatorAllowlistResponse proto.InternalMessageInfo + +func (m *QueryAllValidatorAllowlistResponse) GetAllowedAddress() []*ValidatorAllowedAddress { + if m != nil { + return m.AllowedAddress + } + return nil +} + +func (m *QueryAllValidatorAllowlistResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryValidatorAllowlist struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryValidatorAllowlist) Reset() { *m = QueryValidatorAllowlist{} } +func (m *QueryValidatorAllowlist) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorAllowlist) ProtoMessage() {} +func (*QueryValidatorAllowlist) Descriptor() ([]byte, []int) { + return fileDescriptor_273185ecc792fa38, []int{2} +} +func (m *QueryValidatorAllowlist) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorAllowlist) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorAllowlist.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryValidatorAllowlist) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorAllowlist.Merge(m, src) +} +func (m *QueryValidatorAllowlist) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorAllowlist) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorAllowlist.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorAllowlist proto.InternalMessageInfo + +func (m *QueryValidatorAllowlist) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *QueryValidatorAllowlist) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// all allowlisted entries by a specific validator +type QueryValidatorAllowlistResponse struct { + ValidatorAddress string `protobuf:"bytes,1,opt,name=validator_address,json=validatorAddress,proto3" json:"validator_address,omitempty"` + AllowedAddress []*ValidatorAllowedAddress `protobuf:"bytes,2,rep,name=allowed_address,json=allowedAddress,proto3" json:"allowed_address,omitempty"` + Pagination *query.PageResponse `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryValidatorAllowlistResponse) Reset() { *m = QueryValidatorAllowlistResponse{} } +func (m *QueryValidatorAllowlistResponse) String() string { return proto.CompactTextString(m) } +func (*QueryValidatorAllowlistResponse) ProtoMessage() {} +func (*QueryValidatorAllowlistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_273185ecc792fa38, []int{3} +} +func (m *QueryValidatorAllowlistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryValidatorAllowlistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryValidatorAllowlistResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryValidatorAllowlistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryValidatorAllowlistResponse.Merge(m, src) +} +func (m *QueryValidatorAllowlistResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryValidatorAllowlistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryValidatorAllowlistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryValidatorAllowlistResponse proto.InternalMessageInfo + +func (m *QueryValidatorAllowlistResponse) GetValidatorAddress() string { + if m != nil { + return m.ValidatorAddress + } + return "" +} + +func (m *QueryValidatorAllowlistResponse) GetAllowedAddress() []*ValidatorAllowedAddress { + if m != nil { + return m.AllowedAddress + } + return nil +} + +func (m *QueryValidatorAllowlistResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + type QueryGetGuardianSetRequest struct { Index uint32 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"` } @@ -38,7 +248,7 @@ func (m *QueryGetGuardianSetRequest) Reset() { *m = QueryGetGuardianSetR func (m *QueryGetGuardianSetRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianSetRequest) ProtoMessage() {} func (*QueryGetGuardianSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{0} + return fileDescriptor_273185ecc792fa38, []int{4} } func (m *QueryGetGuardianSetRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -82,7 +292,7 @@ func (m *QueryGetGuardianSetResponse) Reset() { *m = QueryGetGuardianSet func (m *QueryGetGuardianSetResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianSetResponse) ProtoMessage() {} func (*QueryGetGuardianSetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{1} + return fileDescriptor_273185ecc792fa38, []int{5} } func (m *QueryGetGuardianSetResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -126,7 +336,7 @@ func (m *QueryAllGuardianSetRequest) Reset() { *m = QueryAllGuardianSetR func (m *QueryAllGuardianSetRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianSetRequest) ProtoMessage() {} func (*QueryAllGuardianSetRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{2} + return fileDescriptor_273185ecc792fa38, []int{6} } func (m *QueryAllGuardianSetRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -171,7 +381,7 @@ func (m *QueryAllGuardianSetResponse) Reset() { *m = QueryAllGuardianSet func (m *QueryAllGuardianSetResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianSetResponse) ProtoMessage() {} func (*QueryAllGuardianSetResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{3} + return fileDescriptor_273185ecc792fa38, []int{7} } func (m *QueryAllGuardianSetResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -221,7 +431,7 @@ func (m *QueryGetConfigRequest) Reset() { *m = QueryGetConfigRequest{} } func (m *QueryGetConfigRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetConfigRequest) ProtoMessage() {} func (*QueryGetConfigRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{4} + return fileDescriptor_273185ecc792fa38, []int{8} } func (m *QueryGetConfigRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -258,7 +468,7 @@ func (m *QueryGetConfigResponse) Reset() { *m = QueryGetConfigResponse{} func (m *QueryGetConfigResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetConfigResponse) ProtoMessage() {} func (*QueryGetConfigResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{5} + return fileDescriptor_273185ecc792fa38, []int{9} } func (m *QueryGetConfigResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -302,7 +512,7 @@ func (m *QueryGetReplayProtectionRequest) Reset() { *m = QueryGetReplayP func (m *QueryGetReplayProtectionRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetReplayProtectionRequest) ProtoMessage() {} func (*QueryGetReplayProtectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{6} + return fileDescriptor_273185ecc792fa38, []int{10} } func (m *QueryGetReplayProtectionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -346,7 +556,7 @@ func (m *QueryGetReplayProtectionResponse) Reset() { *m = QueryGetReplay func (m *QueryGetReplayProtectionResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetReplayProtectionResponse) ProtoMessage() {} func (*QueryGetReplayProtectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{7} + return fileDescriptor_273185ecc792fa38, []int{11} } func (m *QueryGetReplayProtectionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -390,7 +600,7 @@ func (m *QueryAllReplayProtectionRequest) Reset() { *m = QueryAllReplayP func (m *QueryAllReplayProtectionRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllReplayProtectionRequest) ProtoMessage() {} func (*QueryAllReplayProtectionRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{8} + return fileDescriptor_273185ecc792fa38, []int{12} } func (m *QueryAllReplayProtectionRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -435,7 +645,7 @@ func (m *QueryAllReplayProtectionResponse) Reset() { *m = QueryAllReplay func (m *QueryAllReplayProtectionResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllReplayProtectionResponse) ProtoMessage() {} func (*QueryAllReplayProtectionResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{9} + return fileDescriptor_273185ecc792fa38, []int{13} } func (m *QueryAllReplayProtectionResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -486,7 +696,7 @@ func (m *QueryGetSequenceCounterRequest) Reset() { *m = QueryGetSequence func (m *QueryGetSequenceCounterRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSequenceCounterRequest) ProtoMessage() {} func (*QueryGetSequenceCounterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{10} + return fileDescriptor_273185ecc792fa38, []int{14} } func (m *QueryGetSequenceCounterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -530,7 +740,7 @@ func (m *QueryGetSequenceCounterResponse) Reset() { *m = QueryGetSequenc func (m *QueryGetSequenceCounterResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSequenceCounterResponse) ProtoMessage() {} func (*QueryGetSequenceCounterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{11} + return fileDescriptor_273185ecc792fa38, []int{15} } func (m *QueryGetSequenceCounterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -574,7 +784,7 @@ func (m *QueryAllSequenceCounterRequest) Reset() { *m = QueryAllSequence func (m *QueryAllSequenceCounterRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllSequenceCounterRequest) ProtoMessage() {} func (*QueryAllSequenceCounterRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{12} + return fileDescriptor_273185ecc792fa38, []int{16} } func (m *QueryAllSequenceCounterRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -619,7 +829,7 @@ func (m *QueryAllSequenceCounterResponse) Reset() { *m = QueryAllSequenc func (m *QueryAllSequenceCounterResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllSequenceCounterResponse) ProtoMessage() {} func (*QueryAllSequenceCounterResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{13} + return fileDescriptor_273185ecc792fa38, []int{17} } func (m *QueryAllSequenceCounterResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -671,7 +881,7 @@ func (m *QueryGetConsensusGuardianSetIndexRequest) Reset() { func (m *QueryGetConsensusGuardianSetIndexRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetConsensusGuardianSetIndexRequest) ProtoMessage() {} func (*QueryGetConsensusGuardianSetIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{14} + return fileDescriptor_273185ecc792fa38, []int{18} } func (m *QueryGetConsensusGuardianSetIndexRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -712,7 +922,7 @@ func (m *QueryGetConsensusGuardianSetIndexResponse) String() string { } func (*QueryGetConsensusGuardianSetIndexResponse) ProtoMessage() {} func (*QueryGetConsensusGuardianSetIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{15} + return fileDescriptor_273185ecc792fa38, []int{19} } func (m *QueryGetConsensusGuardianSetIndexResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -756,7 +966,7 @@ func (m *QueryGetGuardianValidatorRequest) Reset() { *m = QueryGetGuardi func (m *QueryGetGuardianValidatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianValidatorRequest) ProtoMessage() {} func (*QueryGetGuardianValidatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{16} + return fileDescriptor_273185ecc792fa38, []int{20} } func (m *QueryGetGuardianValidatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -800,7 +1010,7 @@ func (m *QueryGetGuardianValidatorResponse) Reset() { *m = QueryGetGuard func (m *QueryGetGuardianValidatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetGuardianValidatorResponse) ProtoMessage() {} func (*QueryGetGuardianValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{17} + return fileDescriptor_273185ecc792fa38, []int{21} } func (m *QueryGetGuardianValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -844,7 +1054,7 @@ func (m *QueryAllGuardianValidatorRequest) Reset() { *m = QueryAllGuardi func (m *QueryAllGuardianValidatorRequest) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianValidatorRequest) ProtoMessage() {} func (*QueryAllGuardianValidatorRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{18} + return fileDescriptor_273185ecc792fa38, []int{22} } func (m *QueryAllGuardianValidatorRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -889,7 +1099,7 @@ func (m *QueryAllGuardianValidatorResponse) Reset() { *m = QueryAllGuard func (m *QueryAllGuardianValidatorResponse) String() string { return proto.CompactTextString(m) } func (*QueryAllGuardianValidatorResponse) ProtoMessage() {} func (*QueryAllGuardianValidatorResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{19} + return fileDescriptor_273185ecc792fa38, []int{23} } func (m *QueryAllGuardianValidatorResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -939,7 +1149,7 @@ func (m *QueryLatestGuardianSetIndexRequest) Reset() { *m = QueryLatestG func (m *QueryLatestGuardianSetIndexRequest) String() string { return proto.CompactTextString(m) } func (*QueryLatestGuardianSetIndexRequest) ProtoMessage() {} func (*QueryLatestGuardianSetIndexRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{20} + return fileDescriptor_273185ecc792fa38, []int{24} } func (m *QueryLatestGuardianSetIndexRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -976,7 +1186,7 @@ func (m *QueryLatestGuardianSetIndexResponse) Reset() { *m = QueryLatest func (m *QueryLatestGuardianSetIndexResponse) String() string { return proto.CompactTextString(m) } func (*QueryLatestGuardianSetIndexResponse) ProtoMessage() {} func (*QueryLatestGuardianSetIndexResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_273185ecc792fa38, []int{21} + return fileDescriptor_273185ecc792fa38, []int{25} } func (m *QueryLatestGuardianSetIndexResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1013,6 +1223,10 @@ func (m *QueryLatestGuardianSetIndexResponse) GetLatestGuardianSetIndex() uint32 } func init() { + proto.RegisterType((*QueryAllValidatorAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllValidatorAllowlist") + proto.RegisterType((*QueryAllValidatorAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllValidatorAllowlistResponse") + proto.RegisterType((*QueryValidatorAllowlist)(nil), "wormhole_foundation.wormchain.wormhole.QueryValidatorAllowlist") + proto.RegisterType((*QueryValidatorAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryValidatorAllowlistResponse") proto.RegisterType((*QueryGetGuardianSetRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetGuardianSetRequest") proto.RegisterType((*QueryGetGuardianSetResponse)(nil), "wormhole_foundation.wormchain.wormhole.QueryGetGuardianSetResponse") proto.RegisterType((*QueryAllGuardianSetRequest)(nil), "wormhole_foundation.wormchain.wormhole.QueryAllGuardianSetRequest") @@ -1040,77 +1254,88 @@ func init() { func init() { proto.RegisterFile("wormhole/query.proto", fileDescriptor_273185ecc792fa38) } var fileDescriptor_273185ecc792fa38 = []byte{ - // 1117 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x98, 0xcf, 0x6f, 0x1b, 0x45, - 0x14, 0xc7, 0x33, 0x09, 0xad, 0xc4, 0x04, 0x68, 0x3b, 0xb8, 0x01, 0xb6, 0xc8, 0x49, 0x07, 0x54, - 0x4a, 0x11, 0xbb, 0x34, 0x11, 0x49, 0xd3, 0x52, 0x5a, 0xdb, 0x55, 0xec, 0xb4, 0x39, 0xa4, 0x8e, - 0xc4, 0x01, 0x84, 0xac, 0x8d, 0x3d, 0xd9, 0x6c, 0xb5, 0xd9, 0x71, 0xbd, 0xeb, 0xd2, 0x50, 0xf5, - 0x82, 0xc4, 0x85, 0x43, 0x85, 0xe0, 0x4f, 0x41, 0x9c, 0x39, 0x70, 0xe9, 0xb1, 0x52, 0x25, 0x40, - 0xaa, 0x84, 0x50, 0x82, 0x38, 0xc0, 0x81, 0x3b, 0xe2, 0x80, 0x76, 0xe6, 0xed, 0x7a, 0xbd, 0xde, - 0x5d, 0x76, 0xed, 0xcd, 0xcd, 0x99,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0x01, 0xb9, 0x3c, 0x3e, 0x3f, 0xf9, 0x17, 0xe1, 0xb9, 0x78, 0x4f, - 0x46, 0x6e, 0xe6, 0x8a, 0x34, 0xd5, 0xfe, 0x29, 0xb7, 0x0a, 0xd1, 0x02, 0xee, 0x75, 0xc1, 0x5d, - 0x23, 0x95, 0xac, 0xdc, 0xd2, 0x34, 0xc6, 0x74, 0x7b, 0x75, 0xeb, 0xf1, 0x41, 0x19, 0x3d, 0x39, - 0x28, 0xa3, 0xdf, 0x0e, 0xca, 0xe8, 0xeb, 0xc3, 0xf2, 0xd4, 0x93, 0xc3, 0xf2, 0xd4, 0x2f, 0x87, - 0xe5, 0xa9, 0x8f, 0x57, 0x0d, 0xd3, 0xdd, 0xed, 0x6f, 0xab, 0x6d, 0xbe, 0x17, 0x08, 0xbd, 0x1b, - 0x7b, 0xcc, 0xfd, 0xc1, 0x41, 0xee, 0x7e, 0x97, 0x39, 0xdb, 0xc7, 0xc5, 0x0f, 0x92, 0x4b, 0xff, - 0x05, 0x00, 0x00, 0xff, 0xff, 0x38, 0x4b, 0x01, 0x4c, 0xf7, 0x15, 0x00, 0x00, + // 1285 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x99, 0x4f, 0x6f, 0xdc, 0xc4, + 0x1b, 0xc7, 0x33, 0xd9, 0x5f, 0x2b, 0x65, 0xd2, 0x5f, 0x93, 0x0c, 0x69, 0x52, 0x0c, 0xda, 0x2c, + 0x06, 0x95, 0xd0, 0x0a, 0x9b, 0x24, 0x22, 0x69, 0x5a, 0x4a, 0xba, 0xd9, 0xb2, 0xbb, 0x49, 0x83, + 0x94, 0x6e, 0x24, 0x0e, 0x20, 0xb4, 0x72, 0x76, 0x27, 0x5e, 0x57, 0x8e, 0xbd, 0x5d, 0x7b, 0xdb, + 0x86, 0x28, 0x07, 0x90, 0xb8, 0x70, 0x88, 0x10, 0xbc, 0x14, 0x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6, 0x06, 0xbf, + 0xb8, 0x72, 0x9b, 0xc3, 0x6b, 0xb8, 0xac, 0xab, 0x8c, 0x75, 0x89, 0x2c, 0xc4, 0x65, 0x95, 0xdc, + 0x2f, 0xd1, 0xcf, 0x10, 0x1e, 0xeb, 0x7d, 0x97, 0x5e, 0x4b, 0x14, 0x54, 0x00, 0x55, 0x65, 0x48, + 0x01, 0x17, 0xe9, 0x7d, 0x86, 0x54, 0x21, 0xef, 0x25, 0x46, 0x12, 0x0f, 0x07, 0xbe, 0x60, 0x1f, + 0xad, 0xef, 0x3c, 0x3a, 0xc9, 0xa3, 0xc7, 0x27, 0x79, 0xf4, 0xcb, 0x49, 0x1e, 0x7d, 0x79, 0x9a, + 0x1f, 0x79, 0x7c, 0x9a, 0x1f, 0xf9, 0xf1, 0x34, 0x3f, 0xf2, 0xe1, 0xaa, 0xac, 0x98, 0xad, 0xee, + 0xae, 0xd0, 0xd0, 0xf7, 0x5d, 0xb1, 0x37, 0x03, 0xa7, 0x7a, 0xd8, 0x9b, 0xcc, 0x3c, 0x68, 0x53, + 0x63, 0xf7, 0x2c, 0xfb, 0x47, 0xc9, 0xd2, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x6a, 0x1e, 0x0a, + 0x3b, 0x68, 0x1a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1147,6 +1372,8 @@ type QueryClient interface { GuardianValidatorAll(ctx context.Context, in *QueryAllGuardianValidatorRequest, opts ...grpc.CallOption) (*QueryAllGuardianValidatorResponse, error) // Queries a list of LatestGuardianSetIndex items. LatestGuardianSetIndex(ctx context.Context, in *QueryLatestGuardianSetIndexRequest, opts ...grpc.CallOption) (*QueryLatestGuardianSetIndexResponse, error) + AllowlistAll(ctx context.Context, in *QueryAllValidatorAllowlist, opts ...grpc.CallOption) (*QueryAllValidatorAllowlistResponse, error) + Allowlist(ctx context.Context, in *QueryValidatorAllowlist, opts ...grpc.CallOption) (*QueryValidatorAllowlistResponse, error) } type queryClient struct { @@ -1256,6 +1483,24 @@ func (c *queryClient) LatestGuardianSetIndex(ctx context.Context, in *QueryLates return out, nil } +func (c *queryClient) AllowlistAll(ctx context.Context, in *QueryAllValidatorAllowlist, opts ...grpc.CallOption) (*QueryAllValidatorAllowlistResponse, error) { + out := new(QueryAllValidatorAllowlistResponse) + err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/AllowlistAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Allowlist(ctx context.Context, in *QueryValidatorAllowlist, opts ...grpc.CallOption) (*QueryValidatorAllowlistResponse, error) { + out := new(QueryValidatorAllowlistResponse) + err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Query/Allowlist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Queries a guardianSet by index. @@ -1280,6 +1525,8 @@ type QueryServer interface { GuardianValidatorAll(context.Context, *QueryAllGuardianValidatorRequest) (*QueryAllGuardianValidatorResponse, error) // Queries a list of LatestGuardianSetIndex items. LatestGuardianSetIndex(context.Context, *QueryLatestGuardianSetIndexRequest) (*QueryLatestGuardianSetIndexResponse, error) + AllowlistAll(context.Context, *QueryAllValidatorAllowlist) (*QueryAllValidatorAllowlistResponse, error) + Allowlist(context.Context, *QueryValidatorAllowlist) (*QueryValidatorAllowlistResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1319,6 +1566,12 @@ func (*UnimplementedQueryServer) GuardianValidatorAll(ctx context.Context, req * func (*UnimplementedQueryServer) LatestGuardianSetIndex(ctx context.Context, req *QueryLatestGuardianSetIndexRequest) (*QueryLatestGuardianSetIndexResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method LatestGuardianSetIndex not implemented") } +func (*UnimplementedQueryServer) AllowlistAll(ctx context.Context, req *QueryAllValidatorAllowlist) (*QueryAllValidatorAllowlistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowlistAll not implemented") +} +func (*UnimplementedQueryServer) Allowlist(ctx context.Context, req *QueryValidatorAllowlist) (*QueryValidatorAllowlistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Allowlist not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1522,6 +1775,42 @@ func _Query_LatestGuardianSetIndex_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Query_AllowlistAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllValidatorAllowlist) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllowlistAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/AllowlistAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllowlistAll(ctx, req.(*QueryAllValidatorAllowlist)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Allowlist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryValidatorAllowlist) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Allowlist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wormhole_foundation.wormchain.wormhole.Query/Allowlist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Allowlist(ctx, req.(*QueryValidatorAllowlist)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "wormhole_foundation.wormchain.wormhole.Query", HandlerType: (*QueryServer)(nil), @@ -1570,11 +1859,201 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "LatestGuardianSetIndex", Handler: _Query_LatestGuardianSetIndex_Handler, }, + { + MethodName: "AllowlistAll", + Handler: _Query_AllowlistAll_Handler, + }, + { + MethodName: "Allowlist", + Handler: _Query_Allowlist_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "wormhole/query.proto", } +func (m *QueryAllValidatorAllowlist) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllValidatorAllowlist) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllValidatorAllowlist) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllValidatorAllowlistResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryAllValidatorAllowlistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllValidatorAllowlistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.AllowedAddress) > 0 { + for iNdEx := len(m.AllowedAddress) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedAddress[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorAllowlist) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryValidatorAllowlist) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorAllowlist) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryValidatorAllowlistResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryValidatorAllowlistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryValidatorAllowlistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if len(m.AllowedAddress) > 0 { + for iNdEx := len(m.AllowedAddress) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AllowedAddress[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.ValidatorAddress) > 0 { + i -= len(m.ValidatorAddress) + copy(dAtA[i:], m.ValidatorAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ValidatorAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *QueryGetGuardianSetRequest) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -2335,6 +2814,78 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *QueryAllValidatorAllowlist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllValidatorAllowlistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.AllowedAddress) > 0 { + for _, e := range m.AllowedAddress { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorAllowlist) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryValidatorAllowlistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ValidatorAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.AllowedAddress) > 0 { + for _, e := range m.AllowedAddress { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryGetGuardianSetRequest) Size() (n int) { if m == nil { return 0 @@ -2625,6 +3176,482 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *QueryAllValidatorAllowlist) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllValidatorAllowlist: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllValidatorAllowlist: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllValidatorAllowlistResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryAllValidatorAllowlistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllValidatorAllowlistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedAddress = append(m.AllowedAddress, &ValidatorAllowedAddress{}) + if err := m.AllowedAddress[len(m.AllowedAddress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorAllowlist) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorAllowlist: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorAllowlist: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryValidatorAllowlistResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryValidatorAllowlistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryValidatorAllowlistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ValidatorAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ValidatorAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AllowedAddress", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AllowedAddress = append(m.AllowedAddress, &ValidatorAllowedAddress{}) + if err := m.AllowedAddress[len(m.AllowedAddress)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryGetGuardianSetRequest) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/wormchain/x/wormhole/types/query.pb.gw.go b/wormchain/x/wormhole/types/query.pb.gw.go index 347a76a3b..6e95ffca7 100644 --- a/wormchain/x/wormhole/types/query.pb.gw.go +++ b/wormchain/x/wormhole/types/query.pb.gw.go @@ -447,6 +447,114 @@ func local_request_Query_LatestGuardianSetIndex_0(ctx context.Context, marshaler } +var ( + filter_Query_AllowlistAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllowlistAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllValidatorAllowlist + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowlistAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllowlistAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllowlistAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllValidatorAllowlist + var metadata runtime.ServerMetadata + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_AllowlistAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllowlistAll(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_Allowlist_0 = &utilities.DoubleArray{Encoding: map[string]int{"validator_address": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_Allowlist_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorAllowlist + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allowlist_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.Allowlist(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Allowlist_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryValidatorAllowlist + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["validator_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "validator_address") + } + + protoReq.ValidatorAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "validator_address", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Allowlist_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.Allowlist(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -706,6 +814,52 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_AllowlistAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AllowlistAll_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllowlistAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Allowlist_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Allowlist_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Allowlist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -967,6 +1121,46 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_AllowlistAll_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_AllowlistAll_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllowlistAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Allowlist_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Allowlist_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Allowlist_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -992,6 +1186,10 @@ var ( pattern_Query_GuardianValidatorAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"wormhole_foundation", "wormchain", "wormhole", "guardian_validator"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_LatestGuardianSetIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"wormhole_foundation", "wormchain", "wormhole", "latest_guardian_set_index"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_AllowlistAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"wormhole_foundation", "wormchain", "wormhole", "allowlist"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_Allowlist_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"wormhole_foundation", "wormchain", "wormhole", "allowlist", "validator_address"}, "", runtime.AssumeColonVerbOpt(true))) ) var ( @@ -1016,4 +1214,8 @@ var ( forward_Query_GuardianValidatorAll_0 = runtime.ForwardResponseMessage forward_Query_LatestGuardianSetIndex_0 = runtime.ForwardResponseMessage + + forward_Query_AllowlistAll_0 = runtime.ForwardResponseMessage + + forward_Query_Allowlist_0 = runtime.ForwardResponseMessage ) diff --git a/wormchain/x/wormhole/types/tx.pb.go b/wormchain/x/wormhole/types/tx.pb.go index cdf5be068..997c14a2f 100644 --- a/wormchain/x/wormhole/types/tx.pb.go +++ b/wormchain/x/wormhole/types/tx.pb.go @@ -28,6 +28,159 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type MsgCreateAllowlistRequest struct { + // signer should be a guardian validator in a current set or future set. + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // the address to allowlist + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` + // optional human readable name for the entry + Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *MsgCreateAllowlistRequest) Reset() { *m = MsgCreateAllowlistRequest{} } +func (m *MsgCreateAllowlistRequest) String() string { return proto.CompactTextString(m) } +func (*MsgCreateAllowlistRequest) ProtoMessage() {} +func (*MsgCreateAllowlistRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55f7aa067b0c517b, []int{0} +} +func (m *MsgCreateAllowlistRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateAllowlistRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateAllowlistRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateAllowlistRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateAllowlistRequest.Merge(m, src) +} +func (m *MsgCreateAllowlistRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateAllowlistRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateAllowlistRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateAllowlistRequest proto.InternalMessageInfo + +func (m *MsgCreateAllowlistRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgCreateAllowlistRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *MsgCreateAllowlistRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +type MsgDeleteAllowlistRequest struct { + // signer should be a guardian validator in a current set or future set. + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + // the address allowlist to remove + Address string `protobuf:"bytes,2,opt,name=address,proto3" json:"address,omitempty"` +} + +func (m *MsgDeleteAllowlistRequest) Reset() { *m = MsgDeleteAllowlistRequest{} } +func (m *MsgDeleteAllowlistRequest) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteAllowlistRequest) ProtoMessage() {} +func (*MsgDeleteAllowlistRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_55f7aa067b0c517b, []int{1} +} +func (m *MsgDeleteAllowlistRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteAllowlistRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteAllowlistRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgDeleteAllowlistRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteAllowlistRequest.Merge(m, src) +} +func (m *MsgDeleteAllowlistRequest) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteAllowlistRequest) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteAllowlistRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteAllowlistRequest proto.InternalMessageInfo + +func (m *MsgDeleteAllowlistRequest) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgDeleteAllowlistRequest) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +type MsgAllowlistResponse struct { +} + +func (m *MsgAllowlistResponse) Reset() { *m = MsgAllowlistResponse{} } +func (m *MsgAllowlistResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAllowlistResponse) ProtoMessage() {} +func (*MsgAllowlistResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_55f7aa067b0c517b, []int{2} +} +func (m *MsgAllowlistResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowlistResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowlistResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgAllowlistResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowlistResponse.Merge(m, src) +} +func (m *MsgAllowlistResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowlistResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowlistResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowlistResponse proto.InternalMessageInfo + type MsgExecuteGovernanceVAA struct { Vaa []byte `protobuf:"bytes,1,opt,name=vaa,proto3" json:"vaa,omitempty"` Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` @@ -37,7 +190,7 @@ func (m *MsgExecuteGovernanceVAA) Reset() { *m = MsgExecuteGovernanceVAA func (m *MsgExecuteGovernanceVAA) String() string { return proto.CompactTextString(m) } func (*MsgExecuteGovernanceVAA) ProtoMessage() {} func (*MsgExecuteGovernanceVAA) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{0} + return fileDescriptor_55f7aa067b0c517b, []int{3} } func (m *MsgExecuteGovernanceVAA) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -87,7 +240,7 @@ func (m *MsgExecuteGovernanceVAAResponse) Reset() { *m = MsgExecuteGover func (m *MsgExecuteGovernanceVAAResponse) String() string { return proto.CompactTextString(m) } func (*MsgExecuteGovernanceVAAResponse) ProtoMessage() {} func (*MsgExecuteGovernanceVAAResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{1} + return fileDescriptor_55f7aa067b0c517b, []int{4} } func (m *MsgExecuteGovernanceVAAResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -125,7 +278,7 @@ func (m *MsgRegisterAccountAsGuardian) Reset() { *m = MsgRegisterAccount func (m *MsgRegisterAccountAsGuardian) String() string { return proto.CompactTextString(m) } func (*MsgRegisterAccountAsGuardian) ProtoMessage() {} func (*MsgRegisterAccountAsGuardian) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{2} + return fileDescriptor_55f7aa067b0c517b, []int{5} } func (m *MsgRegisterAccountAsGuardian) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -175,7 +328,7 @@ func (m *MsgRegisterAccountAsGuardianResponse) Reset() { *m = MsgRegiste func (m *MsgRegisterAccountAsGuardianResponse) String() string { return proto.CompactTextString(m) } func (*MsgRegisterAccountAsGuardianResponse) ProtoMessage() {} func (*MsgRegisterAccountAsGuardianResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{3} + return fileDescriptor_55f7aa067b0c517b, []int{6} } func (m *MsgRegisterAccountAsGuardianResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -218,7 +371,7 @@ func (m *MsgStoreCode) Reset() { *m = MsgStoreCode{} } func (m *MsgStoreCode) String() string { return proto.CompactTextString(m) } func (*MsgStoreCode) ProtoMessage() {} func (*MsgStoreCode) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{4} + return fileDescriptor_55f7aa067b0c517b, []int{7} } func (m *MsgStoreCode) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -277,7 +430,7 @@ func (m *MsgStoreCodeResponse) Reset() { *m = MsgStoreCodeResponse{} } func (m *MsgStoreCodeResponse) String() string { return proto.CompactTextString(m) } func (*MsgStoreCodeResponse) ProtoMessage() {} func (*MsgStoreCodeResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{5} + return fileDescriptor_55f7aa067b0c517b, []int{8} } func (m *MsgStoreCodeResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -331,7 +484,7 @@ func (m *MsgInstantiateContract) Reset() { *m = MsgInstantiateContract{} func (m *MsgInstantiateContract) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContract) ProtoMessage() {} func (*MsgInstantiateContract) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{6} + return fileDescriptor_55f7aa067b0c517b, []int{9} } func (m *MsgInstantiateContract) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -406,7 +559,7 @@ func (m *MsgInstantiateContractResponse) Reset() { *m = MsgInstantiateCo func (m *MsgInstantiateContractResponse) String() string { return proto.CompactTextString(m) } func (*MsgInstantiateContractResponse) ProtoMessage() {} func (*MsgInstantiateContractResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_55f7aa067b0c517b, []int{7} + return fileDescriptor_55f7aa067b0c517b, []int{10} } func (m *MsgInstantiateContractResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,6 +603,9 @@ func (m *MsgInstantiateContractResponse) GetData() []byte { } func init() { + proto.RegisterType((*MsgCreateAllowlistRequest)(nil), "wormhole_foundation.wormchain.wormhole.MsgCreateAllowlistRequest") + proto.RegisterType((*MsgDeleteAllowlistRequest)(nil), "wormhole_foundation.wormchain.wormhole.MsgDeleteAllowlistRequest") + proto.RegisterType((*MsgAllowlistResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgAllowlistResponse") proto.RegisterType((*MsgExecuteGovernanceVAA)(nil), "wormhole_foundation.wormchain.wormhole.MsgExecuteGovernanceVAA") proto.RegisterType((*MsgExecuteGovernanceVAAResponse)(nil), "wormhole_foundation.wormchain.wormhole.MsgExecuteGovernanceVAAResponse") proto.RegisterType((*MsgRegisterAccountAsGuardian)(nil), "wormhole_foundation.wormchain.wormhole.MsgRegisterAccountAsGuardian") @@ -463,42 +619,47 @@ func init() { func init() { proto.RegisterFile("wormhole/tx.proto", fileDescriptor_55f7aa067b0c517b) } var fileDescriptor_55f7aa067b0c517b = []byte{ - // 550 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x94, 0xc1, 0x8a, 0xd3, 0x40, - 0x18, 0xc7, 0x3b, 0xb6, 0xdb, 0xa5, 0x1f, 0x45, 0xd6, 0x58, 0xd6, 0x58, 0x96, 0x74, 0x8d, 0xb2, - 0xec, 0xc5, 0x06, 0x54, 0x04, 0x51, 0x94, 0x76, 0x57, 0x4b, 0xc1, 0x78, 0x48, 0x45, 0xc1, 0x4b, - 0x99, 0x26, 0xe3, 0x34, 0xd0, 0xce, 0x94, 0x99, 0xc9, 0x6e, 0x7b, 0xf2, 0x11, 0xf4, 0x05, 0x04, - 0xdf, 0xc0, 0xd7, 0xf0, 0xb8, 0x47, 0x4f, 0x8b, 0xb4, 0x8f, 0xe1, 0x45, 0x26, 0xdd, 0x24, 0x3d, - 0x34, 0x62, 0xdd, 0xbd, 0x7d, 0xdf, 0x24, 0xff, 0xdf, 0xff, 0xff, 0x0d, 0x1f, 0x03, 0x37, 0x4e, - 0xb9, 0x18, 0x0f, 0xf9, 0x88, 0x38, 0x6a, 0xda, 0x9c, 0x08, 0xae, 0xb8, 0x71, 0x90, 0x1c, 0xf5, - 0x3f, 0xf2, 0x88, 0x05, 0x58, 0x85, 0x9c, 0x35, 0xf5, 0x99, 0x3f, 0xc4, 0xe1, 0xb2, 0xd2, 0x5f, - 0xeb, 0x35, 0xca, 0x29, 0x8f, 0x25, 0x8e, 0xae, 0x96, 0x6a, 0xfb, 0x08, 0x6e, 0xb9, 0x92, 0xbe, - 0x9c, 0x12, 0x3f, 0x52, 0xa4, 0xc3, 0x4f, 0x88, 0x60, 0x98, 0xf9, 0xe4, 0x5d, 0xab, 0x65, 0xec, - 0x40, 0xf1, 0x04, 0x63, 0x13, 0xed, 0xa3, 0xc3, 0xaa, 0xa7, 0x4b, 0x63, 0x17, 0xca, 0x32, 0xa4, - 0x8c, 0x08, 0xf3, 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xa3, 0xe1, 0xa3, 0x05, 0x00, 0x00, + // 635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x41, 0x6b, 0xd4, 0x4e, + 0x14, 0x6f, 0xba, 0xed, 0x96, 0x3e, 0xc2, 0xff, 0x5f, 0xe3, 0x52, 0xd3, 0xa5, 0xa4, 0x1a, 0xa5, + 0x78, 0x71, 0x03, 0x2a, 0x82, 0x28, 0x4a, 0xb6, 0xd5, 0x52, 0x30, 0x1e, 0x52, 0x51, 0xf0, 0xb2, + 0xcc, 0x26, 0xe3, 0x34, 0x90, 0xcc, 0xac, 0x99, 0x49, 0xbb, 0x7b, 0xf2, 0x23, 0x28, 0xde, 0x05, + 0x2f, 0x9e, 0xfd, 0x1a, 0x1e, 0x7b, 0xf4, 0x54, 0x64, 0xf7, 0x8b, 0x48, 0x26, 0x26, 0xbb, 0x74, + 0x13, 0x31, 0x6c, 0x6f, 0xef, 0xbd, 0xc9, 0xfb, 0xfd, 0x7e, 0xef, 0xe5, 0xcd, 0x1b, 0xb8, 0x72, + 0xca, 0xe2, 0xe8, 0x98, 0x85, 0xd8, 0x12, 0xc3, 0xce, 0x20, 0x66, 0x82, 0x69, 0xbb, 0x79, 0xa8, + 0xf7, 0x8e, 0x25, 0xd4, 0x47, 0x22, 0x60, 0xb4, 0x93, 0xc6, 0xbc, 0x63, 0x14, 0x64, 0x56, 0x7a, + 0xda, 0x6e, 0x11, 0x46, 0x98, 0x4c, 0xb1, 0x52, 0x2b, 0xcb, 0x36, 0x11, 0x6c, 0x39, 0x9c, 0xec, + 0xc5, 0x18, 0x09, 0x6c, 0x87, 0x21, 0x3b, 0x0d, 0x03, 0x2e, 0x5c, 0xfc, 0x3e, 0xc1, 0x5c, 0x68, + 0x9b, 0xd0, 0xe4, 0x01, 0xa1, 0x38, 0xd6, 0x95, 0xeb, 0xca, 0xed, 0x75, 0xf7, 0x8f, 0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xee, 0xd7, 0x80, 0x2a, 0xb2, + 0x6a, 0x09, 0x98, 0x5f, 0x07, 0x5f, 0x14, 0xb8, 0x5a, 0x76, 0xcd, 0x9f, 0xd4, 0x40, 0x2d, 0xc9, + 0x6f, 0x3f, 0x5f, 0x2c, 0x3f, 0xd7, 0xd7, 0x3d, 0xfa, 0x31, 0x36, 0x94, 0xb3, 0xb1, 0xa1, 0xfc, + 0x1a, 0x1b, 0xca, 0xa7, 0x89, 0xb1, 0x74, 0x36, 0x31, 0x96, 0x7e, 0x4e, 0x8c, 0xa5, 0xb7, 0x0f, + 0x49, 0x20, 0x8e, 0x93, 0x7e, 0xc7, 0x63, 0x91, 0x95, 0xa3, 0xdd, 0x99, 0x72, 0x59, 0x05, 0x97, + 0x35, 0xb4, 0xa6, 0xcf, 0xef, 0x68, 0x80, 0x79, 0xbf, 0x29, 0x1f, 0xd1, 0x7b, 0xbf, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x6a, 0x6d, 0xca, 0x8f, 0x97, 0x07, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -515,6 +676,8 @@ const _ = grpc.SupportPackageIsVersion4 type MsgClient interface { ExecuteGovernanceVAA(ctx context.Context, in *MsgExecuteGovernanceVAA, opts ...grpc.CallOption) (*MsgExecuteGovernanceVAAResponse, error) RegisterAccountAsGuardian(ctx context.Context, in *MsgRegisterAccountAsGuardian, opts ...grpc.CallOption) (*MsgRegisterAccountAsGuardianResponse, error) + CreateAllowlist(ctx context.Context, in *MsgCreateAllowlistRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) + DeleteAllowlist(ctx context.Context, in *MsgDeleteAllowlistRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) // StoreCode to submit Wasm code to the system StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) // Instantiate creates a new smart contract instance for the given code id. @@ -547,6 +710,24 @@ func (c *msgClient) RegisterAccountAsGuardian(ctx context.Context, in *MsgRegist return out, nil } +func (c *msgClient) CreateAllowlist(ctx context.Context, in *MsgCreateAllowlistRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) { + out := new(MsgAllowlistResponse) + err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/CreateAllowlist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DeleteAllowlist(ctx context.Context, in *MsgDeleteAllowlistRequest, opts ...grpc.CallOption) (*MsgAllowlistResponse, error) { + out := new(MsgAllowlistResponse) + err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/DeleteAllowlist", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + func (c *msgClient) StoreCode(ctx context.Context, in *MsgStoreCode, opts ...grpc.CallOption) (*MsgStoreCodeResponse, error) { out := new(MsgStoreCodeResponse) err := c.cc.Invoke(ctx, "/wormhole_foundation.wormchain.wormhole.Msg/StoreCode", in, out, opts...) @@ -569,6 +750,8 @@ func (c *msgClient) InstantiateContract(ctx context.Context, in *MsgInstantiateC type MsgServer interface { ExecuteGovernanceVAA(context.Context, *MsgExecuteGovernanceVAA) (*MsgExecuteGovernanceVAAResponse, error) RegisterAccountAsGuardian(context.Context, *MsgRegisterAccountAsGuardian) (*MsgRegisterAccountAsGuardianResponse, error) + CreateAllowlist(context.Context, *MsgCreateAllowlistRequest) (*MsgAllowlistResponse, error) + DeleteAllowlist(context.Context, *MsgDeleteAllowlistRequest) (*MsgAllowlistResponse, error) // StoreCode to submit Wasm code to the system StoreCode(context.Context, *MsgStoreCode) (*MsgStoreCodeResponse, error) // Instantiate creates a new smart contract instance for the given code id. @@ -585,6 +768,12 @@ func (*UnimplementedMsgServer) ExecuteGovernanceVAA(ctx context.Context, req *Ms func (*UnimplementedMsgServer) RegisterAccountAsGuardian(ctx context.Context, req *MsgRegisterAccountAsGuardian) (*MsgRegisterAccountAsGuardianResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RegisterAccountAsGuardian not implemented") } +func (*UnimplementedMsgServer) CreateAllowlist(ctx context.Context, req *MsgCreateAllowlistRequest) (*MsgAllowlistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateAllowlist not implemented") +} +func (*UnimplementedMsgServer) DeleteAllowlist(ctx context.Context, req *MsgDeleteAllowlistRequest) (*MsgAllowlistResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteAllowlist not implemented") +} func (*UnimplementedMsgServer) StoreCode(ctx context.Context, req *MsgStoreCode) (*MsgStoreCodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method StoreCode not implemented") } @@ -632,6 +821,42 @@ func _Msg_RegisterAccountAsGuardian_Handler(srv interface{}, ctx context.Context return interceptor(ctx, in, info, handler) } +func _Msg_CreateAllowlist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateAllowlistRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateAllowlist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/CreateAllowlist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateAllowlist(ctx, req.(*MsgCreateAllowlistRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DeleteAllowlist_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeleteAllowlistRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DeleteAllowlist(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/wormhole_foundation.wormchain.wormhole.Msg/DeleteAllowlist", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeleteAllowlist(ctx, req.(*MsgDeleteAllowlistRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Msg_StoreCode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(MsgStoreCode) if err := dec(in); err != nil { @@ -680,6 +905,14 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RegisterAccountAsGuardian", Handler: _Msg_RegisterAccountAsGuardian_Handler, }, + { + MethodName: "CreateAllowlist", + Handler: _Msg_CreateAllowlist_Handler, + }, + { + MethodName: "DeleteAllowlist", + Handler: _Msg_DeleteAllowlist_Handler, + }, { MethodName: "StoreCode", Handler: _Msg_StoreCode_Handler, @@ -693,6 +926,110 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ Metadata: "wormhole/tx.proto", } +func (m *MsgCreateAllowlistRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateAllowlistRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateAllowlistRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0x1a + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteAllowlistRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgDeleteAllowlistRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteAllowlistRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintTx(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0x12 + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAllowlistResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgAllowlistResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowlistResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgExecuteGovernanceVAA) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -989,6 +1326,53 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgCreateAllowlistRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDeleteAllowlistRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Address) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAllowlistResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgExecuteGovernanceVAA) Size() (n int) { if m == nil { return 0 @@ -1125,6 +1509,316 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } +func (m *MsgCreateAllowlistRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateAllowlistRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateAllowlistRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteAllowlistRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDeleteAllowlistRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteAllowlistRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAllowlistResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAllowlistResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowlistResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgExecuteGovernanceVAA) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0