wormchain: require addresses to be allowlisted to submit tx

This commit is contained in:
Conor Patrick 2023-01-27 16:51:09 +00:00
parent 7f9a03254a
commit 034358b55f
35 changed files with 4211 additions and 1354 deletions

View File

@ -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

View File

@ -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() }

View File

@ -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
}

View File

@ -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";

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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)

View File

@ -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)
}

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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
}

View File

@ -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

View File

@ -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)

View File

@ -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
}

View File

@ -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
}

View File

@ -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])

View File

@ -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
}

View File

@ -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)
}

View File

@ -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{},

View File

@ -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, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x8b, 0xda, 0x40,
0x14, 0xc7, 0x93, 0xfa, 0xe3, 0x30, 0x16, 0x0a, 0xa9, 0x16, 0x6b, 0x21, 0xda, 0x1e, 0x8a, 0x50,
0x9a, 0x80, 0x1e, 0x5a, 0x8f, 0x55, 0xa8, 0x14, 0x7a, 0x28, 0x09, 0xf4, 0x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f, 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, 0xf6, 0xd7,
0xa4, 0xca, 0x29, 0x61, 0x1a, 0x70, 0x78, 0x60, 0x2f, 0x32, 0xce, 0xae, 0x69, 0x61, 0xe4, 0x81,
0x95, 0x2b, 0x18, 0x97, 0x64, 0x92, 0x36, 0x32, 0x64, 0x0a, 0xaf, 0x2b, 0x8e, 0x6c, 0x85, 0x80,
0xdb, 0x1a, 0x58, 0x06, 0x69, 0xc6, 0x6b, 0x26, 0xa1, 0x32, 0x05,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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:])

View File

@ -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, 0xa4, 0x51, 0xb1, 0x4e, 0xf2, 0x50,
0x18, 0xed, 0xfd, 0x7f, 0x40, 0xbd, 0xa8, 0x43, 0x43, 0x4c, 0xc1, 0xa4, 0x54, 0x06, 0xc3, 0x62,
0x9b, 0xc8, 0xa4, 0x23, 0x0e, 0x4c, 0x26, 0xa6, 0xc4, 0x98, 0xb8, 0x90, 0x4b, 0xfb, 0x59, 0x9a,
0x94, 0x7e, 0xcd, 0xed, 0xad, 0xc8, 0x5b, 0x38, 0x3a, 0xf2, 0x28, 0x8e, 0x8c, 0xb8, 0x39, 0x19,
0x03, 0x8b, 0x8f, 0x61, 0x6e, 0x5b, 0xa0, 0x71, 0x32, 0x71, 0xfb, 0xce, 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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, 0x4f, 0xc2, 0x40,
0x18, 0xed, 0x29, 0xa0, 0x1e, 0xea, 0xd0, 0x10, 0x2d, 0x0c, 0xa5, 0x32, 0x18, 0x16, 0xdb, 0x44,
0x26, 0x1d, 0x71, 0x60, 0x32, 0x31, 0x25, 0xc6, 0xc4, 0xc5, 0x7c, 0xb4, 0x67, 0x69, 0x52, 0xfa,
0x35, 0xd7, 0xab, 0xc8, 0xbf, 0x70, 0x74, 0xe4, 0xa7, 0x38, 0x32, 0xe2, 0xe6, 0x64, 0x0c, 0x2c,
0xfe, 0x0c, 0x73, 0x6d, 0x81, 0xc6, 0xc9, 0xc4, 0xed, 0x7b, 0xef, 0xf5, 0xbd, 0xf4, 0xbd, 0xa3,
0xf5, 0x31, 0xf2, 0xd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a4, 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 {

File diff suppressed because it is too large Load Diff

View File

@ -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")
)

View File

@ -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")
)

View File

@ -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")
)

View File

@ -33,3 +33,7 @@ const (
const (
ConsensusGuardianSetIndexKey = "ConsensusGuardianSetIndex-value-"
)
const (
ValidatorAllowlistKey = "VAK"
)

View File

@ -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
}

File diff suppressed because it is too large Load Diff

View File

@ -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
)

View File

@ -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, 0x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, 0xb9, 0x85, 0x7e, 0xcd, 0x2d, 0xf4, 0x65,
0x61, 0x15, 0xce, 0x16, 0x56, 0xe1, 0xe7, 0xc2, 0x2a, 0x7c, 0x78, 0x42, 0x43, 0x35, 0x8c, 0x06,
0x4d, 0x9f, 0x8f, 0x9d, 0x84, 0x76, 0x3f, 0xf3, 0x72, 0x52, 0x2f, 0x67, 0xea, 0x64, 0x4f, 0xf1,
0x6c, 0x42, 0xe4, 0xa0, 0x1c, 0x3f, 0xa8, 0x0f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x4b,
0xa3, 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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ea, 0xb9, 0xdd, 0xaf, 0x41, 0x53, 0x89,
0xd2, 0x7e, 0x71, 0x19, 0x28, 0x85, 0xe2, 0xcf, 0x0a, 0xfc, 0x7f, 0x61, 0x37, 0x69, 0x76, 0x0d,
0x86, 0xf2, 0xbd, 0xd6, 0x7e, 0x5c, 0x03, 0x62, 0x6e, 0xd1, 0x48, 0x51, 0x17, 0xb6, 0x59, 0x2d,
0x51, 0xe5, 0x9b, 0x70, 0x41, 0x51, 0x1f, 0x60, 0x7d, 0xba, 0x14, 0xee, 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