diff --git a/docs/core/proto-docs.md b/docs/core/proto-docs.md index 107200e039..6626ec1c6b 100644 --- a/docs/core/proto-docs.md +++ b/docs/core/proto-docs.md @@ -649,6 +649,47 @@ - [Msg](#finschia.or.da.v1.Msg) +- [finschia/or/rollup/v1/rollup.proto](#finschia/or/rollup/v1/rollup.proto) + - [Deposit](#finschia.or.rollup.v1.Deposit) + - [Rollup](#finschia.or.rollup.v1.Rollup) + - [Sequencer](#finschia.or.rollup.v1.Sequencer) + - [Sequencers](#finschia.or.rollup.v1.Sequencers) + - [SequencersByRollup](#finschia.or.rollup.v1.SequencersByRollup) + +- [finschia/or/rollup/v1/params.proto](#finschia/or/rollup/v1/params.proto) + - [Params](#finschia.or.rollup.v1.Params) + +- [finschia/or/rollup/v1/genesis.proto](#finschia/or/rollup/v1/genesis.proto) + - [GenesisState](#finschia.or.rollup.v1.GenesisState) + +- [finschia/or/rollup/v1/query.proto](#finschia/or/rollup/v1/query.proto) + - [QueryAllRollupRequest](#finschia.or.rollup.v1.QueryAllRollupRequest) + - [QueryAllRollupResponse](#finschia.or.rollup.v1.QueryAllRollupResponse) + - [QueryDepositRequest](#finschia.or.rollup.v1.QueryDepositRequest) + - [QueryDepositResponse](#finschia.or.rollup.v1.QueryDepositResponse) + - [QueryRollupRequest](#finschia.or.rollup.v1.QueryRollupRequest) + - [QueryRollupResponse](#finschia.or.rollup.v1.QueryRollupResponse) + - [QuerySequencerRequest](#finschia.or.rollup.v1.QuerySequencerRequest) + - [QuerySequencerResponse](#finschia.or.rollup.v1.QuerySequencerResponse) + - [QuerySequencersByRollupRequest](#finschia.or.rollup.v1.QuerySequencersByRollupRequest) + - [QuerySequencersByRollupResponse](#finschia.or.rollup.v1.QuerySequencersByRollupResponse) + + - [Query](#finschia.or.rollup.v1.Query) + +- [finschia/or/rollup/v1/tx.proto](#finschia/or/rollup/v1/tx.proto) + - [MsgCreateRollup](#finschia.or.rollup.v1.MsgCreateRollup) + - [MsgCreateRollupResponse](#finschia.or.rollup.v1.MsgCreateRollupResponse) + - [MsgDeposit](#finschia.or.rollup.v1.MsgDeposit) + - [MsgDepositResponse](#finschia.or.rollup.v1.MsgDepositResponse) + - [MsgRegisterSequencer](#finschia.or.rollup.v1.MsgRegisterSequencer) + - [MsgRegisterSequencerResponse](#finschia.or.rollup.v1.MsgRegisterSequencerResponse) + - [MsgRemoveSequencer](#finschia.or.rollup.v1.MsgRemoveSequencer) + - [MsgRemoveSequencerResponse](#finschia.or.rollup.v1.MsgRemoveSequencerResponse) + - [MsgWithdraw](#finschia.or.rollup.v1.MsgWithdraw) + - [MsgWithdrawResponse](#finschia.or.rollup.v1.MsgWithdrawResponse) + + - [Msg](#finschia.or.rollup.v1.Msg) + - [lbm/bankplus/v1/bankplus.proto](#lbm/bankplus/v1/bankplus.proto) - [InactiveAddr](#lbm.bankplus.v1.InactiveAddr) @@ -9627,6 +9668,505 @@ Msg defines the Msg service. + +

Top

+ +## finschia/or/rollup/v1/rollup.proto + + + + + +### Deposit + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `sequencer_address` | [string](#string) | | | +| `value` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### Rollup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `creator` | [string](#string) | | | +| `permissioned_addresses` | [Sequencers](#finschia.or.rollup.v1.Sequencers) | | | + + + + + + + + +### Sequencer + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequencer_address` | [string](#string) | | | +| `pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `rollup_name` | [string](#string) | | | + + + + + + + + +### Sequencers + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `addresses` | [string](#string) | repeated | | + + + + + + + + +### SequencersByRollup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `sequencers` | [Sequencer](#finschia.or.rollup.v1.Sequencer) | repeated | | + + + + + + + + + + + + + + + + +

Top

+ +## finschia/or/rollup/v1/params.proto + + + + + +### Params +Params defines the parameters for the module. + + + + + + + + + + + + + + + + +

Top

+ +## finschia/or/rollup/v1/genesis.proto + + + + + +### GenesisState + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_list` | [Rollup](#finschia.or.rollup.v1.Rollup) | repeated | | +| `sequencer_list` | [Sequencer](#finschia.or.rollup.v1.Sequencer) | repeated | | +| `params` | [Params](#finschia.or.rollup.v1.Params) | | | + + + + + + + + + + + + + + + + +

Top

+ +## finschia/or/rollup/v1/query.proto + + + + + +### QueryAllRollupRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | | + + + + + + + + +### QueryAllRollupResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup` | [Rollup](#finschia.or.rollup.v1.Rollup) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | | + + + + + + + + +### QueryDepositRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `sequencer_address` | [string](#string) | | | + + + + + + + + +### QueryDepositResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `deposit` | [Deposit](#finschia.or.rollup.v1.Deposit) | | | + + + + + + + + +### QueryRollupRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | + + + + + + + + +### QueryRollupResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup` | [Rollup](#finschia.or.rollup.v1.Rollup) | | | + + + + + + + + +### QuerySequencerRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequencer_address` | [string](#string) | | | + + + + + + + + +### QuerySequencerResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sequencer` | [Sequencer](#finschia.or.rollup.v1.Sequencer) | | | + + + + + + + + +### QuerySequencersByRollupRequest + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | + + + + + + + + +### QuerySequencersByRollupResponse + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `sequencer_list` | [Sequencer](#finschia.or.rollup.v1.Sequencer) | repeated | | + + + + + + + + + + + + + + +### Query + + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Rollup` | [QueryRollupRequest](#finschia.or.rollup.v1.QueryRollupRequest) | [QueryRollupResponse](#finschia.or.rollup.v1.QueryRollupResponse) | | GET|/finschia/or/rollup/v1/rollup/{rollup_name}| +| `AllRollup` | [QueryAllRollupRequest](#finschia.or.rollup.v1.QueryAllRollupRequest) | [QueryAllRollupResponse](#finschia.or.rollup.v1.QueryAllRollupResponse) | | GET|/finschia/or/rollup/v1/rollup/rollup| +| `Sequencer` | [QuerySequencerRequest](#finschia.or.rollup.v1.QuerySequencerRequest) | [QuerySequencerResponse](#finschia.or.rollup.v1.QuerySequencerResponse) | | GET|/finschia/or/rollup/v1/rollup/sequencer/{sequencer_address}| +| `SequencersByRollup` | [QuerySequencersByRollupRequest](#finschia.or.rollup.v1.QuerySequencersByRollupRequest) | [QuerySequencersByRollupResponse](#finschia.or.rollup.v1.QuerySequencersByRollupResponse) | | GET|/finschia/or/rollup/v1/rollup/sequencers_by_rollup/{rollup_name}| +| `Deposit` | [QueryDepositRequest](#finschia.or.rollup.v1.QueryDepositRequest) | [QueryDepositResponse](#finschia.or.rollup.v1.QueryDepositResponse) | | GET|/finschia/or/rollup/v1/rollup/deposit/{rollup_name}/{sequencer_address}| + + + + + + +

Top

+ +## finschia/or/rollup/v1/tx.proto + + + + + +### MsgCreateRollup + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `creator` | [string](#string) | | | +| `permissioned_addresses` | [Sequencers](#finschia.or.rollup.v1.Sequencers) | | | + + + + + + + + +### MsgCreateRollupResponse + + + + + + + + + +### MsgDeposit + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `sequencer_address` | [string](#string) | | | +| `value` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### MsgDepositResponse + + + + + + + + + +### MsgRegisterSequencer + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `creator` | [string](#string) | | | +| `pubkey` | [google.protobuf.Any](#google.protobuf.Any) | | | +| `rollup_name` | [string](#string) | | | +| `value` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### MsgRegisterSequencerResponse + + + + + + + + + +### MsgRemoveSequencer + + + + + + + + + +### MsgRemoveSequencerResponse + + + + + + + + + +### MsgWithdraw + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `rollup_name` | [string](#string) | | | +| `sequencer_address` | [string](#string) | | | +| `value` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### MsgWithdrawResponse + + + + + + + + + + + + + + + +### Msg + + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `CreateRollup` | [MsgCreateRollup](#finschia.or.rollup.v1.MsgCreateRollup) | [MsgCreateRollupResponse](#finschia.or.rollup.v1.MsgCreateRollupResponse) | | | +| `RegisterSequencer` | [MsgRegisterSequencer](#finschia.or.rollup.v1.MsgRegisterSequencer) | [MsgRegisterSequencerResponse](#finschia.or.rollup.v1.MsgRegisterSequencerResponse) | | | +| `Deposit` | [MsgDeposit](#finschia.or.rollup.v1.MsgDeposit) | [MsgDepositResponse](#finschia.or.rollup.v1.MsgDepositResponse) | | | +| `Withdraw` | [MsgWithdraw](#finschia.or.rollup.v1.MsgWithdraw) | [MsgWithdrawResponse](#finschia.or.rollup.v1.MsgWithdrawResponse) | | | +| `RemoveSequencer` | [MsgRemoveSequencer](#finschia.or.rollup.v1.MsgRemoveSequencer) | [MsgRemoveSequencerResponse](#finschia.or.rollup.v1.MsgRemoveSequencerResponse) | | | + + + + +

Top

diff --git a/proto/finschia/or/rollup/v1/genesis.proto b/proto/finschia/or/rollup/v1/genesis.proto new file mode 100644 index 0000000000..89ef91b0c4 --- /dev/null +++ b/proto/finschia/or/rollup/v1/genesis.proto @@ -0,0 +1,15 @@ +syntax = "proto3"; +package finschia.or.rollup.v1; + +import "gogoproto/gogo.proto"; + +import "finschia/or/rollup/v1/rollup.proto"; +import "finschia/or/rollup/v1/params.proto"; + +option go_package = "github.com/Finschia/finschia-sdk/x/or/rollup/types"; + +message GenesisState { + repeated Rollup rollup_list = 1 [(gogoproto.nullable) = false]; + repeated Sequencer sequencer_list = 2 [(gogoproto.nullable) = false]; + Params params = 3 [(gogoproto.nullable) = false]; +} diff --git a/proto/finschia/or/rollup/v1/params.proto b/proto/finschia/or/rollup/v1/params.proto new file mode 100644 index 0000000000..7ba8543b48 --- /dev/null +++ b/proto/finschia/or/rollup/v1/params.proto @@ -0,0 +1,12 @@ +syntax = "proto3"; +package finschia.or.rollup.v1; + +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Finschia/finschia-sdk/x/or/rollup/types"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.goproto_stringer) = false; + +} diff --git a/proto/finschia/or/rollup/v1/query.proto b/proto/finschia/or/rollup/v1/query.proto new file mode 100644 index 0000000000..2e7637a546 --- /dev/null +++ b/proto/finschia/or/rollup/v1/query.proto @@ -0,0 +1,78 @@ +syntax = "proto3"; +package finschia.or.rollup.v1; + +import "google/api/annotations.proto"; + +import "finschia/or/rollup/v1/rollup.proto"; + +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Finschia/finschia-sdk/x/or/rollup/types"; + +service Query { + rpc Rollup(QueryRollupRequest) returns (QueryRollupResponse) { + option (google.api.http).get = "/finschia/or/rollup/v1/rollup/{rollup_name}"; + } + + rpc AllRollup(QueryAllRollupRequest) returns (QueryAllRollupResponse) { + option (google.api.http).get = "/finschia/or/rollup/v1/rollup/rollup"; + } + + rpc Sequencer(QuerySequencerRequest) returns (QuerySequencerResponse) { + option (google.api.http).get = "/finschia/or/rollup/v1/rollup/sequencer/{sequencer_address}"; + } + + rpc SequencersByRollup(QuerySequencersByRollupRequest) returns (QuerySequencersByRollupResponse) { + option (google.api.http).get = "/finschia/or/rollup/v1/rollup/sequencers_by_rollup/{rollup_name}"; + } + + rpc Deposit(QueryDepositRequest) returns (QueryDepositResponse) { + option (google.api.http).get = "/finschia/or/rollup/v1/rollup/deposit/{rollup_name}/{sequencer_address}"; + } +} + +message QueryRollupRequest { + string rollup_name = 1; +} + +message QueryAllRollupRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QueryAllRollupResponse { + repeated Rollup rollup = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QuerySequencerRequest { + string sequencer_address = 1; +} + +message QueryRollupResponse { + Rollup rollup = 1 [(gogoproto.nullable) = false]; +} + +message QuerySequencerResponse { + Sequencer sequencer = 1 [(gogoproto.nullable) = false]; +} + +message QuerySequencersByRollupRequest { + string rollup_name = 1; +} + +message QuerySequencersByRollupResponse { + string rollup_name = 1; + repeated Sequencer sequencer_list = 2 [(gogoproto.nullable) = false]; +} + +message QueryDepositRequest { + string rollup_name = 1; + string sequencer_address = 2; +} + +message QueryDepositResponse { + Deposit deposit = 1; +} diff --git a/proto/finschia/or/rollup/v1/rollup.proto b/proto/finschia/or/rollup/v1/rollup.proto new file mode 100644 index 0000000000..e5b783cb63 --- /dev/null +++ b/proto/finschia/or/rollup/v1/rollup.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package finschia.or.rollup.v1; + +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/Finschia/finschia-sdk/x/or/rollup/types"; + +message Rollup { + string rollup_name = 1; + string creator = 2; + Sequencers permissioned_addresses = 3 [(gogoproto.nullable) = false]; +} + +message Sequencer { + string sequencer_address = 1; + google.protobuf.Any pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + string rollup_name = 3; +} + +message Deposit { + string rollup_name = 1; + string sequencer_address = 2; + cosmos.base.v1beta1.Coin value = 3 [(gogoproto.nullable) = false]; +} + +message SequencersByRollup { + string rollup_name = 1; + repeated Sequencer sequencers = 2 [(gogoproto.nullable) = false]; +} + +message Sequencers { + repeated string addresses = 1; +} diff --git a/proto/finschia/or/rollup/v1/tx.proto b/proto/finschia/or/rollup/v1/tx.proto new file mode 100644 index 0000000000..0bd8e79bdd --- /dev/null +++ b/proto/finschia/or/rollup/v1/tx.proto @@ -0,0 +1,55 @@ +syntax = "proto3"; +package finschia.or.rollup.v1; + +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; +import "finschia/or/rollup/v1/rollup.proto"; + +option go_package = "github.com/Finschia/finschia-sdk/x/or/rollup/types"; + +service Msg { + rpc CreateRollup(MsgCreateRollup) returns (MsgCreateRollupResponse); + rpc RegisterSequencer(MsgRegisterSequencer) returns (MsgRegisterSequencerResponse); + rpc Deposit(MsgDeposit) returns (MsgDepositResponse); + rpc Withdraw(MsgWithdraw) returns (MsgWithdrawResponse); + rpc RemoveSequencer(MsgRemoveSequencer) returns (MsgRemoveSequencerResponse); +} + +message MsgCreateRollup { + string rollup_name = 1; + string creator = 2; + Sequencers permissioned_addresses = 3 [(gogoproto.nullable) = false]; +} + +message MsgRegisterSequencer { + string creator = 1; + google.protobuf.Any pubkey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + string rollup_name = 3; + cosmos.base.v1beta1.Coin value = 4 [(gogoproto.nullable) = false]; +} + +message MsgDeposit { + string rollup_name = 1; + string sequencer_address = 2; + cosmos.base.v1beta1.Coin value = 3 [(gogoproto.nullable) = false]; +} + +message MsgWithdraw { + string rollup_name = 1; + string sequencer_address = 2; + cosmos.base.v1beta1.Coin value = 3 [(gogoproto.nullable) = false]; +} + +message MsgCreateRollupResponse {} + +message MsgRegisterSequencerResponse {} + +message MsgRemoveSequencer {} + +message MsgRemoveSequencerResponse {} + +message MsgDepositResponse {} + +message MsgWithdrawResponse {} diff --git a/simapp/app.go b/simapp/app.go index c44a1436dd..922f383b50 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -105,6 +105,10 @@ import ( upgradekeeper "github.com/Finschia/finschia-sdk/x/upgrade/keeper" upgradetypes "github.com/Finschia/finschia-sdk/x/upgrade/types" + "github.com/Finschia/finschia-sdk/x/or/rollup" + rollupkeeper "github.com/Finschia/finschia-sdk/x/or/rollup/keeper" + rolluptypes "github.com/Finschia/finschia-sdk/x/or/rollup/types" + // unnamed import of statik for swagger UI support _ "github.com/Finschia/finschia-sdk/client/docs/statik" ) @@ -144,6 +148,7 @@ var ( vesting.AppModuleBasic{}, tokenmodule.AppModuleBasic{}, collectionmodule.AppModuleBasic{}, + rollup.AppModuleBasic{}, //ordamodule.AppModuleBasic{}, ) @@ -157,6 +162,7 @@ var ( stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, govtypes.ModuleName: {authtypes.Burner}, + rolluptypes.ModuleName: {authtypes.Burner}, } // module accounts that are allowed to receive tokens @@ -206,6 +212,8 @@ type SimApp struct { CollectionKeeper collectionkeeper.Keeper Ordakeeper ordakeeper.Keeper + RollupKeeper rollupkeeper.Keeper + // the module manager mm *module.Manager @@ -258,6 +266,7 @@ func NewSimApp( token.StoreKey, collection.StoreKey, authzkeeper.StoreKey, + rolluptypes.StoreKey, ordatypes.StoreKey, ) tkeys := sdk.NewTransientStoreKeys(paramstypes.TStoreKey) @@ -362,6 +371,7 @@ func NewSimApp( app.EvidenceKeeper = *evidenceKeeper /**** Rollup ****/ + app.RollupKeeper = rollupkeeper.NewKeeper(appCodec, app.BankKeeper, app.AccountKeeper, keys[rolluptypes.StoreKey], keys[rolluptypes.MemStoreKey], app.GetSubspace(rolluptypes.ModuleName)) app.Ordakeeper = ordakeeper.NewKeeper(appCodec, keys[ordatypes.StoreKey], authtypes.NewModuleAddress(govtypes.ModuleName).String(), app.AccountKeeper, nil) /**** Module Options ****/ @@ -395,6 +405,7 @@ func NewSimApp( tokenmodule.NewAppModule(appCodec, app.TokenKeeper), collectionmodule.NewAppModule(appCodec, app.CollectionKeeper), authzmodule.NewAppModule(appCodec, app.AuthzKeeper, app.AccountKeeper, app.BankKeeper, app.interfaceRegistry), + rollup.NewAppModule(appCodec, app.RollupKeeper, app.AccountKeeper, app.BankKeeper), //ordamodule.NewAppModule(appCodec, app.Ordakeeper, app.AccountKeeper), ) @@ -423,6 +434,7 @@ func NewSimApp( vestingtypes.ModuleName, token.ModuleName, collection.ModuleName, + rolluptypes.ModuleName, ordatypes.ModuleName, ) app.mm.SetOrderEndBlockers( @@ -445,6 +457,7 @@ func NewSimApp( foundation.ModuleName, token.ModuleName, collection.ModuleName, + rolluptypes.ModuleName, ordatypes.ModuleName, ) @@ -473,6 +486,7 @@ func NewSimApp( vestingtypes.ModuleName, token.ModuleName, collection.ModuleName, + rolluptypes.ModuleName, ordatypes.ModuleName, ) @@ -725,5 +739,7 @@ func initParamsKeeper(appCodec codec.BinaryCodec, legacyAmino *codec.LegacyAmino paramsKeeper.Subspace(govtypes.ModuleName).WithKeyTable(govtypes.ParamKeyTable()) paramsKeeper.Subspace(crisistypes.ModuleName) + paramsKeeper.Subspace(rolluptypes.ModuleName) + return paramsKeeper } diff --git a/x/or/demo/prepare_rollup.sh b/x/or/demo/prepare_rollup.sh new file mode 100644 index 0000000000..f271c53352 --- /dev/null +++ b/x/or/demo/prepare_rollup.sh @@ -0,0 +1,87 @@ +#!/bin/bash + +# +DENOM="stake" +ROLLUPNAME="test-rollup" +DEPOSIT="20" +WITHDRAW="10" + +BASE_DIR=~/.simapp + +# Get address which want to register for sequencer +SEQUENCER=$(simd keys list --keyring-backend=test --home $BASE_DIR --output json | jq -r '.[0]'.name) +SEQUENCERADDRESS=$(simd keys list --keyring-backend=test --home $BASE_DIR --output json | jq -r '.[0]'.address) +SEQUENCERPUBKEY=$(simd keys list --keyring-backend=test --home $BASE_DIR --output json | jq -r '.[0]'.pubkey) +echo "Sequencer Info" +echo $SEQUENCER +echo $SEQUENCERADDRESS +echo $SEQUENCERPUBKEY + +echo "# Check init balance" +INITBALANCE=$(simd query bank balances $SEQUENCERADDRESS --home $BASE_DIR --output json | jq -r '.balances[0].amount') +echo $INITBALANCE + +echo "# Create rollup" +simd tx rollup create-rollup $ROLLUPNAME --from $SEQUENCER --keyring-backend=test --home $BASE_DIR --chain-id sim -y + +sleep 5 + +echo "# Check created rollup" +simd query rollup show-rollup $ROLLUPNAME + +echo "# Check rollup list" +simd query rollup list + +echo "# Register sequencer" +simd tx rollup register-sequencer test-rollup ${SEQUENCERPUBKEY} $DEPOSIT$DENOM --from $SEQUENCER --keyring-backend test --home $BASE_DIR --chain-id sim -y + +sleep 5 + +echo "# Check balance after registered sequencer" +BALANCEAFTERREGISTER=$(simd query bank balances $SEQUENCERADDRESS --home $BASE_DIR --output json | jq -r '.balances[0].amount') +echo $BALANCEAFTERREGISTER + +if [ $((${INITBALANCE}-${DEPOSIT})) -ne ${BALANCEAFTERREGISTER} ]; then + echo "The balance after registering the sequencer does not match." + exit 1 +else + echo "Register sequencer done" +fi + +echo "# Check sequencer by rollup name" +simd query rollup show-sequencers-by-rollup $ROLLUPNAME --output json + +echo "# Check sequencer" +simd query rollup show-sequencer $SEQUENCERADDRESS --home $BASE_DIR --output json + +echo "# Withdraw deposit" +simd tx rollup withdraw-by-sequencer $ROLLUPNAME $WITHDRAW$DENOM --from $SEQUENCER --keyring-backend test --home $BASE_DIR --chain-id sim -y + +sleep 5 + +echo "# Check balance after withdraw" +BALANCEAFTERWITHDRAW=$(simd query bank balances $SEQUENCERADDRESS --home $BASE_DIR --output json | jq -r '.balances[0].amount') + +if [ $((${INITBALANCE}-${DEPOSIT}+${WITHDRAW})) -ne ${BALANCEAFTERWITHDRAW} ]; then + echo "The balance after withdraw does not match." + exit 1 +else + echo "Withdraw done" +fi + +echo "# Deposit by sequencer again" +simd tx rollup deposit-by-sequencer test-rollup $DEPOSIT$DENOM --from $SEQUENCER --keyring-backend=test --home $BASE_DIR --chain-id sim -y + +sleep 5 + +echo "# Check balance after deposit again" +BALANCEAFTERDEPOSITAGAIN=$(simd query bank balances $SEQUENCERADDRESS --home $BASE_DIR --output json | jq -r '.balances[0].amount') + +if [ $((${INITBALANCE}-2*${DEPOSIT}+${WITHDRAW})) -ne ${BALANCEAFTERDEPOSITAGAIN} ]; then + echo "The balance after deposit again does not match." + exit 1 +else + echo "Deposit again done" +fi + +echo "Prepare rollup all done." diff --git a/x/or/demo/run_chain.sh b/x/or/demo/run_chain.sh new file mode 100644 index 0000000000..cc25067cb4 --- /dev/null +++ b/x/or/demo/run_chain.sh @@ -0,0 +1,21 @@ +#!/bin/bash + +# Remove data +pkill simd +rm -rf ~/.simapp + +# Prepare chain +TEST_MNEMONIC="mind flame tobacco sense move hammer drift crime ring globe art gaze cinnamon helmet cruise special produce notable negative wait path scrap recall have" +BASE_DIR=~/.simapp +CHAIN_ID=sim + +simd init validator --home $BASE_DIR --chain-id $CHAIN_ID > /dev/null 2>&1 +simd keys add validator --keyring-backend=test --home $BASE_DIR --recover --account=0 <<< ${TEST_MNEMONIC} > /dev/null 2>&1 +simd keys add sequencer --keyring-backend=test --home $BASE_DIR --recover --account=1 <<< ${TEST_MNEMONIC} > /dev/null 2>&1 +simd add-genesis-account $(simd --home $BASE_DIR keys show validator -a --keyring-backend=test) 100000000000stake,100000000000tcony --home $BASE_DIR > /dev/null 2>&1 +simd add-genesis-account $(simd --home $BASE_DIR keys show sequencer -a --keyring-backend=test) 100000000000stake,100000000000tcony --home $BASE_DIR > /dev/null 2>&1 +simd gentx validator 10000000000stake --keyring-backend=test --home $BASE_DIR --chain-id=$CHAIN_ID > /dev/null 2>&1 +simd collect-gentxs --home $BASE_DIR > /dev/null 2>&1 + +# Run chain +simd start --home $BASE_DIR > $BASE_DIR/$CHAIN_ID.log 2>&1 & diff --git a/x/or/rollup/client/cli/query.go b/x/or/rollup/client/cli/query.go new file mode 100644 index 0000000000..72054ae7aa --- /dev/null +++ b/x/or/rollup/client/cli/query.go @@ -0,0 +1,153 @@ +package cli + +import ( + "context" + "fmt" + + "github.com/Finschia/finschia-sdk/client" + "github.com/Finschia/finschia-sdk/client/flags" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" + "github.com/spf13/cobra" +) + +// GetQueryCmd returns the cli query commands for this module +func GetQueryCmd(queryRoute string) *cobra.Command { + // Group rollup queries under a subcommand + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(NewQueryCmdShowRollup()) + cmd.AddCommand(NewQueryCmdShowAllRollup()) + cmd.AddCommand(NewQueryCmdShowSequencer()) + cmd.AddCommand(NewQueryCmdShowSequencersByRollup()) + + return cmd +} + +func NewQueryCmdShowRollup() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-rollup [rollup-name]", + Short: "shows a rollup", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argRollupName := args[0] + + params := &types.QueryRollupRequest{ + RollupName: argRollupName, + } + + res, err := queryClient.Rollup(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func NewQueryCmdShowSequencersByRollup() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-sequencers-by-rollup [rollup-name]", + Short: "show sequencers by rollup", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argRollupName := args[0] + + params := &types.QuerySequencersByRollupRequest{ + RollupName: argRollupName, + } + + res, err := queryClient.SequencersByRollup(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func NewQueryCmdShowAllRollup() *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Short: "shows a all rollup", + Args: cobra.ExactArgs(0), + 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 + } + + params := &types.QueryAllRollupRequest{ + Pagination: pageReq, + } + + res, err := queryClient.AllRollup(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} + +func NewQueryCmdShowSequencer() *cobra.Command { + cmd := &cobra.Command{ + Use: "show-sequencer [sequencer-address]", + Short: "shows a sequencer", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) (err error) { + clientCtx := client.GetClientContextFromCmd(cmd) + + queryClient := types.NewQueryClient(clientCtx) + + argSequencerAddress := args[0] + + params := &types.QuerySequencerRequest{ + SequencerAddress: argSequencerAddress, + } + + res, err := queryClient.Sequencer(context.Background(), params) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + + return cmd +} diff --git a/x/or/rollup/client/cli/tx.go b/x/or/rollup/client/cli/tx.go new file mode 100644 index 0000000000..8531a75292 --- /dev/null +++ b/x/or/rollup/client/cli/tx.go @@ -0,0 +1,198 @@ +package cli + +import ( + "encoding/json" + "fmt" + + "github.com/Finschia/finschia-sdk/client" + "github.com/Finschia/finschia-sdk/client/flags" + "github.com/Finschia/finschia-sdk/client/tx" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" + "github.com/spf13/cobra" + + cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" +) + +const ( + FlagAmount = "amount" +) + +// GetTxCmd returns the transaction commands for this module +func GetTxCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: types.ModuleName, + Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + cmd.AddCommand(NewCreateRollupCmd()) + cmd.AddCommand(NewRegisterSequencerCmd()) + cmd.AddCommand(NewDepositCmd()) + cmd.AddCommand(NewWithdrawCmd()) + // cmd.AddCommand(NewRemoveSequencerCmd()) + + return cmd +} + +func NewCreateRollupCmd() *cobra.Command { + cmd := &cobra.Command{ + // TODO: If rollup:sequencer=1:N, add [max-sequencers] parameter + Use: "create-rollup [rollup_name] [permissioned-addresses]", + Short: "Create a new rollup", + Args: cobra.RangeArgs(1, 2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argRollupName := args[0] + argPermissionedAddresses := new(types.Sequencers) + if len(args) == 2 { + err = json.Unmarshal([]byte(args[1]), argPermissionedAddresses) + if err != nil { + return err + } + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgCreateRollup( + argRollupName, + clientCtx.GetFromAddress().String(), + argPermissionedAddresses, + ) + + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} + +func NewRegisterSequencerCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "register-sequencer [rollup_name] [pubkey] [amount]", + Short: "Register a new sequencer for a rollup. Amount is the value to deposit", + Args: cobra.ExactArgs(3), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argRollupName := args[0] + argPubkey := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + var pk cryptotypes.PubKey + if err := clientCtx.Codec.UnmarshalInterfaceJSON([]byte(argPubkey), &pk); err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[2]) + if err != nil { + return err + } + + msg, err := types.NewMsgRegisterSequencer( + pk, + argRollupName, + clientCtx.GetFromAddress().String(), + amount, + ) + if err != nil { + return err + } + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(FlagAmount) + + return cmd +} + +func NewDepositCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "deposit-by-sequencer [rollup_name] [amount]", + Short: "Deposit by sequencer", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argRollupName := args[0] + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgDeposit(argRollupName, clientCtx.GetFromAddress().String(), amount) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(FlagAmount) + + return cmd +} + +func NewWithdrawCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "withdraw-by-sequencer [rollup_name] [amount]", + Short: "Withdraw by sequencer", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argRollupName := args[0] + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + amount, err := sdk.ParseCoinNormalized(args[1]) + if err != nil { + return err + } + + msg := types.NewMsgWithdraw(argRollupName, clientCtx.GetFromAddress().String(), amount) + + if err := msg.ValidateBasic(); err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + _ = cmd.MarkFlagRequired(FlagAmount) + + return cmd +} + +// func NewRemoveSequencerCmd() *cobra.Command { +// panic("implement me") +// } diff --git a/x/or/rollup/genesis.go b/x/or/rollup/genesis.go new file mode 100644 index 0000000000..d50bd4a139 --- /dev/null +++ b/x/or/rollup/genesis.go @@ -0,0 +1,22 @@ +package rollup + +import ( + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/x/or/rollup/keeper" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +// InitGenesis initializes the capability module's state from a provided genesis +// state. +func InitGenesis(ctx sdk.Context, k keeper.Keeper, accoutKeeper types.AccountKeeper, genState types.GenesisState) { + k.SetParams(ctx, genState.Params) +} + +// ExportGenesis returns the capability module's exported genesis. +func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { + genesis := types.DefaultGenesis() + + // this line is used by starport scaffolding # genesis/module/export + + return genesis +} diff --git a/x/or/rollup/genesis_test.go b/x/or/rollup/genesis_test.go new file mode 100644 index 0000000000..6ce944db86 --- /dev/null +++ b/x/or/rollup/genesis_test.go @@ -0,0 +1 @@ +package rollup_test diff --git a/x/or/rollup/handler.go b/x/or/rollup/handler.go new file mode 100644 index 0000000000..f424de0201 --- /dev/null +++ b/x/or/rollup/handler.go @@ -0,0 +1,37 @@ +package rollup + +import ( + "fmt" + + sdk "github.com/Finschia/finschia-sdk/types" + sdkerrors "github.com/Finschia/finschia-sdk/types/errors" + "github.com/Finschia/finschia-sdk/x/or/rollup/keeper" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +// NewHandler ... +func NewHandler(k keeper.Keeper) sdk.Handler { + // this line is used by starport scaffolding # handler/msgServer + msgServer := keeper.NewMsgServerImpl(k) + + return func(ctx sdk.Context, msg sdk.Msg) (*sdk.Result, error) { + switch msg := msg.(type) { + // this line is used by starport scaffolding # 1 + case *types.MsgCreateRollup: + res, err := msgServer.CreateRollup(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgRegisterSequencer: + res, err := msgServer.RegisterSequencer(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgDeposit: + res, err := msgServer.Deposit(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + case *types.MsgWithdraw: + res, err := msgServer.Withdraw(sdk.WrapSDKContext(ctx), msg) + return sdk.WrapServiceResult(ctx, res, err) + default: + errMsg := fmt.Sprintf("unrecognized %s message type: %T", types.ModuleName, msg) + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, errMsg) + } + } +} diff --git a/x/or/rollup/keeper/grpc_query.go b/x/or/rollup/keeper/grpc_query.go new file mode 100644 index 0000000000..232f7005c0 --- /dev/null +++ b/x/or/rollup/keeper/grpc_query.go @@ -0,0 +1,116 @@ +package keeper + +import ( + "context" + + "github.com/Finschia/finschia-sdk/store/prefix" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/types/query" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/status" +) + +var _ types.QueryServer = Keeper{} + +func (k Keeper) Rollup(ctx context.Context, req *types.QueryRollupRequest) (*types.QueryRollupResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + sdkCtx := sdk.UnwrapSDKContext(ctx) + val, found := k.GetRollup( + sdkCtx, + req.RollupName, + ) + if !found { + return nil, status.Error(codes.NotFound, "not found") + } + res := types.QueryRollupResponse{Rollup: val} + + return &res, nil +} + +func (k Keeper) AllRollup(ctx context.Context, req *types.QueryAllRollupRequest) (*types.QueryAllRollupResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + var rollups []types.Rollup + sdkCtx := sdk.UnwrapSDKContext(ctx) + store := sdkCtx.KVStore(k.storeKey) + rollupStore := prefix.NewStore(store, types.RollupKeyPrefix) + + pageRes, err := query.Paginate(rollupStore, req.Pagination, func(key []byte, value []byte) error { + var rollapp types.Rollup + if err := k.cdc.Unmarshal(value, &rollapp); err != nil { + return err + } + + rollups = append(rollups, rollapp) + return nil + }) + + if err != nil { + return nil, status.Error(codes.Internal, err.Error()) + } + res := types.QueryAllRollupResponse{Rollup: rollups, Pagination: pageRes} + + return &res, nil +} + +func (k Keeper) Sequencer(ctx context.Context, req *types.QuerySequencerRequest) (*types.QuerySequencerResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + sequencer, found := k.GetSequencer(sdkCtx, req.SequencerAddress) + if !found { + return &types.QuerySequencerResponse{}, status.Error(codes.NotFound, "not found") + } + res := types.QuerySequencerResponse{ + Sequencer: sequencer, + } + + return &res, nil +} + +func (k Keeper) SequencersByRollup(ctx context.Context, req *types.QuerySequencersByRollupRequest) (*types.QuerySequencersByRollupResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + sequencersByRollup, found := k.GetSequencersByRollupName(sdkCtx, req.RollupName) + if !found { + return &types.QuerySequencersByRollupResponse{}, status.Error(codes.NotFound, "not found") + } + + res := types.QuerySequencersByRollupResponse{RollupName: req.RollupName, SequencerList: sequencersByRollup.Sequencers} + + return &res, nil +} + +func (k Keeper) Deposit(ctx context.Context, req *types.QueryDepositRequest) (*types.QueryDepositResponse, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + sequencers, found := k.GetSequencersByRollupName(sdkCtx, req.RollupName) + if !found { + return &types.QueryDepositResponse{}, status.Error(codes.NotFound, "not found") + } + + sequencerContains := false + for _, v := range sequencers.Sequencers { + if v.SequencerAddress == req.SequencerAddress { + sequencerContains = true + break + } + } + + if !sequencerContains { + return nil, types.ErrNotExistSequencer + } + + deposit, found := k.GetDeposit(sdkCtx, req.RollupName, req.SequencerAddress) + if !found { + return nil, types.ErrNotFoundDeposit + } + + res := types.QueryDepositResponse{ + Deposit: &deposit, + } + + return &res, nil +} diff --git a/x/or/rollup/keeper/keeper.go b/x/or/rollup/keeper/keeper.go new file mode 100644 index 0000000000..6c2db3d03a --- /dev/null +++ b/x/or/rollup/keeper/keeper.go @@ -0,0 +1,74 @@ +package keeper + +import ( + "fmt" + + "github.com/Finschia/finschia-sdk/codec" + sdk "github.com/Finschia/finschia-sdk/types" + authtypes "github.com/Finschia/finschia-sdk/x/auth/types" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" + paramtypes "github.com/Finschia/finschia-sdk/x/params/types" +) + +type Keeper struct { + cdc codec.BinaryCodec + bankKeeper types.BankKeeper + authKeeper types.AccountKeeper + storeKey sdk.StoreKey + memKey sdk.StoreKey + paramstore paramtypes.Subspace +} + +func NewKeeper(cdc codec.BinaryCodec, bankKeeper types.BankKeeper, accountKeeper types.AccountKeeper, storeKey, memKey sdk.StoreKey, ps paramtypes.Subspace) Keeper { + if addr := accountKeeper.GetModuleAddress(types.ModuleName); addr.Empty() { + panic(fmt.Sprintf("%s module account has not been set", types.ModuleName)) + } + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + return Keeper{ + cdc: cdc, + bankKeeper: bankKeeper, + authKeeper: accountKeeper, + storeKey: storeKey, + memKey: memKey, + paramstore: ps, + } +} + +func (k Keeper) GetRollupAccount(ctx sdk.Context) authtypes.ModuleAccountI { + return k.authKeeper.GetModuleAccount(ctx, types.ModuleName) +} + +func (k Keeper) Slash(ctx sdk.Context, rollupName string, sequencerAddress string, value sdk.Coin) error { + _, found := k.GetRollup(ctx, rollupName) + if !found { + return types.ErrNotExistRollupName + } + _, found = k.GetSequencer(ctx, sequencerAddress) + if !found { + return types.ErrNotExistSequencer + } + + deposit, found := k.GetDeposit(ctx, rollupName, sequencerAddress) + if !found { + return types.ErrNotFoundDeposit + } + + slashAmount := value + if deposit.Value.Amount.LT(value.Amount) { + slashAmount = deposit.Value + deposit.Value = sdk.NewCoin(value.Denom, sdk.NewInt(0)) + } else { + deposit.Value.Sub(value) + } + + err := k.bankKeeper.BurnCoins(ctx, types.ModuleName, sdk.NewCoins(slashAmount)) + if err != nil { + return err + } + + k.SetDeposit(ctx, deposit) + + return nil +} diff --git a/x/or/rollup/keeper/msg_server.go b/x/or/rollup/keeper/msg_server.go new file mode 100644 index 0000000000..47c044d305 --- /dev/null +++ b/x/or/rollup/keeper/msg_server.go @@ -0,0 +1,184 @@ +package keeper + +import ( + "context" + + sdk "github.com/Finschia/finschia-sdk/types" + + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the MsgServer interface +// for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (k msgServer) CreateRollup(goCtx context.Context, msg *types.MsgCreateRollup) (*types.MsgCreateRollupResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if _, found := k.GetRollup(ctx, msg.RollupName); found { + return nil, types.ErrExistRollupName + } + + rollup := types.Rollup{ + RollupName: msg.RollupName, + Creator: msg.Creator, + PermissionedAddresses: msg.PermissionedAddresses, + } + + k.SetRollup(ctx, rollup) + + return &types.MsgCreateRollupResponse{}, nil +} + +func (k msgServer) RegisterSequencer(goCtx context.Context, msg *types.MsgRegisterSequencer) (*types.MsgRegisterSequencerResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + if _, found := k.GetSequencer(ctx, msg.Creator); found { + return nil, types.ErrSequencerExists + } + + rollup, found := k.GetRollup(ctx, msg.RollupName) + if found { + permissionedAddresses := rollup.PermissionedAddresses.Addresses + if len(permissionedAddresses) > 0 { + permissioned := false + for i := range permissionedAddresses { + if permissionedAddresses[i] == msg.Creator { + permissioned = true + break + } + } + if !permissioned { + return nil, types.ErrSequencerNotPermissioned + } + } + } else { + return nil, types.ErrNotExistRollupName + } + + sequencersByRollup, found := k.GetSequencersByRollupName(ctx, msg.RollupName) + sequencer := types.Sequencer{ + SequencerAddress: msg.Creator, + Pubkey: msg.Pubkey, + RollupName: msg.RollupName, + } + + if found { + // TODO: Modify when rollup:sequencer=1:N + return nil, types.SequencersByRollupExists + } + sequencersByRollup.RollupName = msg.RollupName + sequencersByRollup.Sequencers = append(sequencersByRollup.Sequencers, sequencer) + + k.SetSequencersByRollup(ctx, sequencersByRollup) + + k.SetSequencer(ctx, sequencer) + + depositMsg := types.NewMsgDeposit(msg.RollupName, msg.Creator, msg.Value) + _, err := k.Deposit(goCtx, depositMsg) + if err != nil { + return nil, err + } + + return &types.MsgRegisterSequencerResponse{}, nil +} + +func (k msgServer) RemoveSequencer(goCtx context.Context, msg *types.MsgRemoveSequencer) (*types.MsgRemoveSequencerResponse, error) { + panic("implement me") +} + +func (k msgServer) Deposit(goCtx context.Context, msg *types.MsgDeposit) (*types.MsgDepositResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + _, found := k.GetRollup(ctx, msg.RollupName) + if !found { + return nil, types.ErrNotExistRollupName + } + + sequencersInfo, found := k.GetSequencersByRollupName(ctx, msg.RollupName) + if !found { + return nil, types.ErrNotExistSequencer + } + sequencerContains := false + for _, v := range sequencersInfo.Sequencers { + if v.SequencerAddress == msg.SequencerAddress { + sequencerContains = true + break + } + } + if !sequencerContains { + return nil, types.ErrNotExistSequencer + } + + addr, err := sdk.AccAddressFromBech32(msg.SequencerAddress) + if err != nil { + return nil, err + } + amount := sdk.NewCoins(msg.Value) + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, addr, types.ModuleName, amount) + if err != nil { + return nil, err + } + deposit := types.Deposit{ + RollupName: msg.RollupName, + SequencerAddress: msg.SequencerAddress, + Value: msg.Value, + } + + k.SetDeposit(ctx, deposit) + + return &types.MsgDepositResponse{}, nil +} + +func (k msgServer) Withdraw(goCtx context.Context, msg *types.MsgWithdraw) (*types.MsgWithdrawResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + _, found := k.GetRollup(ctx, msg.RollupName) + if !found { + return nil, types.ErrNotExistRollupName + } + _, found = k.GetSequencer(ctx, msg.SequencerAddress) + if !found { + return nil, types.ErrNotExistSequencer + } + + deposit, found := k.GetDeposit(ctx, msg.RollupName, msg.SequencerAddress) + if !found { + return nil, types.ErrNotFoundDeposit + } + + afterWithdrawAmount := deposit.Value.Sub(msg.Value) + + if afterWithdrawAmount.Amount.LT(sdk.NewInt(types.MinDepositAmount)) { + return nil, types.ErrIsNotEnoughDepositAmount + } + + addr, err := sdk.AccAddressFromBech32(msg.SequencerAddress) + if err != nil { + return nil, err + } + amount := sdk.NewCoins(msg.Value) + + err = k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, addr, amount) + if err != nil { + return nil, err + } + deposit = types.Deposit{ + RollupName: msg.RollupName, + SequencerAddress: msg.SequencerAddress, + Value: afterWithdrawAmount, + } + + k.SetDeposit(ctx, deposit) + + return &types.MsgWithdrawResponse{}, nil + +} diff --git a/x/or/rollup/keeper/params.go b/x/or/rollup/keeper/params.go new file mode 100644 index 0000000000..8e1f174fcd --- /dev/null +++ b/x/or/rollup/keeper/params.go @@ -0,0 +1,16 @@ +package keeper + +import ( + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +// GetParams get all parameters as types.Params +func (k Keeper) GetParams(ctx sdk.Context) types.Params { + return types.NewParams() +} + +// SetParams set the params +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramstore.SetParamSet(ctx, ¶ms) +} diff --git a/x/or/rollup/keeper/rollup.go b/x/or/rollup/keeper/rollup.go new file mode 100644 index 0000000000..d821b80d47 --- /dev/null +++ b/x/or/rollup/keeper/rollup.go @@ -0,0 +1,40 @@ +package keeper + +import ( + "github.com/Finschia/finschia-sdk/store/prefix" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/types/query" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +func (k Keeper) GetRollup(ctx sdk.Context, rollupName string) (val types.Rollup, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RollupKeyPrefix) + b := store.Get(types.RollupKey(rollupName)) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k Keeper) SetRollup(ctx sdk.Context, rollup types.Rollup) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RollupKeyPrefix) + b := k.cdc.MustMarshal(&rollup) + store.Set(types.RollupKey(rollup.RollupName), b) +} + +func (k Keeper) GetAllRollup(ctx sdk.Context, pagination *query.PageRequest) (list []types.Rollup) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.RollupKeyPrefix) + iterator := sdk.KVStorePrefixIterator(store, []byte{}) + + defer iterator.Close() + + for ; iterator.Valid(); iterator.Next() { + var val types.Rollup + k.cdc.MustUnmarshal(iterator.Value(), &val) + list = append(list, val) + } + + return +} diff --git a/x/or/rollup/keeper/sequencer.go b/x/or/rollup/keeper/sequencer.go new file mode 100644 index 0000000000..e31a07b7f9 --- /dev/null +++ b/x/or/rollup/keeper/sequencer.go @@ -0,0 +1,76 @@ +package keeper + +import ( + "github.com/Finschia/finschia-sdk/store/prefix" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +func (k Keeper) SetSequencersByRollup(ctx sdk.Context, sequencersByRollup types.SequencersByRollup) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.SequencersByRollupKeyPrefix) + b := k.cdc.MustMarshal(&sequencersByRollup) + store.Set(types.SequencersByRollupKey( + sequencersByRollup.RollupName, + ), b) +} + +func (k Keeper) GetSequencersByRollupName(ctx sdk.Context, rollupName string) (val types.SequencersByRollup, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.SequencersByRollupKeyPrefix) + + b := store.Get(types.SequencersByRollupKey( + rollupName, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k Keeper) SetSequencer(ctx sdk.Context, sequencer types.Sequencer) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.SequencerKeyPrefix) + b := k.cdc.MustMarshal(&sequencer) + store.Set(types.SequencerKey( + sequencer.SequencerAddress, + ), b) +} + +func (k Keeper) GetSequencer(ctx sdk.Context, sequencerAddress string) (val types.Sequencer, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.SequencerKeyPrefix) + + b := store.Get(types.SequencerKey( + sequencerAddress, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} + +func (k Keeper) SetDeposit(ctx sdk.Context, depoist types.Deposit) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.DepositKeyPrefix) + + b := k.cdc.MustMarshal(&depoist) + store.Set(types.DepositKey( + depoist.RollupName, + depoist.SequencerAddress, + ), b) +} + +func (k Keeper) GetDeposit(ctx sdk.Context, rollupName, sequencerAddress string) (val types.Deposit, found bool) { + store := prefix.NewStore(ctx.KVStore(k.storeKey), types.DepositKeyPrefix) + + b := store.Get(types.DepositKey( + rollupName, + sequencerAddress, + )) + if b == nil { + return val, false + } + + k.cdc.MustUnmarshal(b, &val) + return val, true +} diff --git a/x/or/rollup/module.go b/x/or/rollup/module.go new file mode 100644 index 0000000000..102c560525 --- /dev/null +++ b/x/or/rollup/module.go @@ -0,0 +1,176 @@ +package rollup + +import ( + "encoding/json" + "fmt" + + // this line is used by starport scaffolding # 1 + + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + + abci "github.com/tendermint/tendermint/abci/types" + + "github.com/Finschia/finschia-sdk/client" + "github.com/Finschia/finschia-sdk/codec" + cdctypes "github.com/Finschia/finschia-sdk/codec/types" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/types/module" + "github.com/Finschia/finschia-sdk/x/or/rollup/client/cli" + "github.com/Finschia/finschia-sdk/x/or/rollup/keeper" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" +) + +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// ---------------------------------------------------------------------------- +// AppModuleBasic +// ---------------------------------------------------------------------------- + +// AppModuleBasic implements the AppModuleBasic interface for the capability module. +type AppModuleBasic struct { + cdc codec.BinaryCodec +} + +func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { + return AppModuleBasic{cdc: cdc} +} + +// Name returns the capability module's name. +func (AppModuleBasic) Name() string { + return types.ModuleName +} + +func (AppModuleBasic) RegisterCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + types.RegisterCodec(cdc) +} + +// RegisterInterfaces registers the module's interface types +func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { + types.RegisterInterfaces(reg) +} + +// DefaultGenesis returns the capability module's default genesis state. +func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesis()) +} + +// ValidateGenesis performs genesis state validation for the capability module. +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { + var genState types.GenesisState + if err := cdc.UnmarshalJSON(bz, &genState); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + return genState.Validate() +} + +// RegisterRESTRoutes registers the capability module's REST service handlers. +func (AppModuleBasic) RegisterRESTRoutes(clientCtx client.Context, rtr *mux.Router) { +} + +// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. +func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { + // this line is used by starport scaffolding # 2 +} + +// GetTxCmd returns the capability module's root tx command. +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.GetTxCmd() +} + +// GetQueryCmd returns the capability module's root query command. +func (AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd(types.StoreKey) +} + +// ---------------------------------------------------------------------------- +// AppModule +// ---------------------------------------------------------------------------- + +// AppModule implements the AppModule interface for the capability module. +type AppModule struct { + AppModuleBasic + + keeper keeper.Keeper + accountKeeper types.AccountKeeper + bankKeeper types.BankKeeper +} + +func NewAppModule( + cdc codec.Codec, + keeper keeper.Keeper, + accountKeeper types.AccountKeeper, + bankKeeper types.BankKeeper, +) AppModule { + return AppModule{ + AppModuleBasic: NewAppModuleBasic(cdc), + keeper: keeper, + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + } +} + +// Name returns the capability module's name. +func (am AppModule) Name() string { + return am.AppModuleBasic.Name() +} + +// Route returns the capability module's message routing key. +func (am AppModule) Route() sdk.Route { + return sdk.NewRoute(types.RouterKey, NewHandler(am.keeper)) +} + +// QuerierRoute returns the capability module's query routing key. +func (AppModule) QuerierRoute() string { return types.QuerierRoute } + +// LegacyQuerierHandler returns the capability module's Querier. +func (am AppModule) LegacyQuerierHandler(legacyQuerierCdc *codec.LegacyAmino) sdk.Querier { + return nil +} + +// RegisterServices registers a GRPC query service to respond to the +// module-specific GRPC queries. +func (am AppModule) RegisterServices(cfg module.Configurator) { + types.RegisterQueryServer(cfg.QueryServer(), am.keeper) +} + +// RegisterInvariants registers the capability module's invariants. +func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} + +// InitGenesis performs the capability module's genesis initialization It returns +// no validator updates. +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { + var genState types.GenesisState + // Initialize global index to index in genesis state + cdc.MustUnmarshalJSON(gs, &genState) + + InitGenesis(ctx, am.keeper, am.accountKeeper, genState) + + return []abci.ValidatorUpdate{} +} + +// ExportGenesis returns the capability module's exported genesis state as raw JSON bytes. +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + genState := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(genState) +} + +// ConsensusVersion implements ConsensusVersion. +func (AppModule) ConsensusVersion() uint64 { return 2 } + +// BeginBlock executes all ABCI BeginBlock logic respective to the capability module. +func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} + +// EndBlock executes all ABCI EndBlock logic respective to the capability module. It +// returns no validator updates. +func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return []abci.ValidatorUpdate{} +} diff --git a/x/or/rollup/module_simulation.go b/x/or/rollup/module_simulation.go new file mode 100644 index 0000000000..0eb328b93d --- /dev/null +++ b/x/or/rollup/module_simulation.go @@ -0,0 +1,61 @@ +package rollup + +import ( + "math/rand" + + "github.com/Finschia/finschia-sdk/baseapp" + simappparams "github.com/Finschia/finschia-sdk/simapp/params" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/types/module" + simtypes "github.com/Finschia/finschia-sdk/types/simulation" + rollupsimulation "github.com/Finschia/finschia-sdk/x/or/rollup/simulation" + rolluptest "github.com/Finschia/finschia-sdk/x/or/rollup/testutil" + "github.com/Finschia/finschia-sdk/x/or/rollup/types" + "github.com/Finschia/finschia-sdk/x/simulation" +) + +// avoid unused import issue +var ( + _ = rolluptest.AccAddress + _ = rollupsimulation.FindAccount + _ = simappparams.StakePerAccount + _ = simulation.MsgEntryKind + _ = baseapp.Paramspace +) + +const ( +// this line is used by starport scaffolding # simapp/module/const +) + +// GenerateGenesisState creates a randomized GenState of the module +func (AppModule) GenerateGenesisState(simState *module.SimulationState) { + accs := make([]string, len(simState.Accounts)) + for i, acc := range simState.Accounts { + accs[i] = acc.Address.String() + } + rollupGenesis := types.GenesisState{} + simState.GenState[types.ModuleName] = simState.Cdc.MustMarshalJSON(&rollupGenesis) +} + +// ProposalContents doesn't return any content functions for governance proposals +func (AppModule) ProposalContents(_ module.SimulationState) []simtypes.WeightedProposalContent { + return nil +} + +// RandomizedParams creates randomized param changes for the simulator +func (am AppModule) RandomizedParams(_ *rand.Rand) []simtypes.ParamChange { + + return []simtypes.ParamChange{} +} + +// RegisterStoreDecoder registers a decoder +func (am AppModule) RegisterStoreDecoder(_ sdk.StoreDecoderRegistry) {} + +// WeightedOperations returns the all the gov module operations with their respective weights. +func (am AppModule) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { + operations := make([]simtypes.WeightedOperation, 0) + + // this line is used by starport scaffolding # simapp/module/operation + + return operations +} diff --git a/x/or/rollup/simulation/helpers.go b/x/or/rollup/simulation/helpers.go new file mode 100644 index 0000000000..1b74bcd04c --- /dev/null +++ b/x/or/rollup/simulation/helpers.go @@ -0,0 +1,15 @@ +package simulation + +import ( + sdk "github.com/Finschia/finschia-sdk/types" + simtypes "github.com/Finschia/finschia-sdk/types/simulation" +) + +// FindAccount find a specific address from an account list +func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { + creator, err := sdk.AccAddressFromBech32(address) + if err != nil { + panic(err) + } + return simtypes.FindAccount(accs, creator) +} diff --git a/x/or/rollup/testutil/types.go b/x/or/rollup/testutil/types.go new file mode 100644 index 0000000000..59fbefca93 --- /dev/null +++ b/x/or/rollup/testutil/types.go @@ -0,0 +1,19 @@ +package testutil + +import ( + "github.com/Finschia/finschia-sdk/crypto/keys/ed25519" + sdk "github.com/Finschia/finschia-sdk/types" +) + +func AccAddressString() string { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr).String() +} + +// AccAddress returns a sample account address +func AccAddress() sdk.AccAddress { + pk := ed25519.GenPrivKey().PubKey() + addr := pk.Address() + return sdk.AccAddress(addr) +} diff --git a/x/or/rollup/types/codec.go b/x/or/rollup/types/codec.go new file mode 100644 index 0000000000..6a39008242 --- /dev/null +++ b/x/or/rollup/types/codec.go @@ -0,0 +1,33 @@ +package types + +import ( + "github.com/Finschia/finschia-sdk/codec" + cdctypes "github.com/Finschia/finschia-sdk/codec/types" + sdk "github.com/Finschia/finschia-sdk/types" + "github.com/Finschia/finschia-sdk/types/msgservice" +) + +func RegisterCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgCreateRollup{}, "rollup/CreateRollup", nil) + cdc.RegisterConcrete(&MsgRegisterSequencer{}, "rollup/RegisterSequencer", nil) + cdc.RegisterConcrete(&MsgRemoveSequencer{}, "rollup/RemoveSequencer", nil) + cdc.RegisterConcrete(&MsgDeposit{}, "rollup/Deposit", nil) + cdc.RegisterConcrete(&MsgWithdraw{}, "rollup/Withdraw", nil) +} + +func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgCreateRollup{}, + &MsgRegisterSequencer{}, + &MsgRemoveSequencer{}, + &MsgDeposit{}, + &MsgWithdraw{}, + ) + + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + Amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) +) diff --git a/x/or/rollup/types/errors.go b/x/or/rollup/types/errors.go new file mode 100644 index 0000000000..c88edba59e --- /dev/null +++ b/x/or/rollup/types/errors.go @@ -0,0 +1,19 @@ +package types + +import ( + sdkerrors "github.com/Finschia/finschia-sdk/types/errors" +) + +var ( + ErrInvalidNameLength = sdkerrors.Register(ModuleName, 1, "invalid name length") + ErrSequencerExists = sdkerrors.Register(ModuleName, 2, "sequencer already exist for this address") + ErrNotExistRollupName = sdkerrors.Register(ModuleName, 3, "rollup not exist for this name") + SequencersByRollupExists = sdkerrors.Register(ModuleName, 4, "sequencer already exist for this rollup") + ErrPermissionedAddressesDuplicate = sdkerrors.Register(ModuleName, 5, "permissioned address has duplicates") + ErrInvalidPermissionedAddress = sdkerrors.Register(ModuleName, 6, "invalid permissioned address") + ErrSequencerNotPermissioned = sdkerrors.Register(ModuleName, 7, "sequencer is not permissioned for serving the rollup") + ErrExistRollupName = sdkerrors.Register(ModuleName, 8, "rollup already exist for this name") + ErrIsNotEnoughDepositAmount = sdkerrors.Register(ModuleName, 9, "sequencer deposit is not enough.") + ErrNotExistSequencer = sdkerrors.Register(ModuleName, 10, "sequencer exist for this address") + ErrNotFoundDeposit = sdkerrors.Register(ModuleName, 11, "deposit not found") +) diff --git a/x/or/rollup/types/expected_keepers.go b/x/or/rollup/types/expected_keepers.go new file mode 100644 index 0000000000..cc6c55ea60 --- /dev/null +++ b/x/or/rollup/types/expected_keepers.go @@ -0,0 +1,27 @@ +package types + +import ( + sdk "github.com/Finschia/finschia-sdk/types" + authtypes "github.com/Finschia/finschia-sdk/x/auth/types" +) + +// AccountKeeper defines the expected account keeper used for simulations (noalias) +type AccountKeeper interface { + GetAccount(ctx sdk.Context, addr sdk.AccAddress) authtypes.AccountI + // Methods imported from account should be defined here + + GetModuleAddress(name string) sdk.AccAddress + GetModuleAccount(ctx sdk.Context, moduleName string) authtypes.ModuleAccountI + + SetModuleAccount(sdk.Context, authtypes.ModuleAccountI) +} + +// BankKeeper defines the expected interface needed to retrieve account balances. +type BankKeeper interface { + SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins + // Methods imported from bank should be defined here + + SendCoinsFromModuleToAccount(ctx sdk.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + BurnCoins(ctx sdk.Context, name string, amt sdk.Coins) error +} diff --git a/x/or/rollup/types/genesis.go b/x/or/rollup/types/genesis.go new file mode 100644 index 0000000000..b9ecbda04b --- /dev/null +++ b/x/or/rollup/types/genesis.go @@ -0,0 +1,19 @@ +package types + +// this line is used by starport scaffolding # genesis/types/import + +// DefaultIndex is the default capability global index +const DefaultIndex uint64 = 1 + +// DefaultGenesis returns the default Capability genesis state +func DefaultGenesis() *GenesisState { + return &GenesisState{} +} + +// Validate performs basic genesis state validation returning an error upon any +// failure. +func (gs GenesisState) Validate() error { + // this line is used by starport scaffolding # genesis/types/validate + + return nil +} diff --git a/x/or/rollup/types/genesis.pb.go b/x/or/rollup/types/genesis.pb.go new file mode 100644 index 0000000000..5a5f1882cc --- /dev/null +++ b/x/or/rollup/types/genesis.pb.go @@ -0,0 +1,450 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: finschia/or/rollup/v1/genesis.proto + +package types + +import ( + 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 GenesisState struct { + RollupList []Rollup `protobuf:"bytes,1,rep,name=rollup_list,json=rollupList,proto3" json:"rollup_list"` + SequencerList []Sequencer `protobuf:"bytes,2,rep,name=sequencer_list,json=sequencerList,proto3" json:"sequencer_list"` + Params Params `protobuf:"bytes,3,opt,name=params,proto3" json:"params"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_3d4f3012a4291ae6, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetRollupList() []Rollup { + if m != nil { + return m.RollupList + } + return nil +} + +func (m *GenesisState) GetSequencerList() []Sequencer { + if m != nil { + return m.SequencerList + } + return nil +} + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "finschia.or.rollup.v1.GenesisState") +} + +func init() { + proto.RegisterFile("finschia/or/rollup/v1/genesis.proto", fileDescriptor_3d4f3012a4291ae6) +} + +var fileDescriptor_3d4f3012a4291ae6 = []byte{ + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xcb, 0xcc, 0x2b, + 0x4e, 0xce, 0xc8, 0x4c, 0xd4, 0xcf, 0x2f, 0xd2, 0x2f, 0xca, 0xcf, 0xc9, 0x29, 0x2d, 0xd0, 0x2f, + 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, + 0x12, 0x85, 0x29, 0xd2, 0xcb, 0x2f, 0xd2, 0x83, 0x28, 0xd2, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, + 0x4f, 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0xa5, 0x94, 0xb0, 0x9b, 0x08, 0xd5, 0x86, + 0x57, 0x4d, 0x41, 0x62, 0x51, 0x62, 0x2e, 0xd4, 0x52, 0xa5, 0x07, 0x8c, 0x5c, 0x3c, 0xee, 0x10, + 0x67, 0x04, 0x97, 0x24, 0x96, 0xa4, 0x0a, 0xb9, 0x70, 0x71, 0x43, 0x94, 0xc6, 0xe7, 0x64, 0x16, + 0x97, 0x48, 0x30, 0x2a, 0x30, 0x6b, 0x70, 0x1b, 0xc9, 0xea, 0x61, 0x75, 0x9b, 0x5e, 0x10, 0x98, + 0xe5, 0xc4, 0x72, 0xe2, 0x9e, 0x3c, 0x43, 0x10, 0x17, 0x44, 0xdc, 0x27, 0xb3, 0xb8, 0x44, 0xc8, + 0x97, 0x8b, 0xaf, 0x38, 0xb5, 0xb0, 0x34, 0x35, 0x2f, 0x39, 0xb5, 0x08, 0x62, 0x10, 0x13, 0xd8, + 0x20, 0x05, 0x1c, 0x06, 0x05, 0xc3, 0x14, 0x43, 0xcd, 0xe2, 0x85, 0xeb, 0x06, 0x1b, 0x67, 0xcd, + 0xc5, 0x06, 0x71, 0xb5, 0x04, 0xb3, 0x02, 0x23, 0x1e, 0xf7, 0x04, 0x80, 0x15, 0x41, 0xcd, 0x80, + 0x6a, 0x71, 0xf2, 0x39, 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, 0xa3, 0xf4, + 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x37, 0x58, 0x58, 0xc1, 0x4c, 0xd6, + 0x2d, 0x4e, 0xc9, 0xd6, 0xaf, 0x40, 0x0a, 0xba, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0x70, + 0xb8, 0x19, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0x0d, 0x73, 0x66, 0xfd, 0xd3, 0x01, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SequencerList) > 0 { + for iNdEx := len(m.SequencerList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SequencerList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.RollupList) > 0 { + for iNdEx := len(m.RollupList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RollupList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.RollupList) > 0 { + for _, e := range m.RollupList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.SequencerList) > 0 { + for _, e := range m.SequencerList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupList", 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.RollupList = append(m.RollupList, Rollup{}) + if err := m.RollupList[len(m.RollupList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerList", 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.SequencerList = append(m.SequencerList, Sequencer{}) + if err := m.SequencerList[len(m.SequencerList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/or/rollup/types/genesis_test.go b/x/or/rollup/types/genesis_test.go new file mode 100644 index 0000000000..d120515879 --- /dev/null +++ b/x/or/rollup/types/genesis_test.go @@ -0,0 +1,40 @@ +package types_test + +import ( + "testing" + + "github.com/Finschia/finschia-sdk/x/or/rollup/types" + "github.com/stretchr/testify/require" +) + +func TestGenesisState_Validate(t *testing.T) { + for _, tc := range []struct { + desc string + genState *types.GenesisState + valid bool + }{ + { + desc: "default is valid", + genState: types.DefaultGenesis(), + valid: true, + }, + { + desc: "valid genesis state", + genState: &types.GenesisState{ + + // this line is used by starport scaffolding # types/genesis/validField + }, + valid: true, + }, + // this line is used by starport scaffolding # types/genesis/testcase + } { + t.Run(tc.desc, func(t *testing.T) { + err := tc.genState.Validate() + if tc.valid { + require.NoError(t, err) + } else { + require.Error(t, err) + } + }) + } +} diff --git a/x/or/rollup/types/keys.go b/x/or/rollup/types/keys.go new file mode 100644 index 0000000000..9610ac003c --- /dev/null +++ b/x/or/rollup/types/keys.go @@ -0,0 +1,47 @@ +package types + +import "encoding/binary" + +var _ binary.ByteOrder + +const ( + // ModuleName defines the module name + ModuleName = "rollup" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_rollup" +) + +var ( + RollupKeyPrefix = []byte{0x11} + + SequencerKeyPrefix = []byte{0x21} + SequencersByRollupKeyPrefix = []byte{0x22} + + DepositKeyPrefix = []byte{0x31} +) + +func RollupKey(rollupName string) []byte { + return append(RollupKeyPrefix, []byte(rollupName)...) +} + +func SequencerKey(sequencerAddress string) []byte { + return append(SequencerKeyPrefix, []byte(sequencerAddress)...) +} + +func DepositKey(rollupName, sequencerAddress string) []byte { + return append(DepositKeyPrefix, []byte(rollupName+"/"+sequencerAddress)...) +} + +func SequencersByRollupKey(rollupName string) []byte { + return append(SequencersByRollupKeyPrefix, []byte(rollupName)...) +} diff --git a/x/or/rollup/types/message_create_rollup.go b/x/or/rollup/types/message_create_rollup.go new file mode 100644 index 0000000000..f859813e2d --- /dev/null +++ b/x/or/rollup/types/message_create_rollup.go @@ -0,0 +1,89 @@ +package types + +import ( + "unicode/utf8" + + sdk "github.com/Finschia/finschia-sdk/types" + sdkerrors "github.com/Finschia/finschia-sdk/types/errors" +) + +const ( + nameLengthLimit = 30 +) + +var _ sdk.Msg = (*MsgCreateRollup)(nil) + +func NewMsgCreateRollup(rollupName, creator string, permissionedAddresses *Sequencers) *MsgCreateRollup { + return &MsgCreateRollup{ + RollupName: rollupName, + Creator: creator, + PermissionedAddresses: *permissionedAddresses, + } +} + +// ValidateBasic implements Msg. +func (m MsgCreateRollup) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Creator); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid from address: %s", m.Creator) + } + + if err := validateName(m.RollupName); err != nil { + return err + } + + permissionedAddresses := m.GetPermissionedAddresses() + if permissionedAddresses.Size() > 0 { + duplicateAddresses := make(map[string]bool) + for _, item := range permissionedAddresses.GetAddresses() { + // check if the item/element exist in the duplicateAddresses map + _, exist := duplicateAddresses[item] + if exist { + return sdkerrors.Wrapf(ErrPermissionedAddressesDuplicate, "address: %s", item) + } + // check Bech32 format + if _, err := sdk.AccAddressFromBech32(item); err != nil { + return sdkerrors.Wrapf(ErrInvalidPermissionedAddress, "invalid permissioned address: %s", err) + } + // mark as exist + duplicateAddresses[item] = true + } + } + + return nil +} + +// GetSigners implements Msg +func (m MsgCreateRollup) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(m.Creator) + return []sdk.AccAddress{signer} +} + +// Type implements the LegacyMsg.Type method. +func (m MsgCreateRollup) Type() string { + return sdk.MsgTypeURL(&m) +} + +// Route implements the LegacyMsg.Route method. +func (m MsgCreateRollup) Route() string { + return RouterKey +} + +// GetSignBytes implements the LegacyMsg.GetSignBytes method. +func (m MsgCreateRollup) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} + +func validateName(name string) error { + if err := validateStringSize(name, nameLengthLimit, "name"); err != nil { + return ErrInvalidNameLength.Wrap(err.Error()) + } + + return nil +} + +func validateStringSize(str string, limit int, name string) error { + if length := utf8.RuneCountInString(str); length > limit { + return sdkerrors.ErrInvalidRequest.Wrapf("%s cannot exceed %d in length: current %d", name, limit, length) + } + return nil +} diff --git a/x/or/rollup/types/message_deposit.go b/x/or/rollup/types/message_deposit.go new file mode 100644 index 0000000000..7e9ca7f054 --- /dev/null +++ b/x/or/rollup/types/message_deposit.go @@ -0,0 +1,42 @@ +package types + +import ( + sdk "github.com/Finschia/finschia-sdk/types" +) + +var _ sdk.Msg = (*MsgDeposit)(nil) + +func NewMsgDeposit(rollupName string, sequencerAddress string, amount sdk.Coin) *MsgDeposit { + return &MsgDeposit{ + RollupName: rollupName, + SequencerAddress: sequencerAddress, + Value: amount, + } +} + +// ValidateBasic implements Msg. +func (m MsgDeposit) ValidateBasic() error { + + return nil +} + +// GetSigners implements Msg +func (m MsgDeposit) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(m.SequencerAddress) + return []sdk.AccAddress{signer} +} + +// Type implements the LegacyMsg.Type method. +func (m MsgDeposit) Type() string { + return sdk.MsgTypeURL(&m) +} + +// Route implements the LegacyMsg.Route method. +func (m MsgDeposit) Route() string { + return RouterKey +} + +// GetSignBytes implements the LegacyMsg.GetSignBytes method. +func (m MsgDeposit) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} diff --git a/x/or/rollup/types/message_register_sequencer.go b/x/or/rollup/types/message_register_sequencer.go new file mode 100644 index 0000000000..4912085963 --- /dev/null +++ b/x/or/rollup/types/message_register_sequencer.go @@ -0,0 +1,70 @@ +package types + +import ( + sdk "github.com/Finschia/finschia-sdk/types" + sdkerrors "github.com/Finschia/finschia-sdk/types/errors" + + codectypes "github.com/Finschia/finschia-sdk/codec/types" + cryptotypes "github.com/Finschia/finschia-sdk/crypto/types" +) + +const ( + // TODO: change to parameter + MinDepositAmount = 10 +) + +var _ sdk.Msg = (*MsgRegisterSequencer)(nil) + +func NewMsgRegisterSequencer(pubkey cryptotypes.PubKey, rollupName, creator string, amount sdk.Coin) (*MsgRegisterSequencer, error) { + var pkAny *codectypes.Any + if pubkey != nil { + var err error + if pkAny, err = codectypes.NewAnyWithValue(pubkey); err != nil { + return nil, err + } + } + return &MsgRegisterSequencer{ + Creator: creator, + Pubkey: pkAny, + RollupName: rollupName, + Value: amount, + }, nil +} + +// ValidateBasic implements Msg. +func (m MsgRegisterSequencer) ValidateBasic() error { + if _, err := sdk.AccAddressFromBech32(m.Creator); err != nil { + return sdkerrors.ErrInvalidAddress.Wrapf("invalid from address: %s", m.Creator) + } + + if err := validateName(m.RollupName); err != nil { + return err + } + + if m.Value.Amount.LT(sdk.NewInt(MinDepositAmount)) { + return ErrIsNotEnoughDepositAmount + } + + return nil +} + +// GetSigners implements Msg +func (m MsgRegisterSequencer) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(m.Creator) + return []sdk.AccAddress{signer} +} + +// Type implements the LegacyMsg.Type method. +func (m MsgRegisterSequencer) Type() string { + return sdk.MsgTypeURL(&m) +} + +// Route implements the LegacyMsg.Route method. +func (m MsgRegisterSequencer) Route() string { + return RouterKey +} + +// GetSignBytes implements the LegacyMsg.GetSignBytes method. +func (m MsgRegisterSequencer) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} diff --git a/x/or/rollup/types/message_remove_sequencer.go b/x/or/rollup/types/message_remove_sequencer.go new file mode 100644 index 0000000000..39d3ef44a5 --- /dev/null +++ b/x/or/rollup/types/message_remove_sequencer.go @@ -0,0 +1,36 @@ +package types + +import ( + sdk "github.com/Finschia/finschia-sdk/types" +) + +var _ sdk.Msg = (*MsgRemoveSequencer)(nil) + +func NewMsgRemoveSequencer() (*MsgRemoveSequencer, error) { + return &MsgRemoveSequencer{}, nil +} + +// ValidateBasic implements Msg. +func (m MsgRemoveSequencer) ValidateBasic() error { + panic("implement me") +} + +// GetSigners implements Msg +func (m MsgRemoveSequencer) GetSigners() []sdk.AccAddress { + panic("implement me") +} + +// Type implements the LegacyMsg.Type method. +func (m MsgRemoveSequencer) Type() string { + panic("implement me") +} + +// Route implements the LegacyMsg.Route method. +func (m MsgRemoveSequencer) Route() string { + panic("implement me") +} + +// GetSignBytes implements the LegacyMsg.GetSignBytes method. +func (m MsgRemoveSequencer) GetSignBytes() []byte { + panic("implement me") +} diff --git a/x/or/rollup/types/message_withdraw.go b/x/or/rollup/types/message_withdraw.go new file mode 100644 index 0000000000..b7fa407394 --- /dev/null +++ b/x/or/rollup/types/message_withdraw.go @@ -0,0 +1,42 @@ +package types + +import ( + sdk "github.com/Finschia/finschia-sdk/types" +) + +var _ sdk.Msg = (*MsgWithdraw)(nil) + +func NewMsgWithdraw(rollupName string, sequencerAddress string, amount sdk.Coin) *MsgWithdraw { + return &MsgWithdraw{ + RollupName: rollupName, + SequencerAddress: sequencerAddress, + Value: amount, + } +} + +// ValidateBasic implements Msg. +func (m MsgWithdraw) ValidateBasic() error { + + return nil +} + +// GetSigners implements Msg +func (m MsgWithdraw) GetSigners() []sdk.AccAddress { + signer, _ := sdk.AccAddressFromBech32(m.SequencerAddress) + return []sdk.AccAddress{signer} +} + +// Type implements the LegacyMsg.Type method. +func (m MsgWithdraw) Type() string { + return sdk.MsgTypeURL(&m) +} + +// Route implements the LegacyMsg.Route method. +func (m MsgWithdraw) Route() string { + return RouterKey +} + +// GetSignBytes implements the LegacyMsg.GetSignBytes method. +func (m MsgWithdraw) GetSignBytes() []byte { + return sdk.MustSortJSON(ModuleCdc.MustMarshalJSON(&m)) +} diff --git a/x/or/rollup/types/params.go b/x/or/rollup/types/params.go new file mode 100644 index 0000000000..81bb8ee1cc --- /dev/null +++ b/x/or/rollup/types/params.go @@ -0,0 +1,39 @@ +package types + +import ( + paramtypes "github.com/Finschia/finschia-sdk/x/params/types" + "gopkg.in/yaml.v2" +) + +var _ paramtypes.ParamSet = (*Params)(nil) + +// ParamKeyTable the param key table for launch module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// NewParams creates a new Params instance +func NewParams() Params { + return Params{} +} + +// DefaultParams returns a default set of parameters +func DefaultParams() Params { + return NewParams() +} + +// ParamSetPairs get the params.ParamSet +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{} +} + +// Validate validates the set of params +func (p Params) Validate() error { + return nil +} + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/x/or/rollup/types/params.pb.go b/x/or/rollup/types/params.pb.go new file mode 100644 index 0000000000..005ffaddce --- /dev/null +++ b/x/or/rollup/types/params.pb.go @@ -0,0 +1,267 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: finschia/or/rollup/v1/params.proto + +package types + +import ( + 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 + +// Params defines the parameters for the module. +type Params struct { +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_7b9c5f6622dbda26, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func init() { + proto.RegisterType((*Params)(nil), "finschia.or.rollup.v1.Params") +} + +func init() { + proto.RegisterFile("finschia/or/rollup/v1/params.proto", fileDescriptor_7b9c5f6622dbda26) +} + +var fileDescriptor_7b9c5f6622dbda26 = []byte{ + // 163 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4a, 0xcb, 0xcc, 0x2b, + 0x4e, 0xce, 0xc8, 0x4c, 0xd4, 0xcf, 0x2f, 0xd2, 0x2f, 0xca, 0xcf, 0xc9, 0x29, 0x2d, 0xd0, 0x2f, + 0x33, 0xd4, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x12, + 0x85, 0xa9, 0xd1, 0xcb, 0x2f, 0xd2, 0x83, 0xa8, 0xd1, 0x2b, 0x33, 0x94, 0x12, 0x49, 0xcf, 0x4f, + 0xcf, 0x07, 0xab, 0xd0, 0x07, 0xb1, 0x20, 0x8a, 0x95, 0xf8, 0xb8, 0xd8, 0x02, 0xc0, 0x9a, 0xad, + 0x58, 0x66, 0x2c, 0x90, 0x67, 0x70, 0xf2, 0x39, 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, 0xa3, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x37, 0x98, + 0x2b, 0x60, 0x56, 0xe9, 0x16, 0xa7, 0x64, 0xeb, 0x57, 0x20, 0x39, 0xaa, 0xa4, 0xb2, 0x20, 0xb5, + 0x38, 0x89, 0x0d, 0x6c, 0x89, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8d, 0x4e, 0x83, 0x9a, 0xb7, + 0x00, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/or/rollup/types/query.pb.go b/x/or/rollup/types/query.pb.go new file mode 100644 index 0000000000..c6f2d3cb86 --- /dev/null +++ b/x/or/rollup/types/query.pb.go @@ -0,0 +1,2318 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: finschia/or/rollup/v1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/Finschia/finschia-sdk/codec/types" + query "github.com/Finschia/finschia-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 QueryRollupRequest struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` +} + +func (m *QueryRollupRequest) Reset() { *m = QueryRollupRequest{} } +func (m *QueryRollupRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRollupRequest) ProtoMessage() {} +func (*QueryRollupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{0} +} +func (m *QueryRollupRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRollupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRollupRequest.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 *QueryRollupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRollupRequest.Merge(m, src) +} +func (m *QueryRollupRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRollupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRollupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRollupRequest proto.InternalMessageInfo + +func (m *QueryRollupRequest) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +type QueryAllRollupRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRollupRequest) Reset() { *m = QueryAllRollupRequest{} } +func (m *QueryAllRollupRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRollupRequest) ProtoMessage() {} +func (*QueryAllRollupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{1} +} +func (m *QueryAllRollupRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRollupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRollupRequest.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 *QueryAllRollupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRollupRequest.Merge(m, src) +} +func (m *QueryAllRollupRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRollupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRollupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRollupRequest proto.InternalMessageInfo + +func (m *QueryAllRollupRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRollupResponse struct { + Rollup []Rollup `protobuf:"bytes,1,rep,name=rollup,proto3" json:"rollup"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRollupResponse) Reset() { *m = QueryAllRollupResponse{} } +func (m *QueryAllRollupResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRollupResponse) ProtoMessage() {} +func (*QueryAllRollupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{2} +} +func (m *QueryAllRollupResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRollupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRollupResponse.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 *QueryAllRollupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRollupResponse.Merge(m, src) +} +func (m *QueryAllRollupResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRollupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRollupResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRollupResponse proto.InternalMessageInfo + +func (m *QueryAllRollupResponse) GetRollup() []Rollup { + if m != nil { + return m.Rollup + } + return nil +} + +func (m *QueryAllRollupResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QuerySequencerRequest struct { + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` +} + +func (m *QuerySequencerRequest) Reset() { *m = QuerySequencerRequest{} } +func (m *QuerySequencerRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySequencerRequest) ProtoMessage() {} +func (*QuerySequencerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{3} +} +func (m *QuerySequencerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySequencerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySequencerRequest.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 *QuerySequencerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySequencerRequest.Merge(m, src) +} +func (m *QuerySequencerRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySequencerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySequencerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySequencerRequest proto.InternalMessageInfo + +func (m *QuerySequencerRequest) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +type QueryRollupResponse struct { + Rollup Rollup `protobuf:"bytes,1,opt,name=rollup,proto3" json:"rollup"` +} + +func (m *QueryRollupResponse) Reset() { *m = QueryRollupResponse{} } +func (m *QueryRollupResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRollupResponse) ProtoMessage() {} +func (*QueryRollupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{4} +} +func (m *QueryRollupResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRollupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRollupResponse.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 *QueryRollupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRollupResponse.Merge(m, src) +} +func (m *QueryRollupResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRollupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRollupResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRollupResponse proto.InternalMessageInfo + +func (m *QueryRollupResponse) GetRollup() Rollup { + if m != nil { + return m.Rollup + } + return Rollup{} +} + +type QuerySequencerResponse struct { + Sequencer Sequencer `protobuf:"bytes,1,opt,name=sequencer,proto3" json:"sequencer"` +} + +func (m *QuerySequencerResponse) Reset() { *m = QuerySequencerResponse{} } +func (m *QuerySequencerResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySequencerResponse) ProtoMessage() {} +func (*QuerySequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{5} +} +func (m *QuerySequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySequencerResponse.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 *QuerySequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySequencerResponse.Merge(m, src) +} +func (m *QuerySequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySequencerResponse proto.InternalMessageInfo + +func (m *QuerySequencerResponse) GetSequencer() Sequencer { + if m != nil { + return m.Sequencer + } + return Sequencer{} +} + +type QuerySequencersByRollupRequest struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` +} + +func (m *QuerySequencersByRollupRequest) Reset() { *m = QuerySequencersByRollupRequest{} } +func (m *QuerySequencersByRollupRequest) String() string { return proto.CompactTextString(m) } +func (*QuerySequencersByRollupRequest) ProtoMessage() {} +func (*QuerySequencersByRollupRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{6} +} +func (m *QuerySequencersByRollupRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySequencersByRollupRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySequencersByRollupRequest.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 *QuerySequencersByRollupRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySequencersByRollupRequest.Merge(m, src) +} +func (m *QuerySequencersByRollupRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySequencersByRollupRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySequencersByRollupRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySequencersByRollupRequest proto.InternalMessageInfo + +func (m *QuerySequencersByRollupRequest) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +type QuerySequencersByRollupResponse struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + SequencerList []Sequencer `protobuf:"bytes,2,rep,name=sequencer_list,json=sequencerList,proto3" json:"sequencer_list"` +} + +func (m *QuerySequencersByRollupResponse) Reset() { *m = QuerySequencersByRollupResponse{} } +func (m *QuerySequencersByRollupResponse) String() string { return proto.CompactTextString(m) } +func (*QuerySequencersByRollupResponse) ProtoMessage() {} +func (*QuerySequencersByRollupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{7} +} +func (m *QuerySequencersByRollupResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySequencersByRollupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySequencersByRollupResponse.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 *QuerySequencersByRollupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySequencersByRollupResponse.Merge(m, src) +} +func (m *QuerySequencersByRollupResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySequencersByRollupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySequencersByRollupResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySequencersByRollupResponse proto.InternalMessageInfo + +func (m *QuerySequencersByRollupResponse) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *QuerySequencersByRollupResponse) GetSequencerList() []Sequencer { + if m != nil { + return m.SequencerList + } + return nil +} + +type QueryDepositRequest struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + SequencerAddress string `protobuf:"bytes,2,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` +} + +func (m *QueryDepositRequest) Reset() { *m = QueryDepositRequest{} } +func (m *QueryDepositRequest) String() string { return proto.CompactTextString(m) } +func (*QueryDepositRequest) ProtoMessage() {} +func (*QueryDepositRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{8} +} +func (m *QueryDepositRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositRequest.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 *QueryDepositRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositRequest.Merge(m, src) +} +func (m *QueryDepositRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositRequest proto.InternalMessageInfo + +func (m *QueryDepositRequest) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *QueryDepositRequest) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +type QueryDepositResponse struct { + Deposit *Deposit `protobuf:"bytes,1,opt,name=deposit,proto3" json:"deposit,omitempty"` +} + +func (m *QueryDepositResponse) Reset() { *m = QueryDepositResponse{} } +func (m *QueryDepositResponse) String() string { return proto.CompactTextString(m) } +func (*QueryDepositResponse) ProtoMessage() {} +func (*QueryDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9dd402f5beff853f, []int{9} +} +func (m *QueryDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryDepositResponse.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 *QueryDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryDepositResponse.Merge(m, src) +} +func (m *QueryDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryDepositResponse proto.InternalMessageInfo + +func (m *QueryDepositResponse) GetDeposit() *Deposit { + if m != nil { + return m.Deposit + } + return nil +} + +func init() { + proto.RegisterType((*QueryRollupRequest)(nil), "finschia.or.rollup.v1.QueryRollupRequest") + proto.RegisterType((*QueryAllRollupRequest)(nil), "finschia.or.rollup.v1.QueryAllRollupRequest") + proto.RegisterType((*QueryAllRollupResponse)(nil), "finschia.or.rollup.v1.QueryAllRollupResponse") + proto.RegisterType((*QuerySequencerRequest)(nil), "finschia.or.rollup.v1.QuerySequencerRequest") + proto.RegisterType((*QueryRollupResponse)(nil), "finschia.or.rollup.v1.QueryRollupResponse") + proto.RegisterType((*QuerySequencerResponse)(nil), "finschia.or.rollup.v1.QuerySequencerResponse") + proto.RegisterType((*QuerySequencersByRollupRequest)(nil), "finschia.or.rollup.v1.QuerySequencersByRollupRequest") + proto.RegisterType((*QuerySequencersByRollupResponse)(nil), "finschia.or.rollup.v1.QuerySequencersByRollupResponse") + proto.RegisterType((*QueryDepositRequest)(nil), "finschia.or.rollup.v1.QueryDepositRequest") + proto.RegisterType((*QueryDepositResponse)(nil), "finschia.or.rollup.v1.QueryDepositResponse") +} + +func init() { proto.RegisterFile("finschia/or/rollup/v1/query.proto", fileDescriptor_9dd402f5beff853f) } + +var fileDescriptor_9dd402f5beff853f = []byte{ + // 704 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x95, 0x4f, 0x4f, 0x13, 0x4f, + 0x18, 0xc7, 0x3b, 0xfd, 0xfd, 0x2c, 0xe9, 0x10, 0x8d, 0x8e, 0x60, 0x70, 0xa3, 0x0b, 0x6e, 0x0c, + 0x22, 0x7f, 0x76, 0xd2, 0x12, 0x8c, 0x09, 0x31, 0x91, 0x4a, 0x40, 0x13, 0x54, 0xac, 0x37, 0x0f, + 0x36, 0xdb, 0x76, 0x58, 0x36, 0xb6, 0x3b, 0xcb, 0xce, 0x96, 0x48, 0x08, 0x17, 0x5f, 0x81, 0x46, + 0xe3, 0xd1, 0x77, 0xe0, 0xc9, 0x37, 0xc1, 0xc5, 0x84, 0xc4, 0x8b, 0x27, 0x63, 0xc0, 0xab, 0xef, + 0xc1, 0x74, 0xe6, 0xd9, 0xa5, 0xdb, 0x6e, 0x97, 0xe5, 0xd6, 0x99, 0x7d, 0xbe, 0xcf, 0xf3, 0x79, + 0xfe, 0x4d, 0xf1, 0xad, 0x2d, 0xc7, 0x15, 0x8d, 0x6d, 0xc7, 0xa2, 0xdc, 0xa7, 0x3e, 0x6f, 0xb5, + 0x3a, 0x1e, 0xdd, 0x2d, 0xd1, 0x9d, 0x0e, 0xf3, 0xf7, 0x4c, 0xcf, 0xe7, 0x01, 0x27, 0xe3, 0xa1, + 0x89, 0xc9, 0x7d, 0x53, 0x99, 0x98, 0xbb, 0x25, 0xed, 0x86, 0xcd, 0xb9, 0xdd, 0x62, 0xd4, 0xf2, + 0x1c, 0x6a, 0xb9, 0x2e, 0x0f, 0xac, 0xc0, 0xe1, 0xae, 0x50, 0x22, 0xcd, 0x48, 0xf6, 0x0b, 0x72, + 0x65, 0x33, 0xdb, 0xe0, 0xa2, 0xcd, 0x05, 0xad, 0x5b, 0x82, 0xa9, 0x88, 0x74, 0xb7, 0x54, 0x67, + 0x81, 0x55, 0xa2, 0x9e, 0x65, 0x3b, 0xae, 0x74, 0x08, 0xb6, 0xd7, 0x95, 0x6d, 0x4d, 0x9e, 0xa8, + 0x3a, 0x84, 0x9f, 0x00, 0x44, 0x9e, 0xea, 0x9d, 0x2d, 0x6a, 0xb9, 0x80, 0xae, 0x8d, 0xd9, 0xdc, + 0xe6, 0x4a, 0xd2, 0xfd, 0xa5, 0x6e, 0x8d, 0x25, 0x4c, 0x5e, 0x74, 0xa3, 0x55, 0x25, 0x4c, 0x95, + 0xed, 0x74, 0x98, 0x08, 0xc8, 0x24, 0x1e, 0x55, 0x74, 0x35, 0xd7, 0x6a, 0xb3, 0x09, 0x34, 0x85, + 0x66, 0x8a, 0x55, 0xac, 0xae, 0x9e, 0x59, 0x6d, 0x66, 0xd4, 0xf0, 0xb8, 0x94, 0xad, 0xb4, 0x5a, + 0x71, 0xe5, 0x1a, 0xc6, 0xa7, 0xbc, 0x52, 0x38, 0x5a, 0x9e, 0x36, 0x81, 0xb1, 0x9b, 0x9c, 0xa9, + 0xca, 0x09, 0xc9, 0x99, 0x9b, 0x96, 0xcd, 0x40, 0x5b, 0xed, 0x51, 0x1a, 0x5f, 0x10, 0xbe, 0xd6, + 0x1f, 0x41, 0x78, 0xdc, 0x15, 0x8c, 0x2c, 0xe3, 0x82, 0x22, 0x99, 0x40, 0x53, 0xff, 0xcd, 0x8c, + 0x96, 0x6f, 0x9a, 0x89, 0x4d, 0x31, 0x95, 0xac, 0xf2, 0xff, 0xe1, 0xaf, 0xc9, 0x5c, 0x15, 0x24, + 0x64, 0x3d, 0xc6, 0x97, 0x97, 0x7c, 0x77, 0xce, 0xe4, 0x53, 0x91, 0x63, 0x80, 0xab, 0x50, 0x81, + 0x97, 0x5d, 0x78, 0xb7, 0xc1, 0xfc, 0xb0, 0x02, 0x73, 0xf8, 0x8a, 0x08, 0xef, 0x6a, 0x56, 0xb3, + 0xe9, 0x33, 0x21, 0xa0, 0x82, 0x97, 0xa3, 0x0f, 0x2b, 0xea, 0xde, 0xa8, 0xe2, 0xab, 0xb1, 0xf2, + 0x27, 0xa4, 0x88, 0xce, 0x99, 0xa2, 0xf1, 0x1a, 0x2a, 0xd7, 0x43, 0x06, 0x6e, 0x57, 0x71, 0x31, + 0x22, 0x00, 0xcf, 0x53, 0x43, 0x3c, 0x47, 0x62, 0x70, 0x7e, 0x2a, 0x34, 0x56, 0xb0, 0x1e, 0xf7, + 0x2f, 0x2a, 0xe7, 0x1d, 0x9f, 0x0f, 0x08, 0x4f, 0x0e, 0xf5, 0x01, 0xb0, 0x67, 0x39, 0x21, 0x4f, + 0xf1, 0xa5, 0xd3, 0x42, 0xb7, 0x1c, 0x11, 0x4c, 0xe4, 0xe5, 0x3c, 0x64, 0x4d, 0xe9, 0x62, 0xa4, + 0xde, 0x70, 0x44, 0x60, 0x34, 0xa0, 0x15, 0xab, 0xcc, 0xe3, 0xc2, 0x09, 0xb2, 0xe6, 0x92, 0xdc, + 0xef, 0xfc, 0x90, 0x7e, 0x6f, 0xe2, 0xb1, 0x78, 0x10, 0x48, 0xf6, 0x3e, 0x1e, 0x69, 0xaa, 0x2b, + 0xe8, 0x8b, 0x3e, 0x24, 0x89, 0x50, 0x18, 0x9a, 0x97, 0xff, 0x16, 0xf0, 0x05, 0xe9, 0x92, 0x7c, + 0x42, 0xb8, 0xa0, 0x6a, 0x48, 0xee, 0x0e, 0x51, 0x0f, 0xae, 0xba, 0x36, 0x9b, 0xc5, 0x54, 0x51, + 0x1a, 0x8b, 0xef, 0x7e, 0xfc, 0xf9, 0x98, 0x5f, 0x20, 0x73, 0x34, 0xed, 0x45, 0xa3, 0xfb, 0x3d, + 0x05, 0x3b, 0x20, 0x9f, 0x11, 0x2e, 0x46, 0x4b, 0x4c, 0xe6, 0xd3, 0xc2, 0xf5, 0xbf, 0x26, 0xda, + 0x42, 0x46, 0x6b, 0xe0, 0x9b, 0x97, 0x7c, 0xd3, 0xe4, 0x76, 0x3a, 0x1f, 0x3c, 0x05, 0x5f, 0x11, + 0x2e, 0x46, 0x33, 0x91, 0x0e, 0xd6, 0xbf, 0xe4, 0xe9, 0x60, 0x03, 0x8b, 0x67, 0x3c, 0x92, 0x60, + 0x0f, 0xc8, 0x72, 0x3a, 0x58, 0x34, 0x2e, 0x74, 0x7f, 0x60, 0xa4, 0x0e, 0xc8, 0x77, 0x84, 0xc9, + 0xe0, 0xbe, 0x90, 0xa5, 0x4c, 0x28, 0xfd, 0x3b, 0xaa, 0xdd, 0x3b, 0xaf, 0x0c, 0x52, 0x79, 0x2c, + 0x53, 0xa9, 0x90, 0x87, 0x19, 0x53, 0x11, 0xb5, 0xfa, 0x5e, 0x2d, 0x71, 0x30, 0xbe, 0x21, 0x3c, + 0x02, 0xe3, 0x4c, 0x52, 0xa7, 0x30, 0xbe, 0x91, 0xda, 0x5c, 0x26, 0x5b, 0xc0, 0x7d, 0x2e, 0x71, + 0x9f, 0x90, 0xf5, 0x74, 0x5c, 0xd8, 0xa6, 0x38, 0x61, 0x52, 0x17, 0x2a, 0x1b, 0x87, 0xc7, 0x3a, + 0x3a, 0x3a, 0xd6, 0xd1, 0xef, 0x63, 0x1d, 0xbd, 0x3f, 0xd1, 0x73, 0x47, 0x27, 0x7a, 0xee, 0xe7, + 0x89, 0x9e, 0x7b, 0x55, 0xb6, 0x9d, 0x60, 0xbb, 0x53, 0x37, 0x1b, 0xbc, 0x4d, 0xd7, 0xc2, 0x60, + 0x61, 0xd4, 0x05, 0xd1, 0x7c, 0x43, 0xdf, 0xf6, 0xc4, 0x0e, 0xf6, 0x3c, 0x26, 0xea, 0x05, 0xf9, + 0x2f, 0xbc, 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xca, 0xc6, 0x2a, 0x48, 0x7b, 0x08, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + Rollup(ctx context.Context, in *QueryRollupRequest, opts ...grpc.CallOption) (*QueryRollupResponse, error) + AllRollup(ctx context.Context, in *QueryAllRollupRequest, opts ...grpc.CallOption) (*QueryAllRollupResponse, error) + Sequencer(ctx context.Context, in *QuerySequencerRequest, opts ...grpc.CallOption) (*QuerySequencerResponse, error) + SequencersByRollup(ctx context.Context, in *QuerySequencersByRollupRequest, opts ...grpc.CallOption) (*QuerySequencersByRollupResponse, error) + Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Rollup(ctx context.Context, in *QueryRollupRequest, opts ...grpc.CallOption) (*QueryRollupResponse, error) { + out := new(QueryRollupResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Query/Rollup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) AllRollup(ctx context.Context, in *QueryAllRollupRequest, opts ...grpc.CallOption) (*QueryAllRollupResponse, error) { + out := new(QueryAllRollupResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Query/AllRollup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Sequencer(ctx context.Context, in *QuerySequencerRequest, opts ...grpc.CallOption) (*QuerySequencerResponse, error) { + out := new(QuerySequencerResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Query/Sequencer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SequencersByRollup(ctx context.Context, in *QuerySequencersByRollupRequest, opts ...grpc.CallOption) (*QuerySequencersByRollupResponse, error) { + out := new(QuerySequencersByRollupResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Query/SequencersByRollup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Deposit(ctx context.Context, in *QueryDepositRequest, opts ...grpc.CallOption) (*QueryDepositResponse, error) { + out := new(QueryDepositResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Query/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Rollup(context.Context, *QueryRollupRequest) (*QueryRollupResponse, error) + AllRollup(context.Context, *QueryAllRollupRequest) (*QueryAllRollupResponse, error) + Sequencer(context.Context, *QuerySequencerRequest) (*QuerySequencerResponse, error) + SequencersByRollup(context.Context, *QuerySequencersByRollupRequest) (*QuerySequencersByRollupResponse, error) + Deposit(context.Context, *QueryDepositRequest) (*QueryDepositResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Rollup(ctx context.Context, req *QueryRollupRequest) (*QueryRollupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rollup not implemented") +} +func (*UnimplementedQueryServer) AllRollup(ctx context.Context, req *QueryAllRollupRequest) (*QueryAllRollupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AllRollup not implemented") +} +func (*UnimplementedQueryServer) Sequencer(ctx context.Context, req *QuerySequencerRequest) (*QuerySequencerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sequencer not implemented") +} +func (*UnimplementedQueryServer) SequencersByRollup(ctx context.Context, req *QuerySequencersByRollupRequest) (*QuerySequencersByRollupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SequencersByRollup not implemented") +} +func (*UnimplementedQueryServer) Deposit(ctx context.Context, req *QueryDepositRequest) (*QueryDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Rollup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRollupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Rollup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Query/Rollup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Rollup(ctx, req.(*QueryRollupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_AllRollup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRollupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).AllRollup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Query/AllRollup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).AllRollup(ctx, req.(*QueryAllRollupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Sequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySequencerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sequencer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Query/Sequencer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sequencer(ctx, req.(*QuerySequencerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SequencersByRollup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySequencersByRollupRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SequencersByRollup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Query/SequencersByRollup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SequencersByRollup(ctx, req.(*QuerySequencersByRollupRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryDepositRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Query/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Deposit(ctx, req.(*QueryDepositRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "finschia.or.rollup.v1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Rollup", + Handler: _Query_Rollup_Handler, + }, + { + MethodName: "AllRollup", + Handler: _Query_AllRollup_Handler, + }, + { + MethodName: "Sequencer", + Handler: _Query_Sequencer_Handler, + }, + { + MethodName: "SequencersByRollup", + Handler: _Query_SequencersByRollup_Handler, + }, + { + MethodName: "Deposit", + Handler: _Query_Deposit_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "finschia/or/rollup/v1/query.proto", +} + +func (m *QueryRollupRequest) 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 *QueryRollupRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRollupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRollupRequest) 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 *QueryAllRollupRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRollupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryAllRollupResponse) 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 *QueryAllRollupResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRollupResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Rollup) > 0 { + for iNdEx := len(m.Rollup) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rollup[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QuerySequencerRequest) 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 *QuerySequencerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySequencerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryRollupResponse) 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 *QueryRollupResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRollupResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Rollup.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QuerySequencerResponse) 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 *QuerySequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Sequencer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QuerySequencersByRollupRequest) 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 *QuerySequencersByRollupRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySequencersByRollupRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QuerySequencersByRollupResponse) 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 *QuerySequencersByRollupResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySequencersByRollupResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SequencerList) > 0 { + for iNdEx := len(m.SequencerList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SequencerList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositRequest) 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 *QueryDepositRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryDepositResponse) 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 *QueryDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Deposit != nil { + { + size, err := m.Deposit.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRollupRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRollupRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryAllRollupResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rollup) > 0 { + for _, e := range m.Rollup { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySequencerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRollupResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Rollup.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QuerySequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Sequencer.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QuerySequencersByRollupRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QuerySequencersByRollupResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.SequencerList) > 0 { + for _, e := range m.SequencerList { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryDepositRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Deposit != nil { + l = m.Deposit.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRollupRequest) 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: QueryRollupRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRollupRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = 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 (m *QueryAllRollupRequest) 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: QueryAllRollupRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRollupRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryAllRollupResponse) 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: QueryAllRollupResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRollupResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rollup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rollup = append(m.Rollup, Rollup{}) + if err := m.Rollup[len(m.Rollup)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySequencerRequest) 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: QuerySequencerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySequencerRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", 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.SequencerAddress = 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 (m *QueryRollupResponse) 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: QueryRollupResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRollupResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rollup", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Rollup.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySequencerResponse) 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: QuerySequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencer", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Sequencer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QuerySequencersByRollupRequest) 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: QuerySequencersByRollupRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySequencersByRollupRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = 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 (m *QuerySequencersByRollupResponse) 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: QuerySequencersByRollupResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySequencersByRollupResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerList = append(m.SequencerList, Sequencer{}) + if err := m.SequencerList[len(m.SequencerList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryDepositRequest) 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: QueryDepositRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", 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.SequencerAddress = 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 (m *QueryDepositResponse) 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: QueryDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryDepositResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Deposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Deposit == nil { + m.Deposit = &Deposit{} + } + if err := m.Deposit.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/or/rollup/types/query.pb.gw.go b/x/or/rollup/types/query.pb.gw.go new file mode 100644 index 0000000000..71ab405535 --- /dev/null +++ b/x/or/rollup/types/query.pb.gw.go @@ -0,0 +1,580 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: finschia/or/rollup/v1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_Query_Rollup_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRollupRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["rollup_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollup_name") + } + + protoReq.RollupName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollup_name", err) + } + + msg, err := client.Rollup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Rollup_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRollupRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["rollup_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollup_name") + } + + protoReq.RollupName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollup_name", err) + } + + msg, err := server.Rollup(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_AllRollup_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_AllRollup_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRollupRequest + 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_AllRollup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.AllRollup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_AllRollup_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRollupRequest + 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_AllRollup_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.AllRollup(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Sequencer_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySequencerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["sequencer_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencer_address") + } + + protoReq.SequencerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencer_address", err) + } + + msg, err := client.Sequencer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Sequencer_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySequencerRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["sequencer_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencer_address") + } + + protoReq.SequencerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencer_address", err) + } + + msg, err := server.Sequencer(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_SequencersByRollup_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySequencersByRollupRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["rollup_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollup_name") + } + + protoReq.RollupName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollup_name", err) + } + + msg, err := client.SequencersByRollup(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_SequencersByRollup_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QuerySequencersByRollupRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["rollup_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollup_name") + } + + protoReq.RollupName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollup_name", err) + } + + msg, err := server.SequencersByRollup(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["rollup_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollup_name") + } + + protoReq.RollupName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollup_name", err) + } + + val, ok = pathParams["sequencer_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencer_address") + } + + protoReq.SequencerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencer_address", err) + } + + msg, err := client.Deposit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Deposit_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryDepositRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["rollup_name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollup_name") + } + + protoReq.RollupName, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollup_name", err) + } + + val, ok = pathParams["sequencer_address"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencer_address") + } + + protoReq.SequencerAddress, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencer_address", err) + } + + msg, err := server.Deposit(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. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Rollup_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Rollup_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Rollup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllRollup_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_AllRollup_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_AllRollup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Sequencer_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Sequencer_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Sequencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SequencersByRollup_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_SequencersByRollup_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_SequencersByRollup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposit_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.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Deposit_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Rollup_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_Rollup_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_Rollup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_AllRollup_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_AllRollup_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_AllRollup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Sequencer_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_Sequencer_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_Sequencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_SequencersByRollup_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_SequencersByRollup_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_SequencersByRollup_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Deposit_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_Deposit_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_Deposit_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Rollup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 2, 1, 0, 4, 1, 5, 4}, []string{"finschia", "or", "rollup", "v1", "rollup_name"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_AllRollup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 2, 2, 2}, []string{"finschia", "or", "rollup", "v1"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Sequencer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 2, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"finschia", "or", "rollup", "v1", "sequencer", "sequencer_address"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_SequencersByRollup_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 2, 2, 4, 1, 0, 4, 1, 5, 5}, []string{"finschia", "or", "rollup", "v1", "sequencers_by_rollup", "rollup_name"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Deposit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 2, 2, 2, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"finschia", "or", "rollup", "v1", "deposit", "rollup_name", "sequencer_address"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Rollup_0 = runtime.ForwardResponseMessage + + forward_Query_AllRollup_0 = runtime.ForwardResponseMessage + + forward_Query_Sequencer_0 = runtime.ForwardResponseMessage + + forward_Query_SequencersByRollup_0 = runtime.ForwardResponseMessage + + forward_Query_Deposit_0 = runtime.ForwardResponseMessage +) diff --git a/x/or/rollup/types/rollup.pb.go b/x/or/rollup/types/rollup.pb.go new file mode 100644 index 0000000000..f7063b7b16 --- /dev/null +++ b/x/or/rollup/types/rollup.pb.go @@ -0,0 +1,1405 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: finschia/or/rollup/v1/rollup.proto + +package types + +import ( + fmt "fmt" + types "github.com/Finschia/finschia-sdk/codec/types" + types1 "github.com/Finschia/finschia-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-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 Rollup struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` + PermissionedAddresses Sequencers `protobuf:"bytes,3,opt,name=permissioned_addresses,json=permissionedAddresses,proto3" json:"permissioned_addresses"` +} + +func (m *Rollup) Reset() { *m = Rollup{} } +func (m *Rollup) String() string { return proto.CompactTextString(m) } +func (*Rollup) ProtoMessage() {} +func (*Rollup) Descriptor() ([]byte, []int) { + return fileDescriptor_11aa090da04695ac, []int{0} +} +func (m *Rollup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Rollup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Rollup.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 *Rollup) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rollup.Merge(m, src) +} +func (m *Rollup) XXX_Size() int { + return m.Size() +} +func (m *Rollup) XXX_DiscardUnknown() { + xxx_messageInfo_Rollup.DiscardUnknown(m) +} + +var xxx_messageInfo_Rollup proto.InternalMessageInfo + +func (m *Rollup) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *Rollup) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *Rollup) GetPermissionedAddresses() Sequencers { + if m != nil { + return m.PermissionedAddresses + } + return Sequencers{} +} + +type Sequencer struct { + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + Pubkey *types.Any `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + RollupName string `protobuf:"bytes,3,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` +} + +func (m *Sequencer) Reset() { *m = Sequencer{} } +func (m *Sequencer) String() string { return proto.CompactTextString(m) } +func (*Sequencer) ProtoMessage() {} +func (*Sequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_11aa090da04695ac, []int{1} +} +func (m *Sequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sequencer.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 *Sequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sequencer.Merge(m, src) +} +func (m *Sequencer) XXX_Size() int { + return m.Size() +} +func (m *Sequencer) XXX_DiscardUnknown() { + xxx_messageInfo_Sequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_Sequencer proto.InternalMessageInfo + +func (m *Sequencer) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *Sequencer) GetPubkey() *types.Any { + if m != nil { + return m.Pubkey + } + return nil +} + +func (m *Sequencer) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +type Deposit struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + SequencerAddress string `protobuf:"bytes,2,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + Value types1.Coin `protobuf:"bytes,3,opt,name=value,proto3" json:"value"` +} + +func (m *Deposit) Reset() { *m = Deposit{} } +func (m *Deposit) String() string { return proto.CompactTextString(m) } +func (*Deposit) ProtoMessage() {} +func (*Deposit) Descriptor() ([]byte, []int) { + return fileDescriptor_11aa090da04695ac, []int{2} +} +func (m *Deposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Deposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Deposit.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 *Deposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_Deposit.Merge(m, src) +} +func (m *Deposit) XXX_Size() int { + return m.Size() +} +func (m *Deposit) XXX_DiscardUnknown() { + xxx_messageInfo_Deposit.DiscardUnknown(m) +} + +var xxx_messageInfo_Deposit proto.InternalMessageInfo + +func (m *Deposit) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *Deposit) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *Deposit) GetValue() types1.Coin { + if m != nil { + return m.Value + } + return types1.Coin{} +} + +type SequencersByRollup struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + Sequencers []Sequencer `protobuf:"bytes,2,rep,name=sequencers,proto3" json:"sequencers"` +} + +func (m *SequencersByRollup) Reset() { *m = SequencersByRollup{} } +func (m *SequencersByRollup) String() string { return proto.CompactTextString(m) } +func (*SequencersByRollup) ProtoMessage() {} +func (*SequencersByRollup) Descriptor() ([]byte, []int) { + return fileDescriptor_11aa090da04695ac, []int{3} +} +func (m *SequencersByRollup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SequencersByRollup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SequencersByRollup.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 *SequencersByRollup) XXX_Merge(src proto.Message) { + xxx_messageInfo_SequencersByRollup.Merge(m, src) +} +func (m *SequencersByRollup) XXX_Size() int { + return m.Size() +} +func (m *SequencersByRollup) XXX_DiscardUnknown() { + xxx_messageInfo_SequencersByRollup.DiscardUnknown(m) +} + +var xxx_messageInfo_SequencersByRollup proto.InternalMessageInfo + +func (m *SequencersByRollup) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *SequencersByRollup) GetSequencers() []Sequencer { + if m != nil { + return m.Sequencers + } + return nil +} + +type Sequencers struct { + Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"` +} + +func (m *Sequencers) Reset() { *m = Sequencers{} } +func (m *Sequencers) String() string { return proto.CompactTextString(m) } +func (*Sequencers) ProtoMessage() {} +func (*Sequencers) Descriptor() ([]byte, []int) { + return fileDescriptor_11aa090da04695ac, []int{4} +} +func (m *Sequencers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sequencers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sequencers.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 *Sequencers) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sequencers.Merge(m, src) +} +func (m *Sequencers) XXX_Size() int { + return m.Size() +} +func (m *Sequencers) XXX_DiscardUnknown() { + xxx_messageInfo_Sequencers.DiscardUnknown(m) +} + +var xxx_messageInfo_Sequencers proto.InternalMessageInfo + +func (m *Sequencers) GetAddresses() []string { + if m != nil { + return m.Addresses + } + return nil +} + +func init() { + proto.RegisterType((*Rollup)(nil), "finschia.or.rollup.v1.Rollup") + proto.RegisterType((*Sequencer)(nil), "finschia.or.rollup.v1.Sequencer") + proto.RegisterType((*Deposit)(nil), "finschia.or.rollup.v1.Deposit") + proto.RegisterType((*SequencersByRollup)(nil), "finschia.or.rollup.v1.SequencersByRollup") + proto.RegisterType((*Sequencers)(nil), "finschia.or.rollup.v1.Sequencers") +} + +func init() { + proto.RegisterFile("finschia/or/rollup/v1/rollup.proto", fileDescriptor_11aa090da04695ac) +} + +var fileDescriptor_11aa090da04695ac = []byte{ + // 472 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x53, 0xc1, 0x6e, 0xd3, 0x40, + 0x10, 0xcd, 0x36, 0x90, 0x2a, 0x93, 0x0b, 0x58, 0x29, 0x72, 0x2a, 0xe4, 0x06, 0x9f, 0x22, 0x50, + 0x77, 0x95, 0x20, 0x3e, 0xa0, 0x01, 0xe5, 0x02, 0x42, 0xc8, 0xdc, 0x38, 0x10, 0xd9, 0xce, 0xd4, + 0xb5, 0x1a, 0x7b, 0xcc, 0xae, 0x1d, 0xe1, 0x03, 0xbf, 0x80, 0xf8, 0x05, 0xc4, 0x2f, 0xf0, 0x11, + 0x15, 0xa7, 0x1e, 0x39, 0x21, 0x94, 0xfc, 0x08, 0x8a, 0x77, 0x9d, 0x44, 0x55, 0x51, 0x7a, 0xf3, + 0xcc, 0xbc, 0x99, 0x79, 0xf3, 0x9e, 0x17, 0xdc, 0xf3, 0x38, 0x55, 0xe1, 0x45, 0xec, 0x0b, 0x92, + 0x42, 0xd2, 0x7c, 0x5e, 0x64, 0x62, 0x31, 0x34, 0x5f, 0x3c, 0x93, 0x94, 0x93, 0x75, 0x54, 0x63, + 0x38, 0x49, 0x6e, 0x2a, 0x8b, 0xe1, 0x71, 0x2f, 0x24, 0x95, 0x90, 0x9a, 0x56, 0x20, 0xa1, 0x03, + 0xdd, 0x71, 0xdc, 0x8b, 0x88, 0xa2, 0x39, 0x8a, 0x2a, 0x0a, 0x8a, 0x73, 0xe1, 0xa7, 0xa5, 0x29, + 0x39, 0x1a, 0x28, 0x02, 0x5f, 0xa1, 0x58, 0x0c, 0x03, 0xcc, 0xfd, 0xa1, 0x08, 0x29, 0x4e, 0x4d, + 0xbd, 0x1b, 0x51, 0x44, 0x7a, 0xe4, 0xfa, 0x4b, 0x67, 0xdd, 0x1f, 0x0c, 0x5a, 0x5e, 0xb5, 0xd9, + 0x3a, 0x81, 0x8e, 0xe6, 0x30, 0x4d, 0xfd, 0x04, 0x6d, 0xd6, 0x67, 0x83, 0xb6, 0x07, 0x3a, 0xf5, + 0xd6, 0x4f, 0xd0, 0xb2, 0xe1, 0x30, 0x94, 0xe8, 0xe7, 0x24, 0xed, 0x83, 0xaa, 0x58, 0x87, 0xd6, + 0x47, 0x78, 0x94, 0xa1, 0x4c, 0x62, 0xa5, 0x62, 0x4a, 0x71, 0x36, 0xf5, 0x67, 0x33, 0x89, 0x4a, + 0xa1, 0xb2, 0x9b, 0x7d, 0x36, 0xe8, 0x8c, 0x9e, 0xf0, 0x5b, 0x2f, 0xe5, 0xef, 0xf1, 0x53, 0x81, + 0x69, 0x88, 0x52, 0x8d, 0xef, 0x5d, 0xfd, 0x39, 0x69, 0x78, 0x47, 0xbb, 0x63, 0xce, 0xea, 0x29, + 0xee, 0x77, 0x06, 0xed, 0x0d, 0xd6, 0x7a, 0x06, 0x0f, 0x55, 0x1d, 0xd4, 0xab, 0x0c, 0xdd, 0x07, + 0x9b, 0x82, 0x69, 0xb6, 0x26, 0xd0, 0xca, 0x8a, 0xe0, 0x12, 0xcb, 0x8a, 0x73, 0x67, 0xd4, 0xe5, + 0x5a, 0x42, 0x5e, 0x4b, 0xc8, 0xcf, 0xd2, 0x72, 0x6c, 0xff, 0xfa, 0x79, 0xda, 0x35, 0x4a, 0x87, + 0xb2, 0xcc, 0x72, 0xe2, 0xef, 0x8a, 0xe0, 0x35, 0x96, 0x9e, 0xe9, 0xbe, 0xa9, 0x4e, 0xf3, 0xa6, + 0x3a, 0xee, 0x57, 0x06, 0x87, 0xaf, 0x30, 0x23, 0x15, 0xe7, 0xfb, 0xa5, 0xbc, 0xf5, 0x84, 0x83, + 0xff, 0x9c, 0xf0, 0x02, 0xee, 0x2f, 0xfc, 0x79, 0x81, 0x46, 0xcc, 0x1e, 0x37, 0x44, 0xd7, 0x4e, + 0x73, 0xe3, 0x34, 0x7f, 0x49, 0x71, 0x6a, 0x44, 0xd4, 0x68, 0xf7, 0x0b, 0x58, 0x3b, 0xfa, 0x96, + 0x77, 0x75, 0x79, 0x02, 0xb0, 0x61, 0xb0, 0xe6, 0xd4, 0x1c, 0x74, 0x46, 0xfd, 0x7d, 0xfe, 0x99, + 0xcd, 0x3b, 0x9d, 0xee, 0x53, 0x80, 0xed, 0x7a, 0xeb, 0x31, 0xb4, 0xb7, 0x3f, 0x05, 0xeb, 0x37, + 0x07, 0x6d, 0x6f, 0x9b, 0x18, 0xbf, 0xb9, 0x5a, 0x3a, 0xec, 0x7a, 0xe9, 0xb0, 0xbf, 0x4b, 0x87, + 0x7d, 0x5b, 0x39, 0x8d, 0xeb, 0x95, 0xd3, 0xf8, 0xbd, 0x72, 0x1a, 0x1f, 0x46, 0x51, 0x9c, 0x5f, + 0x14, 0x01, 0x0f, 0x29, 0x11, 0x93, 0xfa, 0x45, 0xd5, 0x64, 0x4e, 0xd5, 0xec, 0x52, 0x7c, 0xde, + 0x79, 0x60, 0x79, 0x99, 0xa1, 0x0a, 0x5a, 0x95, 0xb5, 0xcf, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, + 0xf9, 0xce, 0xab, 0x95, 0x83, 0x03, 0x00, 0x00, +} + +func (m *Rollup) 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 *Rollup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Rollup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PermissionedAddresses.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintRollup(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintRollup(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Sequencer) 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 *Sequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintRollup(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0x1a + } + if m.Pubkey != nil { + { + size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintRollup(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Deposit) 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 *Deposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Deposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintRollup(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintRollup(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SequencersByRollup) 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 *SequencersByRollup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SequencersByRollup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sequencers) > 0 { + for iNdEx := len(m.Sequencers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sequencers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollup(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintRollup(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Sequencers) 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 *Sequencers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sequencers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Addresses) > 0 { + for iNdEx := len(m.Addresses) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Addresses[iNdEx]) + copy(dAtA[i:], m.Addresses[iNdEx]) + i = encodeVarintRollup(dAtA, i, uint64(len(m.Addresses[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintRollup(dAtA []byte, offset int, v uint64) int { + offset -= sovRollup(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Rollup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + l = m.PermissionedAddresses.Size() + n += 1 + l + sovRollup(uint64(l)) + return n +} + +func (m *Sequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + if m.Pubkey != nil { + l = m.Pubkey.Size() + n += 1 + l + sovRollup(uint64(l)) + } + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + return n +} + +func (m *Deposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + l = m.Value.Size() + n += 1 + l + sovRollup(uint64(l)) + return n +} + +func (m *SequencersByRollup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovRollup(uint64(l)) + } + if len(m.Sequencers) > 0 { + for _, e := range m.Sequencers { + l = e.Size() + n += 1 + l + sovRollup(uint64(l)) + } + } + return n +} + +func (m *Sequencers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Addresses) > 0 { + for _, s := range m.Addresses { + l = len(s) + n += 1 + l + sovRollup(uint64(l)) + } + } + return n +} + +func sovRollup(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRollup(x uint64) (n int) { + return sovRollup(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Rollup) 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 ErrIntOverflowRollup + } + 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: Rollup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Rollup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PermissionedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PermissionedAddresses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRollup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Sequencer) 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 ErrIntOverflowRollup + } + 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: Sequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pubkey == nil { + m.Pubkey = &types.Any{} + } + if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRollup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Deposit) 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 ErrIntOverflowRollup + } + 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: Deposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Deposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRollup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SequencersByRollup) 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 ErrIntOverflowRollup + } + 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: SequencersByRollup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SequencersByRollup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollup + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sequencers = append(m.Sequencers, Sequencer{}) + if err := m.Sequencers[len(m.Sequencers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRollup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Sequencers) 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 ErrIntOverflowRollup + } + 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: Sequencers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sequencers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Addresses", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollup + } + 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 ErrInvalidLengthRollup + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollup + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Addresses = append(m.Addresses, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRollup(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollup + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRollup(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, ErrIntOverflowRollup + } + 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, ErrIntOverflowRollup + } + 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, ErrIntOverflowRollup + } + 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, ErrInvalidLengthRollup + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRollup + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRollup + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRollup = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRollup = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRollup = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/or/rollup/types/tx.pb.go b/x/or/rollup/types/tx.pb.go new file mode 100644 index 0000000000..222c786a62 --- /dev/null +++ b/x/or/rollup/types/tx.pb.go @@ -0,0 +1,2276 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: finschia/or/rollup/v1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + types "github.com/Finschia/finschia-sdk/codec/types" + types1 "github.com/Finschia/finschia-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "github.com/regen-network/cosmos-proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 MsgCreateRollup struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + Creator string `protobuf:"bytes,2,opt,name=creator,proto3" json:"creator,omitempty"` + PermissionedAddresses Sequencers `protobuf:"bytes,3,opt,name=permissioned_addresses,json=permissionedAddresses,proto3" json:"permissioned_addresses"` +} + +func (m *MsgCreateRollup) Reset() { *m = MsgCreateRollup{} } +func (m *MsgCreateRollup) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRollup) ProtoMessage() {} +func (*MsgCreateRollup) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{0} +} +func (m *MsgCreateRollup) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRollup) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRollup.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 *MsgCreateRollup) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRollup.Merge(m, src) +} +func (m *MsgCreateRollup) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRollup) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRollup.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRollup proto.InternalMessageInfo + +func (m *MsgCreateRollup) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *MsgCreateRollup) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateRollup) GetPermissionedAddresses() Sequencers { + if m != nil { + return m.PermissionedAddresses + } + return Sequencers{} +} + +type MsgRegisterSequencer struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Pubkey *types.Any `protobuf:"bytes,2,opt,name=pubkey,proto3" json:"pubkey,omitempty"` + RollupName string `protobuf:"bytes,3,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + Value types1.Coin `protobuf:"bytes,4,opt,name=value,proto3" json:"value"` +} + +func (m *MsgRegisterSequencer) Reset() { *m = MsgRegisterSequencer{} } +func (m *MsgRegisterSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterSequencer) ProtoMessage() {} +func (*MsgRegisterSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{1} +} +func (m *MsgRegisterSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterSequencer.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 *MsgRegisterSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterSequencer.Merge(m, src) +} +func (m *MsgRegisterSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterSequencer proto.InternalMessageInfo + +func (m *MsgRegisterSequencer) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgRegisterSequencer) GetPubkey() *types.Any { + if m != nil { + return m.Pubkey + } + return nil +} + +func (m *MsgRegisterSequencer) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *MsgRegisterSequencer) GetValue() types1.Coin { + if m != nil { + return m.Value + } + return types1.Coin{} +} + +type MsgDeposit struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + SequencerAddress string `protobuf:"bytes,2,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + Value types1.Coin `protobuf:"bytes,3,opt,name=value,proto3" json:"value"` +} + +func (m *MsgDeposit) Reset() { *m = MsgDeposit{} } +func (m *MsgDeposit) String() string { return proto.CompactTextString(m) } +func (*MsgDeposit) ProtoMessage() {} +func (*MsgDeposit) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{2} +} +func (m *MsgDeposit) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeposit) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeposit.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 *MsgDeposit) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeposit.Merge(m, src) +} +func (m *MsgDeposit) XXX_Size() int { + return m.Size() +} +func (m *MsgDeposit) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeposit.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeposit proto.InternalMessageInfo + +func (m *MsgDeposit) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *MsgDeposit) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *MsgDeposit) GetValue() types1.Coin { + if m != nil { + return m.Value + } + return types1.Coin{} +} + +type MsgWithdraw struct { + RollupName string `protobuf:"bytes,1,opt,name=rollup_name,json=rollupName,proto3" json:"rollup_name,omitempty"` + SequencerAddress string `protobuf:"bytes,2,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + Value types1.Coin `protobuf:"bytes,3,opt,name=value,proto3" json:"value"` +} + +func (m *MsgWithdraw) Reset() { *m = MsgWithdraw{} } +func (m *MsgWithdraw) String() string { return proto.CompactTextString(m) } +func (*MsgWithdraw) ProtoMessage() {} +func (*MsgWithdraw) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{3} +} +func (m *MsgWithdraw) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdraw) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdraw.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 *MsgWithdraw) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdraw.Merge(m, src) +} +func (m *MsgWithdraw) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdraw) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdraw.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdraw proto.InternalMessageInfo + +func (m *MsgWithdraw) GetRollupName() string { + if m != nil { + return m.RollupName + } + return "" +} + +func (m *MsgWithdraw) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *MsgWithdraw) GetValue() types1.Coin { + if m != nil { + return m.Value + } + return types1.Coin{} +} + +type MsgCreateRollupResponse struct { +} + +func (m *MsgCreateRollupResponse) Reset() { *m = MsgCreateRollupResponse{} } +func (m *MsgCreateRollupResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRollupResponse) ProtoMessage() {} +func (*MsgCreateRollupResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{4} +} +func (m *MsgCreateRollupResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRollupResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRollupResponse.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 *MsgCreateRollupResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRollupResponse.Merge(m, src) +} +func (m *MsgCreateRollupResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRollupResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRollupResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRollupResponse proto.InternalMessageInfo + +type MsgRegisterSequencerResponse struct { +} + +func (m *MsgRegisterSequencerResponse) Reset() { *m = MsgRegisterSequencerResponse{} } +func (m *MsgRegisterSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRegisterSequencerResponse) ProtoMessage() {} +func (*MsgRegisterSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{5} +} +func (m *MsgRegisterSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRegisterSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRegisterSequencerResponse.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 *MsgRegisterSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRegisterSequencerResponse.Merge(m, src) +} +func (m *MsgRegisterSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRegisterSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRegisterSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRegisterSequencerResponse proto.InternalMessageInfo + +type MsgRemoveSequencer struct { +} + +func (m *MsgRemoveSequencer) Reset() { *m = MsgRemoveSequencer{} } +func (m *MsgRemoveSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveSequencer) ProtoMessage() {} +func (*MsgRemoveSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{6} +} +func (m *MsgRemoveSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveSequencer.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 *MsgRemoveSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveSequencer.Merge(m, src) +} +func (m *MsgRemoveSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveSequencer proto.InternalMessageInfo + +type MsgRemoveSequencerResponse struct { +} + +func (m *MsgRemoveSequencerResponse) Reset() { *m = MsgRemoveSequencerResponse{} } +func (m *MsgRemoveSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRemoveSequencerResponse) ProtoMessage() {} +func (*MsgRemoveSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{7} +} +func (m *MsgRemoveSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRemoveSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRemoveSequencerResponse.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 *MsgRemoveSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRemoveSequencerResponse.Merge(m, src) +} +func (m *MsgRemoveSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRemoveSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRemoveSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRemoveSequencerResponse proto.InternalMessageInfo + +type MsgDepositResponse struct { +} + +func (m *MsgDepositResponse) Reset() { *m = MsgDepositResponse{} } +func (m *MsgDepositResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDepositResponse) ProtoMessage() {} +func (*MsgDepositResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{8} +} +func (m *MsgDepositResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDepositResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDepositResponse.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 *MsgDepositResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDepositResponse.Merge(m, src) +} +func (m *MsgDepositResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDepositResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDepositResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDepositResponse proto.InternalMessageInfo + +type MsgWithdrawResponse struct { +} + +func (m *MsgWithdrawResponse) Reset() { *m = MsgWithdrawResponse{} } +func (m *MsgWithdrawResponse) String() string { return proto.CompactTextString(m) } +func (*MsgWithdrawResponse) ProtoMessage() {} +func (*MsgWithdrawResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c08605be9a42de51, []int{9} +} +func (m *MsgWithdrawResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgWithdrawResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgWithdrawResponse.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 *MsgWithdrawResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgWithdrawResponse.Merge(m, src) +} +func (m *MsgWithdrawResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgWithdrawResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgWithdrawResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgWithdrawResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateRollup)(nil), "finschia.or.rollup.v1.MsgCreateRollup") + proto.RegisterType((*MsgRegisterSequencer)(nil), "finschia.or.rollup.v1.MsgRegisterSequencer") + proto.RegisterType((*MsgDeposit)(nil), "finschia.or.rollup.v1.MsgDeposit") + proto.RegisterType((*MsgWithdraw)(nil), "finschia.or.rollup.v1.MsgWithdraw") + proto.RegisterType((*MsgCreateRollupResponse)(nil), "finschia.or.rollup.v1.MsgCreateRollupResponse") + proto.RegisterType((*MsgRegisterSequencerResponse)(nil), "finschia.or.rollup.v1.MsgRegisterSequencerResponse") + proto.RegisterType((*MsgRemoveSequencer)(nil), "finschia.or.rollup.v1.MsgRemoveSequencer") + proto.RegisterType((*MsgRemoveSequencerResponse)(nil), "finschia.or.rollup.v1.MsgRemoveSequencerResponse") + proto.RegisterType((*MsgDepositResponse)(nil), "finschia.or.rollup.v1.MsgDepositResponse") + proto.RegisterType((*MsgWithdrawResponse)(nil), "finschia.or.rollup.v1.MsgWithdrawResponse") +} + +func init() { proto.RegisterFile("finschia/or/rollup/v1/tx.proto", fileDescriptor_c08605be9a42de51) } + +var fileDescriptor_c08605be9a42de51 = []byte{ + // 613 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0xc1, 0x4e, 0xdb, 0x4c, + 0x10, 0x8e, 0xff, 0xf0, 0x43, 0x3b, 0xa9, 0x44, 0x71, 0x43, 0xeb, 0x58, 0xc8, 0x80, 0x0f, 0x15, + 0x14, 0xb1, 0xab, 0x04, 0xf5, 0x01, 0x80, 0x8a, 0x4b, 0x9b, 0xaa, 0x72, 0x0f, 0x48, 0x1c, 0x8a, + 0x6c, 0x67, 0x30, 0x16, 0xb1, 0xd7, 0xdd, 0xb5, 0x53, 0xfc, 0x0a, 0x3d, 0xb5, 0x7d, 0x8e, 0x1e, + 0xfb, 0x10, 0xa8, 0x27, 0x8e, 0x3d, 0x55, 0x15, 0xbc, 0x48, 0x85, 0xbd, 0xeb, 0x86, 0x84, 0x34, + 0x70, 0xeb, 0xcd, 0x3b, 0xdf, 0xf7, 0xcd, 0xce, 0x7c, 0x33, 0x5e, 0xb0, 0x8e, 0xc2, 0x58, 0xf8, + 0xc7, 0xa1, 0x4b, 0x19, 0xa7, 0x9c, 0xf5, 0xfb, 0x59, 0x42, 0x07, 0x6d, 0x9a, 0x9e, 0x92, 0x84, + 0xb3, 0x94, 0xe9, 0x8b, 0x0a, 0x27, 0x8c, 0x93, 0x12, 0x27, 0x83, 0xb6, 0xd9, 0xf2, 0x99, 0x88, + 0x98, 0x38, 0x2c, 0x48, 0xb4, 0x3c, 0x94, 0x0a, 0xb3, 0x15, 0x30, 0x16, 0xf4, 0x91, 0x16, 0x27, + 0x2f, 0x3b, 0xa2, 0x6e, 0x9c, 0x4b, 0xa8, 0x19, 0xb0, 0x80, 0x95, 0x92, 0xab, 0x2f, 0x19, 0xb5, + 0x4a, 0x39, 0xf5, 0x5c, 0x81, 0x74, 0xd0, 0xf6, 0x30, 0x75, 0xdb, 0xd4, 0x67, 0x61, 0x2c, 0x71, + 0xfb, 0xe6, 0x12, 0x65, 0x31, 0x05, 0xc7, 0xfe, 0xaa, 0xc1, 0x7c, 0x57, 0x04, 0xbb, 0x1c, 0xdd, + 0x14, 0x9d, 0x02, 0xd1, 0x97, 0xa1, 0x51, 0x72, 0x0e, 0x63, 0x37, 0x42, 0x43, 0x5b, 0xd1, 0xd6, + 0xee, 0x3b, 0x50, 0x86, 0x5e, 0xbb, 0x11, 0xea, 0x06, 0xcc, 0xf9, 0x57, 0x02, 0xc6, 0x8d, 0xff, + 0x0a, 0x50, 0x1d, 0xf5, 0x77, 0xf0, 0x38, 0x41, 0x1e, 0x85, 0x42, 0x84, 0x2c, 0xc6, 0xde, 0xa1, + 0xdb, 0xeb, 0x71, 0x14, 0x02, 0x85, 0x51, 0x5f, 0xd1, 0xd6, 0x1a, 0x9d, 0x55, 0x72, 0xa3, 0x2d, + 0xe4, 0x2d, 0xbe, 0xcf, 0x30, 0xf6, 0x91, 0x8b, 0x9d, 0x99, 0xb3, 0x9f, 0xcb, 0x35, 0x67, 0x71, + 0x38, 0xcd, 0xb6, 0xca, 0x62, 0x9f, 0x6b, 0xd0, 0xec, 0x8a, 0xc0, 0xc1, 0x20, 0x14, 0x29, 0xf2, + 0x4a, 0x36, 0x5c, 0x92, 0x76, 0xbd, 0xa4, 0x3d, 0x98, 0x4d, 0x32, 0xef, 0x04, 0xf3, 0xa2, 0xd6, + 0x46, 0xa7, 0x49, 0x4a, 0x9f, 0x89, 0xf2, 0x99, 0x6c, 0xc7, 0xf9, 0x8e, 0xf1, 0xfd, 0xdb, 0x66, + 0x53, 0x8e, 0xc3, 0xe7, 0x79, 0x92, 0x32, 0xf2, 0x26, 0xf3, 0x5e, 0x62, 0xee, 0x48, 0xf5, 0xa8, + 0x2b, 0xf5, 0x31, 0x57, 0x9e, 0xc3, 0xff, 0x03, 0xb7, 0x9f, 0xa1, 0x31, 0x53, 0xdc, 0xd3, 0x22, + 0x32, 0xdd, 0xd5, 0x78, 0x88, 0x1c, 0x0f, 0xd9, 0x65, 0x61, 0x2c, 0x5b, 0x2c, 0xd9, 0xf6, 0x67, + 0x0d, 0xa0, 0x2b, 0x82, 0x17, 0x98, 0x30, 0x11, 0xa6, 0xd3, 0xcd, 0xdf, 0x80, 0x05, 0xa1, 0xda, + 0x56, 0xfe, 0xca, 0x31, 0x3c, 0xac, 0x00, 0xe9, 0xd8, 0x9f, 0x9a, 0xea, 0x77, 0xaa, 0xe9, 0x8b, + 0x06, 0x8d, 0xae, 0x08, 0xf6, 0xc3, 0xf4, 0xb8, 0xc7, 0xdd, 0x0f, 0xff, 0x46, 0x51, 0x2d, 0x78, + 0x32, 0xb2, 0xa9, 0x0e, 0x8a, 0x84, 0xc5, 0x02, 0x6d, 0x0b, 0x96, 0x6e, 0xda, 0x8a, 0x0a, 0x6f, + 0x82, 0x5e, 0xe0, 0x11, 0x1b, 0x60, 0x85, 0xda, 0x4b, 0x60, 0x8e, 0x47, 0x47, 0x34, 0x72, 0x2c, + 0x55, 0x74, 0x11, 0x1e, 0x0d, 0x19, 0xa3, 0xc2, 0x9d, 0x8f, 0x33, 0x50, 0xef, 0x8a, 0x40, 0x3f, + 0x82, 0x07, 0xd7, 0x7e, 0xa5, 0xa7, 0x13, 0xf6, 0x7d, 0xa4, 0x11, 0x93, 0xdc, 0x8e, 0xa7, 0xee, + 0xd3, 0x33, 0x58, 0x18, 0xff, 0x07, 0x36, 0x26, 0x27, 0x19, 0x23, 0x9b, 0x5b, 0x77, 0x20, 0x57, + 0xd7, 0xee, 0xc3, 0x9c, 0xda, 0xd3, 0xd5, 0xc9, 0x7a, 0x49, 0x31, 0xd7, 0xa7, 0x52, 0xaa, 0xc4, + 0x07, 0x70, 0xaf, 0x5a, 0x36, 0x7b, 0xb2, 0x4c, 0x71, 0xcc, 0x67, 0xd3, 0x39, 0x55, 0x6e, 0x06, + 0xf3, 0x23, 0x33, 0xd6, 0xd7, 0xff, 0xd6, 0xfc, 0x35, 0xaa, 0xd9, 0xbe, 0x35, 0x55, 0x5d, 0xb8, + 0xf3, 0xea, 0xec, 0xc2, 0xd2, 0xce, 0x2f, 0x2c, 0xed, 0xd7, 0x85, 0xa5, 0x7d, 0xba, 0xb4, 0x6a, + 0xe7, 0x97, 0x56, 0xed, 0xc7, 0xa5, 0x55, 0x3b, 0xe8, 0x04, 0x61, 0x7a, 0x9c, 0x79, 0xc4, 0x67, + 0x11, 0xdd, 0x53, 0x8f, 0xb3, 0xca, 0xbf, 0x29, 0x7a, 0x27, 0xf4, 0x74, 0xe8, 0xad, 0x4e, 0xf3, + 0x04, 0x85, 0x37, 0x5b, 0xbc, 0x53, 0x5b, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x58, 0xbb, 0x89, + 0xb0, 0x71, 0x06, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + CreateRollup(ctx context.Context, in *MsgCreateRollup, opts ...grpc.CallOption) (*MsgCreateRollupResponse, error) + RegisterSequencer(ctx context.Context, in *MsgRegisterSequencer, opts ...grpc.CallOption) (*MsgRegisterSequencerResponse, error) + Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) + Withdraw(ctx context.Context, in *MsgWithdraw, opts ...grpc.CallOption) (*MsgWithdrawResponse, error) + RemoveSequencer(ctx context.Context, in *MsgRemoveSequencer, opts ...grpc.CallOption) (*MsgRemoveSequencerResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateRollup(ctx context.Context, in *MsgCreateRollup, opts ...grpc.CallOption) (*MsgCreateRollupResponse, error) { + out := new(MsgCreateRollupResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Msg/CreateRollup", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RegisterSequencer(ctx context.Context, in *MsgRegisterSequencer, opts ...grpc.CallOption) (*MsgRegisterSequencerResponse, error) { + out := new(MsgRegisterSequencerResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Msg/RegisterSequencer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Deposit(ctx context.Context, in *MsgDeposit, opts ...grpc.CallOption) (*MsgDepositResponse, error) { + out := new(MsgDepositResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Msg/Deposit", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) Withdraw(ctx context.Context, in *MsgWithdraw, opts ...grpc.CallOption) (*MsgWithdrawResponse, error) { + out := new(MsgWithdrawResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Msg/Withdraw", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RemoveSequencer(ctx context.Context, in *MsgRemoveSequencer, opts ...grpc.CallOption) (*MsgRemoveSequencerResponse, error) { + out := new(MsgRemoveSequencerResponse) + err := c.cc.Invoke(ctx, "/finschia.or.rollup.v1.Msg/RemoveSequencer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + CreateRollup(context.Context, *MsgCreateRollup) (*MsgCreateRollupResponse, error) + RegisterSequencer(context.Context, *MsgRegisterSequencer) (*MsgRegisterSequencerResponse, error) + Deposit(context.Context, *MsgDeposit) (*MsgDepositResponse, error) + Withdraw(context.Context, *MsgWithdraw) (*MsgWithdrawResponse, error) + RemoveSequencer(context.Context, *MsgRemoveSequencer) (*MsgRemoveSequencerResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateRollup(ctx context.Context, req *MsgCreateRollup) (*MsgCreateRollupResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRollup not implemented") +} +func (*UnimplementedMsgServer) RegisterSequencer(ctx context.Context, req *MsgRegisterSequencer) (*MsgRegisterSequencerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RegisterSequencer not implemented") +} +func (*UnimplementedMsgServer) Deposit(ctx context.Context, req *MsgDeposit) (*MsgDepositResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Deposit not implemented") +} +func (*UnimplementedMsgServer) Withdraw(ctx context.Context, req *MsgWithdraw) (*MsgWithdrawResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Withdraw not implemented") +} +func (*UnimplementedMsgServer) RemoveSequencer(ctx context.Context, req *MsgRemoveSequencer) (*MsgRemoveSequencerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RemoveSequencer not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateRollup_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateRollup) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateRollup(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Msg/CreateRollup", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateRollup(ctx, req.(*MsgCreateRollup)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RegisterSequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRegisterSequencer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RegisterSequencer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Msg/RegisterSequencer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RegisterSequencer(ctx, req.(*MsgRegisterSequencer)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Deposit_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeposit) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Deposit(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Msg/Deposit", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Deposit(ctx, req.(*MsgDeposit)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_Withdraw_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgWithdraw) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Withdraw(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Msg/Withdraw", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Withdraw(ctx, req.(*MsgWithdraw)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RemoveSequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRemoveSequencer) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RemoveSequencer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/finschia.or.rollup.v1.Msg/RemoveSequencer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RemoveSequencer(ctx, req.(*MsgRemoveSequencer)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "finschia.or.rollup.v1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRollup", + Handler: _Msg_CreateRollup_Handler, + }, + { + MethodName: "RegisterSequencer", + Handler: _Msg_RegisterSequencer_Handler, + }, + { + MethodName: "Deposit", + Handler: _Msg_Deposit_Handler, + }, + { + MethodName: "Withdraw", + Handler: _Msg_Withdraw_Handler, + }, + { + MethodName: "RemoveSequencer", + Handler: _Msg_RemoveSequencer_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "finschia/or/rollup/v1/tx.proto", +} + +func (m *MsgCreateRollup) 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 *MsgCreateRollup) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRollup) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.PermissionedAddresses.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintTx(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRegisterSequencer) 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 *MsgRegisterSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintTx(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0x1a + } + if m.Pubkey != nil { + { + size, err := m.Pubkey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeposit) 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 *MsgDeposit) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeposit) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintTx(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgWithdraw) 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 *MsgWithdraw) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdraw) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollupName) > 0 { + i -= len(m.RollupName) + copy(dAtA[i:], m.RollupName) + i = encodeVarintTx(dAtA, i, uint64(len(m.RollupName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateRollupResponse) 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 *MsgCreateRollupResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRollupResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRegisterSequencerResponse) 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 *MsgRegisterSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRegisterSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRemoveSequencer) 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 *MsgRemoveSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRemoveSequencerResponse) 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 *MsgRemoveSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRemoveSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDepositResponse) 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 *MsgDepositResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDepositResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgWithdrawResponse) 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 *MsgWithdrawResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgWithdrawResponse) 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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateRollup) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.PermissionedAddresses.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgRegisterSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Pubkey != nil { + l = m.Pubkey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Value.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgDeposit) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Value.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgWithdraw) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollupName) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Value.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgCreateRollupResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRegisterSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRemoveSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDepositResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgWithdrawResponse) 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 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateRollup) 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: MsgCreateRollup: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRollup: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PermissionedAddresses", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.PermissionedAddresses.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgRegisterSequencer) 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: MsgRegisterSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pubkey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pubkey == nil { + m.Pubkey = &types.Any{} + } + if err := m.Pubkey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgDeposit) 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: MsgDeposit: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeposit: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", 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.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgWithdraw) 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: MsgWithdraw: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdraw: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollupName", 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.RollupName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", 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.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + 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 *MsgCreateRollupResponse) 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: MsgCreateRollupResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRollupResponse: 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 *MsgRegisterSequencerResponse) 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: MsgRegisterSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRegisterSequencerResponse: 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 *MsgRemoveSequencer) 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: MsgRemoveSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveSequencer: 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 *MsgRemoveSequencerResponse) 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: MsgRemoveSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRemoveSequencerResponse: 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 *MsgDepositResponse) 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: MsgDepositResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDepositResponse: 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 *MsgWithdrawResponse) 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: MsgWithdrawResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgWithdrawResponse: 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrIntOverflowTx + } + 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, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +)