From 23b7e8384163409350d7665928fb6407e7d65dd2 Mon Sep 17 00:00:00 2001 From: John Letey Date: Sun, 23 Jun 2024 15:30:00 +0200 Subject: [PATCH] feat: implement allowed channels --- e2e/go.mod | 2 +- e2e/go.sum | 4 +- e2e/main_test.go | 66 ++++- e2e/utils.go | 48 ++- go.mod | 1 + go.sum | 2 + proto/aura/v1/events.proto | 6 + proto/aura/v1/genesis.proto | 3 + proto/aura/v1/query.proto | 10 + proto/aura/v1/tx.proto | 12 + simapp/ante.go | 75 +++++ simapp/app.go | 79 ++++- simapp/go.mod | 1 + simapp/go.sum | 2 + x/aura/ante.go | 55 ++++ x/aura/client/cli/query.go | 24 ++ x/aura/client/cli/tx.go | 26 ++ x/aura/genesis.go | 4 + x/aura/keeper/msg_server.go | 22 ++ x/aura/keeper/msg_server_test.go | 43 +++ x/aura/keeper/query_server.go | 10 + x/aura/keeper/query_server_test.go | 30 ++ x/aura/keeper/state.go | 25 ++ x/aura/types/codec.go | 4 + x/aura/types/events.pb.go | 227 ++++++++++++-- x/aura/types/genesis.go | 7 + x/aura/types/genesis.pb.go | 109 +++++-- x/aura/types/keys.go | 5 + x/aura/types/msgs.go | 30 ++ x/aura/types/query.pb.go | 399 ++++++++++++++++++++++--- x/aura/types/query.pb.gw.go | 65 ++++ x/aura/types/tx.pb.go | 462 ++++++++++++++++++++++++++--- 32 files changed, 1708 insertions(+), 150 deletions(-) create mode 100644 simapp/ante.go create mode 100644 x/aura/ante.go diff --git a/e2e/go.mod b/e2e/go.mod index 44db378..45ae9b3 100644 --- a/e2e/go.mod +++ b/e2e/go.mod @@ -4,6 +4,7 @@ go 1.21 require ( github.com/cosmos/cosmos-sdk v0.45.16 + github.com/cosmos/ibc-go/v4 v4.6.0 github.com/gogo/protobuf v1.3.3 github.com/noble-assets/aura v1.0.0 github.com/strangelove-ventures/interchaintest/v4 v4.0.0-20231026153934-334934f17a68 @@ -42,7 +43,6 @@ require ( github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gorocksdb v1.2.0 // indirect github.com/cosmos/iavl v0.19.5 // indirect - github.com/cosmos/ibc-go/v4 v4.5.1 // indirect github.com/cosmos/ledger-cosmos-go v0.12.2 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect diff --git a/e2e/go.sum b/e2e/go.sum index 467275f..361b9cc 100644 --- a/e2e/go.sum +++ b/e2e/go.sum @@ -217,8 +217,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= -github.com/cosmos/ibc-go/v4 v4.5.1 h1:+P73X7aIikGAXBUJ9vP9rEbvdSuekt3KGXmAWCSYets= -github.com/cosmos/ibc-go/v4 v4.5.1/go.mod h1:2EOi40Bx/j6rJrtP1ui8k8yUAMpGybmL1EjakYqYv5U= +github.com/cosmos/ibc-go/v4 v4.6.0 h1:G7kiD4Zf8Wrxc8BXWIKuFnzI0W4wpvRPrl5HwdfTIsA= +github.com/cosmos/ibc-go/v4 v4.6.0/go.mod h1:ksiZHUypws0NVP50E3ea0ivVFO/bfS8q8yLg8yZ2ATQ= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= diff --git a/e2e/main_test.go b/e2e/main_test.go index 757d8d2..a0adbfe 100644 --- a/e2e/main_test.go +++ b/e2e/main_test.go @@ -4,7 +4,9 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" "github.com/strangelove-ventures/interchaintest/v4/ibc" + "github.com/strangelove-ventures/interchaintest/v4/testutil" "github.com/stretchr/testify/require" ) @@ -14,7 +16,7 @@ func TestMintBurn(t *testing.T) { t.Parallel() var wrapper Wrapper - ctx := Suite(t, &wrapper) + ctx := Suite(t, &wrapper, false) validator := wrapper.chain.Validators[0] // ASSERT: Minter has an allowance of 1 $USDY. @@ -56,7 +58,7 @@ func TestMintTransferBurn(t *testing.T) { t.Parallel() var wrapper Wrapper - ctx := Suite(t, &wrapper) + ctx := Suite(t, &wrapper, false) validator := wrapper.chain.Validators[0] // ASSERT: Minter has an allowance of 1 $USDY. @@ -115,7 +117,7 @@ func TestMintTransferBlockBurn(t *testing.T) { t.Parallel() var wrapper Wrapper - ctx := Suite(t, &wrapper) + ctx := Suite(t, &wrapper, false) validator := wrapper.chain.Validators[0] // ASSERT: Minter has an allowance of 1 $USDY. @@ -191,3 +193,61 @@ func TestMintTransferBlockBurn(t *testing.T) { // ASSERT: Burner has no allowance. EnsureBurner(t, wrapper, ctx, wrapper.burner.FormattedAddress(), sdk.ZeroInt()) } + +func TestIBCTransfer(t *testing.T) { + t.Parallel() + + var wrapper Wrapper + ctx := Suite(t, &wrapper, true) + validator := wrapper.chain.Validators[0] + + // ARRANGE: Mint 1 $USDY to Alice. + _, err := validator.ExecTx( + ctx, wrapper.minter.KeyName(), + "aura", "mint", wrapper.alice.FormattedAddress(), ONE.String(), + ) + require.NoError(t, err) + // ARRANGE: Determine Bob's external address. + recipient := sdk.MustBech32ifyAddressBytes(wrapper.gaia.Config().Bech32Prefix, wrapper.bob.Address()) + + // ACT: Attempt to transfer out of Noble. + _, err = validator.SendIBCTransfer(ctx, "channel-0", wrapper.alice.KeyName(), ibc.WalletAmount{ + Address: recipient, + Denom: "ausdy", + Amount: ONE.Int64(), + }, ibc.TransferOptions{}) + // ASSERT: The action should've failed due to not allowed channel. + require.ErrorContains(t, err, "ausdy cannot be transferred over channel-0") + + // ACT: Allow transfers over channel-0. + _, err = validator.ExecTx( + ctx, wrapper.owner.KeyName(), + "aura", "allow-channel", "channel-0", + ) + require.NoError(t, err) + // ASSERT: channel-0 has been allowed. + EnsureChannel(t, wrapper, ctx, "channel-0") + + // ACT: Transfer 1 $USDY out of Noble. + _, err = validator.SendIBCTransfer(ctx, "channel-0", wrapper.alice.KeyName(), ibc.WalletAmount{ + Address: recipient, + Denom: "ausdy", + Amount: ONE.Int64(), + }, ibc.TransferOptions{}) + require.NoError(t, err) + + // ACT: Wait 10 blocks for packet to be relayed. + require.NoError(t, testutil.WaitForBlocks(ctx, 10, wrapper.gaia)) + + // ASSERT: Alice has no balance. + balance, err := wrapper.chain.GetBalance(ctx, wrapper.alice.FormattedAddress(), "ausdy") + require.NoError(t, err) + require.Zero(t, balance) + // ASSERT: Bob has 1 $USDY. + balance, err = wrapper.gaia.GetBalance(ctx, recipient, transfertypes.DenomTrace{ + Path: "transfer/channel-0", + BaseDenom: "ausdy", + }.IBCDenom()) + require.NoError(t, err) + require.Equal(t, ONE.Int64(), balance) +} diff --git a/e2e/utils.go b/e2e/utils.go index b26dcc5..e0dcb1b 100644 --- a/e2e/utils.go +++ b/e2e/utils.go @@ -13,6 +13,7 @@ import ( "github.com/strangelove-ventures/interchaintest/v4" "github.com/strangelove-ventures/interchaintest/v4/chain/cosmos" "github.com/strangelove-ventures/interchaintest/v4/ibc" + "github.com/strangelove-ventures/interchaintest/v4/relayer/rly" "github.com/strangelove-ventures/interchaintest/v4/testreporter" "github.com/stretchr/testify/require" "go.uber.org/zap/zaptest" @@ -20,6 +21,7 @@ import ( type Wrapper struct { chain *cosmos.CosmosChain + gaia *cosmos.CosmosChain owner ibc.Wallet minter ibc.Wallet @@ -28,7 +30,7 @@ type Wrapper struct { bob ibc.Wallet } -func Suite(t *testing.T, wrapper *Wrapper) (ctx context.Context) { +func Suite(t *testing.T, wrapper *Wrapper, ibcEnabled bool) (ctx context.Context) { ctx = context.Background() logger := zaptest.NewLogger(t) reporter := testreporter.NewNopReporter() @@ -135,6 +137,14 @@ func Suite(t *testing.T, wrapper *Wrapper) (ctx context.Context) { }, }, } + if ibcEnabled { + specs = append(specs, &interchaintest.ChainSpec{ + Name: "ibc-go-simd", + Version: "v4.5.0", + NumValidators: &numValidators, + NumFullNodes: &numFullNodes, + }) + } factory := interchaintest.NewBuiltinChainFactory(logger, specs) chains, err := factory.Chains(t.Name()) @@ -144,6 +154,26 @@ func Suite(t *testing.T, wrapper *Wrapper) (ctx context.Context) { wrapper.chain = noble interchain := interchaintest.NewInterchain().AddChain(noble) + var relayer *rly.CosmosRelayer + if ibcEnabled { + relayer = interchaintest.NewBuiltinRelayerFactory( + ibc.CosmosRly, + logger, + ).Build(t, client, network).(*rly.CosmosRelayer) + + gaia := chains[1].(*cosmos.CosmosChain) + wrapper.gaia = gaia + + interchain = interchain. + AddChain(gaia). + AddRelayer(relayer, "relayer"). + AddLink(interchaintest.InterchainLink{ + Chain1: noble, + Chain2: gaia, + Relayer: relayer, + Path: "transfer", + }) + } require.NoError(t, interchain.Build(ctx, execReporter, interchaintest.InterchainBuildOptions{ TestName: t.Name(), Client: client, @@ -154,6 +184,10 @@ func Suite(t *testing.T, wrapper *Wrapper) (ctx context.Context) { _ = interchain.Close() }) + if ibcEnabled { + require.NoError(t, relayer.StartRelayer(ctx, execReporter)) + } + return } @@ -194,3 +228,15 @@ func EnsureMinter(t *testing.T, wrapper Wrapper, ctx context.Context, address st require.Contains(t, res.Minters, types.Minter{Address: address, Allowance: allowance}) } + +func EnsureChannel(t *testing.T, wrapper Wrapper, ctx context.Context, channel string) { + validator := wrapper.chain.Validators[0] + + raw, _, err := validator.ExecQuery(ctx, "aura", "channels") + require.NoError(t, err) + + var res types.QueryChannelsResponse + require.NoError(t, json.Unmarshal(raw, &res)) + + require.Contains(t, res.Channels, channel) +} diff --git a/go.mod b/go.mod index 02d4903..0f1ced3 100644 --- a/go.mod +++ b/go.mod @@ -5,6 +5,7 @@ go 1.21 require ( cosmossdk.io/errors v1.0.0 github.com/cosmos/cosmos-sdk v0.45.16 + github.com/cosmos/ibc-go/v4 v4.6.0 github.com/gogo/protobuf v1.3.3 github.com/golang/protobuf v1.5.3 github.com/golangci/golangci-lint v1.55.0 diff --git a/go.sum b/go.sum index ba46ad0..6d21cfd 100644 --- a/go.sum +++ b/go.sum @@ -233,6 +233,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ibc-go/v4 v4.6.0 h1:G7kiD4Zf8Wrxc8BXWIKuFnzI0W4wpvRPrl5HwdfTIsA= +github.com/cosmos/ibc-go/v4 v4.6.0/go.mod h1:ksiZHUypws0NVP50E3ea0ivVFO/bfS8q8yLg8yZ2ATQ= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= diff --git a/proto/aura/v1/events.proto b/proto/aura/v1/events.proto index 0018746..3d64d6a 100644 --- a/proto/aura/v1/events.proto +++ b/proto/aura/v1/events.proto @@ -119,3 +119,9 @@ message PauserRemoved { // address is the address of the pauser. string address = 1; } + +// ChannelAllowed is emitted whenever a new channel is allowed. +message ChannelAllowed { + // channel is the id of the allowed channel. + string channel = 1; +} diff --git a/proto/aura/v1/genesis.proto b/proto/aura/v1/genesis.proto index d395143..ae4c231 100644 --- a/proto/aura/v1/genesis.proto +++ b/proto/aura/v1/genesis.proto @@ -25,6 +25,9 @@ message GenesisState { repeated Minter minters = 6 [(gogoproto.nullable) = false]; // pausers is the list of addresses that can pause USDY. repeated string pausers = 7; + + // channels is the list of allowed IBC channels. + repeated string channels = 8; } // diff --git a/proto/aura/v1/query.proto b/proto/aura/v1/query.proto index bc9b6de..679f2e2 100644 --- a/proto/aura/v1/query.proto +++ b/proto/aura/v1/query.proto @@ -30,6 +30,10 @@ service Query { rpc Pausers(aura.v1.QueryPausers) returns (aura.v1.QueryPausersResponse) { option (google.api.http).get = "/aura/v1/pausers"; } + + rpc Channels(aura.v1.QueryChannels) returns (aura.v1.QueryChannelsResponse) { + option (google.api.http).get = "/aura/v1/channels"; + } } // @@ -70,3 +74,9 @@ message QueryPausers {} message QueryPausersResponse { repeated string pausers = 1; } + +message QueryChannels {} + +message QueryChannelsResponse { + repeated string channels = 1; +} diff --git a/proto/aura/v1/tx.proto b/proto/aura/v1/tx.proto index eb2c1c0..1f644d2 100644 --- a/proto/aura/v1/tx.proto +++ b/proto/aura/v1/tx.proto @@ -26,6 +26,8 @@ service Msg { rpc AddPauser(aura.v1.MsgAddPauser) returns (aura.v1.MsgAddPauserResponse); rpc RemovePauser(aura.v1.MsgRemovePauser) returns (aura.v1.MsgRemovePauserResponse); + + rpc AllowChannel(aura.v1.MsgAllowChannel) returns (aura.v1.MsgAllowChannelResponse); } // @@ -190,3 +192,13 @@ message MsgRemovePauser { } message MsgRemovePauserResponse {} + +message MsgAllowChannel { + option (gogoproto.equal) = false; + option (gogoproto.goproto_getters) = false; + + string signer = 1; + string channel = 2; +} + +message MsgAllowChannelResponse {} diff --git a/simapp/ante.go b/simapp/ante.go new file mode 100644 index 0000000..b9f9a1c --- /dev/null +++ b/simapp/ante.go @@ -0,0 +1,75 @@ +package simapp + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/ante" + authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" + "github.com/cosmos/cosmos-sdk/x/auth/types" + ibcante "github.com/cosmos/ibc-go/v4/modules/core/ante" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" + "github.com/noble-assets/aura/x/aura" + aurakeeper "github.com/noble-assets/aura/x/aura/keeper" +) + +// HandlerOptions are the options required for constructing a default SDK AnteHandler. +type HandlerOptions struct { + AccountKeeper ante.AccountKeeper + AuraKeeper *aurakeeper.Keeper + BankKeeper types.BankKeeper + FeegrantKeeper ante.FeegrantKeeper + IBCKeeper *ibckeeper.Keeper + SignModeHandler authsigning.SignModeHandler + SigGasConsumer func(meter sdk.GasMeter, sig signing.SignatureV2, params types.Params) error +} + +// NewAnteHandler returns an AnteHandler that checks and increments sequence +// numbers, checks signatures & account numbers, and deducts fees from the first +// signer. +func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { + if options.AccountKeeper == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "account keeper is required for ante builder") + } + + if options.AuraKeeper == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "aura 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.IBCKeeper == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrLogic, "ibc 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), + ibcante.NewAnteDecorator(options.IBCKeeper), + aura.NewAnteDecorator(options.AuraKeeper), + } + + return sdk.ChainAnteDecorators(anteDecorators...), nil +} diff --git a/simapp/app.go b/simapp/app.go index 7d1fe2f..9df404d 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -32,6 +32,9 @@ import ( "github.com/cosmos/cosmos-sdk/x/bank" bankkeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/cosmos/cosmos-sdk/x/capability" + capabilitykeeper "github.com/cosmos/cosmos-sdk/x/capability/keeper" + capabilitytypes "github.com/cosmos/cosmos-sdk/x/capability/types" "github.com/cosmos/cosmos-sdk/x/genutil" genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types" "github.com/cosmos/cosmos-sdk/x/params" @@ -40,6 +43,16 @@ import ( "github.com/cosmos/cosmos-sdk/x/staking" stakingkeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/cosmos/cosmos-sdk/x/upgrade" + upgradekeeper "github.com/cosmos/cosmos-sdk/x/upgrade/keeper" + upgradetypes "github.com/cosmos/cosmos-sdk/x/upgrade/types" + "github.com/cosmos/ibc-go/v4/modules/apps/transfer" + transferkeeper "github.com/cosmos/ibc-go/v4/modules/apps/transfer/keeper" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + ibc "github.com/cosmos/ibc-go/v4/modules/core" + porttypes "github.com/cosmos/ibc-go/v4/modules/core/05-port/types" + host "github.com/cosmos/ibc-go/v4/modules/core/24-host" + ibckeeper "github.com/cosmos/ibc-go/v4/modules/core/keeper" abci "github.com/tendermint/tendermint/abci/types" "github.com/tendermint/tendermint/libs/log" tmos "github.com/tendermint/tendermint/libs/os" @@ -59,6 +72,10 @@ var ( genutil.AppModuleBasic{}, params.AppModuleBasic{}, staking.AppModuleBasic{}, + upgrade.AppModuleBasic{}, + capability.AppModuleBasic{}, + ibc.AppModuleBasic{}, + transfer.AppModuleBasic{}, aura.AppModuleBasic{}, ) @@ -66,6 +83,7 @@ var ( authtypes.FeeCollectorName: nil, stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + transfertypes.ModuleName: {authtypes.Burner, authtypes.Minter}, auratypes.ModuleName: {authtypes.Burner, authtypes.Minter}, } ) @@ -87,6 +105,7 @@ type SimApp struct { mm *module.Manager configurator module.Configurator keys map[string]*sdk.KVStoreKey + mkeys map[string]*sdk.MemoryStoreKey tkeys map[string]*sdk.TransientStoreKey // Cosmos SDK Modules @@ -94,6 +113,11 @@ type SimApp struct { BankKeeper bankkeeper.Keeper ParamsKeeper paramskeeper.Keeper StakingKeeper stakingkeeper.Keeper + UpgradeKeeper upgradekeeper.Keeper + // IBC Modules + CapabilityKeeper *capabilitykeeper.Keeper + IBCKeeper *ibckeeper.Keeper + TransferKeeper transferkeeper.Keeper // Custom Modules AuraKeeper *aurakeeper.Keeper } @@ -128,8 +152,10 @@ func NewSimApp( keys := sdk.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, paramstypes.StoreKey, stakingtypes.StoreKey, + upgradetypes.ModuleName, capabilitytypes.StoreKey, host.StoreKey, transfertypes.StoreKey, auratypes.ModuleName, ) + mkeys := sdk.NewMemoryStoreKeys(capabilitytypes.MemStoreKey) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) if _, _, err := streaming.LoadStreamingServices(bApp, appOpts, appCodec, keys); err != nil { @@ -143,6 +169,7 @@ func NewSimApp( appCodec: appCodec, interfaceRegistry: interfaceRegistry, keys: keys, + mkeys: mkeys, tkeys: tkeys, } @@ -165,6 +192,29 @@ func NewSimApp( appCodec, keys[stakingtypes.StoreKey], app.AccountKeeper, app.BankKeeper, app.GetSubspace(stakingtypes.ModuleName), ) + app.UpgradeKeeper = upgradekeeper.NewKeeper( + make(map[int64]bool), keys[upgradetypes.StoreKey], appCodec, DefaultNodeHome, app.BaseApp, + ) + + app.CapabilityKeeper = capabilitykeeper.NewKeeper( + appCodec, keys[capabilitytypes.StoreKey], mkeys[capabilitytypes.MemStoreKey], + ) + + scopedIBCKeeper := app.CapabilityKeeper.ScopeToModule(host.ModuleName) + app.IBCKeeper = ibckeeper.NewKeeper( + appCodec, keys[host.StoreKey], app.GetSubspace(host.ModuleName), app.StakingKeeper, app.UpgradeKeeper, scopedIBCKeeper, + ) + + scopedTransferKeeper := app.CapabilityKeeper.ScopeToModule(transfertypes.ModuleName) + app.TransferKeeper = transferkeeper.NewKeeper( + appCodec, keys[transfertypes.StoreKey], app.GetSubspace(transfertypes.ModuleName), + app.IBCKeeper.ChannelKeeper, app.IBCKeeper.ChannelKeeper, &app.IBCKeeper.PortKeeper, + app.AccountKeeper, app.BankKeeper, scopedTransferKeeper, + ) + + router := porttypes.NewRouter().AddRoute(transfertypes.ModuleName, transfer.NewIBCModule(app.TransferKeeper)) + app.IBCKeeper.SetRouter(router) + app.mm = module.NewManager( auth.NewAppModule(appCodec, app.AccountKeeper, nil), bank.NewAppModule(appCodec, app.BankKeeper.(bankkeeper.BaseKeeper), app.AccountKeeper), @@ -174,20 +224,27 @@ func NewSimApp( ), params.NewAppModule(app.ParamsKeeper), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), + upgrade.NewAppModule(app.UpgradeKeeper), + capability.NewAppModule(appCodec, *app.CapabilityKeeper), + ibc.NewAppModule(app.IBCKeeper), + transfer.NewAppModule(app.TransferKeeper), aura.NewAppModule(app.AuraKeeper), ) app.mm.SetOrderBeginBlockers( - stakingtypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, - auratypes.ModuleName, + upgradetypes.ModuleName, capabilitytypes.ModuleName, stakingtypes.ModuleName, + host.ModuleName, transfertypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, + genutiltypes.ModuleName, paramstypes.ModuleName, auratypes.ModuleName, ) app.mm.SetOrderEndBlockers( - stakingtypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, - auratypes.ModuleName, + stakingtypes.ModuleName, host.ModuleName, transfertypes.ModuleName, capabilitytypes.ModuleName, + authtypes.ModuleName, banktypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, + upgradetypes.ModuleName, auratypes.ModuleName, ) app.mm.SetOrderInitGenesis( - authtypes.ModuleName, banktypes.ModuleName, stakingtypes.ModuleName, genutiltypes.ModuleName, paramstypes.ModuleName, - auratypes.ModuleName, + capabilitytypes.ModuleName, authtypes.ModuleName, banktypes.ModuleName, + stakingtypes.ModuleName, host.ModuleName, genutiltypes.ModuleName, transfertypes.ModuleName, + paramstypes.ModuleName, upgradetypes.ModuleName, auratypes.ModuleName, ) app.mm.RegisterRoutes(app.Router(), app.QueryRouter(), encodingConfig.Amino) @@ -195,12 +252,15 @@ func NewSimApp( app.mm.RegisterServices(app.configurator) app.MountKVStores(keys) + app.MountMemoryStores(mkeys) app.MountTransientStores(tkeys) - anteHandler, err := ante.NewAnteHandler( - ante.HandlerOptions{ + anteHandler, err := NewAnteHandler( + HandlerOptions{ AccountKeeper: app.AccountKeeper, + AuraKeeper: app.AuraKeeper, BankKeeper: app.BankKeeper, + IBCKeeper: app.IBCKeeper, SignModeHandler: encodingConfig.TxConfig.SignModeHandler(), FeegrantKeeper: nil, SigGasConsumer: ante.DefaultSigVerificationGasConsumer, @@ -295,6 +355,9 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(authtypes.ModuleName) paramsKeeper.Subspace(banktypes.ModuleName) paramsKeeper.Subspace(stakingtypes.ModuleName) + paramsKeeper.Subspace(capabilitytypes.ModuleName) + paramsKeeper.Subspace(host.ModuleName) + paramsKeeper.Subspace(transfertypes.ModuleName) return paramsKeeper } diff --git a/simapp/go.mod b/simapp/go.mod index 5a4ef2a..2e5a91e 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -4,6 +4,7 @@ go 1.21 require ( github.com/cosmos/cosmos-sdk v0.45.16 + github.com/cosmos/ibc-go/v4 v4.6.0 github.com/noble-assets/aura v1.0.0 github.com/spf13/cast v1.5.1 github.com/spf13/cobra v1.7.0 diff --git a/simapp/go.sum b/simapp/go.sum index 89791d9..795b664 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -295,6 +295,8 @@ github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4 github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.5 h1:rGA3hOrgNxgRM5wYcSCxgQBap7fW82WZgY78V9po/iY= github.com/cosmos/iavl v0.19.5/go.mod h1:X9PKD3J0iFxdmgNLa7b2LYWdsGd90ToV5cAONApkEPw= +github.com/cosmos/ibc-go/v4 v4.6.0 h1:G7kiD4Zf8Wrxc8BXWIKuFnzI0W4wpvRPrl5HwdfTIsA= +github.com/cosmos/ibc-go/v4 v4.6.0/go.mod h1:ksiZHUypws0NVP50E3ea0ivVFO/bfS8q8yLg8yZ2ATQ= github.com/cosmos/ledger-cosmos-go v0.12.4 h1:drvWt+GJP7Aiw550yeb3ON/zsrgW0jgh5saFCr7pDnw= github.com/cosmos/ledger-cosmos-go v0.12.4/go.mod h1:fjfVWRf++Xkygt9wzCsjEBdjcf7wiiY35fv3ctT+k4M= github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwcJI5acqYI6dE= diff --git a/x/aura/ante.go b/x/aura/ante.go new file mode 100644 index 0000000..eadfd4c --- /dev/null +++ b/x/aura/ante.go @@ -0,0 +1,55 @@ +package aura + +import ( + "fmt" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/x/authz" + transfertypes "github.com/cosmos/ibc-go/v4/modules/apps/transfer/types" + "github.com/noble-assets/aura/x/aura/keeper" +) + +type Decorator struct { + *keeper.Keeper +} + +var _ sdk.AnteDecorator = Decorator{} + +func NewAnteDecorator(keeper *keeper.Keeper) Decorator { + return Decorator{Keeper: keeper} +} + +func (d Decorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (newCtx sdk.Context, err error) { + msgs := tx.GetMsgs() + + err = d.CheckMessages(ctx, msgs) + if err != nil { + return ctx, err + } + + return next(ctx, tx, simulate) +} + +func (d Decorator) CheckMessages(ctx sdk.Context, msgs []sdk.Msg) error { + for _, raw := range msgs { + if msg, ok := raw.(*authz.MsgExec); ok { + nestedMsgs, err := msg.GetMessages() + if err != nil { + return err + } + + return d.CheckMessages(ctx, nestedMsgs) + } + + switch msg := raw.(type) { + case *transfertypes.MsgTransfer: + if msg.Token.Denom == d.Denom { + if !d.HasChannel(ctx, msg.SourceChannel) { + return fmt.Errorf("%s cannot be transferred over %s", d.Denom, msg.SourceChannel) + } + } + } + } + + return nil +} diff --git a/x/aura/client/cli/query.go b/x/aura/client/cli/query.go index edb5969..18a64ee 100644 --- a/x/aura/client/cli/query.go +++ b/x/aura/client/cli/query.go @@ -27,6 +27,7 @@ func GetQueryCmd() *cobra.Command { cmd.AddCommand(QueryBurners()) cmd.AddCommand(QueryMinters()) cmd.AddCommand(QueryPausers()) + cmd.AddCommand(QueryChannels()) return cmd } @@ -168,3 +169,26 @@ func QueryPausers() *cobra.Command { return cmd } + +func QueryChannels() *cobra.Command { + cmd := &cobra.Command{ + Use: "channels", + Short: "Query the allowed channels", + Args: cobra.NoArgs, + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx := client.GetClientContextFromCmd(cmd) + queryClient := types.NewQueryClient(clientCtx) + + res, err := queryClient.Channels(context.Background(), &types.QueryChannels{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/aura/client/cli/tx.go b/x/aura/client/cli/tx.go index f041fac..8db13b4 100644 --- a/x/aura/client/cli/tx.go +++ b/x/aura/client/cli/tx.go @@ -37,6 +37,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(TxSetMinterAllowance()) cmd.AddCommand(TxAddPauser()) cmd.AddCommand(TxRemovePauser()) + cmd.AddCommand(TxAllowChannel()) return cmd } @@ -424,3 +425,28 @@ func TxRemovePauser() *cobra.Command { return cmd } + +func TxAllowChannel() *cobra.Command { + cmd := &cobra.Command{ + Use: "allow-channel [channel]", + Short: "Allow a new channel", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := &types.MsgAllowChannel{ + Signer: clientCtx.GetFromAddress().String(), + Channel: args[0], + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/aura/genesis.go b/x/aura/genesis.go index b00f0d0..79fee97 100644 --- a/x/aura/genesis.go +++ b/x/aura/genesis.go @@ -27,6 +27,9 @@ func InitGenesis(ctx sdk.Context, k *keeper.Keeper, genesis types.GenesisState) for _, pauser := range genesis.Pausers { k.SetPauser(ctx, pauser) } + for _, channel := range genesis.Channels { + k.SetChannel(ctx, channel) + } } func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { @@ -42,5 +45,6 @@ func ExportGenesis(ctx sdk.Context, k *keeper.Keeper) *types.GenesisState { Burners: k.GetBurners(ctx), Minters: k.GetMinters(ctx), Pausers: k.GetPausers(ctx), + Channels: k.GetChannels(ctx), } } diff --git a/x/aura/keeper/msg_server.go b/x/aura/keeper/msg_server.go index b2326a7..a8f92f9 100644 --- a/x/aura/keeper/msg_server.go +++ b/x/aura/keeper/msg_server.go @@ -376,3 +376,25 @@ func (k msgServer) RemovePauser(goCtx context.Context, msg *types.MsgRemovePause Address: msg.Pauser, }) } + +func (k msgServer) AllowChannel(goCtx context.Context, msg *types.MsgAllowChannel) (*types.MsgAllowChannelResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + owner := k.GetOwner(ctx) + if owner == "" { + return nil, types.ErrNoOwner + } + if msg.Signer != owner { + return nil, sdkerrors.Wrapf(types.ErrInvalidOwner, "expected %s, got %s", owner, msg.Signer) + } + + if k.HasChannel(ctx, msg.Channel) { + return nil, fmt.Errorf("%s is already allowed", msg.Channel) + } + + k.SetChannel(ctx, msg.Channel) + + return &types.MsgAllowChannelResponse{}, ctx.EventManager().EmitTypedEvent(&types.ChannelAllowed{ + Channel: msg.Channel, + }) +} diff --git a/x/aura/keeper/msg_server_test.go b/x/aura/keeper/msg_server_test.go index 91bc7cb..ac2743e 100644 --- a/x/aura/keeper/msg_server_test.go +++ b/x/aura/keeper/msg_server_test.go @@ -711,3 +711,46 @@ func TestRemovePauser(t *testing.T) { require.NoError(t, err) require.False(t, k.HasPauser(ctx, pauser.Address)) } + +func TestAllowChannel(t *testing.T) { + k, ctx := mocks.AuraKeeper(t) + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewMsgServer(k) + + // ACT: Attempt to allow channel with no owner set. + _, err := server.AllowChannel(goCtx, &types.MsgAllowChannel{}) + // ASSERT: The action should've failed due to no owner set. + require.ErrorContains(t, err, "there is no owner") + + // ARRANGE: Set owner in state. + owner := utils.TestAccount() + k.SetOwner(ctx, owner.Address) + + // ACT: Attempt to allow channel with invalid signer. + _, err = server.AllowChannel(goCtx, &types.MsgAllowChannel{ + Signer: utils.TestAccount().Address, + }) + // ASSERT: The action should've failed due to invalid signer. + require.ErrorContains(t, err, types.ErrInvalidOwner.Error()) + + // ARRANGE: Generate two channels, add one to state. + channel1, channel2 := "channel-0", "channel-1" + k.SetChannel(ctx, channel2) + + // ACT: Attempt to allow channel that is already allowed. + _, err = server.AllowChannel(goCtx, &types.MsgAllowChannel{ + Signer: owner.Address, + Channel: channel2, + }) + // ASSERT: The action should've failed due to allowed channel. + require.ErrorContains(t, err, "is already allowed") + + // ACT: Attempt to allow channel. + _, err = server.AllowChannel(goCtx, &types.MsgAllowChannel{ + Signer: owner.Address, + Channel: channel1, + }) + // ASSERT: The action should've succeeded, and set channel in state. + require.NoError(t, err) + require.True(t, k.HasChannel(ctx, channel1)) +} diff --git a/x/aura/keeper/query_server.go b/x/aura/keeper/query_server.go index d930765..5070531 100644 --- a/x/aura/keeper/query_server.go +++ b/x/aura/keeper/query_server.go @@ -78,3 +78,13 @@ func (k queryServer) Pausers(goCtx context.Context, req *types.QueryPausers) (*t return &types.QueryPausersResponse{Pausers: k.GetPausers(ctx)}, nil } + +func (k queryServer) Channels(goCtx context.Context, req *types.QueryChannels) (*types.QueryChannelsResponse, error) { + if req == nil { + return nil, errors.ErrInvalidRequest + } + + ctx := sdk.UnwrapSDKContext(goCtx) + + return &types.QueryChannelsResponse{Channels: k.GetChannels(ctx)}, nil +} diff --git a/x/aura/keeper/query_server_test.go b/x/aura/keeper/query_server_test.go index 789fec5..308e5be 100644 --- a/x/aura/keeper/query_server_test.go +++ b/x/aura/keeper/query_server_test.go @@ -189,3 +189,33 @@ func TestPausersQuery(t *testing.T) { require.Contains(t, res.Pausers, pauser1.Address) require.Contains(t, res.Pausers, pauser2.Address) } + +func TestChannelsQuery(t *testing.T) { + k, ctx := mocks.AuraKeeper(t) + goCtx := sdk.WrapSDKContext(ctx) + server := keeper.NewQueryServer(k) + + // ACT: Attempt to query channels with invalid request. + _, err := server.Channels(goCtx, nil) + // ASSERT: The query should've failed due to invalid request. + require.ErrorContains(t, err, errors.ErrInvalidRequest.Error()) + + // ACT: Attempt to query channels with no state. + res, err := server.Channels(goCtx, &types.QueryChannels{}) + // ASSERT: The query should've succeeded, and returned no channels. + require.NoError(t, err) + require.Empty(t, res.Channels) + + // ARRANGE: Set channels in state. + channel1, channel2 := "channel-0", "channel-1" + k.SetChannel(ctx, channel1) + k.SetChannel(ctx, channel2) + + // ACT: Attempt to query channels with state. + res, err = server.Channels(goCtx, &types.QueryChannels{}) + // ASSERT: The query should've succeeded, and returned channels. + require.NoError(t, err) + require.Len(t, res.Channels, 2) + require.Contains(t, res.Channels, channel1) + require.Contains(t, res.Channels, channel2) +} diff --git a/x/aura/keeper/state.go b/x/aura/keeper/state.go index 5959a6d..84a2d81 100644 --- a/x/aura/keeper/state.go +++ b/x/aura/keeper/state.go @@ -175,3 +175,28 @@ func (k *Keeper) SetPauser(ctx sdk.Context, pauser string) { store := ctx.KVStore(k.storeKey) store.Set(types.PauserKey(pauser), []byte{}) } + +// + +func (k *Keeper) GetChannels(ctx sdk.Context) (channels []string) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.ChannelPrefix) + itr := store.Iterator(nil, nil) + + defer itr.Close() + + for ; itr.Valid(); itr.Next() { + channels = append(channels, string(itr.Key())) + } + + return +} + +func (k *Keeper) HasChannel(ctx sdk.Context, channel string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(types.ChannelKey(channel)) +} + +func (k *Keeper) SetChannel(ctx sdk.Context, channel string) { + store := ctx.KVStore(k.storeKey) + store.Set(types.ChannelKey(channel), []byte{}) +} diff --git a/x/aura/types/codec.go b/x/aura/types/codec.go index d725bc5..41b74ef 100644 --- a/x/aura/types/codec.go +++ b/x/aura/types/codec.go @@ -30,6 +30,8 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgAddPauser{}, "aura/AddPauser", nil) cdc.RegisterConcrete(&MsgRemovePauser{}, "aura/RemovePauser", nil) + + cdc.RegisterConcrete(&MsgAllowChannel{}, "aura/AllowChannel", nil) } func RegisterInterfaces(registry codectypes.InterfaceRegistry) { @@ -55,6 +57,8 @@ func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAddPauser{}) registry.RegisterImplementations((*sdk.Msg)(nil), &MsgRemovePauser{}) + registry.RegisterImplementations((*sdk.Msg)(nil), &MsgAllowChannel{}) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } diff --git a/x/aura/types/events.pb.go b/x/aura/types/events.pb.go index 3353148..18340de 100644 --- a/x/aura/types/events.pb.go +++ b/x/aura/types/events.pb.go @@ -606,6 +606,52 @@ func (m *PauserRemoved) GetAddress() string { return "" } +// ChannelAllowed is emitted whenever a new channel is allowed. +type ChannelAllowed struct { + // channel is the id of the allowed channel. + Channel string `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` +} + +func (m *ChannelAllowed) Reset() { *m = ChannelAllowed{} } +func (m *ChannelAllowed) String() string { return proto.CompactTextString(m) } +func (*ChannelAllowed) ProtoMessage() {} +func (*ChannelAllowed) Descriptor() ([]byte, []int) { + return fileDescriptor_2e649e32a11ca0c4, []int{12} +} +func (m *ChannelAllowed) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ChannelAllowed) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ChannelAllowed.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 *ChannelAllowed) XXX_Merge(src proto.Message) { + xxx_messageInfo_ChannelAllowed.Merge(m, src) +} +func (m *ChannelAllowed) XXX_Size() int { + return m.Size() +} +func (m *ChannelAllowed) XXX_DiscardUnknown() { + xxx_messageInfo_ChannelAllowed.DiscardUnknown(m) +} + +var xxx_messageInfo_ChannelAllowed proto.InternalMessageInfo + +func (m *ChannelAllowed) GetChannel() string { + if m != nil { + return m.Channel + } + return "" +} + func init() { proto.RegisterType((*Paused)(nil), "aura.v1.Paused") proto.RegisterType((*Unpaused)(nil), "aura.v1.Unpaused") @@ -619,38 +665,40 @@ func init() { proto.RegisterType((*MinterUpdated)(nil), "aura.v1.MinterUpdated") proto.RegisterType((*PauserAdded)(nil), "aura.v1.PauserAdded") proto.RegisterType((*PauserRemoved)(nil), "aura.v1.PauserRemoved") + proto.RegisterType((*ChannelAllowed)(nil), "aura.v1.ChannelAllowed") } func init() { proto.RegisterFile("aura/v1/events.proto", fileDescriptor_2e649e32a11ca0c4) } var fileDescriptor_2e649e32a11ca0c4 = []byte{ - // 411 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x94, 0xdd, 0x6a, 0xdb, 0x30, - 0x14, 0xc7, 0xed, 0x0d, 0xf2, 0xa1, 0x2c, 0x83, 0x99, 0x5c, 0x84, 0x0d, 0x9c, 0x61, 0xf6, 0x95, - 0x8b, 0xd8, 0x84, 0x3d, 0x41, 0xb2, 0xab, 0xc1, 0xc6, 0x46, 0xd2, 0xdc, 0x04, 0xda, 0xa2, 0x58, - 0xa7, 0x89, 0x69, 0x22, 0x19, 0x49, 0xb6, 0xdb, 0xb7, 0xe8, 0x63, 0xe5, 0x32, 0x97, 0xa5, 0xd0, - 0x50, 0x92, 0x17, 0x29, 0x96, 0xec,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3c, 0x9f, 0x89, - 0x19, 0x13, 0xd9, 0xd2, 0x12, 0xe4, 0xd4, 0x93, 0xe7, 0x21, 0x08, 0xf7, 0x37, 0x95, 0xbd, 0x2d, - 0xc0, 0x69, 0xa2, 0xaa, 0x4e, 0xdb, 0x83, 0x19, 0x8b, 0x77, 0x25, 0x76, 0xae, 0xcd, 0x5c, 0x3b, - 0x08, 0x09, 0x96, 0x3b, 0x8b, 0x3c, 0x44, 0xd6, 0xa6, 0x23, 0x4f, 0xad, 0xf6, 0x43, 0x4e, 0xea, - 0xe4, 0x20, 0xab, 0x8f, 0xaa, 0x69, 0x27, 0xb7, 0xe4, 0xb7, 0x8f, 0x22, 0xbf, 0xa3, 0x90, 0x6c, - 0xa0, 0xa9, 0x03, 0x7f, 0x03, 0x2a, 0x5f, 0xc0, 0x01, 0x9d, 0xf6, 0x61, 0x0e, 0x68, 0xed, 0xeb, - 0x74, 0xe0, 0x3b, 0xaa, 0xa8, 0x49, 0xb0, 0xcf, 0x81, 0xb4, 0x67, 0x5a, 0xb8, 0xb7, 0x67, 0xdd, - 0x5f, 0xf3, 0x95, 0x6d, 0x2e, 0x56, 0xb6, 0x79, 0xb3, 0xb2, 0xcd, 0x8b, 0xb5, 0x6d, 0x2c, 0xd6, - 0xb6, 0x71, 0xb9, 0xb6, 0x8d, 0x61, 0xf3, 0x4e, 0x8d, 0x94, 0x8d, 0xa6, 0xd0, 0xc2, 0x42, 0x80, - 0x14, 0x9e, 0x1a, 0x62, 0x67, 0x7a, 0x51, 0xa5, 0x8e, 0x0a, 0x6a, 0x52, 0xfd, 0xbc, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0xc7, 0xfa, 0x36, 0x1f, 0xe0, 0x04, 0x00, 0x00, + // 427 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xdc, 0x94, 0xdd, 0x8a, 0xda, 0x40, + 0x14, 0xc7, 0x93, 0x16,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b, 0xf8, 0xb7, 0xb3, 0x8d, 0x69, 0xe7, 0x52, 0x3f, 0x94, 0xcd, 0x42, 0xe8, 0x62, 0x21, 0x40, + 0x0a, 0x4f, 0x2d, 0xbc, 0xdf, 0xfa, 0xa3, 0xda, 0x9a, 0x95, 0xd4, 0x56, 0x7b, 0x7f, 0x11, 0x00, + 0x00, 0xff, 0xff, 0x77, 0xa5, 0x08, 0x20, 0x0c, 0x05, 0x00, 0x00, } func (m *Paused) Marshal() (dAtA []byte, err error) { @@ -1087,6 +1135,36 @@ func (m *PauserRemoved) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ChannelAllowed) 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 *ChannelAllowed) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ChannelAllowed) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Channel) > 0 { + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Channel))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { offset -= sovEvents(v) base := offset @@ -1274,6 +1352,19 @@ func (m *PauserRemoved) Size() (n int) { return n } +func (m *ChannelAllowed) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Channel) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + func sovEvents(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2532,6 +2623,88 @@ func (m *PauserRemoved) Unmarshal(dAtA []byte) error { } return nil } +func (m *ChannelAllowed) 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 ErrIntOverflowEvents + } + 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: ChannelAllowed: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ChannelAllowed: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channel", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + 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 ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channel = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipEvents(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/aura/types/genesis.go b/x/aura/types/genesis.go index 668763f..e6de7b2 100644 --- a/x/aura/types/genesis.go +++ b/x/aura/types/genesis.go @@ -4,6 +4,7 @@ import ( "fmt" sdk "github.com/cosmos/cosmos-sdk/types" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" "github.com/noble-assets/aura/x/aura/types/blocklist" ) @@ -53,5 +54,11 @@ func (gs *GenesisState) Validate() error { } } + for _, channel := range gs.Channels { + if !channeltypes.IsValidChannelID(channel) { + return fmt.Errorf("invalid channel (%s)", channel) + } + } + return gs.BlocklistState.Validate() } diff --git a/x/aura/types/genesis.pb.go b/x/aura/types/genesis.pb.go index beabcef..b25626c 100644 --- a/x/aura/types/genesis.pb.go +++ b/x/aura/types/genesis.pb.go @@ -40,6 +40,8 @@ type GenesisState struct { Minters []Minter `protobuf:"bytes,6,rep,name=minters,proto3" json:"minters"` // pausers is the list of addresses that can pause USDY. Pausers []string `protobuf:"bytes,7,rep,name=pausers,proto3" json:"pausers,omitempty"` + // channels is the list of allowed IBC channels. + Channels []string `protobuf:"bytes,8,rep,name=channels,proto3" json:"channels,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -124,6 +126,13 @@ func (m *GenesisState) GetPausers() []string { return nil } +func (m *GenesisState) GetChannels() []string { + if m != nil { + return m.Channels + } + return nil +} + type Burner struct { Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` Allowance github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,2,opt,name=allowance,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"allowance"` @@ -223,32 +232,33 @@ func init() { func init() { proto.RegisterFile("aura/v1/genesis.proto", fileDescriptor_dffbbeb9813c8a98) } var fileDescriptor_dffbbeb9813c8a98 = []byte{ - // 392 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x52, 0x4d, 0x8e, 0xd3, 0x30, - 0x14, 0x4e, 0xa6, 0x33, 0x09, 0xf1, 0x0c, 0x8c, 0x14, 0x15, 0x14, 0x75, 0x91, 0x44, 0x45, 0x42, - 0x61, 0x51, 0x47, 0x2d, 0x37, 0x08, 0x0b, 0x84, 0xc4, 0x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 0x45, 0xb7, 0x8b, 0x7b, 0xdc, 0xff, 0x02, 0x4e, 0x14, 0xde, 0x8f, 0x32, 0xb0, 0xa4, 0x60, 0x5d, - 0x31, 0x21, 0x05, 0xd6, 0x3f, 0x82, 0xf7, 0x0a, 0x1f, 0x04, 0x3d, 0xcb, 0xf5, 0x90, 0xad, 0xc6, - 0x6c, 0xc1, 0xb3, 0xc3, 0x51, 0xe4, 0xa4, 0x43, 0x39, 0x6d, 0x90, 0xa5, 0x33, 0x24, 0x87, 0x14, - 0x45, 0x4b, 0x01, 0xd4, 0x07, 0x39, 0xe9, 0x50, 0xba, 0xef, 0x90, 0x43, 0xea, 0x9a, 0x6f, 0x09, - 0xcb, 0xa9, 0x7a, 0xb5, 0x93, 0x60, 0xe9, 0xff, 0xeb, 0x10, 0xbc, 0x28, 0x2b, 0xf1, 0xa5, 0xcb, - 0x70, 0xce, 0xd7, 0x71, 0xce, 0x61, 0xcd, 0xa1, 0x3f, 0x66, 0x50, 0xac, 0x62, 0xf1, 0xad, 0xa1, - 0x80, 0xdf, 0x32, 0x91, 0xfe, 0x35, 0x90, 0x89, 0x7a, 0xc8, 0x87, 0x4a, 0x4c, 0x5e, 0xef, 0x8e, - 0xbe, 0xb9, 0x3f, 0xfa, 0xe6, 0xef, 0xa3, 0x6f, 0x7e, 0x3f, 0xf9, 0xc6, 0xfe, 0xe4, 0x1b, 0x3f, - 0x4f, 0xbe, 0xf1, 0xf9, 0xe5, 0x85, 0x19, 0xe3, 0x59, 0x4d, 0x67, 0x04, 0x80, 0x0a, 0x88, 0xd5, - 0xf2, 0x7d, 0xd5, 0x87, 0xf2, 0xcc, 0x2c, 0xb5, 0x5f, 0xaf, 0xfe, 0x04, 0x00, 0x00, 0xff, 0xff, - 0x35, 0xf1, 0x1f, 0xd2, 0xb8, 0x02, 0x00, 0x00, + // 403 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb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xa8, 0x80, 0x58, 0x3d, 0xcc, 0xaf, 0xfa, 0xa3, 0x32, + 0x33, 0x4b, 0xbd, 0xbd, 0xd7, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x74, 0x9a, 0xdd, 0x9f, 0xd4, + 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -271,6 +281,15 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Channels[iNdEx]) + copy(dAtA[i:], m.Channels[iNdEx]) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Channels[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } if len(m.Pausers) > 0 { for iNdEx := len(m.Pausers) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.Pausers[iNdEx]) @@ -473,6 +492,12 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if len(m.Channels) > 0 { + for _, s := range m.Channels { + l = len(s) + n += 1 + l + sovGenesis(uint64(l)) + } + } return n } @@ -758,6 +783,38 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { } m.Pausers = append(m.Pausers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channels = append(m.Channels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:]) diff --git a/x/aura/types/keys.go b/x/aura/types/keys.go index 99c92e2..1208995 100644 --- a/x/aura/types/keys.go +++ b/x/aura/types/keys.go @@ -13,6 +13,7 @@ var ( BurnerPrefix = []byte("burner/") MinterPrefix = []byte("minter/") PauserPrefix = []byte("pauser/") + ChannelPrefix = []byte("channel/") ) func BurnerKey(address string) []byte { @@ -26,3 +27,7 @@ func MinterKey(address string) []byte { func PauserKey(address string) []byte { return append(PauserPrefix, []byte(address)...) } + +func ChannelKey(channel string) []byte { + return append(ChannelPrefix, []byte(channel)...) +} diff --git a/x/aura/types/msgs.go b/x/aura/types/msgs.go index 7e3ec36..3be4310 100644 --- a/x/aura/types/msgs.go +++ b/x/aura/types/msgs.go @@ -5,6 +5,7 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" + channeltypes "github.com/cosmos/ibc-go/v4/modules/core/04-channel/types" ) // @@ -400,3 +401,32 @@ func (msg *MsgRemovePauser) GetSignBytes() []byte { func (*MsgRemovePauser) Route() string { return ModuleName } func (*MsgRemovePauser) Type() string { return "aura/RemovePauser" } + +// + +var _ legacytx.LegacyMsg = &MsgAllowChannel{} + +func (msg *MsgAllowChannel) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(msg.Signer); err != nil { + return fmt.Errorf("invalid signer address (%s): %w", msg.Signer, err) + } + + if !channeltypes.IsValidChannelID(msg.Channel) { + return fmt.Errorf("invalid channel (%s)", msg.Channel) + } + + return nil +} + +func (msg *MsgAllowChannel) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{signer} +} + +func (msg *MsgAllowChannel) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(msg)) +} + +func (*MsgAllowChannel) Route() string { return ModuleName } + +func (*MsgAllowChannel) Type() string { return "aura/AllowChannel" } diff --git a/x/aura/types/query.pb.go b/x/aura/types/query.pb.go index 6a1a494..745a340 100644 --- a/x/aura/types/query.pb.go +++ b/x/aura/types/query.pb.go @@ -517,6 +517,86 @@ func (m *QueryPausersResponse) GetPausers() []string { return nil } +type QueryChannels struct { +} + +func (m *QueryChannels) Reset() { *m = QueryChannels{} } +func (m *QueryChannels) String() string { return proto.CompactTextString(m) } +func (*QueryChannels) ProtoMessage() {} +func (*QueryChannels) Descriptor() ([]byte, []int) { + return fileDescriptor_2046dd993d22edf0, []int{12} +} +func (m *QueryChannels) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChannels) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChannels.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 *QueryChannels) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChannels.Merge(m, src) +} +func (m *QueryChannels) XXX_Size() int { + return m.Size() +} +func (m *QueryChannels) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChannels.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChannels proto.InternalMessageInfo + +type QueryChannelsResponse struct { + Channels []string `protobuf:"bytes,1,rep,name=channels,proto3" json:"channels,omitempty"` +} + +func (m *QueryChannelsResponse) Reset() { *m = QueryChannelsResponse{} } +func (m *QueryChannelsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryChannelsResponse) ProtoMessage() {} +func (*QueryChannelsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_2046dd993d22edf0, []int{13} +} +func (m *QueryChannelsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryChannelsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryChannelsResponse.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 *QueryChannelsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryChannelsResponse.Merge(m, src) +} +func (m *QueryChannelsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryChannelsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryChannelsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryChannelsResponse proto.InternalMessageInfo + +func (m *QueryChannelsResponse) GetChannels() []string { + if m != nil { + return m.Channels + } + return nil +} + func init() { proto.RegisterType((*QueryDenom)(nil), "aura.v1.QueryDenom") proto.RegisterType((*QueryDenomResponse)(nil), "aura.v1.QueryDenomResponse") @@ -530,44 +610,50 @@ func init() { proto.RegisterType((*QueryMintersResponse)(nil), "aura.v1.QueryMintersResponse") proto.RegisterType((*QueryPausers)(nil), "aura.v1.QueryPausers") proto.RegisterType((*QueryPausersResponse)(nil), "aura.v1.QueryPausersResponse") + proto.RegisterType((*QueryChannels)(nil), "aura.v1.QueryChannels") + proto.RegisterType((*QueryChannelsResponse)(nil), "aura.v1.QueryChannelsResponse") } func init() { proto.RegisterFile("aura/v1/query.proto", fileDescriptor_2046dd993d22edf0) } var fileDescriptor_2046dd993d22edf0 = []byte{ - // 510 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0xcf, 0x6e, 0xd3, 0x40, - 0x10, 0xc6, 0xe3, 0xd2, 0x24, 0x74, 0x9a, 0xfe, 0x61, 0x93, 0x96, 0xc8, 0x14, 0x53, 0x99, 0x4b, - 0x41, 0xaa, 0x4d, 0xcb, 0x1b, 0x04, 0x24, 0x4e, 0xa8, 0xd4, 0x12, 0x07, 0xb8, 0x20, 0x9b, 0xac, - 0x8c, 0xa5, 0x66, 0xd7, 0x78, 0xed, 0x42, 0xaf, 0x3c, 0x01, 0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, 0x9b, 0xe8, 0xc6, 0x56, 0xb4, 0xa0, 0x29, 0xfe, 0x12, 0x4d, 0x49, 0x37, 0xd1, 0x64, - 0x37, 0xd1, 0x8d, 0xbd, 0x68, 0x41, 0xd3, 0x5e, 0x4c, 0x5e, 0x5c, 0xcf, 0x1d, 0xeb, 0x66, 0xee, - 0x58, 0x7f, 0xe7, 0x8e, 0xf5, 0x7d, 0xe1, 0x74, 0x6e, 0x16, 0x4e, 0xe7, 0xf7, 0xc2, 0xe9, 0xbc, - 0x7f, 0x12, 0x27, 0xf9, 0xa7, 0x22, 0xf2, 0x3e, 0xca, 0x99, 0x2f, 0x64, 0x74, 0xc1, 0x8f, 0x43, - 0xa5, 0x78, 0xae, 0x34, 0xe2, 0xab, 0xfe, 0xc9, 0xaf, 0x52, 0xae, 0xa2, 0x1e, 0xfe, 0x5d, 0x3c, - 0xff, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x88, 0xa0, 0x33, 0x6b, 0x99, 0x04, 0x00, 0x00, + // 562 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x6c, 0x94, 0xcf, 0x6e, 0xd3, 0x4e, + 0x10, 0xc7, 0xe3, 0xfe, 0x9a, 0x3f, 0x9d, 0x26, 0x4d, 0xbb, 0xf9, 0xf3, 0x0b, 0xa6, 0x98, 0xca, + 0x5c, 0x0a, 0x52, 0x63, 0xda, 0xbe, 0x41, 0x8a, 0xc4, 0x09, 0x95, 0x46, 0xe2, 0x00, 0x12, 0x42, + 0x4e, 0xb3, 0x72, 0x2d, 0x25, 0xbb, 0xc6, 0xeb, 0x14, 0x7a, 0xe5, 0x09, 0x90, 0x78, 0xa9, 0x1e, + 0x2b, 0x71, 0xe1, 0x84, 0x50, 0xc2, 0x23, 0xf0, 0x00, 0xc8, 0xb3, 0xe3, 0x6d, 0x6c, 0x7c, 0x8a, + 0xe7, 0xb3, 0x3b, 0x9f, 0x19, 0x39, 0x5f, 0x19, 0x3a, 0xfe, 0x22, 0xf6, 0xbd, 0xeb, 0x63, 0xef, + 0xe3, 0x82, 0xc7, 0x37, 0xc3, 0x28, 0x96, 0x89, 0x64, 0xf5, 0x14, 0x0e, 0xaf, 0x8f, 0xed, 0x5e, + 0x76, 0x1a, 0x70, 0xc1, 0x55, 0xa8, 0xf4, 0xb9, 0xdd, 0x0d, 0x64, 0x20, 0xf1, 0xd1, 0x4b, 0x9f, + 0x88, 0xee, 0x07, 0x52, 0x06, 0x33, 0xee, 0xf9, 0x51, 0xe8, 0xf9, 0x42, 0xc8, 0xc4, 0x4f, 0x42, + 0x29, 0xa8, 0xc7, 0x6d, 0x02, 0x5c, 0xa4, 0x23, 0x5e, 0x70, 0x21, 0xe7, 0xee, 0x33, 0x60, 0xf7, + 0xd5, 0x98, 0xab, 0x48, 0x0a, 0xc5, 0x59, 0x17, 0xaa, 0xd3, 0x14, 0x0c, 0xac, 0x03, 0xeb, 0x70, + 0x6b, 0xac, 0x0b, 0xb7, 0x05, 0xdb, 0x78, 0xf7, 0xb5, 0xbf, 0x50, 0x7c, 0xea, 0x1e, 0x41, 0x67, + 0xad, 0x34, 0xbd, 0x7d, 0xa8, 0x45, 0x48, 0xb0, 0xb9, 0x31, 0xa6, 0xca, 0xcc, 0x3d, 0xff, 0x24, + 0x78, 0xec, 0x9e, 0xd3, 0x5c, 0xac, 0xd6, 0xe7, 0xca, 0x14, 0x64, 0x73, 0xb1, 0x60, 0x4f, 0xa0, + 0x15, 0x71, 0x31, 0x0d, 0x45, 0xf0, 0x41, 0x9f, 0x6e, 0xe0, 0x69, 0x93, 0xa0, 0x16, 0xee, 0x40, + 0x13, 0x85, 0xa3, 0x45, 0x2c, 0x78, 0xac, 0xdc, 0x97, 0xd0, 0x5d, 0xaf, 0xcd, 0x08, 0x0f, 0xea, + 0x13, 0x8d, 0x06, 0xd6, 0xc1, 0x7f, 0x87, 0xdb, 0x27, 0xed, 0x21, 0xbd, 0xe4, 0xa1, 0xbe, 0x3a, + 0xda, 0xbc, 0xfd, 0xf9, 0xb8, 0x32, 0xce, 0x6e, 0x19, 0xf1, 0xab, 0x50, 0x24, 0xeb, 0x62, 0xaa, + 0xd7, 0xc5, 0x73, 0x8d, 0xfe, 0x11, 0xeb, 0xab, 0x99, 0x98, 0x6e, 0x19, 0x31, 0xbe, 0xbf, 0x58, + 0xb9, 0xcf, 0x49, 0x4c, 0xb5, 0x11, 0x0f, 0xa0, 0x1e, 0x69, 0x84, 0xe2, 0xad, 0x71, 0x56, 0xba, + 0x6d, 0x68, 0x61, 0xc7, 0xd9, 0x95, 0x2f, 0x04, 0x9f, 0x29, 0xf7, 0x14, 0x7a, 0x39, 0x60, 0x1c, + 0x36, 0x34, 0x2e, 0x89, 0x91, 0xc4, 0xd4, 0x27, 0x7f, 0x36, 0xa1, 0x8a, 0x5d, 0xec, 0x02, 0xaa, + 0x98, 0x03, 0xd6, 0x31, 0xab, 0xdf, 0x87, 0xc3, 0x7e, 0x58, 0x02, 0xb3, 0x01, 0x6e, 0xff, 0xcb, + 0xf7, 0xdf, 0xdf, 0x36, 0x76, 0xd9, 0x8e, 0x97, 0x25, 0x15, 0x33, 0xc3, 0xde, 0x40, 0x4d, 0xe7, + 0x83, 0x75, 0xf3, 0xed, 0x9a, 0xda, 0xfb, 0x65, 0xd4, 0x58, 0xff, 0x47, 0xeb, 0x1e, 0x6b, 0x1b, + 0xab, 0x0e, 0x53, 0xba, 0x29, 0xfe, 0xed, 0xc5, 0x4d, 0x11, 0x16, 0x37, 0xcd, 0x65, 0xac, 0x64, + 0x53, 0x9d, 0xb2, 0xb7, 0x50, 0xa7, 0xac, 0xb0, 0x5e, 0xbe, 0x9f, 0xb0, 0xfd, 0xa8, 0x14, 0x1b, + 0xf1, 0x00, 0xc5, 0x8c, 0xed, 0x1a, 0x31, 0x45, 0x28, 0x55, 0x53, 0x5a, 0x8a, 0x6a, 0xc2, 0x45, + 0x75, 0x21, 0x5b, 0x25, 0x6a, 0x0a, 0x51, 0xaa, 0xa6, 0xbc, 0x14, 0xd5, 0x84, 0x8b, 0xea, 0x42, + 0xba, 0x4a, 0xd4, 0x94, 0x2e, 0xf6, 0x1e, 0x1a, 0x59, 0x8e, 0x58, 0x3f, 0x2f, 0xc9, 0xb8, 0xed, + 0x94, 0x73, 0x63, 0x7f, 0x80, 0xf6, 0x0e, 0xdb, 0x33, 0xf6, 0x2c, 0x76, 0xa3, 0xb3, 0xdb, 0xa5, + 0x63, 0xdd, 0x2d, 0x1d, 0xeb, 0xd7, 0xd2, 0xb1, 0xbe, 0xae, 0x9c, 0xca, 0xdd, 0xca, 0xa9, 0xfc, + 0x58, 0x39, 0x95, 0x77, 0x4f, 0x83, 0x30, 0xb9, 0x5a, 0x4c, 0x86, 0x97, 0x72, 0xee, 0x09, 0x39, + 0x99, 0xf1, 0x23, 0x5f, 0x29, 0x9e, 0x28, 0xed, 0xf8, 0xac, 0x7f, 0x92, 0x9b, 0x88, 0xab, 0x49, + 0x0d, 0xbf, 0x69, 0xa7, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xee, 0x6f, 0x88, 0xb4, 0x3e, 0x05, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -588,6 +674,7 @@ type QueryClient interface { Burners(ctx context.Context, in *QueryBurners, opts ...grpc.CallOption) (*QueryBurnersResponse, error) Minters(ctx context.Context, in *QueryMinters, opts ...grpc.CallOption) (*QueryMintersResponse, error) Pausers(ctx context.Context, in *QueryPausers, opts ...grpc.CallOption) (*QueryPausersResponse, error) + Channels(ctx context.Context, in *QueryChannels, opts ...grpc.CallOption) (*QueryChannelsResponse, error) } type queryClient struct { @@ -652,6 +739,15 @@ func (c *queryClient) Pausers(ctx context.Context, in *QueryPausers, opts ...grp return out, nil } +func (c *queryClient) Channels(ctx context.Context, in *QueryChannels, opts ...grpc.CallOption) (*QueryChannelsResponse, error) { + out := new(QueryChannelsResponse) + err := c.cc.Invoke(ctx, "/aura.v1.Query/Channels", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { Denom(context.Context, *QueryDenom) (*QueryDenomResponse, error) @@ -660,6 +756,7 @@ type QueryServer interface { Burners(context.Context, *QueryBurners) (*QueryBurnersResponse, error) Minters(context.Context, *QueryMinters) (*QueryMintersResponse, error) Pausers(context.Context, *QueryPausers) (*QueryPausersResponse, error) + Channels(context.Context, *QueryChannels) (*QueryChannelsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -684,6 +781,9 @@ func (*UnimplementedQueryServer) Minters(ctx context.Context, req *QueryMinters) func (*UnimplementedQueryServer) Pausers(ctx context.Context, req *QueryPausers) (*QueryPausersResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Pausers not implemented") } +func (*UnimplementedQueryServer) Channels(ctx context.Context, req *QueryChannels) (*QueryChannelsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Channels not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -797,6 +897,24 @@ func _Query_Pausers_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Query_Channels_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryChannels) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Channels(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/aura.v1.Query/Channels", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Channels(ctx, req.(*QueryChannels)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "aura.v1.Query", HandlerType: (*QueryServer)(nil), @@ -825,6 +943,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "Pausers", Handler: _Query_Pausers_Handler, }, + { + MethodName: "Channels", + Handler: _Query_Channels_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "aura/v1/query.proto", @@ -1174,6 +1296,61 @@ func (m *QueryPausersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *QueryChannels) 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 *QueryChannels) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChannels) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryChannelsResponse) 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 *QueryChannelsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryChannelsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Channels) > 0 { + for iNdEx := len(m.Channels) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Channels[iNdEx]) + copy(dAtA[i:], m.Channels[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Channels[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1326,6 +1503,30 @@ func (m *QueryPausersResponse) Size() (n int) { return n } +func (m *QueryChannels) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryChannelsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Channels) > 0 { + for _, s := range m.Channels { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2148,6 +2349,138 @@ func (m *QueryPausersResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryChannels) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryChannels: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChannels: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryChannelsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryChannelsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryChannelsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Channels", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Channels = append(m.Channels, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/aura/types/query.pb.gw.go b/x/aura/types/query.pb.gw.go index 2dbebac..a144313 100644 --- a/x/aura/types/query.pb.gw.go +++ b/x/aura/types/query.pb.gw.go @@ -141,6 +141,24 @@ func local_request_Query_Pausers_0(ctx context.Context, marshaler runtime.Marsha } +func request_Query_Channels_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChannels + var metadata runtime.ServerMetadata + + msg, err := client.Channels(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Channels_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryChannels + var metadata runtime.ServerMetadata + + msg, err := server.Channels(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. @@ -285,6 +303,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_Channels_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_Channels_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_Channels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -446,6 +487,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_Channels_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_Channels_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_Channels_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -461,6 +522,8 @@ var ( pattern_Query_Minters_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"aura", "v1", "minters"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_Pausers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"aura", "v1", "pausers"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Channels_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"aura", "v1", "channels"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -475,4 +538,6 @@ var ( forward_Query_Minters_0 = runtime.ForwardResponseMessage forward_Query_Pausers_0 = runtime.ForwardResponseMessage + + forward_Query_Channels_0 = runtime.ForwardResponseMessage ) diff --git a/x/aura/types/tx.pb.go b/x/aura/types/tx.pb.go index 4d4bbf3..9fe0422 100644 --- a/x/aura/types/tx.pb.go +++ b/x/aura/types/tx.pb.go @@ -1068,6 +1068,80 @@ func (m *MsgRemovePauserResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgRemovePauserResponse proto.InternalMessageInfo +type MsgAllowChannel struct { + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Channel string `protobuf:"bytes,2,opt,name=channel,proto3" json:"channel,omitempty"` +} + +func (m *MsgAllowChannel) Reset() { *m = MsgAllowChannel{} } +func (m *MsgAllowChannel) String() string { return proto.CompactTextString(m) } +func (*MsgAllowChannel) ProtoMessage() {} +func (*MsgAllowChannel) Descriptor() ([]byte, []int) { + return fileDescriptor_72e81433c42c397f, []int{28} +} +func (m *MsgAllowChannel) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowChannel) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowChannel.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 *MsgAllowChannel) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowChannel.Merge(m, src) +} +func (m *MsgAllowChannel) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowChannel) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowChannel.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowChannel proto.InternalMessageInfo + +type MsgAllowChannelResponse struct { +} + +func (m *MsgAllowChannelResponse) Reset() { *m = MsgAllowChannelResponse{} } +func (m *MsgAllowChannelResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAllowChannelResponse) ProtoMessage() {} +func (*MsgAllowChannelResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_72e81433c42c397f, []int{29} +} +func (m *MsgAllowChannelResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAllowChannelResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAllowChannelResponse.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 *MsgAllowChannelResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAllowChannelResponse.Merge(m, src) +} +func (m *MsgAllowChannelResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAllowChannelResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAllowChannelResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAllowChannelResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgBurn)(nil), "aura.v1.MsgBurn") proto.RegisterType((*MsgBurnResponse)(nil), "aura.v1.MsgBurnResponse") @@ -1097,60 +1171,64 @@ func init() { proto.RegisterType((*MsgAddPauserResponse)(nil), "aura.v1.MsgAddPauserResponse") proto.RegisterType((*MsgRemovePauser)(nil), "aura.v1.MsgRemovePauser") proto.RegisterType((*MsgRemovePauserResponse)(nil), "aura.v1.MsgRemovePauserResponse") + proto.RegisterType((*MsgAllowChannel)(nil), "aura.v1.MsgAllowChannel") + proto.RegisterType((*MsgAllowChannelResponse)(nil), "aura.v1.MsgAllowChannelResponse") } func init() { proto.RegisterFile("aura/v1/tx.proto", fileDescriptor_72e81433c42c397f) } var fileDescriptor_72e81433c42c397f = []byte{ - // 763 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0xee, 0x02, 0xb6, 0xf4, 0x85, 0x08, 0xac, 0x80, 0x65, 0x81, 0x6d, 0x83, 0x91, 0x68, 0x22, - 0xdb, 0x80, 0xd1, 0x83, 0x9e, 0xc0, 0xc4, 0xf8, 0x6b, 0xa3, 0x29, 0x72, 0xd0, 0x98, 0x98, 0x6d, - 0x19, 0x96, 0x46, 0x3a, 0xd3, 0xec, 0x6c, 0x29, 0x9e, 0x3d, 0xe8, 0xd1, 0x93, 0x57, 0xf9, 0x73, - 0x38, 0x72, 0x34, 0x1e, 0x88, 0x81, 0x8b, 0x7f, 0x83, 0x27, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, - 0xbb, 0x95, 0x60, 0x30, 0x9e, 0xda, 0x7d, 0xdf, 0xbc, 0xef, 0x7d, 0xdf, 0xbc, 0xee, 0x7b, 0x85, - 0x09, 0xa7, 0xe7, 0x39, 0xf5, 0xbd, 0x95, 0xba, 0xbf, 0x6f, 0x75, 0x3d, 0xe2, 0x13, 0xbd, 0x14, - 0x44, 0xac, 0xbd, 0x15, 0x63, 0xca, 0x25, 0x2e, 0x61, 0xb1, 0x7a, 0xf0, 0x2d, 0x84, 0x17, 0x3f, - 0x6a,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, 0x59, 0xcd, 0x08, 0x99, 0x32, - 0x9b, 0xf1, 0xd7, 0x45, 0xe4, 0x66, 0x24, 0xeb, 0xac, 0xfe, 0x2a, 0xc1, 0xb0, 0x4d, 0x5d, 0x7d, - 0x15, 0x46, 0xd8, 0x42, 0x9c, 0xb0, 0xf8, 0xf2, 0xb4, 0xf8, 0x66, 0x32, 0x2a, 0x6a, 0x24, 0xca, - 0x0d, 0x72, 0xd8, 0x9e, 0x4a, 0xe4, 0x04, 0x91, 0x64, 0x8e, 0xbc, 0x46, 0xf4, 0x3b, 0x70, 0x29, - 0xdc, 0x21, 0x93, 0xf2, 0x11, 0x16, 0x32, 0x66, 0x53, 0x21, 0x91, 0x76, 0x1f, 0x4a, 0xd1, 0xe2, - 0xb8, 0x22, 0x9f, 0xe2, 0x41, 0x63, 0x2e, 0x23, 0x28, 0x92, 0x5f, 0xc1, 0x64, 0x7a, 0x5f, 0x2c, - 0xc8, 0x19, 0x29, 0xd8, 0xb8, 0x3e, 0x10, 0x16, 0xd4, 0x1b, 0x30, 0xae, 0xee, 0x84, 0x84, 0x14, - 0x05, 0x34, 0xae, 0x0d, 0x00, 0x05, 0xe9, 0x1a, 0x94, 0xe3, 0x8d, 0x30, 0x9d, 0xc8, 0x88, 0xc2, - 0xc6, 0x42, 0x66, 0x58, 0x50, 0x3c, 0x81, 0xb1, 0xc4, 0x90, 0x4e, 0x34, 0x44, 0x46, 0x8c, 0x5a, - 0x1e, 0x22, 0xb8, 0xde, 0x80, 0x9e, 0x31, 0x87, 0x4d, 0x39, 0x2f, 0x8d, 0x1b, 0x4b, 0x83, 0x71, - 0xc5, 0x2c, 0x9f, 0x37, 0xaa, 0xd9, 0x30, 0x9c, 0x32, 0x9b, 0x1c, 0x28, 0xb1, 0x59, 0xce, 0x92, - 0x61, 0x96, 0x13, 0xd5, 0xf2, 0x10, 0xc5, 0xac, 0x3a, 0x98, 0x54, 0xb3, 0x0a, 0x9e, 0x32, 0x9b, - 0x33, 0x37, 0xb8, 0x59, 0xfe, 0x3e, 0xab, 0x66, 0xc3, 0x70, 0xca, 0x6c, 0xf2, 0x85, 0x8d, 0xcd, - 0x72, 0x96, 0x0c, 0xb3, 0x9c, 0xa8, 0x96, 0x87, 0x44, 0x5c, 0xeb, 0x0f, 0x0e, 0x4f, 0x4c, 0xed, - 0xe8, 0xc4, 0xd4, 0x7e, 0x9c, 0x98, 0xda, 0xe7, 0x53, 0xb3, 0x70, 0x74, 0x6a, 0x16, 0xbe, 0x9d, - 0x9a, 0x85, 0xd7, 0x37, 0xa5, 0xf1, 0x89, 0x49, 0x73, 0x17, 0x2d, 0x3b, 0x94, 0x22, 0x9f, 0xd6, - 0xd9, 0x9f, 0xed, 0xfd, 0xf0, 0x83, 0x4d, 0xd1, 0x66, 0x91, 0xfd, 0xab, 0xbe, 0xfd, 0x3b, 0x00, - 0x00, 0xff, 0xff, 0xd9, 0x1d, 0xd2, 0x17, 0x88, 0x0b, 0x00, 0x00, + // 800 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x4f, 0xd4, 0x4e, + 0x14, 0xdf, 0x02, 0xdf, 0xfd, 0xf1, 0x42, 0xbe, 0x40, 0x05, 0x5c, 0x0a, 0x74, 0x37, 0x18, 0x89, + 0x26, 0xd2, 0x0d, 0x18, 0x3d, 0xe8, 0x09, 0x48, 0x8c, 0xbf, 0x1a, 0xcd, 0x22, 0x07, 0x8d, 0x89, + 0xe9, 0x2e, 0x43, 0xd9, 0xb8, 0x3b, 0xb3, 0xe9, 0x74, 0x59, 0x3c, 0x7b, 0xd0, 0xa3, 0x27, 0xaf, + 0xf2, 0xd7, 0x18, 0x8e, 0x1c, 0x8d, 0x07, 0x62, 0xe0, 0xe2, 0x9f, 0x61, 0x3a, 0x9d, 0xce, 0x4e, + 0xa7, 0xed, 0x4a, 0x30, 0x18, 0x4f, 0xdb, 0x79, 0x3f, 0x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 0x51, 0xb4, 0x40, 0xb0, 0x00, 0x6c, 0xea, 0x6e, 0xe3, 0xee, 0x39, 0x31, 0xa6, 0x41, 0x1f, 0xc4, + 0x0b, 0x94, 0x6d, 0x98, 0xb6, 0xa9, 0xfb, 0xc2, 0x73, 0x30, 0xdd, 0x45, 0xde, 0xb3, 0x3e, 0x46, + 0x1e, 0xdd, 0x6b, 0x75, 0x33, 0x2f, 0x6b, 0x1e, 0x4a, 0x18, 0xf5, 0xdf, 0x90, 0x20, 0x90, 0xdf, + 0x59, 0x11, 0xa3, 0x3e, 0x4b, 0x94, 0x8a, 0x99, 0xb0, 0x90, 0x06, 0x2b, 0xca, 0xde, 0x65, 0x64, + 0xd6, 0x9b, 0x4d, 0xd4, 0xf5, 0x7f, 0x5b, 0x54, 0xc2, 0x5d, 0x00, 0x23, 0x99, 0x27, 0x50, 0x3f, + 0x6b, 0x30, 0x1e, 0xb8, 0x77, 0x76, 0x82, 0x97, 0x00, 0x79, 0x99, 0x2a, 0x66, 0x21, 0xdf, 0x60, + 0x11, 0x5c, 0x02, 0x3f, 0xe9, 0x4f, 0xa1, 0xe4, 0xb4, 0xdb, 0xa4, 0xef, 0xe0, 0x26, 0xba, 0x60, + 0xf7, 0x07, 0x00, 0x12, 0xed, 0x59, 0x76, 0xcb, 0x82, 0x97, 0x20, 0xfc, 0x84, 0xbd, 0x18, 0x75, + 0xd4, 0x21, 0xfb, 0xe8, 0x62, 0x94, 0xa5, 0x22, 0x73, 0x70, 0x55, 0x01, 0x13, 0x75, 0xbe, 0x68, + 0x30, 0x63, 0x53, 0x77, 0x0b, 0xf9, 0xa1, 0x63, 0x3d, 0xe2, 0xf8, 0xcf, 0xdc, 0x50, 0x05, 0x16, + 0x53, 0x09, 0xa6, 0xf4, 0x36, 0xf8, 0x1f, 0x0d, 0xbf, 0xa8, 0x0e, 0x8b, 0x88, 0x98, 0x87, 0xa7, + 0xcb, 0xef, 0x6d, 0xc8, 0x2b, 0xb5, 0xb7, 0x17, 0xa3, 0x9c, 0xd1, 0x5b, 0xa5, 0xce, 0xa0, 0xb7, + 0xa1, 0xe3, 0x5c, 0xbd, 0xfd, 0xab, 0x37, 0x24, 0x7a, 0xab, 0x10, 0x14, 0x12, 0x1e, 0x46, 0xad, + 0x65, 0x13, 0x6e, 0xe8, 0x3d, 0xb1, 0xe9, 0x25, 0x88, 0x87, 0xa7, 0xb4, 0x66, 0x84, 0x48, 0xa9, + 0xcd, 0xf8, 0xe3, 0x22, 0x72, 0x33, 0x94, 0x3a, 0x36, 0xab, 0xc3, 0x14, 0x6e, 0xee, 0x39, 0x18, + 0xa3, 0x76, 0x66, 0x9d, 0x32, 0x14, 0x9a, 0x61, 0x08, 0x2f, 0x14, 0x1d, 0x13, 0x95, 0x64, 0xb8, + 0xa8, 0xd2, 0xda, 0xd7, 0x22, 0x8c, 0xda, 0xd4, 0xd5, 0xd7, 0x60, 0x8c, 0xad, 0xde, 0x49, 0x8b, + 0xaf, 0x69, 0x8b, 0xef, 0x40, 0xa3, 0xac, 0x5a, 0xa2, 0xdc, 0x20, 0x87, 0x6d, 0xc4, 0x58, 0x4e, + 0x60, 0x89, 0xe7, 0xc8, 0x0b, 0x4b, 0xbf, 0x03, 0xff, 0x85, 0xdb, 0x6a, 0x4a, 0x0e, 0x61, 0x26, + 0x63, 0x2e, 0x61, 0x12, 0x69, 0xf7, 0xa1, 0x10, 0xad, 0xa8, 0x2b, 0x72, 0x14, 0x37, 0x1a, 0xf3, + 0x29, 0x46, 0x91, 0xfc, 0x12, 0xa6, 0x92, 0x9b, 0x69, 0x51, 0xce, 0x48, 0xb8, 0x8d, 0xeb, 0x43, + 0xdd, 0x02, 0x7a, 0x0b, 0x26, 0xd4, 0xed, 0x13, 0xa3, 0xa2, 0x38, 0x8d, 0x6b, 0x43, 0x9c, 0x02, + 0x74, 0x1d, 0x4a, 0x83, 0xdd, 0x33, 0x13, 0xcb, 0x88, 0xcc, 0xc6, 0x62, 0xaa, 0x59, 0x40, 0x3c, + 0x86, 0xf1, 0xd8, 0x3a, 0x88, 0x35, 0x44, 0xf6, 0x18, 0xd5, 0x2c, 0x8f, 0xc0, 0x7a, 0x0d, 0x7a, + 0xca, 0xc4, 0x37, 0xe5, 0xbc, 0xa4, 0xdf, 0x58, 0x1e, 0xee, 0x57, 0xc4, 0xf2, 0xc9, 0xa6, 0x8a, + 0x0d, 0xcd, 0x09, 0xb1, 0xf1, 0xd1, 0x35, 0x10, 0xcb, 0x51, 0x52, 0xc4, 0x72, 0xa0, 0x6a, 0x96, + 0x47, 0x11, 0xab, 0x8e, 0x40, 0x55, 0xac, 0xe2, 0x4f, 0x88, 0xcd, 0x98, 0x50, 0x5c, 0x2c, 0x9f, + 0x1c, 0xaa, 0xd8, 0xd0, 0x9c, 0x10, 0x1b, 0x1f, 0x0d, 0x03, 0xb1, 0x1c, 0x25, 0x45, 0x2c, 0x07, + 0xaa, 0x66, 0x79, 0x64, 0xac, 0xd8, 0x8c, 0x89, 0x61, 0xc9, 0x9e, 0x38, 0x56, 0xda, 0x20, 0xd9, + 0xd8, 0x3c, 0x3a, 0x35, 0xb5, 0xe3, 0x53, 0x53, 0xfb, 0x71, 0x6a, 0x6a, 0x9f, 0xce, 0xcc, 0xdc, + 0xf1, 0x99, 0x99, 0xfb, 0x76, 0x66, 0xe6, 0x5e, 0xdd, 0x94, 0x86, 0x3e, 0x26, 0x8d, 0x36, 0x5a, + 0x71, 0x28, 0x45, 0x3e, 0xad, 0xb1, 0x4f, 0x84, 0x83, 0xf0, 0x87, 0xcd, 0xfe, 0x46, 0x9e, 0x7d, + 0x0b, 0xdc, 0xfe, 0x15, 0x00, 0x00, 0xff, 0xff, 0x32, 0xd4, 0xc3, 0x2b, 0x3e, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1179,6 +1257,7 @@ type MsgClient interface { SetMinterAllowance(ctx context.Context, in *MsgSetMinterAllowance, opts ...grpc.CallOption) (*MsgSetMinterAllowanceResponse, error) AddPauser(ctx context.Context, in *MsgAddPauser, opts ...grpc.CallOption) (*MsgAddPauserResponse, error) RemovePauser(ctx context.Context, in *MsgRemovePauser, opts ...grpc.CallOption) (*MsgRemovePauserResponse, error) + AllowChannel(ctx context.Context, in *MsgAllowChannel, opts ...grpc.CallOption) (*MsgAllowChannelResponse, error) } type msgClient struct { @@ -1315,6 +1394,15 @@ func (c *msgClient) RemovePauser(ctx context.Context, in *MsgRemovePauser, opts return out, nil } +func (c *msgClient) AllowChannel(ctx context.Context, in *MsgAllowChannel, opts ...grpc.CallOption) (*MsgAllowChannelResponse, error) { + out := new(MsgAllowChannelResponse) + err := c.cc.Invoke(ctx, "/aura.v1.Msg/AllowChannel", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { Burn(context.Context, *MsgBurn) (*MsgBurnResponse, error) @@ -1331,6 +1419,7 @@ type MsgServer interface { SetMinterAllowance(context.Context, *MsgSetMinterAllowance) (*MsgSetMinterAllowanceResponse, error) AddPauser(context.Context, *MsgAddPauser) (*MsgAddPauserResponse, error) RemovePauser(context.Context, *MsgRemovePauser) (*MsgRemovePauserResponse, error) + AllowChannel(context.Context, *MsgAllowChannel) (*MsgAllowChannelResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1379,6 +1468,9 @@ func (*UnimplementedMsgServer) AddPauser(ctx context.Context, req *MsgAddPauser) func (*UnimplementedMsgServer) RemovePauser(ctx context.Context, req *MsgRemovePauser) (*MsgRemovePauserResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method RemovePauser not implemented") } +func (*UnimplementedMsgServer) AllowChannel(ctx context.Context, req *MsgAllowChannel) (*MsgAllowChannelResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllowChannel not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1636,6 +1728,24 @@ func _Msg_RemovePauser_Handler(srv interface{}, ctx context.Context, dec func(in return interceptor(ctx, in, info, handler) } +func _Msg_AllowChannel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAllowChannel) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AllowChannel(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/aura.v1.Msg/AllowChannel", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AllowChannel(ctx, req.(*MsgAllowChannel)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "aura.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -1696,6 +1806,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "RemovePauser", Handler: _Msg_RemovePauser_Handler, }, + { + MethodName: "AllowChannel", + Handler: _Msg_AllowChannel_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "aura/v1/tx.proto", @@ -2580,6 +2694,66 @@ func (m *MsgRemovePauserResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } +func (m *MsgAllowChannel) 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 *MsgAllowChannel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowChannel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Channel) > 0 { + i -= len(m.Channel) + copy(dAtA[i:], m.Channel) + i = encodeVarintTx(dAtA, i, uint64(len(m.Channel))) + 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 *MsgAllowChannelResponse) 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 *MsgAllowChannelResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAllowChannelResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2955,6 +3129,32 @@ func (m *MsgRemovePauserResponse) Size() (n int) { return n } +func (m *MsgAllowChannel) 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.Channel) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAllowChannelResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func sovTx(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -5365,6 +5565,170 @@ func (m *MsgRemovePauserResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgAllowChannel) 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: MsgAllowChannel: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowChannel: 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 Channel", 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.Channel = 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 *MsgAllowChannelResponse) 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: MsgAllowChannelResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAllowChannelResponse: 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 skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0