diff --git a/app/app.go b/app/app.go index fd6dbf5fc..bb553721d 100644 --- a/app/app.go +++ b/app/app.go @@ -59,8 +59,6 @@ import ( v1_7 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.7" v1_8 "github.com/scrtlabs/SecretNetwork/app/upgrades/v1.8" - icaauthtypes "github.com/scrtlabs/SecretNetwork/x/mauth/types" - "github.com/cosmos/cosmos-sdk/version" "github.com/cosmos/cosmos-sdk/x/auth/ante" @@ -563,7 +561,6 @@ func SetOrderBeginBlockers(app *SecretNetworkApp) { authz.ModuleName, paramstypes.ModuleName, icatypes.ModuleName, - icaauthtypes.ModuleName, packetforwardtypes.ModuleName, ibcfeetypes.ModuleName, // custom modules @@ -591,7 +588,6 @@ func SetOrderInitGenesis(app *SecretNetworkApp) { ibcswitchtypes.ModuleName, icatypes.ModuleName, - icaauthtypes.ModuleName, authz.ModuleName, minttypes.ModuleName, @@ -628,7 +624,6 @@ func SetOrderEndBlockers(app *SecretNetworkApp) { ibcexported.ModuleName, ibctransfertypes.ModuleName, icatypes.ModuleName, - icaauthtypes.ModuleName, ibcfeetypes.ModuleName, packetforwardtypes.ModuleName, compute.ModuleName, diff --git a/app/config.go b/app/config.go index 2124637fa..bd833a481 100644 --- a/app/config.go +++ b/app/config.go @@ -41,7 +41,6 @@ import ( packetforwardrouter "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" scrt "github.com/scrtlabs/SecretNetwork/types" "github.com/scrtlabs/SecretNetwork/x/compute" - icaauth "github.com/scrtlabs/SecretNetwork/x/mauth" "github.com/scrtlabs/SecretNetwork/x/registration" ) @@ -87,7 +86,6 @@ func customModuleBasics() []module.AppModuleBasic { return []module.AppModuleBasic{ compute.AppModuleBasic{}, registration.AppModuleBasic{}, - icaauth.AppModuleBasic{}, ibcswitch.AppModuleBasic{}, } } diff --git a/app/keepers/keepers.go b/app/keepers/keepers.go index 7c275bf4f..e07ecc2a6 100644 --- a/app/keepers/keepers.go +++ b/app/keepers/keepers.go @@ -41,7 +41,6 @@ import ( ibcpacketforward "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward" capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - icacontroller "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller" icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" icacontrollertypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/types" icahost "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/host" @@ -55,9 +54,6 @@ import ( ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" ibckeeper "github.com/cosmos/ibc-go/v8/modules/core/keeper" "github.com/scrtlabs/SecretNetwork/x/compute" - icaauth "github.com/scrtlabs/SecretNetwork/x/mauth" - icaauthkeeper "github.com/scrtlabs/SecretNetwork/x/mauth/keeper" - icaauthtypes "github.com/scrtlabs/SecretNetwork/x/mauth/types" reg "github.com/scrtlabs/SecretNetwork/x/registration" ibcpacketforwardkeeper "github.com/cosmos/ibc-apps/middleware/packet-forward-middleware/v8/packetforward/keeper" @@ -106,7 +102,6 @@ type SecretAppKeepers struct { ICAControllerKeeper *icacontrollerkeeper.Keeper ICAHostKeeper *icahostkeeper.Keeper - ICAAuthKeeper *icaauthkeeper.Keeper // make scoped keepers public for test purposes ScopedIBCKeeper capabilitykeeper.ScopedKeeper @@ -114,7 +109,6 @@ type SecretAppKeepers struct { ScopedICAControllerKeeper capabilitykeeper.ScopedKeeper ScopedICAHostKeeper capabilitykeeper.ScopedKeeper - ScopedICAAuthKeeper capabilitykeeper.ScopedKeeper ScopedComputeKeeper capabilitykeeper.ScopedKeeper @@ -339,7 +333,6 @@ func (ak *SecretAppKeepers) CreateScopedKeepers() { ak.ScopedTransferKeeper = ak.CapabilityKeeper.ScopeToModule(ibctransfertypes.ModuleName) ak.ScopedICAControllerKeeper = ak.CapabilityKeeper.ScopeToModule(icacontrollertypes.SubModuleName) ak.ScopedICAHostKeeper = ak.CapabilityKeeper.ScopeToModule(icahosttypes.SubModuleName) - ak.ScopedICAAuthKeeper = ak.CapabilityKeeper.ScopeToModule(icaauthtypes.ModuleName) ak.ScopedComputeKeeper = ak.CapabilityKeeper.ScopeToModule(compute.ModuleName) // Applications that wish to enforce statically created ScopedKeepers should call `Seal` after creating @@ -472,16 +465,6 @@ func (ak *SecretAppKeepers) InitCustomKeepers( ) ak.ICAHostKeeper = &icaHostKeeper - icaAuthKeeper := icaauthkeeper.NewKeeper( - appCodec, - runtime.NewKVStoreService(ak.keys[icaauthtypes.StoreKey]), - *ak.ICAControllerKeeper, - ak.ScopedICAAuthKeeper, - ) - ak.ICAAuthKeeper = &icaAuthKeeper - - icaAuthIBCModule := icaauth.NewIBCModule(*ak.ICAAuthKeeper) - icaHostIBCModule := icahost.NewIBCModule(*ak.ICAHostKeeper) // Create Transfer Keepers @@ -521,7 +504,6 @@ func (ak *SecretAppKeepers) InitCustomKeepers( // initialize ICA module with mock module as the authentication module on the controller side var icaControllerStack porttypes.IBCModule - icaControllerStack = icacontroller.NewIBCMiddleware(icaAuthIBCModule, *ak.ICAControllerKeeper) icaControllerStack = ibcfee.NewIBCMiddleware(icaControllerStack, ak.IbcFeeKeeper) icaControllerStack = ibcswitch.NewIBCMiddleware(icaControllerStack, ak.IbcSwitchKeeper) diff --git a/app/modules.go b/app/modules.go index 3f58f83bd..0d976b9a5 100644 --- a/app/modules.go +++ b/app/modules.go @@ -40,7 +40,6 @@ import ( ibctm "github.com/cosmos/ibc-go/v8/modules/light-clients/07-tendermint" "github.com/scrtlabs/SecretNetwork/x/compute" ibcswitch "github.com/scrtlabs/SecretNetwork/x/emergencybutton" - icaauth "github.com/scrtlabs/SecretNetwork/x/mauth" reg "github.com/scrtlabs/SecretNetwork/x/registration" ) @@ -89,6 +88,5 @@ func Modules( packetforward.NewAppModule(app.AppKeepers.PacketForwardKeeper, app.AppKeepers.GetSubspace(packetforwardtypes.ModuleName)), ibcfee.NewAppModule(app.AppKeepers.IbcFeeKeeper), ibcswitch.NewAppModule(app.AppKeepers.IbcSwitchKeeper), - icaauth.NewAppModule(appCodec, *app.AppKeepers.ICAAuthKeeper), } } diff --git a/client/docs/config.json b/client/docs/config.json index f4bbbc14b..e53343d0d 100644 --- a/client/docs/config.json +++ b/client/docs/config.json @@ -776,28 +776,6 @@ } } }, - { - "url": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.json", - "operationIds": { - "rename": { - "Params": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonParams", - "Pool": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonPool", - "DelegatorValidators": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonDelegatorValidators", - "UpgradedConsensusState": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonUpgradedConsensusState", - "Accounts": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonAccounts", - "Account": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonAccount", - "Proposal": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonProposal", - "Proposals": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonProposals", - "Deposits": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonDeposits", - "Deposit": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonDeposit", - "TallyResult": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonTallyResult", - "Votes": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonVotes", - "Vote": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonVote", - "Balance": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonBalance", - "Code": "../../tmp-swagger-gen/secret/intertx/v1beta1/query.swagger.jsonCode" - } - } - }, { "url": "../../tmp-swagger-gen/secret/registration/v1beta1/query.swagger.json", "operationIds": { diff --git a/client/docs/swagger-ui/swagger.yaml b/client/docs/swagger-ui/swagger.yaml index 3805f4ec4..7a0311faf 100644 --- a/client/docs/swagger-ui/swagger.yaml +++ b/client/docs/swagger-ui/swagger.yaml @@ -63038,60 +63038,6 @@ paths: format: byte tags: - gRPC Gateway API - /mauth/interchain_account/owner/{owner}/connection/{connection_id}: - get: - summary: >- - QueryInterchainAccountFromAddress returns the interchain account for - given - - owner address on a given connection pair - operationId: InterchainAccountFromAddress - responses: - '200': - description: A successful response. - schema: - type: object - properties: - interchain_account_address: - type: string - title: >- - QueryInterchainAccountFromAddressResponse the response type for - the - - Query/InterchainAccountAddress RPC - default: - description: An unexpected error response. - schema: - type: object - properties: - error: - type: string - code: - type: integer - format: int32 - message: - type: string - details: - type: array - items: - type: object - properties: - type_url: - type: string - value: - type: string - format: byte - parameters: - - name: owner - in: path - required: true - type: string - - name: connection_id - in: path - required: true - type: string - tags: - - gRPC Gateway API /registration/v1beta1/encrypted-seed/{pub_key}: get: summary: Returns the encrypted seed for a registered node by public key @@ -111154,14 +111100,6 @@ definitions: pauser_address: type: string description: ParamsResponse is the response type for the Query/Params RPC method. - secret.intertx.v1beta1.QueryInterchainAccountFromAddressResponse: - type: object - properties: - interchain_account_address: - type: string - title: |- - QueryInterchainAccountFromAddressResponse the response type for the - Query/InterchainAccountAddress RPC secret.registration.v1beta1.Key: type: object properties: diff --git a/go.mod b/go.mod index 1324224ee..8e2123432 100644 --- a/go.mod +++ b/go.mod @@ -73,7 +73,6 @@ require ( cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect - cosmossdk.io/x/circuit v0.1.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect diff --git a/proto/secret/intertx/v1beta1/query.proto b/proto/secret/intertx/v1beta1/query.proto deleted file mode 100644 index 60938f193..000000000 --- a/proto/secret/intertx/v1beta1/query.proto +++ /dev/null @@ -1,35 +0,0 @@ -syntax = "proto3"; - -package secret.intertx.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; - -option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// Query defines the gRPC querier service. -service Query { - // QueryInterchainAccountFromAddress returns the interchain account for given - // owner address on a given connection pair - rpc InterchainAccountFromAddress(QueryInterchainAccountFromAddressRequest) - returns (QueryInterchainAccountFromAddressResponse) { - option (google.api.http).get = - "/mauth/interchain_account/owner/{owner}/connection/{connection_id}"; - }; -} - -// QueryInterchainAccountFromAddressRequest is the request type for the -// Query/InterchainAccountAddress RPC -message QueryInterchainAccountFromAddressRequest { - string owner = 1; - string connection_id = 2 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ]; -} - -// QueryInterchainAccountFromAddressResponse the response type for the -// Query/InterchainAccountAddress RPC -message QueryInterchainAccountFromAddressResponse { - string interchain_account_address = 1 - [ (gogoproto.moretags) = "yaml:\"interchain_account_address\"" ]; -} \ No newline at end of file diff --git a/proto/secret/intertx/v1beta1/tx.proto b/proto/secret/intertx/v1beta1/tx.proto deleted file mode 100644 index c6cfd5d04..000000000 --- a/proto/secret/intertx/v1beta1/tx.proto +++ /dev/null @@ -1,54 +0,0 @@ -syntax = "proto3"; - -package secret.intertx.v1beta1; - -import "gogoproto/gogo.proto"; -import "google/protobuf/any.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "cosmos_proto/cosmos.proto"; -import "cosmos/msg/v1/msg.proto"; - -option go_package = "github.com/scrtlabs/SecretNetwork/x/mauth/types"; -option (gogoproto.goproto_getters_all) = false; -option (gogoproto.equal_all) = true; - -// Msg defines the ica-authentication Msg service. -service Msg { - option (cosmos.msg.v1.service) = true; - - // Register defines a rpc handler for MsgRegisterAccount - rpc RegisterAccount(MsgRegisterAccount) returns (MsgRegisterAccountResponse) { - option (google.api.http).post = "/mauth/v1beta1/register-account"; - }; - rpc SubmitTx(MsgSubmitTx) returns (MsgSubmitTxResponse) { - option (google.api.http).post = "/mauth/v1beta1/submit-tx"; - }; -} - -// MsgRegisterAccount registers an interchain account for the given owner over -// the specified connection pair -message MsgRegisterAccount { - option (cosmos.msg.v1.signer) = "owner"; - - string owner = 1; - string connection_id = 2 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ]; - string version = 3; -} - -// MsgRegisterAccountResponse is the response type for Msg/RegisterAccount -message MsgRegisterAccountResponse {} - -// MsgSubmitTx creates and submits an arbitrary transaction msg to be executed -// using an interchain account -message MsgSubmitTx { - option (cosmos.msg.v1.signer) = "connection_id"; - - bytes owner = 1 [ (gogoproto.casttype) = - "github.com/cosmos/cosmos-sdk/types.AccAddress" ]; - string connection_id = 2 [ (gogoproto.moretags) = "yaml:\"connection_id\"" ]; - google.protobuf.Any msg = 3; -} - -// MsgSubmitTxResponse defines the MsgSubmitTx response type -message MsgSubmitTxResponse {} \ No newline at end of file diff --git a/x/mauth/alias.go b/x/mauth/alias.go deleted file mode 100644 index 81eaa9f02..000000000 --- a/x/mauth/alias.go +++ /dev/null @@ -1,8 +0,0 @@ -package mauth - -import "github.com/scrtlabs/SecretNetwork/x/mauth/types" - -const ( - ModuleName = types.ModuleName - StoreKey = types.StoreKey -) diff --git a/x/mauth/client/cli/flags.go b/x/mauth/client/cli/flags.go deleted file mode 100644 index 7a385c86b..000000000 --- a/x/mauth/client/cli/flags.go +++ /dev/null @@ -1,22 +0,0 @@ -package cli - -import ( - flag "github.com/spf13/pflag" -) - -const ( - // The connection end identifier on the controller chain - FlagConnectionID = "connection-id" - // The connection end identifier on the host chain - FlagCounterpartyConnectionID = "counterparty-connection-id" -) - -// common flagsets to add to various functions -var ( - fsConnectionPair = flag.NewFlagSet("", flag.ContinueOnError) -) - -func init() { - fsConnectionPair.String(FlagConnectionID, "", "Connection ID") - fsConnectionPair.String(FlagCounterpartyConnectionID, "", "Counterparty Connection ID") -} diff --git a/x/mauth/client/cli/query.go b/x/mauth/client/cli/query.go deleted file mode 100644 index ca251c0ac..000000000 --- a/x/mauth/client/cli/query.go +++ /dev/null @@ -1,48 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/scrtlabs/SecretNetwork/x/mauth/types" - "github.com/spf13/cobra" -) - -// GetQueryCmd creates and returns the intertx query command -func GetQueryCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: "Querying commands for the mauth module", - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(getInterchainAccountCmd()) - - return cmd -} - -func getInterchainAccountCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "interchainaccounts [account] [connection-id] [counterparty-connection-id]", - Args: cobra.ExactArgs(3), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.InterchainAccountFromAddress(cmd.Context(), types.NewQueryInterchainAccountRequest(args[0], args[1], args[2])) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/mauth/client/cli/tx.go b/x/mauth/client/cli/tx.go deleted file mode 100644 index c7ba2b349..000000000 --- a/x/mauth/client/cli/tx.go +++ /dev/null @@ -1,126 +0,0 @@ -package cli - -import ( - "fmt" - "os" - - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/pkg/errors" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/scrtlabs/SecretNetwork/x/mauth/types" - "github.com/spf13/cobra" - "github.com/spf13/viper" -) - -// GetTxCmd creates and returns the intertx tx command -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( - getRegisterAccountCmd(), - getSubmitTxCmd(), - ) - - return cmd -} - -func getRegisterAccountCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "register", - RunE: func(cmd *cobra.Command, _ []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - msg := types.NewMsgRegisterAccount( - clientCtx.GetFromAddress().String(), - viper.GetString(FlagConnectionID), - viper.GetString(FlagCounterpartyConnectionID), - ) - - if err := msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().AddFlagSet(fsConnectionPair) - _ = cmd.MarkFlagRequired(FlagConnectionID) - _ = cmd.MarkFlagRequired(FlagCounterpartyConnectionID) - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -// cmd.Flags().AddFlagSet(fsConnectionPair) -// -// _ = cmd.MarkFlagRequired(FlagConnectionID) -// _ = cmd.MarkFlagRequired(FlagCounterpartyConnectionID) -// -// flags.AddTxFlagsToCmd(cmd) -// -// return cmd -//} - -func getSubmitTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: "submit-tx [path/to/sdk_msg.json]", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - cdc := codec.NewProtoCodec(clientCtx.InterfaceRegistry) - - var txMsg sdk.Msg - if err := cdc.UnmarshalInterfaceJSON([]byte(args[0]), &txMsg); err != nil { - - // check for file path if JSON input is not provided - contents, err := os.ReadFile(args[0]) - if err != nil { - return errors.Wrap(err, "neither JSON input nor path to .json file for sdk msg were provided") - } - - if err := cdc.UnmarshalInterfaceJSON(contents, &txMsg); err != nil { - return errors.Wrap(err, "error unmarshalling sdk msg file") - } - } - - msg, err := types.NewMsgSubmitTx(clientCtx.GetFromAddress(), txMsg, viper.GetString(FlagConnectionID), viper.GetString(FlagCounterpartyConnectionID)) - if err != nil { - return err - } - - if err := msg.ValidateBasic(); err != nil { - return err - } - - return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) - }, - } - - cmd.Flags().AddFlagSet(fsConnectionPair) - - _ = cmd.MarkFlagRequired(FlagConnectionID) - _ = cmd.MarkFlagRequired(FlagCounterpartyConnectionID) - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} diff --git a/x/mauth/ibc_module.go b/x/mauth/ibc_module.go deleted file mode 100644 index 01735a08c..000000000 --- a/x/mauth/ibc_module.go +++ /dev/null @@ -1,140 +0,0 @@ -package mauth - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - "github.com/scrtlabs/SecretNetwork/x/mauth/keeper" - - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - porttypes "github.com/cosmos/ibc-go/v8/modules/core/05-port/types" - host "github.com/cosmos/ibc-go/v8/modules/core/24-host" - ibcexported "github.com/cosmos/ibc-go/v8/modules/core/exported" -) - -var _ porttypes.IBCModule = IBCModule{} - -// IBCModule implements the ICS26 interface for interchain accounts controller chains -type IBCModule struct { - keeper keeper.Keeper -} - -// NewIBCModule creates a new IBCModule given the keeper -func NewIBCModule(k keeper.Keeper) IBCModule { - return IBCModule{ - keeper: k, - } -} - -// OnChanOpenInit implements the IBCModule interface -func (im IBCModule) OnChanOpenInit( - ctx sdk.Context, - _ channeltypes.Order, - _ []string, - portID string, - channelID string, - chanCap *capabilitytypes.Capability, - _ channeltypes.Counterparty, - version string, -) (string, error) { - err := im.keeper.ClaimCapability(ctx, chanCap, host.ChannelCapabilityPath(portID, channelID)) - if err != nil { - return "", err - } - - return version, nil -} - -// OnChanOpenTry implements the IBCModule interface -func (im IBCModule) OnChanOpenTry( - _ sdk.Context, - _ channeltypes.Order, - _ []string, - _, - _ string, - _ *capabilitytypes.Capability, - _ channeltypes.Counterparty, - _ string, -) (version string, err error) { - return "", nil -} - -// OnChanOpenAck implements the IBCModule interface -func (im IBCModule) OnChanOpenAck( - _ sdk.Context, - _, - _ string, - _ string, - _ string, -) error { - return nil -} - -// OnChanOpenConfirm implements the IBCModule interface -func (im IBCModule) OnChanOpenConfirm( - _ sdk.Context, - _, - _ string, -) error { - return nil -} - -// OnChanCloseInit implements the IBCModule interface -func (im IBCModule) OnChanCloseInit( - _ sdk.Context, - _, - _ string, -) error { - return nil -} - -// OnChanCloseConfirm implements the IBCModule interface -func (im IBCModule) OnChanCloseConfirm( - _ sdk.Context, - _, - _ string, -) error { - return nil -} - -// OnRecvPacket implements the IBCModule interface. A successful acknowledgement -// is returned if the packet data is successfully decoded and the receive application -// logic returns without error. -func (im IBCModule) OnRecvPacket( - _ sdk.Context, - _ channeltypes.Packet, - _ sdk.AccAddress, -) ibcexported.Acknowledgement { - return channeltypes.NewErrorAcknowledgement(sdkerrors.ErrInvalidRequest.Wrapf("cannot receive packet via interchain accounts authentication module")) -} - -// OnAcknowledgementPacket implements the IBCModule interface -func (im IBCModule) OnAcknowledgementPacket( - _ sdk.Context, - _ channeltypes.Packet, - _ []byte, - _ sdk.AccAddress, -) error { - return nil -} - -// OnTimeoutPacket implements the IBCModule interface. -func (im IBCModule) OnTimeoutPacket( - _ sdk.Context, - _ channeltypes.Packet, - _ sdk.AccAddress, -) error { - return nil -} - -// NegotiateAppVersion implements the IBCModule interface -func (im IBCModule) NegotiateAppVersion( - _ sdk.Context, - _ channeltypes.Order, - _ string, - _ string, - _ channeltypes.Counterparty, - _ string, -) (string, error) { - return "", nil -} diff --git a/x/mauth/keeper/account.go b/x/mauth/keeper/account.go deleted file mode 100644 index 274fd6a6c..000000000 --- a/x/mauth/keeper/account.go +++ /dev/null @@ -1,11 +0,0 @@ -package keeper - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// RegisterInterchainAccount invokes the InitInterchainAccount entrypoint. -// InitInterchainAccount binds a new controller port and initiates a new ICS-27 channel handshake -func (k Keeper) RegisterInterchainAccount(ctx sdk.Context, owner sdk.AccAddress, connectionID string, version string) error { - return k.icaControllerKeeper.RegisterInterchainAccount(ctx, connectionID, owner.String(), version) -} diff --git a/x/mauth/keeper/grpc_query.go b/x/mauth/keeper/grpc_query.go deleted file mode 100644 index 1b3c5d34e..000000000 --- a/x/mauth/keeper/grpc_query.go +++ /dev/null @@ -1,31 +0,0 @@ -package keeper - -import ( - "context" - - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - - sdk "github.com/cosmos/cosmos-sdk/types" - icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - - "github.com/scrtlabs/SecretNetwork/x/mauth/types" -) - -// InterchainAccountFromAddress implements the Query/InterchainAccountFromAddress gRPC method -func (k Keeper) InterchainAccountFromAddress(goCtx context.Context, req *types.QueryInterchainAccountFromAddressRequest) (*types.QueryInterchainAccountFromAddressResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - portID, err := icatypes.NewControllerPortID(req.Owner) - if err != nil { - return nil, status.Errorf(codes.InvalidArgument, "could not find account: %s", err) - } - - addr, found := k.icaControllerKeeper.GetInterchainAccountAddress(ctx, req.ConnectionId, portID) - if !found { - return nil, status.Errorf(codes.NotFound, "no account found for connectionId %s portID %s", - req.ConnectionId, portID) - } - - return types.NewQueryInterchainAccountResponse(addr), nil -} diff --git a/x/mauth/keeper/keeper.go b/x/mauth/keeper/keeper.go deleted file mode 100644 index d8ad5c798..000000000 --- a/x/mauth/keeper/keeper.go +++ /dev/null @@ -1,34 +0,0 @@ -package keeper - -import ( - "cosmossdk.io/core/store" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - capabilitykeeper "github.com/cosmos/ibc-go/modules/capability/keeper" - capabilitytypes "github.com/cosmos/ibc-go/modules/capability/types" - - icacontrollerkeeper "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/controller/keeper" -) - -type Keeper struct { - cdc codec.Codec - - storeService store.KVStoreService - - scopedKeeper capabilitykeeper.ScopedKeeper - icaControllerKeeper icacontrollerkeeper.Keeper -} - -func NewKeeper(cdc codec.Codec, storeService store.KVStoreService, iaKeeper icacontrollerkeeper.Keeper, scopedKeeper capabilitykeeper.ScopedKeeper) Keeper { - return Keeper{ - cdc: cdc, - storeService: storeService, - scopedKeeper: scopedKeeper, - icaControllerKeeper: iaKeeper, - } -} - -// ClaimCapability claims the channel capability passed via the OnOpenChanInit callback -func (k *Keeper) ClaimCapability(ctx sdk.Context, cap *capabilitytypes.Capability, name string) error { - return k.scopedKeeper.ClaimCapability(ctx, cap, name) -} diff --git a/x/mauth/keeper/keeper_test.go b/x/mauth/keeper/keeper_test.go deleted file mode 100644 index d3cab010e..000000000 --- a/x/mauth/keeper/keeper_test.go +++ /dev/null @@ -1,119 +0,0 @@ -package keeper_test - -import ( - "encoding/json" - "os" - "testing" - - // "github.com/cosmos/cosmos-sdk/simapp" - compute "github.com/scrtlabs/SecretNetwork/x/compute" - - "github.com/stretchr/testify/suite" - //"github.com/cometbft/cometbft/crypto" - "cosmossdk.io/log" - dbm "github.com/cosmos/cosmos-db" - simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" - - // sdk "github.com/cosmos/cosmos-sdk/types" - icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - ibctesting "github.com/cosmos/ibc-go/v8/testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - icaapp "github.com/scrtlabs/SecretNetwork/app" - scrt "github.com/scrtlabs/SecretNetwork/types" -) - -var ( - // TestAccAddress defines a resuable bech32 address for testing purposes - // TODO: update crypto.AddressHash() when sdk uses address.Module() - // TestAccAddress = icatypes.GenerateAddress(sdk.AccAddress(crypto.AddressHash([]byte(icatypes.ModuleName))), ibctesting.FirstConnectionID, TestPortID) - // TestOwnerAddress defines a reusable bech32 address for testing purposes - TestOwnerAddress = "cosmos17dtl0mjt3t77kpuhg2edqzjpszulwhgzuj9ljs" - // TestPortID defines a resuable port identifier for testing purposes - TestPortID, _ = icatypes.NewControllerPortID(TestOwnerAddress) - // TestVersion defines a resuable interchainaccounts version string for testing purposes - TestVersion = string(icatypes.ModuleCdc.MustMarshalJSON(&icatypes.Metadata{ - Version: icatypes.Version, - ControllerConnectionId: ibctesting.FirstConnectionID, - HostConnectionId: ibctesting.FirstConnectionID, - })) -) - -func init() { - ibctesting.DefaultTestingAppInit = SetupICATestingApp -} - -func SetupICATestingApp() (ibctesting.TestingApp, map[string]json.RawMessage) { - db := dbm.NewMemDB() - // encCdc := icaapp.MakeEncodingConfig() - - config := sdk.GetConfig() - config.SetCoinType(scrt.CoinType) - config.SetPurpose(scrt.CoinPurpose) - config.SetBech32PrefixForAccount(scrt.Bech32PrefixAccAddr, scrt.Bech32PrefixAccPub) - config.SetBech32PrefixForValidator(scrt.Bech32PrefixValAddr, scrt.Bech32PrefixValPub) - config.SetBech32PrefixForConsensusNode(scrt.Bech32PrefixConsAddr, scrt.Bech32PrefixConsPub) - config.SetAddressVerifier(scrt.AddressVerifier) - config.Seal() - - tempDir := func() string { - dir, err := os.MkdirTemp("", "secretd") - if err != nil { - dir = icaapp.DefaultNodeHome - } - defer os.RemoveAll(dir) - - return dir - } - // NewAppOptionsWithFlagHome(tempDir()) - app := icaapp.NewSecretNetworkApp(log.NewNopLogger(), db, nil, true, true, simtestutil.NewAppOptionsWithFlagHome(tempDir()), compute.DefaultWasmConfig()) - - // app := icaapp.NewSecretNetworkApp(log.NewNopLogger(), db, nil, true, true, icaapp.DefaultNodeHome, 5, false, simapp.EmptyAppOptions{}, compute.DefaultWasmConfig()) - // TODO: figure out if it's ok that w MakeEncodingConfig inside of our Genesis.go. It would be a different instance than the one used in app - return app, icaapp.NewDefaultGenesisState() -} - -// KeeperTestSuite is a testing suite to test keeper functions -type KeeperTestSuite struct { - suite.Suite - - coordinator *ibctesting.Coordinator - - // testing chains used for convenience and readability - chainA *ibctesting.TestChain - chainB *ibctesting.TestChain -} - -func (suite *KeeperTestSuite) GetICAApp(chain *ibctesting.TestChain) *icaapp.SecretNetworkApp { - app, ok := chain.App.(*icaapp.SecretNetworkApp) - if !ok { - panic("not ica app") - } - - return app -} - -// TestKeeperTestSuite runs all the tests within this package. -func TestKeeperTestSuite(t *testing.T) { - suite.Run(t, new(KeeperTestSuite)) -} - -// SetupTest creates a coordinator with 2 test chains. -func (suite *KeeperTestSuite) SetupTest() { - suite.coordinator = ibctesting.NewCoordinator(suite.T(), 2) - suite.chainA = suite.coordinator.GetChain(ibctesting.GetChainID(0)) - suite.chainB = suite.coordinator.GetChain(ibctesting.GetChainID(1)) -} - -func NewICAPath(chainA, chainB *ibctesting.TestChain) *ibctesting.Path { - path := ibctesting.NewPath(chainA, chainB) - path.EndpointA.ChannelConfig.PortID = icatypes.HostPortID - path.EndpointB.ChannelConfig.PortID = icatypes.HostPortID - path.EndpointA.ChannelConfig.Order = channeltypes.ORDERED - path.EndpointB.ChannelConfig.Order = channeltypes.ORDERED - path.EndpointA.ChannelConfig.Version = TestVersion - path.EndpointB.ChannelConfig.Version = TestVersion - - return path -} diff --git a/x/mauth/keeper/msg_server.go b/x/mauth/keeper/msg_server.go deleted file mode 100644 index 1c1fbd7e0..000000000 --- a/x/mauth/keeper/msg_server.go +++ /dev/null @@ -1,78 +0,0 @@ -package keeper - -import ( - "context" - - errorsmod "cosmossdk.io/errors" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/gogoproto/proto" - icatypes "github.com/cosmos/ibc-go/v8/modules/apps/27-interchain-accounts/types" - channeltypes "github.com/cosmos/ibc-go/v8/modules/core/04-channel/types" - host "github.com/cosmos/ibc-go/v8/modules/core/24-host" - "github.com/scrtlabs/SecretNetwork/x/mauth/types" -) - -var _ types.MsgServer = msgServer{} - -type msgServer struct { - Keeper -} - -// NewMsgServerImpl creates and returns a new types.MsgServer, fulfilling the intertx Msg service interface -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -// RegisterAccount implements the Msg/RegisterAccount interface -func (k msgServer) RegisterAccount(goCtx context.Context, msg *types.MsgRegisterAccount) (*types.MsgRegisterAccountResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - acc, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - return nil, err - } - - if err := k.RegisterInterchainAccount(ctx, acc, msg.ConnectionId, msg.Version); err != nil { - return nil, err - } - - return &types.MsgRegisterAccountResponse{}, nil -} - -// SubmitTx implements the Msg/SubmitTx interface -func (k msgServer) SubmitTx(goCtx context.Context, msg *types.MsgSubmitTx) (*types.MsgSubmitTxResponse, error) { - ctx := sdk.UnwrapSDKContext(goCtx) - - portID, err := icatypes.NewControllerPortID(msg.Owner.String()) - if err != nil { - return nil, err - } - - channelID, found := k.icaControllerKeeper.GetActiveChannelID(ctx, msg.ConnectionId, portID) - if !found { - return nil, errorsmod.Wrapf(icatypes.ErrActiveChannelNotFound, "failed to retrieve active channel for port %s", portID) - } - - chanCap, found := k.scopedKeeper.GetCapability(ctx, host.ChannelCapabilityPath(portID, channelID)) - if !found { - return nil, errorsmod.Wrap(channeltypes.ErrChannelCapabilityNotFound, "module does not own channel capability") - } - - data, err := icatypes.SerializeCosmosTx(k.cdc, []proto.Message{msg.GetTxMsg()}, icatypes.EncodingProtobuf) - if err != nil { - return nil, err - } - - packetData := icatypes.InterchainAccountPacketData{ - Type: icatypes.EXECUTE_TX, - Data: data, - } - - //nolint:staticcheck - _, err = k.icaControllerKeeper.SendTx(ctx, chanCap, msg.ConnectionId, portID, packetData, ^uint64(0)) - if err != nil { - return nil, err - } - - return &types.MsgSubmitTxResponse{}, nil -} diff --git a/x/mauth/keeper/msg_server_test.go b/x/mauth/keeper/msg_server_test.go deleted file mode 100644 index 457a60658..000000000 --- a/x/mauth/keeper/msg_server_test.go +++ /dev/null @@ -1,78 +0,0 @@ -package keeper_test - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - ibctesting "github.com/cosmos/ibc-go/v8/testing" - - "github.com/scrtlabs/SecretNetwork/x/mauth/keeper" - "github.com/scrtlabs/SecretNetwork/x/mauth/types" -) - -func (suite *KeeperTestSuite) TestRegisterInterchainAccount() { - var ( - owner string - path *ibctesting.Path - ) - - testCases := []struct { - name string - malleate func() - expPass bool - }{ - { - "success", func() {}, true, - }, - // { - // "port is already bound", - // func() { - // suite.GetICAApp(suite.chainA).GetIBCKeeper().PortKeeper.BindPort(suite.chainA.GetContext(), TestPortID) - // }, - // false, - // }, - // { - // "fails to generate port-id", - // func() { - // owner = "" - // }, - // false, - // }, - // { - // "MsgChanOpenInit fails - channel is already active", - // func() { - // portID, err := icatypes.NewControllerPortID(owner) - // suite.Require().NoError(err) - - // suite.GetICAApp(suite.chainA).AppKeepers.ICAControllerKeeper.SetActiveChannelID(suite.chainA.GetContext(), path.EndpointA.ConnectionID, portID, path.EndpointA.ChannelID) - // }, - // false, - // }, - } - - for _, tc := range testCases { - tc := tc - - suite.Run(tc.name, func() { - suite.SetupTest() - - owner = TestOwnerAddress // must be explicitly changed - - path = NewICAPath(suite.chainA, suite.chainB) - suite.coordinator.SetupConnections(path) - - tc.malleate() // malleate mutates test data - - msgSrv := keeper.NewMsgServerImpl(*suite.GetICAApp(suite.chainA).AppKeepers.ICAAuthKeeper) - msg := types.NewMsgRegisterAccount(owner, path.EndpointA.ConnectionID, path.EndpointB.ConnectionID) - - res, err := msgSrv.RegisterAccount(sdk.WrapSDKContext(suite.chainA.GetContext()), msg) - - if tc.expPass { - suite.Require().NoError(err) - suite.Require().NotNil(res) - } else { - suite.Require().Error(err) - suite.Require().Nil(res) - } - }) - } -} diff --git a/x/mauth/module.go b/x/mauth/module.go deleted file mode 100644 index 353f5d215..000000000 --- a/x/mauth/module.go +++ /dev/null @@ -1,83 +0,0 @@ -package mauth - -import ( - "github.com/grpc-ecosystem/grpc-gateway/runtime" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/scrtlabs/SecretNetwork/x/mauth/keeper" - "github.com/scrtlabs/SecretNetwork/x/mauth/types" -) - -var ( - _ module.HasName = AppModule{} - _ module.HasServices = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - _ module.AppModule = AppModule{} - _ module.HasConsensusVersion = AppModule{} -) - -// AppModuleBasic implements the AppModuleBasic interface for the capability module. -type AppModuleBasic struct { - cdc codec.Codec -} - -func NewAppModuleBasic(cdc codec.Codec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the capability module's name. -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -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) -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module. -func (AppModuleBasic) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) { -} - -// AppModule implements the AppModule interface for the capability module. -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper -} - -// NewAppModule creates and returns a new intertx AppModule -func NewAppModule(cdc codec.Codec, keeper keeper.Keeper) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - } -} - -// Name returns the capability module's name. -func (am AppModule) Name() string { - return am.AppModuleBasic.Name() -} - -// RegisterServices registers a GRPC query service to respond to the -// module-specific GRPC queries. -func (am AppModule) RegisterServices(cfg module.Configurator) { - types.RegisterMsgServer(cfg.MsgServer(), keeper.NewMsgServerImpl(am.keeper)) - types.RegisterQueryServer(cfg.QueryServer(), am.keeper) -} - -// ConsensusVersion implements AppModule/ConsensusVersion. -func (AppModule) ConsensusVersion() uint64 { return 1 } - -// IsAppModule implements the appmodule.AppModule interface. -func (AppModule) IsAppModule() {} - -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (AppModule) IsOnePerModuleType() {} diff --git a/x/mauth/types/codec.go b/x/mauth/types/codec.go deleted file mode 100644 index 99025d281..000000000 --- a/x/mauth/types/codec.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import ( - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - - // this line is used by starport scaffolding # 1 - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -func RegisterCodec(_ *codec.LegacyAmino) { - // cdc.RegisterConcrete(MsgRegister{}, "intertx/MsgRegister", nil) - // cdc.RegisterConcrete(MsgSend{}, "intertx/MsgSend", nil) -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgRegisterAccount{}, - &MsgSubmitTx{}, - ) -} diff --git a/x/mauth/types/errors.go b/x/mauth/types/errors.go deleted file mode 100644 index 05f38f2da..000000000 --- a/x/mauth/types/errors.go +++ /dev/null @@ -1,10 +0,0 @@ -package types - -import ( - "cosmossdk.io/errors" -) - -var ( - ErrIBCAccountAlreadyExist = errors.Register(ModuleName, 2, "interchain account already registered") - ErrIBCAccountNotExist = errors.Register(ModuleName, 3, "interchain account not exist") -) diff --git a/x/mauth/types/keys.go b/x/mauth/types/keys.go deleted file mode 100644 index 324d149fc..000000000 --- a/x/mauth/types/keys.go +++ /dev/null @@ -1,11 +0,0 @@ -package types - -const ( - ModuleName = "icamsgauth" - - StoreKey = ModuleName - - RouterKey = ModuleName - - QuerierRoute = ModuleName -) diff --git a/x/mauth/types/msgs.go b/x/mauth/types/msgs.go deleted file mode 100644 index 4bc602d61..000000000 --- a/x/mauth/types/msgs.go +++ /dev/null @@ -1,109 +0,0 @@ -package types - -import ( - fmt "fmt" - "strings" - - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - proto "github.com/gogo/protobuf/proto" -) - -var ( - _ sdk.Msg = &MsgRegisterAccount{} - _ sdk.Msg = &MsgSubmitTx{} - - _ codectypes.UnpackInterfacesMessage = MsgSubmitTx{} -) - -// NewMsgRegisterAccount creates a new MsgRegisterAccount instance -func NewMsgRegisterAccount(owner, connectionID, _ string) *MsgRegisterAccount { - return &MsgRegisterAccount{ - Owner: owner, - ConnectionId: connectionID, - } -} - -// ValidateBasic implements sdk.Msg -func (msg MsgRegisterAccount) ValidateBasic() error { - if strings.TrimSpace(msg.Owner) == "" { - return sdkerrors.ErrInvalidAddress.Wrap("missing sender address") - } - - return nil -} - -// GetSigners implements sdk.Msg -func (msg MsgRegisterAccount) GetSigners() []sdk.AccAddress { - accAddr, err := sdk.AccAddressFromBech32(msg.Owner) - if err != nil { - panic(err) - } - - return []sdk.AccAddress{accAddr} -} - -// NewMsgSend creates a new MsgSend instance -func NewMsgSubmitTx(owner sdk.AccAddress, sdkMsg sdk.Msg, connectionID, _ string) (*MsgSubmitTx, error) { - anyObj, err := PackTxMsgAny(sdkMsg) - if err != nil { - return nil, err - } - - return &MsgSubmitTx{ - Owner: owner, - ConnectionId: connectionID, - Msg: anyObj, - }, nil -} - -// PackTxMsgAny marshals the sdk.Msg payload to a protobuf Any type -func PackTxMsgAny(sdkMsg sdk.Msg) (*codectypes.Any, error) { - msg, ok := sdkMsg.(proto.Message) - if !ok { - return nil, fmt.Errorf("can't proto marshal %T", sdkMsg) - } - - anyObj, err := codectypes.NewAnyWithValue(msg) - if err != nil { - return nil, err - } - - return anyObj, nil -} - -// UnpackInterfaces implements codectypes.UnpackInterfacesMessage -func (msg MsgSubmitTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { - var sdkMsg sdk.Msg - - return unpacker.UnpackAny(msg.Msg, &sdkMsg) -} - -// GetTxMsg fetches the cached any message -func (msg *MsgSubmitTx) GetTxMsg() sdk.Msg { - sdkMsg, ok := msg.Msg.GetCachedValue().(sdk.Msg) - if !ok { - return nil - } - - return sdkMsg -} - -// GetSigners implements sdk.Msg -func (msg MsgSubmitTx) GetSigners() []sdk.AccAddress { - return []sdk.AccAddress{msg.Owner} -} - -// ValidateBasic implements sdk.Msg -func (msg MsgSubmitTx) ValidateBasic() error { - if len(msg.Msg.GetValue()) == 0 { - return fmt.Errorf("can't execute an empty msg") - } - - if msg.ConnectionId == "" { - return fmt.Errorf("can't execute an empty ConnectionId") - } - - return nil -} diff --git a/x/mauth/types/query.go b/x/mauth/types/query.go deleted file mode 100644 index a1b27150d..000000000 --- a/x/mauth/types/query.go +++ /dev/null @@ -1,16 +0,0 @@ -package types - -// NewQueryInterchainAccountRequest creates and returns a new QueryInterchainAccountFromAddressRequest -func NewQueryInterchainAccountRequest(owner, connectionID, _ string) *QueryInterchainAccountFromAddressRequest { - return &QueryInterchainAccountFromAddressRequest{ - Owner: owner, - ConnectionId: connectionID, - } -} - -// NewQueryInterchainAccountResponse creates and returns a new QueryInterchainAccountFromAddressResponse -func NewQueryInterchainAccountResponse(interchainAccAddr string) *QueryInterchainAccountFromAddressResponse { - return &QueryInterchainAccountFromAddressResponse{ - InterchainAccountAddress: interchainAccAddr, - } -} diff --git a/x/mauth/types/query.pb.go b/x/mauth/types/query.pb.go deleted file mode 100644 index 148cbd7ec..000000000 --- a/x/mauth/types/query.pb.go +++ /dev/null @@ -1,685 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: secret/intertx/v1beta1/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/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 - -// QueryInterchainAccountFromAddressRequest is the request type for the -// Query/InterchainAccountAddress RPC -type QueryInterchainAccountFromAddressRequest struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` -} - -func (m *QueryInterchainAccountFromAddressRequest) Reset() { - *m = QueryInterchainAccountFromAddressRequest{} -} -func (m *QueryInterchainAccountFromAddressRequest) String() string { return proto.CompactTextString(m) } -func (*QueryInterchainAccountFromAddressRequest) ProtoMessage() {} -func (*QueryInterchainAccountFromAddressRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_9777b436e70abcdd, []int{0} -} -func (m *QueryInterchainAccountFromAddressRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryInterchainAccountFromAddressRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryInterchainAccountFromAddressRequest.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 *QueryInterchainAccountFromAddressRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInterchainAccountFromAddressRequest.Merge(m, src) -} -func (m *QueryInterchainAccountFromAddressRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryInterchainAccountFromAddressRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInterchainAccountFromAddressRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInterchainAccountFromAddressRequest proto.InternalMessageInfo - -// QueryInterchainAccountFromAddressResponse the response type for the -// Query/InterchainAccountAddress RPC -type QueryInterchainAccountFromAddressResponse struct { - InterchainAccountAddress string `protobuf:"bytes,1,opt,name=interchain_account_address,json=interchainAccountAddress,proto3" json:"interchain_account_address,omitempty" yaml:"interchain_account_address"` -} - -func (m *QueryInterchainAccountFromAddressResponse) Reset() { - *m = QueryInterchainAccountFromAddressResponse{} -} -func (m *QueryInterchainAccountFromAddressResponse) String() string { - return proto.CompactTextString(m) -} -func (*QueryInterchainAccountFromAddressResponse) ProtoMessage() {} -func (*QueryInterchainAccountFromAddressResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9777b436e70abcdd, []int{1} -} -func (m *QueryInterchainAccountFromAddressResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryInterchainAccountFromAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryInterchainAccountFromAddressResponse.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 *QueryInterchainAccountFromAddressResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryInterchainAccountFromAddressResponse.Merge(m, src) -} -func (m *QueryInterchainAccountFromAddressResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryInterchainAccountFromAddressResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryInterchainAccountFromAddressResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryInterchainAccountFromAddressResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*QueryInterchainAccountFromAddressRequest)(nil), "secret.intertx.v1beta1.QueryInterchainAccountFromAddressRequest") - proto.RegisterType((*QueryInterchainAccountFromAddressResponse)(nil), "secret.intertx.v1beta1.QueryInterchainAccountFromAddressResponse") -} - -func init() { - proto.RegisterFile("secret/intertx/v1beta1/query.proto", fileDescriptor_9777b436e70abcdd) -} - -var fileDescriptor_9777b436e70abcdd = []byte{ - // 404 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xcf, 0x8b, 0xd3, 0x40, - 0x14, 0xc7, 0x33, 0x0b, 0x2b, 0x38, 0xe8, 0x25, 0x14, 0x09, 0x61, 0x99, 0xd5, 0x80, 0xb0, 0x5e, - 0xf2, 0x58, 0xbd, 0x09, 0x82, 0x0d, 0x22, 0xac, 0x07, 0x61, 0xe3, 0xcd, 0x4b, 0x99, 0x4c, 0x86, - 0x74, 0xb0, 0x99, 0xc9, 0xce, 0x4c, 0xdc, 0x2d, 0xcb, 0x22, 0xf8, 0x17, 0x14, 0xfc, 0x27, 0xfc, - 0x53, 0x7a, 0x2c, 0x78, 0xf1, 0x54, 0x34, 0xf5, 0x2e, 0xf4, 0xe6, 0x4d, 0x92, 0x09, 0x96, 0xfa, - 0x8b, 0xc2, 0x9e, 0x92, 0xc7, 0xfb, 0xf0, 0x7d, 0xdf, 0xf7, 0xbe, 0x83, 0x23, 0xc3, 0x99, 0xe6, - 0x16, 0x84, 0xb4, 0x5c, 0xdb, 0x0b, 0x78, 0x7b, 0x9c, 0x71, 0x4b, 0x8f, 0xe1, 0xac, 0xe6, 0x7a, - 0x1a, 0x57, 0x5a, 0x59, 0xe5, 0xdf, 0x71, 0x4c, 0xdc, 0x33, 0x71, 0xcf, 0x84, 0x83, 0x42, 0x15, - 0xaa, 0x43, 0xa0, 0xfd, 0x73, 0x74, 0x78, 0x50, 0x28, 0x55, 0x4c, 0x38, 0xd0, 0x4a, 0x00, 0x95, - 0x52, 0x59, 0x6a, 0x85, 0x92, 0xc6, 0x75, 0xa3, 0x77, 0xf8, 0xe8, 0xb4, 0x95, 0x3e, 0x69, 0xb5, - 0xd8, 0x98, 0x0a, 0x39, 0x64, 0x4c, 0xd5, 0xd2, 0x3e, 0xd7, 0xaa, 0x1c, 0xe6, 0xb9, 0xe6, 0xc6, - 0xa4, 0xfc, 0xac, 0xe6, 0xc6, 0xfa, 0x03, 0xbc, 0xaf, 0xce, 0x25, 0xd7, 0x01, 0xba, 0x8b, 0x8e, - 0x6e, 0xa6, 0xae, 0xf0, 0x9f, 0xe0, 0xdb, 0x4c, 0x49, 0xc9, 0x59, 0x2b, 0x3b, 0x12, 0x79, 0xb0, - 0xd7, 0x76, 0x93, 0x60, 0xbd, 0x3c, 0x1c, 0x4c, 0x69, 0x39, 0x79, 0x1c, 0x6d, 0xb5, 0xa3, 0xf4, - 0xd6, 0xa6, 0x3e, 0xc9, 0xa3, 0x19, 0xc2, 0x0f, 0x76, 0x70, 0x60, 0x2a, 0x25, 0x0d, 0xf7, 0x19, - 0x0e, 0xc5, 0x2f, 0x6e, 0x44, 0x1d, 0x38, 0xa2, 0x8e, 0x72, 0xbe, 0x92, 0xfb, 0xeb, 0xe5, 0xe1, - 0x3d, 0x37, 0xf9, 0xdf, 0x6c, 0x94, 0x06, 0xe2, 0xf7, 0x81, 0xfd, 0xb0, 0x87, 0x3f, 0x10, 0xde, - 0xef, 0x2c, 0xf9, 0xdf, 0x11, 0x3e, 0xf8, 0x9f, 0x2f, 0xff, 0x69, 0xfc, 0xf7, 0x2c, 0xe2, 0x5d, - 0x8f, 0x1a, 0x0e, 0xaf, 0xa1, 0xe0, 0x8e, 0x12, 0xbd, 0x78, 0xff, 0xe9, 0xdb, 0x87, 0xbd, 0x67, - 0x7e, 0x02, 0x25, 0xad, 0xed, 0x18, 0xfe, 0xdc, 0x1a, 0xba, 0xa8, 0xe0, 0xb2, 0xfb, 0x5c, 0xc1, - 0x26, 0x00, 0xb8, 0xdc, 0x0a, 0xe7, 0x2a, 0x39, 0x9d, 0x7f, 0x25, 0xde, 0xc7, 0x86, 0xa0, 0x79, - 0x43, 0xd0, 0xa2, 0x21, 0xe8, 0x4b, 0x43, 0xd0, 0x6c, 0x45, 0xbc, 0xc5, 0x8a, 0x78, 0x9f, 0x57, - 0xc4, 0x7b, 0x0d, 0x85, 0xb0, 0xe3, 0x3a, 0x8b, 0x99, 0x2a, 0xc1, 0x30, 0x6d, 0x27, 0x34, 0x33, - 0xf0, 0xaa, 0xdb, 0xe1, 0x25, 0xb7, 0xe7, 0x4a, 0xbf, 0x81, 0x8b, 0xde, 0x88, 0x9d, 0x56, 0xdc, - 0x64, 0x37, 0xba, 0x97, 0xf6, 0xe8, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb6, 0x4e, 0x28, 0x0f, - 0xdb, 0x02, 0x00, 0x00, -} - -func (this *QueryInterchainAccountFromAddressRequest) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryInterchainAccountFromAddressRequest) - if !ok { - that2, ok := that.(QueryInterchainAccountFromAddressRequest) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Owner != that1.Owner { - return false - } - if this.ConnectionId != that1.ConnectionId { - return false - } - return true -} -func (this *QueryInterchainAccountFromAddressResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*QueryInterchainAccountFromAddressResponse) - if !ok { - that2, ok := that.(QueryInterchainAccountFromAddressResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.InterchainAccountAddress != that1.InterchainAccountAddress { - return false - } - return true -} - -// 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 { - // QueryInterchainAccountFromAddress returns the interchain account for given - // owner address on a given connection pair - InterchainAccountFromAddress(ctx context.Context, in *QueryInterchainAccountFromAddressRequest, opts ...grpc.CallOption) (*QueryInterchainAccountFromAddressResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) InterchainAccountFromAddress(ctx context.Context, in *QueryInterchainAccountFromAddressRequest, opts ...grpc.CallOption) (*QueryInterchainAccountFromAddressResponse, error) { - out := new(QueryInterchainAccountFromAddressResponse) - err := c.cc.Invoke(ctx, "/secret.intertx.v1beta1.Query/InterchainAccountFromAddress", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // QueryInterchainAccountFromAddress returns the interchain account for given - // owner address on a given connection pair - InterchainAccountFromAddress(context.Context, *QueryInterchainAccountFromAddressRequest) (*QueryInterchainAccountFromAddressResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) InterchainAccountFromAddress(ctx context.Context, req *QueryInterchainAccountFromAddressRequest) (*QueryInterchainAccountFromAddressResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method InterchainAccountFromAddress not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_InterchainAccountFromAddress_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryInterchainAccountFromAddressRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).InterchainAccountFromAddress(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/secret.intertx.v1beta1.Query/InterchainAccountFromAddress", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).InterchainAccountFromAddress(ctx, req.(*QueryInterchainAccountFromAddressRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "secret.intertx.v1beta1.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "InterchainAccountFromAddress", - Handler: _Query_InterchainAccountFromAddress_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "secret/intertx/v1beta1/query.proto", -} - -func (m *QueryInterchainAccountFromAddressRequest) 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 *QueryInterchainAccountFromAddressRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryInterchainAccountFromAddressRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintQuery(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *QueryInterchainAccountFromAddressResponse) 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 *QueryInterchainAccountFromAddressResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryInterchainAccountFromAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.InterchainAccountAddress) > 0 { - i -= len(m.InterchainAccountAddress) - copy(dAtA[i:], m.InterchainAccountAddress) - i = encodeVarintQuery(dAtA, i, uint64(len(m.InterchainAccountAddress))) - 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 *QueryInterchainAccountFromAddressRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovQuery(uint64(l)) - } - return n -} - -func (m *QueryInterchainAccountFromAddressResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.InterchainAccountAddress) - if l > 0 { - 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 *QueryInterchainAccountFromAddressRequest) 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: QueryInterchainAccountFromAddressRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryInterchainAccountFromAddressRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", 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.ConnectionId = 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 *QueryInterchainAccountFromAddressResponse) 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: QueryInterchainAccountFromAddressResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryInterchainAccountFromAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field InterchainAccountAddress", 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.InterchainAccountAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - 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/mauth/types/query.pb.gw.go b/x/mauth/types/query.pb.gw.go deleted file mode 100644 index ea8b22516..000000000 --- a/x/mauth/types/query.pb.gw.go +++ /dev/null @@ -1,211 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: secret/intertx/v1beta1/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/metadata" - "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 -var _ = metadata.Join - -func request_Query_InterchainAccountFromAddress_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryInterchainAccountFromAddressRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - val, ok = pathParams["connection_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "connection_id") - } - - protoReq.ConnectionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "connection_id", err) - } - - msg, err := client.InterchainAccountFromAddress(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_InterchainAccountFromAddress_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryInterchainAccountFromAddressRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["owner"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "owner") - } - - protoReq.Owner, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "owner", err) - } - - val, ok = pathParams["connection_id"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "connection_id") - } - - protoReq.ConnectionId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "connection_id", err) - } - - msg, err := server.InterchainAccountFromAddress(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 to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_InterchainAccountFromAddress_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_InterchainAccountFromAddress_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_InterchainAccountFromAddress_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_InterchainAccountFromAddress_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_InterchainAccountFromAddress_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_InterchainAccountFromAddress_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_InterchainAccountFromAddress_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"mauth", "interchain_account", "owner", "connection", "connection_id"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_InterchainAccountFromAddress_0 = runtime.ForwardResponseMessage -) diff --git a/x/mauth/types/tx.pb.go b/x/mauth/types/tx.pb.go deleted file mode 100644 index 385f2fce5..000000000 --- a/x/mauth/types/tx.pb.go +++ /dev/null @@ -1,1159 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: secret/intertx/v1beta1/tx.proto - -package types - -import ( - bytes "bytes" - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" - _ "github.com/cosmos/cosmos-sdk/types" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/gogoproto/gogoproto" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/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 - -// MsgRegisterAccount registers an interchain account for the given owner over -// the specified connection pair -type MsgRegisterAccount struct { - Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` - ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` - Version string `protobuf:"bytes,3,opt,name=version,proto3" json:"version,omitempty"` -} - -func (m *MsgRegisterAccount) Reset() { *m = MsgRegisterAccount{} } -func (m *MsgRegisterAccount) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterAccount) ProtoMessage() {} -func (*MsgRegisterAccount) Descriptor() ([]byte, []int) { - return fileDescriptor_40e9982773ad08e4, []int{0} -} -func (m *MsgRegisterAccount) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterAccount.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 *MsgRegisterAccount) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterAccount.Merge(m, src) -} -func (m *MsgRegisterAccount) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterAccount) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterAccount.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterAccount proto.InternalMessageInfo - -// MsgRegisterAccountResponse is the response type for Msg/RegisterAccount -type MsgRegisterAccountResponse struct { -} - -func (m *MsgRegisterAccountResponse) Reset() { *m = MsgRegisterAccountResponse{} } -func (m *MsgRegisterAccountResponse) String() string { return proto.CompactTextString(m) } -func (*MsgRegisterAccountResponse) ProtoMessage() {} -func (*MsgRegisterAccountResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40e9982773ad08e4, []int{1} -} -func (m *MsgRegisterAccountResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgRegisterAccountResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgRegisterAccountResponse.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 *MsgRegisterAccountResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgRegisterAccountResponse.Merge(m, src) -} -func (m *MsgRegisterAccountResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgRegisterAccountResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgRegisterAccountResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgRegisterAccountResponse proto.InternalMessageInfo - -// MsgSubmitTx creates and submits an arbitrary transaction msg to be executed -// using an interchain account -type MsgSubmitTx struct { - Owner github_com_cosmos_cosmos_sdk_types.AccAddress `protobuf:"bytes,1,opt,name=owner,proto3,casttype=github.com/cosmos/cosmos-sdk/types.AccAddress" json:"owner,omitempty"` - ConnectionId string `protobuf:"bytes,2,opt,name=connection_id,json=connectionId,proto3" json:"connection_id,omitempty" yaml:"connection_id"` - Msg *types.Any `protobuf:"bytes,3,opt,name=msg,proto3" json:"msg,omitempty"` -} - -func (m *MsgSubmitTx) Reset() { *m = MsgSubmitTx{} } -func (m *MsgSubmitTx) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitTx) ProtoMessage() {} -func (*MsgSubmitTx) Descriptor() ([]byte, []int) { - return fileDescriptor_40e9982773ad08e4, []int{2} -} -func (m *MsgSubmitTx) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitTx) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitTx.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 *MsgSubmitTx) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitTx.Merge(m, src) -} -func (m *MsgSubmitTx) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitTx) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitTx.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitTx proto.InternalMessageInfo - -// MsgSubmitTxResponse defines the MsgSubmitTx response type -type MsgSubmitTxResponse struct { -} - -func (m *MsgSubmitTxResponse) Reset() { *m = MsgSubmitTxResponse{} } -func (m *MsgSubmitTxResponse) String() string { return proto.CompactTextString(m) } -func (*MsgSubmitTxResponse) ProtoMessage() {} -func (*MsgSubmitTxResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_40e9982773ad08e4, []int{3} -} -func (m *MsgSubmitTxResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgSubmitTxResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgSubmitTxResponse.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 *MsgSubmitTxResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgSubmitTxResponse.Merge(m, src) -} -func (m *MsgSubmitTxResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgSubmitTxResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgSubmitTxResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgSubmitTxResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgRegisterAccount)(nil), "secret.intertx.v1beta1.MsgRegisterAccount") - proto.RegisterType((*MsgRegisterAccountResponse)(nil), "secret.intertx.v1beta1.MsgRegisterAccountResponse") - proto.RegisterType((*MsgSubmitTx)(nil), "secret.intertx.v1beta1.MsgSubmitTx") - proto.RegisterType((*MsgSubmitTxResponse)(nil), "secret.intertx.v1beta1.MsgSubmitTxResponse") -} - -func init() { proto.RegisterFile("secret/intertx/v1beta1/tx.proto", fileDescriptor_40e9982773ad08e4) } - -var fileDescriptor_40e9982773ad08e4 = []byte{ - // 533 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x3f, 0x6f, 0x13, 0x31, - 0x18, 0xc6, 0x73, 0x89, 0xca, 0x1f, 0xb7, 0x08, 0xe9, 0x08, 0x70, 0x9c, 0xaa, 0x4b, 0x39, 0x24, - 0x40, 0x41, 0xb1, 0x95, 0xb0, 0x45, 0x62, 0x48, 0x16, 0xc4, 0x10, 0x24, 0x52, 0x26, 0x96, 0xca, - 0xe7, 0x18, 0xf7, 0xd4, 0x9c, 0x1d, 0xf9, 0x75, 0xd2, 0x64, 0x41, 0xa8, 0x5f, 0x00, 0x24, 0x36, - 0x3e, 0x01, 0x6c, 0xfd, 0x18, 0x1d, 0x8b, 0x58, 0x98, 0x2a, 0x48, 0x90, 0xba, 0x33, 0x32, 0xa1, - 0xbb, 0x73, 0x42, 0xda, 0x22, 0xd4, 0xa1, 0x93, 0xef, 0xd5, 0xf3, 0x3b, 0xbf, 0xcf, 0xeb, 0xe7, - 0x45, 0x15, 0xe0, 0x4c, 0x73, 0x43, 0x62, 0x69, 0xb8, 0x36, 0x63, 0x32, 0xaa, 0x47, 0xdc, 0xd0, - 0x3a, 0x31, 0x63, 0x3c, 0xd0, 0xca, 0x28, 0xf7, 0x56, 0x0e, 0x60, 0x0b, 0x60, 0x0b, 0xf8, 0x65, - 0xa1, 0x84, 0xca, 0x10, 0x92, 0x7e, 0xe5, 0xb4, 0x7f, 0x47, 0x28, 0x25, 0xfa, 0x9c, 0x64, 0x55, - 0x34, 0x7c, 0x4d, 0xa8, 0x9c, 0x58, 0x69, 0xdd, 0x4a, 0x74, 0x10, 0x13, 0x2a, 0xa5, 0x32, 0xd4, - 0xc4, 0x4a, 0x82, 0x55, 0x03, 0xa6, 0x20, 0x51, 0x40, 0x22, 0x0a, 0x7c, 0x61, 0x82, 0xa9, 0x58, - 0xce, 0x2f, 0xce, 0xf5, 0xad, 0xbc, 0x63, 0x5e, 0x58, 0xe9, 0xb6, 0xfd, 0x35, 0x01, 0x41, 0x46, - 0xf5, 0xf4, 0xc8, 0x85, 0xf0, 0x9d, 0x83, 0xdc, 0x0e, 0x88, 0x2e, 0x17, 0x31, 0x18, 0xae, 0x5b, - 0x8c, 0xa9, 0xa1, 0x34, 0x6e, 0x19, 0xad, 0xa8, 0x5d, 0xc9, 0xb5, 0xe7, 0x6c, 0x38, 0x0f, 0xaf, - 0x76, 0xf3, 0xc2, 0x7d, 0x82, 0xae, 0x31, 0x25, 0x25, 0x67, 0xa9, 0xab, 0xad, 0xb8, 0xe7, 0x15, - 0x53, 0xb5, 0xed, 0xfd, 0x3a, 0xaa, 0x94, 0x27, 0x34, 0xe9, 0x37, 0xc3, 0x13, 0x72, 0xd8, 0x5d, - 0xfb, 0x5b, 0x3f, 0xeb, 0xb9, 0x1e, 0xba, 0x3c, 0xe2, 0x1a, 0x62, 0x25, 0xbd, 0x52, 0x76, 0xed, - 0xbc, 0x6c, 0xa2, 0xbd, 0xe3, 0xfd, 0x6a, 0xde, 0x24, 0x5c, 0x47, 0xfe, 0x59, 0x43, 0x5d, 0x0e, - 0x03, 0x25, 0x81, 0x87, 0x5f, 0x1c, 0xb4, 0xda, 0x01, 0xb1, 0x39, 0x8c, 0x92, 0xd8, 0xbc, 0x1c, - 0xbb, 0x4f, 0x97, 0x8d, 0xae, 0xb5, 0xeb, 0xbf, 0x8f, 0x2a, 0x35, 0x11, 0x9b, 0xed, 0x61, 0x84, - 0x99, 0x4a, 0xec, 0x23, 0xd8, 0xa3, 0x06, 0xbd, 0x1d, 0x62, 0x26, 0x03, 0x0e, 0xb8, 0xc5, 0x58, - 0xab, 0xd7, 0xd3, 0x1c, 0xe0, 0x82, 0x66, 0xbb, 0x8f, 0x4a, 0x09, 0x88, 0x6c, 0xae, 0xd5, 0x46, - 0x19, 0xe7, 0x39, 0xe2, 0x79, 0xc4, 0xb8, 0x25, 0x27, 0xdd, 0x14, 0x68, 0xba, 0xe9, 0xa4, 0x27, - 0x3b, 0x85, 0x37, 0xd1, 0x8d, 0xa5, 0x91, 0xe6, 0xa3, 0x36, 0x3e, 0x17, 0x51, 0xa9, 0x03, 0xc2, - 0xfd, 0xe8, 0xa0, 0xeb, 0xa7, 0xf3, 0xa9, 0xe2, 0x7f, 0xaf, 0x1c, 0x3e, 0xfb, 0x74, 0x7e, 0xe3, - 0xfc, 0xec, 0xe2, 0x99, 0x1f, 0xec, 0x7d, 0xfd, 0xf9, 0xa1, 0x78, 0x37, 0xac, 0x90, 0x84, 0x0e, - 0xcd, 0xf6, 0x62, 0xdb, 0xb4, 0xe5, 0x6b, 0xd4, 0x1a, 0x79, 0x83, 0xae, 0x2c, 0xb2, 0xb8, 0xf7, - 0x9f, 0x46, 0x73, 0xc8, 0x7f, 0x74, 0x0e, 0x68, 0x61, 0x63, 0x23, 0xb3, 0xe1, 0x87, 0xde, 0x29, - 0x1b, 0x90, 0x81, 0x35, 0x33, 0xf6, 0x57, 0xde, 0x1e, 0xef, 0x57, 0x9d, 0xf6, 0x8b, 0x83, 0x1f, - 0x41, 0xe1, 0xd3, 0x34, 0x70, 0x0e, 0xa6, 0x81, 0x73, 0x38, 0x0d, 0x9c, 0xef, 0xd3, 0xc0, 0x79, - 0x3f, 0x0b, 0x0a, 0x87, 0xb3, 0xa0, 0xf0, 0x6d, 0x16, 0x14, 0x5e, 0x91, 0xa5, 0xad, 0x00, 0xa6, - 0x4d, 0x9f, 0x46, 0x40, 0x36, 0x33, 0x2b, 0xcf, 0xb9, 0xd9, 0x55, 0x7a, 0x87, 0x8c, 0x6d, 0x97, - 0x6c, 0x45, 0xa2, 0x4b, 0x59, 0x78, 0x8f, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xc6, 0x62, - 0x3b, 0xfe, 0x03, 0x00, 0x00, -} - -func (this *MsgRegisterAccount) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgRegisterAccount) - if !ok { - that2, ok := that.(MsgRegisterAccount) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if this.Owner != that1.Owner { - return false - } - if this.ConnectionId != that1.ConnectionId { - return false - } - if this.Version != that1.Version { - return false - } - return true -} -func (this *MsgRegisterAccountResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgRegisterAccountResponse) - if !ok { - that2, ok := that.(MsgRegisterAccountResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} -func (this *MsgSubmitTx) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgSubmitTx) - if !ok { - that2, ok := that.(MsgSubmitTx) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - if !bytes.Equal(this.Owner, that1.Owner) { - return false - } - if this.ConnectionId != that1.ConnectionId { - return false - } - if !this.Msg.Equal(that1.Msg) { - return false - } - return true -} -func (this *MsgSubmitTxResponse) Equal(that interface{}) bool { - if that == nil { - return this == nil - } - - that1, ok := that.(*MsgSubmitTxResponse) - if !ok { - that2, ok := that.(MsgSubmitTxResponse) - if ok { - that1 = &that2 - } else { - return false - } - } - if that1 == nil { - return this == nil - } else if this == nil { - return false - } - return true -} - -// 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 { - // Register defines a rpc handler for MsgRegisterAccount - RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) - SubmitTx(ctx context.Context, in *MsgSubmitTx, opts ...grpc.CallOption) (*MsgSubmitTxResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) RegisterAccount(ctx context.Context, in *MsgRegisterAccount, opts ...grpc.CallOption) (*MsgRegisterAccountResponse, error) { - out := new(MsgRegisterAccountResponse) - err := c.cc.Invoke(ctx, "/secret.intertx.v1beta1.Msg/RegisterAccount", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -func (c *msgClient) SubmitTx(ctx context.Context, in *MsgSubmitTx, opts ...grpc.CallOption) (*MsgSubmitTxResponse, error) { - out := new(MsgSubmitTxResponse) - err := c.cc.Invoke(ctx, "/secret.intertx.v1beta1.Msg/SubmitTx", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - // Register defines a rpc handler for MsgRegisterAccount - RegisterAccount(context.Context, *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) - SubmitTx(context.Context, *MsgSubmitTx) (*MsgSubmitTxResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) RegisterAccount(ctx context.Context, req *MsgRegisterAccount) (*MsgRegisterAccountResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterAccount not implemented") -} -func (*UnimplementedMsgServer) SubmitTx(ctx context.Context, req *MsgSubmitTx) (*MsgSubmitTxResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method SubmitTx not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_RegisterAccount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgRegisterAccount) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterAccount(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/secret.intertx.v1beta1.Msg/RegisterAccount", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterAccount(ctx, req.(*MsgRegisterAccount)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_SubmitTx_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgSubmitTx) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).SubmitTx(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/secret.intertx.v1beta1.Msg/SubmitTx", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).SubmitTx(ctx, req.(*MsgSubmitTx)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "secret.intertx.v1beta1.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RegisterAccount", - Handler: _Msg_RegisterAccount_Handler, - }, - { - MethodName: "SubmitTx", - Handler: _Msg_SubmitTx_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "secret/intertx/v1beta1/tx.proto", -} - -func (m *MsgRegisterAccount) 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 *MsgRegisterAccount) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterAccount) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Version) > 0 { - i -= len(m.Version) - copy(dAtA[i:], m.Version) - i = encodeVarintTx(dAtA, i, uint64(len(m.Version))) - i-- - dAtA[i] = 0x1a - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgRegisterAccountResponse) 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 *MsgRegisterAccountResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgRegisterAccountResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgSubmitTx) 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 *MsgSubmitTx) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitTx) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Msg != nil { - { - size, err := m.Msg.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - if len(m.ConnectionId) > 0 { - i -= len(m.ConnectionId) - copy(dAtA[i:], m.ConnectionId) - i = encodeVarintTx(dAtA, i, uint64(len(m.ConnectionId))) - i-- - dAtA[i] = 0x12 - } - if len(m.Owner) > 0 { - i -= len(m.Owner) - copy(dAtA[i:], m.Owner) - i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgSubmitTxResponse) 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 *MsgSubmitTxResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgSubmitTxResponse) 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 *MsgRegisterAccount) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Version) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgRegisterAccountResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgSubmitTx) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Owner) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.ConnectionId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Msg != nil { - l = m.Msg.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgSubmitTxResponse) 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 *MsgRegisterAccount) 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: MsgRegisterAccount: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAccount: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", 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.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Version", 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.Version = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgRegisterAccountResponse) 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: MsgRegisterAccountResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgRegisterAccountResponse: 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 *MsgSubmitTx) 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: MsgSubmitTx: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitTx: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Owner = append(m.Owner[:0], dAtA[iNdEx:postIndex]...) - if m.Owner == nil { - m.Owner = []byte{} - } - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConnectionId", 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.ConnectionId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Msg", 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.Msg == nil { - m.Msg = &types.Any{} - } - if err := m.Msg.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 *MsgSubmitTxResponse) 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: MsgSubmitTxResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitTxResponse: 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") -) diff --git a/x/mauth/types/tx.pb.gw.go b/x/mauth/types/tx.pb.gw.go deleted file mode 100644 index 96b920b27..000000000 --- a/x/mauth/types/tx.pb.gw.go +++ /dev/null @@ -1,254 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: secret/intertx/v1beta1/tx.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/metadata" - "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 -var _ = metadata.Join - -var ( - filter_Msg_RegisterAccount_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_RegisterAccount_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgRegisterAccount - 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_Msg_RegisterAccount_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.RegisterAccount(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_RegisterAccount_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgRegisterAccount - 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_Msg_RegisterAccount_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.RegisterAccount(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Msg_SubmitTx_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_SubmitTx_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgSubmitTx - 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_Msg_SubmitTx_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.SubmitTx(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_SubmitTx_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq MsgSubmitTx - 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_Msg_SubmitTx_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.SubmitTx(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer 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 to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_RegisterAccount_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_RegisterAccount_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_RegisterAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Msg_SubmitTx_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_SubmitTx_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_SubmitTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(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 RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_RegisterAccount_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_Msg_RegisterAccount_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_RegisterAccount_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("POST", pattern_Msg_SubmitTx_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_Msg_SubmitTx_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_SubmitTx_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_RegisterAccount_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mauth", "v1beta1", "register-account"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Msg_SubmitTx_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mauth", "v1beta1", "submit-tx"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_RegisterAccount_0 = runtime.ForwardResponseMessage - - forward_Msg_SubmitTx_0 = runtime.ForwardResponseMessage -)