From bbd2a05e4ba21099214a737434b73285e186650b Mon Sep 17 00:00:00 2001 From: mikebraver <142298428+mikebraver@users.noreply.github.com> Date: Mon, 8 Apr 2024 11:19:56 +0800 Subject: [PATCH] fix: some refactor --- app/app.go | 8 +- precompiles/avs/abi.json | 20 +- precompiles/avs/avs.sol | 12 +- precompiles/avs/avs_test.go | 159 +++ precompiles/avs/setup_test.go | 35 + precompiles/avs/tx.go | 4 +- precompiles/avs/types.go | 36 +- proto/exocore/avs/genesis.proto | 12 - proto/exocore/avs/params.proto | 12 - proto/exocore/avs/query.proto | 30 +- proto/exocore/avs/tx.proto | 97 +- proto/exocore/taskmanageravs/genesis.proto | 12 - proto/exocore/taskmanageravs/params.proto | 12 - proto/exocore/taskmanageravs/query.proto | 26 - proto/exocore/taskmanageravs/tx.proto | 32 - x/avs/client/cli/query.go | 38 +- x/avs/client/cli/query_params.go | 36 - x/avs/client/cli/tx.go | 20 +- x/avs/keeper/avs_test.go | 7 + x/avs/keeper/keeper.go | 50 +- x/avs/keeper/msg_server.go | 4 +- x/avs/keeper/params.go | 14 +- x/avs/keeper/query.go | 8 + x/avs/keeper/query_params.go | 22 - x/avs/keeper/setup_test.go | 29 + x/avs/module.go | 14 +- x/avs/types/codec.go | 16 +- x/avs/types/errors.go | 4 +- x/avs/types/genesis.go | 7 +- x/avs/types/params.go | 16 +- x/avs/types/query.pb.go | 250 ++-- x/avs/types/query.pb.gw.go | 46 +- x/avs/types/tx.pb.go | 758 ++--------- x/deposit/keeper/cross_chain_tx_process.go | 6 +- x/taskmanageravs/client/cli/query.go | 32 - x/taskmanageravs/client/cli/query_params.go | 36 - x/taskmanageravs/client/cli/tx.go | 76 -- x/taskmanageravs/genesis.go | 23 - x/taskmanageravs/genesis_test.go | 31 - x/taskmanageravs/keeper/keeper.go | 54 - x/taskmanageravs/keeper/msg_server.go | 17 - x/taskmanageravs/keeper/msg_server_test.go | 23 - x/taskmanageravs/keeper/params.go | 18 - x/taskmanageravs/keeper/params_test.go | 18 - x/taskmanageravs/keeper/query.go | 7 - x/taskmanageravs/keeper/query_params.go | 19 - x/taskmanageravs/keeper/query_params_test.go | 21 - x/taskmanageravs/module.go | 150 --- x/taskmanageravs/simulation/helpers.go | 15 - x/taskmanageravs/types/codec.go | 23 - x/taskmanageravs/types/errors.go | 13 - x/taskmanageravs/types/expected_keepers.go | 20 - x/taskmanageravs/types/genesis.go | 24 - x/taskmanageravs/types/genesis.pb.go | 323 ----- x/taskmanageravs/types/genesis_test.go | 41 - x/taskmanageravs/types/keys.go | 23 - x/taskmanageravs/types/params.go | 47 - x/taskmanageravs/types/params.pb.go | 267 ---- x/taskmanageravs/types/query.pb.go | 540 -------- x/taskmanageravs/types/query.pb.gw.go | 148 --- x/taskmanageravs/types/tx.pb.go | 1180 ------------------ x/taskmanageravs/types/types.go | 1 - 62 files changed, 743 insertions(+), 4299 deletions(-) create mode 100644 precompiles/avs/avs_test.go create mode 100644 precompiles/avs/setup_test.go delete mode 100644 proto/exocore/avs/genesis.proto delete mode 100644 proto/exocore/avs/params.proto delete mode 100644 proto/exocore/taskmanageravs/genesis.proto delete mode 100644 proto/exocore/taskmanageravs/params.proto delete mode 100644 proto/exocore/taskmanageravs/query.proto delete mode 100644 proto/exocore/taskmanageravs/tx.proto delete mode 100644 x/avs/client/cli/query_params.go create mode 100644 x/avs/keeper/avs_test.go delete mode 100644 x/avs/keeper/query_params.go create mode 100644 x/avs/keeper/setup_test.go delete mode 100644 x/taskmanageravs/client/cli/query.go delete mode 100644 x/taskmanageravs/client/cli/query_params.go delete mode 100644 x/taskmanageravs/client/cli/tx.go delete mode 100644 x/taskmanageravs/genesis.go delete mode 100644 x/taskmanageravs/genesis_test.go delete mode 100644 x/taskmanageravs/keeper/keeper.go delete mode 100644 x/taskmanageravs/keeper/msg_server.go delete mode 100644 x/taskmanageravs/keeper/msg_server_test.go delete mode 100644 x/taskmanageravs/keeper/params.go delete mode 100644 x/taskmanageravs/keeper/params_test.go delete mode 100644 x/taskmanageravs/keeper/query.go delete mode 100644 x/taskmanageravs/keeper/query_params.go delete mode 100644 x/taskmanageravs/keeper/query_params_test.go delete mode 100644 x/taskmanageravs/module.go delete mode 100644 x/taskmanageravs/simulation/helpers.go delete mode 100644 x/taskmanageravs/types/codec.go delete mode 100644 x/taskmanageravs/types/errors.go delete mode 100644 x/taskmanageravs/types/expected_keepers.go delete mode 100644 x/taskmanageravs/types/genesis.go delete mode 100644 x/taskmanageravs/types/genesis.pb.go delete mode 100644 x/taskmanageravs/types/genesis_test.go delete mode 100644 x/taskmanageravs/types/keys.go delete mode 100644 x/taskmanageravs/types/params.go delete mode 100644 x/taskmanageravs/types/params.pb.go delete mode 100644 x/taskmanageravs/types/query.pb.go delete mode 100644 x/taskmanageravs/types/query.pb.gw.go delete mode 100644 x/taskmanageravs/types/tx.pb.go delete mode 100644 x/taskmanageravs/types/types.go diff --git a/app/app.go b/app/app.go index af2795712..59536da77 100644 --- a/app/app.go +++ b/app/app.go @@ -43,18 +43,12 @@ import ( depositKeeper "github.com/ExocoreNetwork/exocore/x/deposit/keeper" depositTypes "github.com/ExocoreNetwork/exocore/x/deposit/types" - "github.com/ExocoreNetwork/exocore/x/operator" - operatorKeeper "github.com/ExocoreNetwork/exocore/x/operator/keeper" operatorTypes "github.com/ExocoreNetwork/exocore/x/operator/types" "github.com/ExocoreNetwork/exocore/x/reward" rewardKeeper "github.com/ExocoreNetwork/exocore/x/reward/keeper" rewardTypes "github.com/ExocoreNetwork/exocore/x/reward/types" - exoslash "github.com/ExocoreNetwork/exocore/x/slash" - slashKeeper "github.com/ExocoreNetwork/exocore/x/slash/keeper" - exoslashTypes "github.com/ExocoreNetwork/exocore/x/slash/types" - "github.com/ExocoreNetwork/exocore/x/withdraw" withdrawKeeper "github.com/ExocoreNetwork/exocore/x/withdraw/keeper" withdrawTypes "github.com/ExocoreNetwork/exocore/x/withdraw/types" @@ -663,7 +657,7 @@ func NewExocoreApp( app.WithdrawKeeper = *withdrawKeeper.NewKeeper(appCodec, keys[withdrawTypes.StoreKey], app.AssetsKeeper, app.DepositKeeper) app.RewardKeeper = *rewardKeeper.NewKeeper(appCodec, keys[rewardTypes.StoreKey], app.AssetsKeeper) app.ExoSlashKeeper = slashKeeper.NewKeeper(appCodec, keys[exoslashTypes.StoreKey], app.AssetsKeeper) - app.AVSManagerKeeper = *avsManagerKeeper.NewKeeper(appCodec, keys[avsManagerTypes.StoreKey], &app.OperatorKeeper) + app.AVSManagerKeeper = *avsManagerKeeper.NewKeeper(appCodec, keys[avsManagerTypes.StoreKey], &app.OperatorKeeper, app.AssetsKeeper) // We call this after setting the hooks to ensure that the hooks are set on the keeper evmKeeper.WithPrecompiles( evmkeeper.AvailablePrecompiles( diff --git a/precompiles/avs/abi.json b/precompiles/avs/abi.json index 82afbc291..8b373648d 100644 --- a/precompiles/avs/abi.json +++ b/precompiles/avs/abi.json @@ -7,22 +7,32 @@ "type": "string" }, { - "internalType": "bytes", + "internalType": "string", "name": "avsAddress", - "type": "bytes" + "type": "string" }, { - "internalType": "bytes", + "internalType": "string", "name": "operatorAddress", - "type": "bytes" + "type": "string" }, { "internalType": "uint64", "name": "action", "type": "uint64" + }, + { + "internalType": "string", + "name": "avsOwnerAddress", + "type": "string" + }, + { + "internalType": "string", + "name": "assetID", + "type": "string" } ], - "name": "AVSInfoRegisterOrDeregister", + "name": "AVSAction", "outputs": [ { "internalType": "bool", diff --git a/precompiles/avs/avs.sol b/precompiles/avs/avs.sol index 4f8453b05..cadc76390 100644 --- a/precompiles/avs/avs.sol +++ b/precompiles/avs/avs.sol @@ -13,12 +13,12 @@ IAVSManager constant AVSMANAGER_CONTRACT = IAVSManager( /// @dev The interface through which solidity contracts will interact with AVS-Manager /// @custom:address 0x0000000000000000000000000000000000000902 interface IAVSManager { - function AVSInfoRegisterOrDeregister( + function AVSAction( string memory avsName, - bytes memory avsAddress, - bytes memory operatorAddress, - uint64 action - + string memory avsAddress, + string memory operatorAddress, + uint64 action, + string memory avsOwnerAddress, + string memory assetID ) external returns (bool success); - } \ No newline at end of file diff --git a/precompiles/avs/avs_test.go b/precompiles/avs/avs_test.go new file mode 100644 index 000000000..fe0d020d0 --- /dev/null +++ b/precompiles/avs/avs_test.go @@ -0,0 +1,159 @@ +package avs_test + +import ( + "math/big" + + "github.com/ExocoreNetwork/exocore/app" + "github.com/ExocoreNetwork/exocore/precompiles/avs" + avskeeper "github.com/ExocoreNetwork/exocore/x/avs/keeper" + operatortypes "github.com/ExocoreNetwork/exocore/x/operator/types" + "github.com/ethereum/go-ethereum/common" + ethtypes "github.com/ethereum/go-ethereum/core/types" + "github.com/ethereum/go-ethereum/core/vm" + evmtypes "github.com/evmos/evmos/v14/x/evm/types" +) + +func (s *AVSManagerPrecompileSuite) TestIsTransaction() { + testCases := []struct { + name string + method string + isTx bool + }{ + { + avs.MethodAVSAction, + s.precompile.Methods[avs.MethodAVSAction].Name, + true, + }, + { + "invalid", + "invalid", + false, + }, + } + + for _, tc := range testCases { + s.Run(tc.name, func() { + s.Require().Equal(s.precompile.IsTransaction(tc.method), tc.isTx) + }) + } +} + +func (s *AVSManagerPrecompileSuite) TestAVSManager() { + avsName, avsAddres, operatorAddress := "avsTest", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr" + avsAction := avskeeper.RegisterAction + avsOwnderAddress, assetID := "0x123", "0x1" + registerOperator := func() { + registerReq := &operatortypes.RegisterOperatorReq{ + FromAddress: operatorAddress, + Info: &operatortypes.OperatorInfo{ + EarningsAddr: operatorAddress, + }, + } + _, err := s.App.OperatorKeeper.RegisterOperator(s.Ctx, registerReq) + s.NoError(err) + } + commonMalleate := func() (common.Address, []byte) { + // prepare the call input for delegation test + input, err := s.precompile.Pack( + avs.MethodAVSAction, + avsName, + avsAddres, + operatorAddress, + uint64(avsAction), + avsOwnderAddress, + assetID, + ) + s.Require().NoError(err, "failed to pack input") + return s.Address, input + } + successRet, err := s.precompile.Methods[avs.MethodAVSAction].Outputs.Pack(true) + s.Require().NoError(err) + + testcases := []struct { + name string + malleate func() (common.Address, []byte) + readOnly bool + expPass bool + errContains string + returnBytes []byte + }{ + { + name: "pass for avs-manager", + malleate: func() (common.Address, []byte) { + registerOperator() + return commonMalleate() + }, + readOnly: false, + expPass: true, + returnBytes: successRet, + }, + } + + for _, tc := range testcases { + tc := tc + s.Run(tc.name, func() { + // setup basic test suite + s.SetupTest() + + baseFee := s.App.FeeMarketKeeper.GetBaseFee(s.Ctx) + + // malleate testcase + caller, input := tc.malleate() + + contract := vm.NewPrecompile(vm.AccountRef(caller), s.precompile, big.NewInt(0), uint64(1e6)) + contract.Input = input + + contractAddr := contract.Address() + // Build and sign Ethereum transaction + txArgs := evmtypes.EvmTxArgs{ + ChainID: s.App.EvmKeeper.ChainID(), + Nonce: 0, + To: &contractAddr, + Amount: nil, + GasLimit: 100000, + GasPrice: app.MainnetMinGasPrices.BigInt(), + GasFeeCap: baseFee, + GasTipCap: big.NewInt(1), + Accesses: ðtypes.AccessList{}, + } + msgEthereumTx := evmtypes.NewTx(&txArgs) + + msgEthereumTx.From = s.Address.String() + err := msgEthereumTx.Sign(s.EthSigner, s.Signer) + s.Require().NoError(err, "failed to sign Ethereum message") + + // Instantiate config + proposerAddress := s.Ctx.BlockHeader().ProposerAddress + cfg, err := s.App.EvmKeeper.EVMConfig(s.Ctx, proposerAddress, s.App.EvmKeeper.ChainID()) + s.Require().NoError(err, "failed to instantiate EVM config") + + msg, err := msgEthereumTx.AsMessage(s.EthSigner, baseFee) + s.Require().NoError(err, "failed to instantiate Ethereum message") + + // Instantiate EVM + evm := s.App.EvmKeeper.NewEVM( + s.Ctx, msg, cfg, nil, s.StateDB, + ) + + params := s.App.EvmKeeper.GetParams(s.Ctx) + activePrecompiles := params.GetActivePrecompilesAddrs() + precompileMap := s.App.EvmKeeper.Precompiles(activePrecompiles...) + err = vm.ValidatePrecompiles(precompileMap, activePrecompiles) + s.Require().NoError(err, "invalid precompiles", activePrecompiles) + evm.WithPrecompiles(precompileMap, activePrecompiles) + + // Run precompiled contract + bz, err := s.precompile.Run(evm, contract, tc.readOnly) + + // Check results + if tc.expPass { + s.Require().NoError(err, "expected no error when running the precompile") + s.Require().Equal(tc.returnBytes, bz, "the return doesn't match the expected result") + } else { + s.Require().Error(err, "expected error to be returned when running the precompile") + s.Require().Nil(bz, "expected returned bytes to be nil") + s.Require().ErrorContains(err, tc.errContains) + } + }) + } +} diff --git a/precompiles/avs/setup_test.go b/precompiles/avs/setup_test.go new file mode 100644 index 000000000..c47cb2192 --- /dev/null +++ b/precompiles/avs/setup_test.go @@ -0,0 +1,35 @@ +package avs_test + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/precompiles/avs" + "github.com/ExocoreNetwork/exocore/testutil" + "github.com/stretchr/testify/suite" + + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" +) + +var s *AVSManagerPrecompileSuite + +type AVSManagerPrecompileSuite struct { + testutil.BaseTestSuite + precompile *avs.Precompile +} + +func TestPrecompileTestSuite(t *testing.T) { + s = new(AVSManagerPrecompileSuite) + suite.Run(t, s) + + // Run Ginkgo integration tests + RegisterFailHandler(Fail) + RunSpecs(t, "AVSManager Precompile Suite") +} + +func (s *AVSManagerPrecompileSuite) SetupTest() { + s.DoSetupTest() + precompile, err := avs.NewPrecompile(s.App.AVSManagerKeeper, s.App.AuthzKeeper) + s.Require().NoError(err) + s.precompile = precompile +} diff --git a/precompiles/avs/tx.go b/precompiles/avs/tx.go index e4174ca4f..8832574f6 100644 --- a/precompiles/avs/tx.go +++ b/precompiles/avs/tx.go @@ -10,14 +10,14 @@ import ( const ( // AVSRegister defines the ABI method name for the avs // related transaction. - MethodAVSAction = "avsAction" + MethodAVSAction = "AVSAction" ) // AVSInfoRegister register the avs related information and change the state in avs keeper module. func (p Precompile) AVSInfoRegisterOrDeregister( ctx sdk.Context, _ common.Address, - contract *vm.Contract, + _ *vm.Contract, _ vm.StateDB, method *abi.Method, args []interface{}, diff --git a/precompiles/avs/types.go b/precompiles/avs/types.go index 870f9f707..bad73920d 100644 --- a/precompiles/avs/types.go +++ b/precompiles/avs/types.go @@ -2,39 +2,51 @@ package avs import ( exocmn "github.com/ExocoreNetwork/exocore/precompiles/common" - "github.com/ExocoreNetwork/exocore/x/avs/keeper" + avstypes "github.com/ExocoreNetwork/exocore/x/avs/keeper" sdk "github.com/cosmos/cosmos-sdk/types" cmn "github.com/evmos/evmos/v14/precompiles/common" "golang.org/x/xerrors" ) -func (p Precompile) GetAVSParamsFromInputs(ctx sdk.Context, args []interface{}) (*keeper.AVSParams, error) { - if len(args) != 4 { - return nil, xerrors.Errorf(cmn.ErrInvalidNumberOfArgs, 4, len(args)) +func (p Precompile) GetAVSParamsFromInputs(_ sdk.Context, args []interface{}) (*avstypes.AVSRegisterOrDeregisterParams, error) { + if len(args) != 6 { + return nil, xerrors.Errorf(cmn.ErrInvalidNumberOfArgs, 6, len(args)) } - avsParams := &keeper.AVSParams{} + avsParams := &avstypes.AVSRegisterOrDeregisterParams{} avsName, ok := args[0].(string) if !ok { return nil, xerrors.Errorf(exocmn.ErrContractInputParaOrType, 0, "string", avsName) } - avsParams.AVSName = avsName + avsParams.AvsName = avsName - avsAddress, ok := args[1].([]byte) - if !ok || avsAddress == nil { + avsAddress, ok := args[1].(string) + if !ok { return nil, xerrors.Errorf(exocmn.ErrContractInputParaOrType, 1, "[]byte", avsAddress) } - avsParams.AVSAddress = avsAddress + avsParams.AvsAddress = avsAddress - operatorAddress, ok := args[2].([]byte) - if !ok || operatorAddress == nil { + operatorAddress, ok := args[2].(string) + if !ok || operatorAddress == "" { return nil, xerrors.Errorf(exocmn.ErrContractInputParaOrType, 2, "[]byte", operatorAddress) } avsParams.OperatorAddress = operatorAddress action, ok := args[3].(uint64) - if !ok || action != keeper.RegisterAction || action != keeper.DeRegisterAction { + if !ok || (action != avstypes.RegisterAction && action != avstypes.DeRegisterAction) { return nil, xerrors.Errorf(exocmn.ErrContractInputParaOrType, 3, "uint64", action) } avsParams.Action = action + + avsOwnerAddress, ok := args[4].(string) + if !ok || avsOwnerAddress == "" { + return nil, xerrors.Errorf(exocmn.ErrContractInputParaOrType, 4, "string", avsOwnerAddress) + } + avsParams.AvsOwnerAddress = avsOwnerAddress + + assetID, ok := args[5].(string) + if !ok || assetID == "" { + return nil, xerrors.Errorf(exocmn.ErrContractInputParaOrType, 3, "uint64", action) + } + avsParams.AssetID = assetID return avsParams, nil } diff --git a/proto/exocore/avs/genesis.proto b/proto/exocore/avs/genesis.proto deleted file mode 100644 index 0231fb278..000000000 --- a/proto/exocore/avs/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package exocore.avs; - -import "gogoproto/gogo.proto"; -import "exocore/avs/params.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/avs/types"; - -// GenesisState defines the avs module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; -} diff --git a/proto/exocore/avs/params.proto b/proto/exocore/avs/params.proto deleted file mode 100644 index bbc7d1796..000000000 --- a/proto/exocore/avs/params.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package exocore.avs; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/avs/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - -} diff --git a/proto/exocore/avs/query.proto b/proto/exocore/avs/query.proto index 8803a1699..516811ca6 100644 --- a/proto/exocore/avs/query.proto +++ b/proto/exocore/avs/query.proto @@ -1,26 +1,30 @@ syntax = "proto3"; package exocore.avs; +import "exocore/avs/tx.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "exocore/avs/params.proto"; + option go_package = "github.com/ExocoreNetwork/exocore/x/avs/types"; +// QueryAVSInfoReq is the request to query avs related information +message QueryAVSInfoReq { + // avs_address is the address of avs + string avs_address = 1 [(gogoproto.customname) = "AVSAddres"]; +} + +// QueryAVSInfoResponse is the response of avs related information +message QueryAVSInfoResponse { + // basic information of avs + AVSInfo info = 1; +} + + // Query defines the gRPC querier service. service Query { // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/avs/params"; + rpc QueryAVSInfo(QueryAVSInfoReq) returns (QueryAVSInfoResponse) { + option (google.api.http).get = "/ExocoreNetwork/exocore/avs/QueryAVSInfo"; } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; } \ No newline at end of file diff --git a/proto/exocore/avs/tx.proto b/proto/exocore/avs/tx.proto index 017702e4b..244fddc35 100644 --- a/proto/exocore/avs/tx.proto +++ b/proto/exocore/avs/tx.proto @@ -1,73 +1,72 @@ syntax = "proto3"; package exocore.avs; -import "amino/amino.proto"; import "cosmos/msg/v1/msg.proto"; import "cosmos_proto/cosmos.proto"; -import "exocore/delegation/v1/tx.proto"; -import "exocore/avs/params.proto"; option go_package = "github.com/ExocoreNetwork/exocore/x/avs/types"; +// AVSinfo represent the information of avs message AVSInfo { - string name = 1; - string AVSAddress = 2; - repeated string operatorAddress = 3; - -} - -message AVSManager { - map AVSOperatorRelation = 1; + // name of avs + string name = 1; + // address of avs + string avs_address = 2; + // registered operator of avs + repeated string operator_address = 3; + // the owner who has permission for avs + string avs_owner_address = 4; + // asset_basic_info is all the basic asset information of the avs. + repeated string asset_id = 5; } +// RegisterAVSReq is requst to register avs message RegisterAVSReq { - option (cosmos.msg.v1.signer) = "FromAddress"; - string FromAddress = 1 - [(cosmos_proto.scalar) = "cosmos.AddressString"]; - AVSInfo info = 2; + // from_address is the source + option (cosmos.msg.v1.signer) = "FromAddress"; + // from_address is the source + string from_address = 1 + [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs information + AVSInfo info = 2; } +// RegisterAVSResponse is the response for register avs message RegisterAVSResponse { - option (cosmos.msg.v1.signer) = "FromAddress"; - string FromAddress = 1 - [(cosmos_proto.scalar) = "cosmos.AddressString"]; - AVSInfo info = 2; + // from_address is the source + option (cosmos.msg.v1.signer) = "FromAddress"; + // from_address is the source + string from_address = 1 + [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs information + AVSInfo info = 2; } +// DeRegisterAVSReq is requst to deregister avs message DeRegisterAVSReq { - option (cosmos.msg.v1.signer) = "FromAddress"; - string FromAddress = 1 - [(cosmos_proto.scalar) = "cosmos.AddressString"]; - AVSInfo info = 2; + option (cosmos.msg.v1.signer) = "FromAddress"; + // from_address is the source address + string from_address = 1 + [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs information + AVSInfo info = 2; } +// DeRegisterAVSResponse is requst to register avs message DeRegisterAVSResponse { - option (cosmos.msg.v1.signer) = "FromAddress"; - string FromAddress = 1 - [(cosmos_proto.scalar) = "cosmos.AddressString"]; - AVSInfo info = 2; + // from_address is the source address + option (cosmos.msg.v1.signer) = "FromAddress"; + // from_address is the source address + string from_address = 1 + [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // avs information + AVSInfo info = 2; } // Msg defines the AVS related Msg service. service Msg { - option (cosmos.msg.v1.service) = true; - // RegisterAVS registers a new AVS with corresponding operator. - rpc RegisterAVS (RegisterAVSReq) returns (RegisterAVSResponse); - // DelegateAssetToOperator delegates asset to operator. - rpc DeRegisterAVS (DeRegisterAVSReq) returns (DeRegisterAVSResponse); -} - -// MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. -message MsgUpdateParams { - // todo: temporarily not update configuration through gov module - option (cosmos.msg.v1.signer) = "authority"; - // authority is the address of the governance account. - string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - - // params defines the x/evm parameters to update. - // NOTE: All parameters must be supplied. - Params params = 2; - } - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -message MsgUpdateParamsResponse {} \ No newline at end of file + option (cosmos.msg.v1.service) = true; + // RegisterAVS registers a new AVS with corresponding operator. + rpc RegisterAVS (RegisterAVSReq) returns (RegisterAVSResponse); + // DelegateAssetToOperator delegates asset to operator. + rpc DeRegisterAVS (DeRegisterAVSReq) returns (DeRegisterAVSResponse); +} \ No newline at end of file diff --git a/proto/exocore/taskmanageravs/genesis.proto b/proto/exocore/taskmanageravs/genesis.proto deleted file mode 100644 index aeaa3034e..000000000 --- a/proto/exocore/taskmanageravs/genesis.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package exocore.taskmanageravs; - -import "gogoproto/gogo.proto"; -import "exocore/taskmanageravs/params.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types"; - -// GenesisState defines the taskmanageravs module's genesis state. -message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; -} diff --git a/proto/exocore/taskmanageravs/params.proto b/proto/exocore/taskmanageravs/params.proto deleted file mode 100644 index af6ca4e72..000000000 --- a/proto/exocore/taskmanageravs/params.proto +++ /dev/null @@ -1,12 +0,0 @@ -syntax = "proto3"; -package exocore.taskmanageravs; - -import "gogoproto/gogo.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types"; - -// Params defines the parameters for the module. -message Params { - option (gogoproto.goproto_stringer) = false; - -} diff --git a/proto/exocore/taskmanageravs/query.proto b/proto/exocore/taskmanageravs/query.proto deleted file mode 100644 index 1df79afb0..000000000 --- a/proto/exocore/taskmanageravs/query.proto +++ /dev/null @@ -1,26 +0,0 @@ -syntax = "proto3"; -package exocore.taskmanageravs; - -import "gogoproto/gogo.proto"; -import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "exocore/taskmanageravs/params.proto"; - -option go_package = "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types"; - -// Query defines the gRPC querier service. -service Query { - // Parameters queries the parameters of the module. - rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { - option (google.api.http).get = "/ExocoreNetwork/exocore/taskmanageravs/params"; - } -} - -// QueryParamsRequest is request type for the Query/Params RPC method. -message QueryParamsRequest {} - -// QueryParamsResponse is response type for the Query/Params RPC method. -message QueryParamsResponse { - // params holds all the parameters of this module. - Params params = 1 [(gogoproto.nullable) = false]; -} \ No newline at end of file diff --git a/proto/exocore/taskmanageravs/tx.proto b/proto/exocore/taskmanageravs/tx.proto deleted file mode 100644 index 94d18edf0..000000000 --- a/proto/exocore/taskmanageravs/tx.proto +++ /dev/null @@ -1,32 +0,0 @@ -syntax = "proto3"; -package exocore.taskmanageravs; - -option go_package = "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types"; - -message TaskInfo { - string Name = 1; - string MetaInfo = 2; - uint64 TaskId = 3; - // each task needs to reach at least thresholdPercentage of operator signatures. - uint64 thresholdPercentage = 4; -} - -message TaskManagerInfo { - map TaskManager = 1; -} - -message RegisterAVSTaskReq { - string AVSAddress = 1; - TaskInfo task = 2; -} - -message RegisterAVSTaskResponse {} - - -// Msg defines the Msg service. -service Msg { - rpc RegisterAVSTask(RegisterAVSTaskReq) returns (RegisterAVSTaskResponse); -} - - - diff --git a/x/avs/client/cli/query.go b/x/avs/client/cli/query.go index bdf0577b8..937bf41d0 100644 --- a/x/avs/client/cli/query.go +++ b/x/avs/client/cli/query.go @@ -1,12 +1,16 @@ package cli import ( + "context" "fmt" + // "strings" "github.com/spf13/cobra" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + // "github.com/cosmos/cosmos-sdk/client/flags" // sdk "github.com/cosmos/cosmos-sdk/types" @@ -14,7 +18,7 @@ import ( ) // GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(queryRoute string) *cobra.Command { +func GetQueryCmd(_ string) *cobra.Command { // Group avs queries under a subcommand cmd := &cobra.Command{ Use: types.ModuleName, @@ -24,9 +28,33 @@ func GetQueryCmd(queryRoute string) *cobra.Command { RunE: client.ValidateCmd, } - cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 - - return cmd + cmd.AddCommand(QueryAVSInfo()) + return cmd } +func QueryAVSInfo() *cobra.Command { + cmd := &cobra.Command{ + Use: "AVSInfo query", + Short: "AVSInfo query", + Long: "AVSInfo query for current registered AVS", + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + req := &types.QueryAVSInfoReq{ + AVSAddres: args[0], + } + res, err := queryClient.QueryAVSInfo(context.Background(), req) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/avs/client/cli/query_params.go b/x/avs/client/cli/query_params.go deleted file mode 100644 index 91d3ce7f1..000000000 --- a/x/avs/client/cli/query_params.go +++ /dev/null @@ -1,36 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/avs/types" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/avs/client/cli/tx.go b/x/avs/client/cli/tx.go index 2cec62353..46a58a421 100644 --- a/x/avs/client/cli/tx.go +++ b/x/avs/client/cli/tx.go @@ -2,7 +2,6 @@ package cli import ( "fmt" - "time" "github.com/spf13/cobra" @@ -14,15 +13,6 @@ import ( "github.com/ExocoreNetwork/exocore/x/avs/types" ) -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) - -const ( - flagPacketTimeoutTimestamp = "packet-timeout-timestamp" - listSeparator = "," -) - // GetTxCmd returns the transaction commands for this module func GetTxCmd() *cobra.Command { cmd := &cobra.Command{ @@ -33,16 +23,14 @@ func GetTxCmd() *cobra.Command { RunE: client.ValidateCmd, } - // this line is used by starport scaffolding # 1 - return cmd } func RegisterAVS() *cobra.Command { cmd := &cobra.Command{ - Use: "RegisterAVS: AVSName, AVSAddress, OperatorAddress", + Use: "RegisterAVS: AvsName, AvsAddress, OperatorAddress, AvsOwnerAddress, AssetId", Short: "register to be an avs", - Args: cobra.MinimumNArgs(4), + Args: cobra.MinimumNArgs(5), RunE: func(cmd *cobra.Command, args []string) error { cliCtx, err := client.GetClientTxContext(cmd) if err != nil { @@ -55,8 +43,10 @@ func RegisterAVS() *cobra.Command { FromAddress: fromAddress, Info: &types.AVSInfo{ Name: args[0], - AVSAddress: args[1], + AvsAddress: args[1], OperatorAddress: []string{args[2]}, + AvsOwnerAddress: args[3], + AssetId: []string{args[4]}, }, } diff --git a/x/avs/keeper/avs_test.go b/x/avs/keeper/avs_test.go new file mode 100644 index 000000000..fa70c256e --- /dev/null +++ b/x/avs/keeper/avs_test.go @@ -0,0 +1,7 @@ +package keeper_test + +func (suite *AVSTestSuite) TestAVS() { + avsName, avsAddres, operatorAddress, assetID := "avsTest", "exo13h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "exo18h6xg79g82e2g2vhjwg7j4r2z2hlncelwutkjr", "" + err := suite.App.AVSManagerKeeper.SetAVSInfo(suite.Ctx, avsName, avsAddres, operatorAddress, assetID) + suite.NoError(err) +} diff --git a/x/avs/keeper/keeper.go b/x/avs/keeper/keeper.go index 93a448552..0a7222002 100644 --- a/x/avs/keeper/keeper.go +++ b/x/avs/keeper/keeper.go @@ -4,6 +4,7 @@ import ( "fmt" errorsmod "cosmossdk.io/errors" + assettypes "github.com/ExocoreNetwork/exocore/x/assets/keeper" delegationtypes "github.com/ExocoreNetwork/exocore/x/delegation/types" "github.com/cometbft/cometbft/libs/log" "github.com/cosmos/cosmos-sdk/codec" @@ -19,6 +20,8 @@ type ( cdc codec.BinaryCodec storeKey storetypes.StoreKey operatorKeeper delegationtypes.OperatorKeeper + // other keepers + assetsKeeper assettypes.Keeper } ) @@ -26,12 +29,13 @@ func NewKeeper( cdc codec.BinaryCodec, storeKey storetypes.StoreKey, operatorKeeper delegationtypes.OperatorKeeper, + assetKeeper assettypes.Keeper, ) *Keeper { - return &Keeper{ cdc: cdc, storeKey: storeKey, operatorKeeper: operatorKeeper, + assetsKeeper: assetKeeper, } } @@ -39,45 +43,52 @@ func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) } -func (k Keeper) AVSInfoUpdate(ctx sdk.Context, params *AVSParams) error { +func (k Keeper) AVSInfoUpdate(ctx sdk.Context, params *AVSRegisterOrDeregisterParams) error { operatorAddress := params.OperatorAddress - opAccAddr, err := sdk.AccAddressFromBech32(string(operatorAddress)) + opAccAddr, err := sdk.AccAddressFromBech32(operatorAddress) if err != nil { return errorsmod.Wrap(err, fmt.Sprintf("error occurred when parse acc address from Bech32,the addr is:%s", operatorAddress)) } if !k.operatorKeeper.IsOperator(ctx, opAccAddr) { return errorsmod.Wrap(delegationtypes.ErrOperatorNotExist, "AVSInfoUpdate: invalid operator address") } + action := params.Action if action == RegisterAction { - return k.SetAVSInfo(ctx, params.AVSName, string(params.AVSAddress), string(operatorAddress)) - } else { - return k.DeleteAVSInfo(ctx, string(params.AVSAddress)) + return k.SetAVSInfo(ctx, params.AvsName, params.AvsAddress, operatorAddress, params.AssetID) + } + avsInfo, err := k.GetAVSInfo(ctx, params.AvsAddress) + if err != nil { + return errorsmod.Wrap(err, fmt.Sprintf("error occurred when get avs info %s", avsInfo)) + } + if avsInfo.Info.AvsOwnerAddress != params.AvsOwnerAddress { + return errorsmod.Wrap(err, fmt.Sprintf("not qualified to deregister %s", avsInfo)) } + return k.DeleteAVSInfo(ctx, params.AvsAddress) } -func (k Keeper) SetAVSInfo(ctx sdk.Context, AVSName string, AVSAddress string, OperatorAddress string) (err error) { - avsAddr, err := sdk.AccAddressFromBech32(AVSAddress) +func (k Keeper) SetAVSInfo(ctx sdk.Context, avsName, avsAddress, operatorAddress, assetID string) (err error) { + avsAddr, err := sdk.AccAddressFromBech32(avsAddress) if err != nil { - return errorsmod.Wrap(err, "GetAVSInfo: error occurred when parse acc address from Bech32") + return errorsmod.Wrap(err, "SetAVSInfo: error occurred when parse acc address from Bech32") } store := prefix.NewStore(ctx.KVStore(k.storeKey), types.KeyPrefixAVSInfo) if !store.Has(avsAddr) { - AVSInfo := &types.AVSInfo{Name: AVSName, AVSAddress: AVSAddress, OperatorAddress: []string{OperatorAddress}} + AVSInfo := &types.AVSInfo{Name: avsName, AvsAddress: avsAddress, OperatorAddress: []string{operatorAddress}, AssetId: []string{assetID}} bz := k.cdc.MustMarshal(AVSInfo) store.Set(avsAddr, bz) return nil - } else { - value := store.Get(avsAddr) - ret := &types.AVSInfo{} - k.cdc.MustUnmarshal(value, ret) - ret.OperatorAddress = append(ret.OperatorAddress, OperatorAddress) - return nil } + value := store.Get(avsAddr) + ret := &types.AVSInfo{} + k.cdc.MustUnmarshal(value, ret) + ret.OperatorAddress = append(ret.OperatorAddress, operatorAddress) + ret.AssetId = append(ret.AssetId, assetID) + return nil } -func (k Keeper) GetAVSInfo(ctx sdk.Context, addr string) (*types.AVSInfo, error) { +func (k Keeper) GetAVSInfo(ctx sdk.Context, addr string) (*types.QueryAVSInfoResponse, error) { avsAddr, err := sdk.AccAddressFromBech32(addr) if err != nil { return nil, errorsmod.Wrap(err, "GetAVSInfo: error occurred when parse acc address from Bech32") @@ -90,7 +101,10 @@ func (k Keeper) GetAVSInfo(ctx sdk.Context, addr string) (*types.AVSInfo, error) value := store.Get(avsAddr) ret := types.AVSInfo{} k.cdc.MustUnmarshal(value, &ret) - return &ret, nil + res := &types.QueryAVSInfoResponse{ + Info: &ret, + } + return res, nil } func (k Keeper) DeleteAVSInfo(ctx sdk.Context, addr string) error { diff --git a/x/avs/keeper/msg_server.go b/x/avs/keeper/msg_server.go index 8bc3313fa..659cf1730 100644 --- a/x/avs/keeper/msg_server.go +++ b/x/avs/keeper/msg_server.go @@ -8,7 +8,7 @@ import ( var _ types.MsgServer = &Keeper{} -func (k Keeper) RegisterAVS(ctx context.Context, req *types.RegisterAVSReq) (*types.RegisterAVSResponse, error) { +func (k Keeper) RegisterAVS(_ context.Context, _ *types.RegisterAVSReq) (*types.RegisterAVSResponse, error) { // Disable cosmos transaction temporarily // c := sdk.UnwrapSDKContext(ctx) // fromAddress := req.FromAddress @@ -24,7 +24,7 @@ func (k Keeper) RegisterAVS(ctx context.Context, req *types.RegisterAVSReq) (*ty return nil, nil } -func (k Keeper) DeRegisterAVS(ctx context.Context, req *types.DeRegisterAVSReq) (*types.DeRegisterAVSResponse, error) { +func (k Keeper) DeRegisterAVS(_ context.Context, _ *types.DeRegisterAVSReq) (*types.DeRegisterAVSResponse, error) { // Disable cosmos transaction temporarily // c := sdk.UnwrapSDKContext(ctx) // if err := k.DeleteAVSInfo(c, req.Info); err != nil { diff --git a/x/avs/keeper/params.go b/x/avs/keeper/params.go index 255a88b24..367a0230e 100644 --- a/x/avs/keeper/params.go +++ b/x/avs/keeper/params.go @@ -31,14 +31,16 @@ func (k Keeper) SetParams(ctx sdk.Context, params *types.Params) error { return nil } -type AVSParams struct { - AVSName string - AVSAddress []byte - OperatorAddress []byte +type AVSRegisterOrDeregisterParams struct { + AvsName string + AvsAddress string + OperatorAddress string Action uint64 + AvsOwnerAddress string + AssetID string } const ( - RegisterAction = iota + 1 - DeRegisterAction + RegisterAction = 1 + DeRegisterAction = 2 ) diff --git a/x/avs/keeper/query.go b/x/avs/keeper/query.go index f6f9fd320..c976ca358 100644 --- a/x/avs/keeper/query.go +++ b/x/avs/keeper/query.go @@ -1,7 +1,15 @@ package keeper import ( + "context" + "github.com/ExocoreNetwork/exocore/x/avs/types" + sdk "github.com/cosmos/cosmos-sdk/types" ) var _ types.QueryServer = Keeper{} + +func (k Keeper) QueryAVSInfo(ctx context.Context, req *types.QueryAVSInfoReq) (*types.QueryAVSInfoResponse, error) { + c := sdk.UnwrapSDKContext(ctx) + return k.GetAVSInfo(c, req.AVSAddres) +} diff --git a/x/avs/keeper/query_params.go b/x/avs/keeper/query_params.go deleted file mode 100644 index 98c778e6c..000000000 --- a/x/avs/keeper/query_params.go +++ /dev/null @@ -1,22 +0,0 @@ -package keeper - -import ( - "context" - - "github.com/ExocoreNetwork/exocore/x/avs/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - params, err := k.GetParams(ctx) - if err != nil { - return nil, err - } - return &types.QueryParamsResponse{Params: *params}, nil -} diff --git a/x/avs/keeper/setup_test.go b/x/avs/keeper/setup_test.go new file mode 100644 index 000000000..898322afc --- /dev/null +++ b/x/avs/keeper/setup_test.go @@ -0,0 +1,29 @@ +package keeper_test + +import ( + "testing" + + "github.com/ExocoreNetwork/exocore/testutil" + . "github.com/onsi/ginkgo/v2" + . "github.com/onsi/gomega" + "github.com/stretchr/testify/suite" +) + +type AVSTestSuite struct { + testutil.BaseTestSuite +} + +var s *AVSTestSuite + +func TestKeeperTestSuite(t *testing.T) { + s = new(AVSTestSuite) + suite.Run(t, s) + + // Run Ginkgo integration tests + RegisterFailHandler(Fail) + RunSpecs(t, "Keeper Suite") +} + +func (suite *AVSTestSuite) SetupTest() { + suite.DoSetupTest() +} diff --git a/x/avs/module.go b/x/avs/module.go index bb8556817..5517973f7 100644 --- a/x/avs/module.go +++ b/x/avs/module.go @@ -44,17 +44,17 @@ func (b AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { } // RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { +func (b AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { types.RegisterInterfaces(reg) } -// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { +// DefaultGenesis returns a default GenesisState for the module, marshaled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing +func (b AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { return cdc.MustMarshalJSON(types.DefaultGenesis()) } // ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { +func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, _ client.TxEncodingConfig, bz json.RawMessage) error { var genState types.GenesisState if err := cdc.UnmarshalJSON(bz, &genState); err != nil { return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) @@ -64,11 +64,13 @@ func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncod // RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) + if err := types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)); err != nil { + panic(err) + } } // GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module -func (a AppModuleBasic) GetTxCmd() *cobra.Command { +func (b AppModuleBasic) GetTxCmd() *cobra.Command { return cli.GetTxCmd() } diff --git a/x/avs/types/codec.go b/x/avs/types/codec.go index b353cdd0c..0d191313b 100644 --- a/x/avs/types/codec.go +++ b/x/avs/types/codec.go @@ -3,30 +3,16 @@ package types import ( "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" // this line is used by starport scaffolding # 1 "github.com/cosmos/cosmos-sdk/types/msgservice" ) -const ( - // Amino names - updateParamsName = "exocore/MsgUpdateParams" -) - func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - registry.RegisterImplementations( - (*sdk.Msg)(nil), - &MsgUpdateParams{}, - ) msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) } -// RegisterLegacyAminoCodec registers the necessary x/revenue interfaces and -// concrete types on the provided LegacyAmino codec. These types are used for -// Amino JSON serialization and EIP-712 compatibility. -func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - cdc.RegisterConcrete(&MsgUpdateParams{}, updateParamsName, nil) +func RegisterLegacyAminoCodec(_ *codec.LegacyAmino) { } var ( diff --git a/x/avs/types/errors.go b/x/avs/types/errors.go index 925153146..705986b4c 100644 --- a/x/avs/types/errors.go +++ b/x/avs/types/errors.go @@ -4,11 +4,9 @@ package types import ( errorsmod "cosmossdk.io/errors" - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // x/avs module sentinel errors var ( - ErrNoKeyInTheStore = errorsmod.Register(ModuleName, 0, "there is not the key for in the store") - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrNoKeyInTheStore = errorsmod.Register(ModuleName, 0, "there is no such key in the store") ) diff --git a/x/avs/types/genesis.go b/x/avs/types/genesis.go index c41be0742..1cd6086b0 100644 --- a/x/avs/types/genesis.go +++ b/x/avs/types/genesis.go @@ -1,8 +1,6 @@ package types -import ( // this line is used by starport scaffolding # genesis/types/import -) // DefaultIndex is the default global index const DefaultIndex uint64 = 1 @@ -10,15 +8,14 @@ const DefaultIndex uint64 = 1 // DefaultGenesis returns the default genesis state func DefaultGenesis() *GenesisState { return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), + Params: DefaultParams(), } } // Validate performs basic genesis state validation returning an error upon any // failure. func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate + // this line is used by starport scaffolding # genesis/types/validate return gs.Params.Validate() } diff --git a/x/avs/types/params.go b/x/avs/types/params.go index 52a8a059f..357196ad6 100644 --- a/x/avs/types/params.go +++ b/x/avs/types/params.go @@ -1,38 +1,30 @@ package types import ( - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" "gopkg.in/yaml.v2" ) var _ paramtypes.ParamSet = (*Params)(nil) - - // ParamKeyTable the param key table for launch module func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) } // NewParams creates a new Params instance -func NewParams( -) Params { - return Params{ - } +func NewParams() Params { + return Params{} } // DefaultParams returns a default set of parameters func DefaultParams() Params { - return NewParams( - ) + return NewParams() } // ParamSetPairs get the params.ParamSet func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - } + return paramtypes.ParamSetPairs{} } // Validate validates the set of params diff --git a/x/avs/types/query.pb.go b/x/avs/types/query.pb.go index 1e76f2c7b..7a23a3394 100644 --- a/x/avs/types/query.pb.go +++ b/x/avs/types/query.pb.go @@ -6,7 +6,6 @@ package types import ( context "context" fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" _ "github.com/cosmos/gogoproto/gogoproto" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" @@ -30,22 +29,22 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { +type QueryAVSInfoReq struct { + AVSAddres string `protobuf:"bytes,1,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` } -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { +func (m *QueryAVSInfoReq) Reset() { *m = QueryAVSInfoReq{} } +func (m *QueryAVSInfoReq) String() string { return proto.CompactTextString(m) } +func (*QueryAVSInfoReq) ProtoMessage() {} +func (*QueryAVSInfoReq) Descriptor() ([]byte, []int) { return fileDescriptor_d9df5f5965203ddc, []int{0} } -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { +func (m *QueryAVSInfoReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAVSInfoReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAVSInfoReq.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,36 +54,41 @@ func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) +func (m *QueryAVSInfoReq) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAVSInfoReq.Merge(m, src) } -func (m *QueryParamsRequest) XXX_Size() int { +func (m *QueryAVSInfoReq) XXX_Size() int { return m.Size() } -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +func (m *QueryAVSInfoReq) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAVSInfoReq.DiscardUnknown(m) } -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo +var xxx_messageInfo_QueryAVSInfoReq proto.InternalMessageInfo -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +func (m *QueryAVSInfoReq) GetAVSAddres() string { + if m != nil { + return m.AVSAddres + } + return "" } -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { +type QueryAVSInfoResponse struct { + Info *AVSInfo `protobuf:"bytes,1,opt,name=info,proto3" json:"info,omitempty"` +} + +func (m *QueryAVSInfoResponse) Reset() { *m = QueryAVSInfoResponse{} } +func (m *QueryAVSInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAVSInfoResponse) ProtoMessage() {} +func (*QueryAVSInfoResponse) Descriptor() ([]byte, []int) { return fileDescriptor_d9df5f5965203ddc, []int{1} } -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryAVSInfoResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryAVSInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryAVSInfoResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -94,53 +98,53 @@ func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) +func (m *QueryAVSInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAVSInfoResponse.Merge(m, src) } -func (m *QueryParamsResponse) XXX_Size() int { +func (m *QueryAVSInfoResponse) XXX_Size() int { return m.Size() } -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +func (m *QueryAVSInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAVSInfoResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryAVSInfoResponse proto.InternalMessageInfo -func (m *QueryParamsResponse) GetParams() Params { +func (m *QueryAVSInfoResponse) GetInfo() *AVSInfo { if m != nil { - return m.Params + return m.Info } - return Params{} + return nil } func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "exocore.avs.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "exocore.avs.QueryParamsResponse") + proto.RegisterType((*QueryAVSInfoReq)(nil), "exocore.avs.QueryAVSInfoReq") + proto.RegisterType((*QueryAVSInfoResponse)(nil), "exocore.avs.QueryAVSInfoResponse") } func init() { proto.RegisterFile("exocore/avs/query.proto", fileDescriptor_d9df5f5965203ddc) } var fileDescriptor_d9df5f5965203ddc = []byte{ - // 300 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x90, 0x41, 0x4b, 0xf3, 0x30, - 0x18, 0xc7, 0x9b, 0x97, 0xd7, 0x1d, 0xb2, 0x5b, 0x36, 0x70, 0x14, 0xc9, 0x46, 0xf1, 0x20, 0x03, - 0x1b, 0x3a, 0xbf, 0xc1, 0x40, 0xf4, 0x24, 0xba, 0xa3, 0xb7, 0xb4, 0x84, 0x58, 0xb4, 0x7d, 0xb2, - 0x26, 0xed, 0xb6, 0x9b, 0xf8, 0x09, 0x04, 0xbf, 0xd4, 0x8e, 0x03, 0x2f, 0x9e, 0x44, 0x5a, 0x3f, - 0x88, 0x2c, 0xe9, 0x61, 0x63, 0xec, 0x56, 0xfe, 0xcf, 0xef, 0xff, 0xeb, 0xf3, 0x04, 0x9f, 0x8a, - 0x25, 0x24, 0x50, 0x08, 0xc6, 0x2b, 0xcd, 0xe6, 0xa5, 0x28, 0x56, 0xa1, 0x2a, 0xc0, 0x00, 0xe9, - 0xb6, 0x83, 0x90, 0x57, 0xda, 0xef, 0x4b, 0x90, 0x60, 0x73, 0xb6, 0xfd, 0x72, 0x88, 0x7f, 0x26, - 0x01, 0xe4, 0x8b, 0x60, 0x5c, 0xa5, 0x8c, 0xe7, 0x39, 0x18, 0x6e, 0x52, 0xc8, 0x75, 0x3b, 0x1d, - 0x27, 0xa0, 0x33, 0xd0, 0x2c, 0xe6, 0x5a, 0x38, 0x33, 0xab, 0xa2, 0x58, 0x18, 0x1e, 0x31, 0xc5, - 0x65, 0x9a, 0x5b, 0xb8, 0x65, 0x07, 0xbb, 0x5b, 0x28, 0x5e, 0xf0, 0xac, 0xb5, 0x04, 0x7d, 0x4c, - 0x1e, 0xb6, 0xdd, 0x7b, 0x1b, 0xce, 0xc4, 0xbc, 0x14, 0xda, 0x04, 0xb7, 0xb8, 0xb7, 0x97, 0x6a, - 0x05, 0xb9, 0x16, 0x24, 0xc2, 0x1d, 0x57, 0x1e, 0xa0, 0x11, 0xba, 0xe8, 0x4e, 0x7a, 0xe1, 0xce, - 0x11, 0xa1, 0x83, 0xa7, 0xff, 0xd7, 0xdf, 0x43, 0x6f, 0xd6, 0x82, 0x93, 0x57, 0x84, 0x4f, 0xac, - 0x8a, 0x2c, 0x70, 0xc7, 0x11, 0x64, 0xb8, 0x57, 0x3b, 0xfc, 0xbd, 0x3f, 0x3a, 0x0e, 0xb8, 0x4d, - 0x82, 0xf1, 0xdb, 0xe7, 0xef, 0xc7, 0xbf, 0x73, 0x12, 0xb0, 0x6b, 0x47, 0xde, 0x09, 0xb3, 0x80, - 0xe2, 0x99, 0x1d, 0x1e, 0x3a, 0xbd, 0x59, 0xd7, 0x14, 0x6d, 0x6a, 0x8a, 0x7e, 0x6a, 0x8a, 0xde, - 0x1b, 0xea, 0x6d, 0x1a, 0xea, 0x7d, 0x35, 0xd4, 0x7b, 0xbc, 0x94, 0xa9, 0x79, 0x2a, 0xe3, 0x30, - 0x81, 0xec, 0x98, 0x67, 0x69, 0x4d, 0x66, 0xa5, 0x84, 0x8e, 0x3b, 0xf6, 0xc9, 0xae, 0xfe, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x78, 0xe2, 0x4e, 0x16, 0xd4, 0x01, 0x00, 0x00, + // 303 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x12, 0x4f, 0xad, 0xc8, 0x4f, + 0xce, 0x2f, 0x4a, 0xd5, 0x4f, 0x2c, 0x2b, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xaa, 0xd4, 0x2b, 0x28, + 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x86, 0x4a, 0xe8, 0x25, 0x96, 0x15, 0x4b, 0x89, 0xa4, 0xe7, 0xa7, + 0xe7, 0x83, 0xc5, 0xf5, 0x41, 0x2c, 0x88, 0x12, 0x29, 0x99, 0xf4, 0xfc, 0xfc, 0xf4, 0x9c, 0x54, + 0xfd, 0xc4, 0x82, 0x4c, 0xfd, 0xc4, 0xbc, 0xbc, 0xfc, 0x92, 0xc4, 0x92, 0xcc, 0xfc, 0xbc, 0x62, + 0xa8, 0xac, 0x08, 0xb2, 0xc9, 0x25, 0x15, 0x10, 0x51, 0x25, 0x47, 0x2e, 0xfe, 0x40, 0x90, 0x2d, + 0x8e, 0x61, 0xc1, 0x9e, 0x79, 0x69, 0xf9, 0x41, 0xa9, 0x85, 0x42, 0x7a, 0x5c, 0xdc, 0x89, 0x65, + 0xc5, 0xf1, 0x89, 0x29, 0x29, 0x45, 0xa9, 0xc5, 0xc5, 0x12, 0x8c, 0x0a, 0x8c, 0x1a, 0x9c, 0x4e, + 0xbc, 0x8f, 0xee, 0xc9, 0x73, 0x3a, 0x86, 0x05, 0x3b, 0x82, 0x45, 0x83, 0xb8, 0x12, 0xcb, 0x8a, + 0x21, 0xcc, 0x62, 0x25, 0x07, 0x2e, 0x11, 0x54, 0x23, 0x8a, 0x0b, 0xf2, 0xf3, 0x8a, 0x53, 0x85, + 0x34, 0xb8, 0x58, 0x32, 0xf3, 0xd2, 0xf2, 0xc1, 0x06, 0x70, 0x1b, 0x89, 0xe8, 0x21, 0x79, 0x40, + 0x0f, 0xa6, 0x16, 0xac, 0xc2, 0xa8, 0x9b, 0x91, 0x8b, 0x15, 0x6c, 0x84, 0x50, 0x23, 0x23, 0x17, + 0x0f, 0xb2, 0x61, 0x42, 0x32, 0x28, 0xda, 0xd0, 0x9c, 0x2a, 0xa5, 0x88, 0x47, 0x16, 0xe2, 0x0a, + 0x25, 0x83, 0xa6, 0xcb, 0x4f, 0x26, 0x33, 0x69, 0x09, 0x69, 0xe8, 0xbb, 0x42, 0x94, 0xfa, 0xa5, + 0x96, 0x94, 0xe7, 0x17, 0x65, 0xeb, 0x23, 0x07, 0x07, 0xb2, 0x4e, 0x27, 0xf7, 0x13, 0x8f, 0xe4, + 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, + 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0xd2, 0x4d, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, + 0xce, 0xcf, 0xc5, 0x65, 0x5a, 0x05, 0x24, 0x78, 0x2b, 0x0b, 0x52, 0x8b, 0x93, 0xd8, 0xc0, 0x41, + 0x6c, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xa5, 0x03, 0xeb, 0x15, 0xd4, 0x01, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -156,7 +160,7 @@ const _ = grpc.SupportPackageIsVersion4 // 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 { // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + QueryAVSInfo(ctx context.Context, in *QueryAVSInfoReq, opts ...grpc.CallOption) (*QueryAVSInfoResponse, error) } type queryClient struct { @@ -167,9 +171,9 @@ func NewQueryClient(cc grpc1.ClientConn) QueryClient { return &queryClient{cc} } -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/exocore.avs.Query/Params", in, out, opts...) +func (c *queryClient) QueryAVSInfo(ctx context.Context, in *QueryAVSInfoReq, opts ...grpc.CallOption) (*QueryAVSInfoResponse, error) { + out := new(QueryAVSInfoResponse) + err := c.cc.Invoke(ctx, "/exocore.avs.Query/QueryAVSInfo", in, out, opts...) if err != nil { return nil, err } @@ -179,35 +183,35 @@ func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts . // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + QueryAVSInfo(context.Context, *QueryAVSInfoReq) (*QueryAVSInfoResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. type UnimplementedQueryServer struct { } -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +func (*UnimplementedQueryServer) QueryAVSInfo(ctx context.Context, req *QueryAVSInfoReq) (*QueryAVSInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method QueryAVSInfo not implemented") } func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) } -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) +func _Query_QueryAVSInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAVSInfoReq) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) + return srv.(QueryServer).QueryAVSInfo(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/exocore.avs.Query/Params", + FullMethod: "/exocore.avs.Query/QueryAVSInfo", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + return srv.(QueryServer).QueryAVSInfo(ctx, req.(*QueryAVSInfoReq)) } return interceptor(ctx, in, info, handler) } @@ -217,15 +221,15 @@ var _Query_serviceDesc = grpc.ServiceDesc{ HandlerType: (*QueryServer)(nil), Methods: []grpc.MethodDesc{ { - MethodName: "Params", - Handler: _Query_Params_Handler, + MethodName: "QueryAVSInfo", + Handler: _Query_QueryAVSInfo_Handler, }, }, Streams: []grpc.StreamDesc{}, Metadata: "exocore/avs/query.proto", } -func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { +func (m *QueryAVSInfoReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -235,20 +239,27 @@ func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAVSInfoReq) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAVSInfoReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l + if len(m.AVSAddres) > 0 { + i -= len(m.AVSAddres) + copy(dAtA[i:], m.AVSAddres) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AVSAddres))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } -func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryAVSInfoResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -258,26 +269,28 @@ func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryAVSInfoResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryAVSInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if m.Info != nil { + { + size, err := m.Info.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0xa } - i-- - dAtA[i] = 0xa return len(dAtA) - i, nil } @@ -292,23 +305,29 @@ func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *QueryParamsRequest) Size() (n int) { +func (m *QueryAVSInfoReq) Size() (n int) { if m == nil { return 0 } var l int _ = l + l = len(m.AVSAddres) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } -func (m *QueryParamsResponse) Size() (n int) { +func (m *QueryAVSInfoResponse) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) + if m.Info != nil { + l = m.Info.Size() + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -318,7 +337,7 @@ func sovQuery(x uint64) (n int) { func sozQuery(x uint64) (n int) { return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { +func (m *QueryAVSInfoReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -341,12 +360,44 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAVSInfoReq: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAVSInfoReq: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AVSAddres", 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.AVSAddres = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) @@ -368,7 +419,7 @@ func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { +func (m *QueryAVSInfoResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -391,15 +442,15 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryAVSInfoResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryAVSInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -426,7 +477,10 @@ func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if m.Info == nil { + m.Info = &AVSInfo{} + } + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/avs/types/query.pb.gw.go b/x/avs/types/query.pb.gw.go index 47246d466..b2855b174 100644 --- a/x/avs/types/query.pb.gw.go +++ b/x/avs/types/query.pb.gw.go @@ -31,20 +31,38 @@ var _ = runtime.String var _ = utilities.NewDoubleArray var _ = descriptor.ForMessage -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest +var ( + filter_Query_QueryAVSInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_QueryAVSInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAVSInfoReq var metadata runtime.ServerMetadata - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAVSInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.QueryAVSInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest +func local_request_Query_QueryAVSInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAVSInfoReq var metadata runtime.ServerMetadata - msg, err := server.Params(ctx, &protoReq) + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_QueryAVSInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.QueryAVSInfo(ctx, &protoReq) return msg, metadata, err } @@ -55,7 +73,7 @@ func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshal // Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryAVSInfo_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) @@ -64,14 +82,14 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_QueryAVSInfo_0(rctx, inboundMarshaler, server, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryAVSInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -116,7 +134,7 @@ func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc // "QueryClient" to call the correct interceptors. func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_QueryAVSInfo_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) @@ -125,14 +143,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_QueryAVSInfo_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_QueryAVSInfo_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -140,9 +158,9 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie } var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "avs", "params"}, "", runtime.AssumeColonVerbOpt(false))) + pattern_Query_QueryAVSInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "avs", "QueryAVSInfo"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage + forward_Query_QueryAVSInfo_0 = runtime.ForwardResponseMessage ) diff --git a/x/avs/types/tx.pb.go b/x/avs/types/tx.pb.go index 5d6a3d78d..1c62e02c4 100644 --- a/x/avs/types/tx.pb.go +++ b/x/avs/types/tx.pb.go @@ -6,10 +6,8 @@ package types import ( context "context" fmt "fmt" - _ "github.com/ExocoreNetwork/exocore/x/delegation/types" _ "github.com/cosmos/cosmos-proto" _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/cosmos/cosmos-sdk/types/tx/amino" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" grpc "google.golang.org/grpc" @@ -33,8 +31,11 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type AVSInfo struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - AVSAddress string `protobuf:"bytes,2,opt,name=AVSAddress,proto3" json:"AVSAddress,omitempty"` - OperatorAddress []string `protobuf:"bytes,3,rep,name=operatorAddress,proto3" json:"operatorAddress,omitempty"` + AvsAddress string `protobuf:"bytes,2,opt,name=avs_address,json=avsAddress,proto3" json:"avs_address,omitempty"` + OperatorAddress []string `protobuf:"bytes,3,rep,name=operator_address,json=operatorAddress,proto3" json:"operator_address,omitempty"` + AvsOwnerAddress string `protobuf:"bytes,4,opt,name=avs_owner_address,json=avsOwnerAddress,proto3" json:"avs_owner_address,omitempty"` + // asset_basic_info is all the basic asset information of the avs. + AssetId []string `protobuf:"bytes,5,rep,name=asset_id,json=assetId,proto3" json:"asset_id,omitempty"` } func (m *AVSInfo) Reset() { *m = AVSInfo{} } @@ -77,9 +78,9 @@ func (m *AVSInfo) GetName() string { return "" } -func (m *AVSInfo) GetAVSAddress() string { +func (m *AVSInfo) GetAvsAddress() string { if m != nil { - return m.AVSAddress + return m.AvsAddress } return "" } @@ -91,52 +92,22 @@ func (m *AVSInfo) GetOperatorAddress() []string { return nil } -type AVSManager struct { - AVSOperatorRelation map[string]string `protobuf:"bytes,1,rep,name=AVSOperatorRelation,proto3" json:"AVSOperatorRelation,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *AVSManager) Reset() { *m = AVSManager{} } -func (m *AVSManager) String() string { return proto.CompactTextString(m) } -func (*AVSManager) ProtoMessage() {} -func (*AVSManager) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{1} -} -func (m *AVSManager) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *AVSManager) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_AVSManager.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 *AVSInfo) GetAvsOwnerAddress() string { + if m != nil { + return m.AvsOwnerAddress } + return "" } -func (m *AVSManager) XXX_Merge(src proto.Message) { - xxx_messageInfo_AVSManager.Merge(m, src) -} -func (m *AVSManager) XXX_Size() int { - return m.Size() -} -func (m *AVSManager) XXX_DiscardUnknown() { - xxx_messageInfo_AVSManager.DiscardUnknown(m) -} - -var xxx_messageInfo_AVSManager proto.InternalMessageInfo -func (m *AVSManager) GetAVSOperatorRelation() map[string]string { +func (m *AVSInfo) GetAssetId() []string { if m != nil { - return m.AVSOperatorRelation + return m.AssetId } return nil } type RegisterAVSReq struct { - FromAddress string `protobuf:"bytes,1,opt,name=FromAddress,proto3" json:"FromAddress,omitempty"` + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } @@ -144,7 +115,7 @@ func (m *RegisterAVSReq) Reset() { *m = RegisterAVSReq{} } func (m *RegisterAVSReq) String() string { return proto.CompactTextString(m) } func (*RegisterAVSReq) ProtoMessage() {} func (*RegisterAVSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{2} + return fileDescriptor_c92b5dfe90086a66, []int{1} } func (m *RegisterAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -188,7 +159,7 @@ func (m *RegisterAVSReq) GetInfo() *AVSInfo { } type RegisterAVSResponse struct { - FromAddress string `protobuf:"bytes,1,opt,name=FromAddress,proto3" json:"FromAddress,omitempty"` + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } @@ -196,7 +167,7 @@ func (m *RegisterAVSResponse) Reset() { *m = RegisterAVSResponse{} } func (m *RegisterAVSResponse) String() string { return proto.CompactTextString(m) } func (*RegisterAVSResponse) ProtoMessage() {} func (*RegisterAVSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{3} + return fileDescriptor_c92b5dfe90086a66, []int{2} } func (m *RegisterAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -240,7 +211,7 @@ func (m *RegisterAVSResponse) GetInfo() *AVSInfo { } type DeRegisterAVSReq struct { - FromAddress string `protobuf:"bytes,1,opt,name=FromAddress,proto3" json:"FromAddress,omitempty"` + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } @@ -248,7 +219,7 @@ func (m *DeRegisterAVSReq) Reset() { *m = DeRegisterAVSReq{} } func (m *DeRegisterAVSReq) String() string { return proto.CompactTextString(m) } func (*DeRegisterAVSReq) ProtoMessage() {} func (*DeRegisterAVSReq) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{4} + return fileDescriptor_c92b5dfe90086a66, []int{3} } func (m *DeRegisterAVSReq) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -292,7 +263,7 @@ func (m *DeRegisterAVSReq) GetInfo() *AVSInfo { } type DeRegisterAVSResponse struct { - FromAddress string `protobuf:"bytes,1,opt,name=FromAddress,proto3" json:"FromAddress,omitempty"` + FromAddress string `protobuf:"bytes,1,opt,name=from_address,json=fromAddress,proto3" json:"from_address,omitempty"` Info *AVSInfo `protobuf:"bytes,2,opt,name=info,proto3" json:"info,omitempty"` } @@ -300,7 +271,7 @@ func (m *DeRegisterAVSResponse) Reset() { *m = DeRegisterAVSResponse{} } func (m *DeRegisterAVSResponse) String() string { return proto.CompactTextString(m) } func (*DeRegisterAVSResponse) ProtoMessage() {} func (*DeRegisterAVSResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{5} + return fileDescriptor_c92b5dfe90086a66, []int{4} } func (m *DeRegisterAVSResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -343,152 +314,46 @@ func (m *DeRegisterAVSResponse) GetInfo() *AVSInfo { return nil } -// MsgUpdateParams is the Msg/UpdateParams request type for Erc20 parameters. -type MsgUpdateParams struct { - // authority is the address of the governance account. - Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` - // params defines the x/evm parameters to update. - // NOTE: All parameters must be supplied. - Params *Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params,omitempty"` -} - -func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } -func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParams) ProtoMessage() {} -func (*MsgUpdateParams) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{6} -} -func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParams.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 *MsgUpdateParams) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParams.Merge(m, src) -} -func (m *MsgUpdateParams) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParams) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo - -func (m *MsgUpdateParams) GetAuthority() string { - if m != nil { - return m.Authority - } - return "" -} - -func (m *MsgUpdateParams) GetParams() *Params { - if m != nil { - return m.Params - } - return nil -} - -// MsgUpdateParamsResponse defines the response structure for executing a -// MsgUpdateParams message. -type MsgUpdateParamsResponse struct { -} - -func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } -func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateParamsResponse) ProtoMessage() {} -func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c92b5dfe90086a66, []int{7} -} -func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateParamsResponse.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 *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) -} -func (m *MsgUpdateParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo - func init() { proto.RegisterType((*AVSInfo)(nil), "exocore.avs.AVSInfo") - proto.RegisterType((*AVSManager)(nil), "exocore.avs.AVSManager") - proto.RegisterMapType((map[string]string)(nil), "exocore.avs.AVSManager.AVSOperatorRelationEntry") proto.RegisterType((*RegisterAVSReq)(nil), "exocore.avs.RegisterAVSReq") proto.RegisterType((*RegisterAVSResponse)(nil), "exocore.avs.RegisterAVSResponse") proto.RegisterType((*DeRegisterAVSReq)(nil), "exocore.avs.DeRegisterAVSReq") proto.RegisterType((*DeRegisterAVSResponse)(nil), "exocore.avs.DeRegisterAVSResponse") - proto.RegisterType((*MsgUpdateParams)(nil), "exocore.avs.MsgUpdateParams") - proto.RegisterType((*MsgUpdateParamsResponse)(nil), "exocore.avs.MsgUpdateParamsResponse") } func init() { proto.RegisterFile("exocore/avs/tx.proto", fileDescriptor_c92b5dfe90086a66) } var fileDescriptor_c92b5dfe90086a66 = []byte{ - // 564 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x41, 0x6b, 0x13, 0x41, - 0x14, 0xce, 0x34, 0x6d, 0x25, 0x2f, 0xd8, 0xc6, 0x49, 0xa4, 0xdb, 0x15, 0x97, 0xb0, 0xa7, 0x50, - 0xe9, 0xae, 0x46, 0x10, 0xc9, 0x2d, 0xc5, 0x56, 0x04, 0xa3, 0xb2, 0xc1, 0x1c, 0xbc, 0xc8, 0x24, - 0x99, 0x6e, 0x97, 0x66, 0x77, 0xd6, 0x99, 0x49, 0x4c, 0x6e, 0xe2, 0x41, 0x44, 0x10, 0xfd, 0x25, - 0xd2, 0x83, 0x07, 0x7f, 0x82, 0xc7, 0xe2, 0xc9, 0xa3, 0x24, 0x87, 0xfe, 0x0d, 0xc9, 0xee, 0x2c, - 0xd9, 0x0d, 0xad, 0x1e, 0xdb, 0x4b, 0x32, 0x33, 0xdf, 0xfb, 0xbe, 0xf9, 0xde, 0x7b, 0x3b, 0x0f, - 0x2a, 0x74, 0xcc, 0x7a, 0x8c, 0x53, 0x9b, 0x8c, 0x84, 0x2d, 0xc7, 0x56, 0xc8, 0x99, 0x64, 0xb8, - 0xa8, 0x4e, 0x2d, 0x32, 0x12, 0xfa, 0x0d, 0xe2, 0x7b, 0x01, 0xb3, 0xa3, 0xdf, 0x18, 0xd7, 0xb7, - 0x7a, 0x4c, 0xf8, 0x4c, 0xd8, 0xbe, 0x70, 0xed, 0xd1, 0xbd, 0xf9, 0x9f, 0x02, 0xb6, 0x63, 0xe0, - 0x75, 0xb4, 0xb3, 0xe3, 0x8d, 0x82, 0x8c, 0xe4, 0xa6, 0x3e, 0x1d, 0x50, 0x97, 0x48, 0x8f, 0x05, - 0x73, 0x6e, 0x72, 0xa7, 0xae, 0xa5, 0x9d, 0x84, 0x84, 0x13, 0x5f, 0x31, 0x4d, 0x17, 0xae, 0x35, - 0x3b, 0xed, 0x27, 0xc1, 0x21, 0xc3, 0x18, 0x56, 0x03, 0xe2, 0x53, 0x0d, 0x55, 0x51, 0xad, 0xe0, - 0x44, 0x6b, 0x6c, 0x00, 0x34, 0x3b, 0xed, 0x66, 0xbf, 0xcf, 0xa9, 0x10, 0xda, 0x4a, 0x84, 0xa4, - 0x4e, 0x70, 0x0d, 0x36, 0x59, 0x48, 0x39, 0x91, 0x8c, 0x27, 0x41, 0xf9, 0x6a, 0xbe, 0x56, 0x70, - 0x96, 0x8f, 0xcd, 0x1f, 0x28, 0x92, 0x6a, 0x91, 0x80, 0xb8, 0x94, 0xe3, 0x2e, 0x94, 0x9b, 0x9d, - 0xf6, 0x73, 0x15, 0xe4, 0xd0, 0x41, 0x64, 0x5a, 0x43, 0xd5, 0x7c, 0xad, 0x58, 0xbf, 0x6b, 0xa5, - 0x6a, 0x64, 0x2d, 0x58, 0xd6, 0x39, 0x94, 0xfd, 0x40, 0xf2, 0x89, 0x73, 0x9e, 0x98, 0x7e, 0x00, - 0xda, 0x45, 0x04, 0x5c, 0x82, 0xfc, 0x31, 0x9d, 0xa8, 0x5c, 0xe7, 0x4b, 0x5c, 0x81, 0xb5, 0x11, - 0x19, 0x0c, 0xa9, 0xca, 0x32, 0xde, 0x34, 0x56, 0x1e, 0x22, 0xf3, 0x23, 0x82, 0x0d, 0x87, 0xba, - 0x9e, 0x90, 0x94, 0x37, 0x3b, 0x6d, 0x87, 0xbe, 0xc1, 0x0d, 0x28, 0x1e, 0x70, 0xe6, 0x27, 0x39, - 0x47, 0x32, 0x7b, 0xda, 0xaf, 0xef, 0xbb, 0x15, 0xd5, 0x17, 0x85, 0xb4, 0x25, 0xf7, 0x02, 0xd7, - 0x49, 0x07, 0xe3, 0x1a, 0xac, 0x7a, 0xc1, 0x21, 0x8b, 0xee, 0x29, 0xd6, 0x2b, 0xcb, 0xb9, 0xce, - 0x7b, 0xe1, 0x44, 0x11, 0x8d, 0xd2, 0xfb, 0xb3, 0x93, 0x9d, 0x34, 0xd7, 0xfc, 0x8c, 0xa0, 0x9c, - 0xb1, 0x22, 0x42, 0x16, 0x08, 0x7a, 0x69, 0x7e, 0x3e, 0x21, 0x28, 0x3d, 0xa2, 0x57, 0xa4, 0x38, - 0x5f, 0x10, 0xdc, 0x5c, 0x32, 0x73, 0xc9, 0xe5, 0xf9, 0x80, 0x60, 0xb3, 0x25, 0xdc, 0x97, 0x61, - 0x9f, 0x48, 0xfa, 0x22, 0x7a, 0x77, 0xf8, 0x01, 0x14, 0xc8, 0x50, 0x1e, 0x31, 0xee, 0xc9, 0xc9, - 0x7f, 0x9d, 0x2c, 0x42, 0xf1, 0x1d, 0x58, 0x8f, 0x5f, 0xae, 0x72, 0x52, 0xce, 0x38, 0x89, 0xc5, - 0x1d, 0x15, 0xd2, 0xd8, 0x98, 0x5b, 0x59, 0x90, 0xcd, 0x6d, 0xd8, 0x5a, 0xf2, 0x91, 0xd4, 0xa6, - 0xfe, 0x0d, 0x41, 0xbe, 0x25, 0x5c, 0xfc, 0x14, 0x8a, 0xa9, 0xd2, 0xe1, 0x5b, 0x19, 0xf9, 0x6c, - 0x87, 0xf5, 0xea, 0xc5, 0xa0, 0xaa, 0xb8, 0x03, 0xd7, 0x33, 0xad, 0xc0, 0xb7, 0x33, 0x94, 0xe5, - 0x6f, 0x46, 0x37, 0xff, 0x05, 0xc7, 0x9a, 0xfa, 0xda, 0xbb, 0xb3, 0x93, 0x1d, 0xb4, 0xf7, 0xf8, - 0xe7, 0xd4, 0x40, 0xa7, 0x53, 0x03, 0xfd, 0x99, 0x1a, 0xe8, 0xeb, 0xcc, 0xc8, 0x9d, 0xce, 0x8c, - 0xdc, 0xef, 0x99, 0x91, 0x7b, 0xb5, 0xeb, 0x7a, 0xf2, 0x68, 0xd8, 0xb5, 0x7a, 0xcc, 0xb7, 0xf7, - 0x63, 0xb9, 0x67, 0x54, 0xbe, 0x65, 0xfc, 0xd8, 0x4e, 0x06, 0xe0, 0x38, 0x1e, 0xc6, 0x93, 0x90, - 0x8a, 0xee, 0x7a, 0x34, 0x02, 0xef, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0x2e, 0xf9, 0x90, 0x0d, - 0xa8, 0x05, 0x00, 0x00, + // 448 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x54, 0x4d, 0x6f, 0xd3, 0x40, + 0x10, 0xcd, 0x92, 0x94, 0xd2, 0x31, 0xd0, 0xb0, 0x04, 0x91, 0x1a, 0x61, 0x22, 0x9f, 0x42, 0xa4, + 0xda, 0xa2, 0xdc, 0xe0, 0x94, 0x8a, 0x0f, 0x55, 0xe2, 0x43, 0x72, 0xa4, 0x1e, 0xb8, 0x44, 0xdb, + 0x78, 0x63, 0x2c, 0x64, 0xaf, 0xd9, 0x59, 0xdc, 0x70, 0x43, 0xdc, 0x10, 0x12, 0xea, 0x2f, 0x41, + 0x39, 0xf0, 0x23, 0x38, 0x56, 0x9c, 0x38, 0xa2, 0xe4, 0xd0, 0xbf, 0x81, 0xbc, 0x6b, 0xb7, 0x75, + 0x25, 0xb8, 0xb6, 0x27, 0x7b, 0xe6, 0xbd, 0x7d, 0x9e, 0xf7, 0xac, 0x1d, 0xe8, 0xf0, 0x99, 0x98, + 0x08, 0xc9, 0x7d, 0x96, 0xa3, 0xaf, 0x66, 0x5e, 0x26, 0x85, 0x12, 0xd4, 0x2a, 0xbb, 0x1e, 0xcb, + 0xd1, 0xbe, 0x3d, 0x11, 0x98, 0x08, 0xf4, 0x13, 0x8c, 0xfc, 0xfc, 0x41, 0xf1, 0x30, 0x2c, 0x7b, + 0xc3, 0x00, 0x63, 0x5d, 0xf9, 0xa6, 0x30, 0x90, 0x3b, 0x27, 0xb0, 0x3a, 0xdc, 0x1d, 0xed, 0xa4, + 0x53, 0x41, 0x29, 0xb4, 0x52, 0x96, 0xf0, 0x2e, 0xe9, 0x91, 0xfe, 0x5a, 0xa0, 0xdf, 0xe9, 0x3d, + 0xb0, 0x58, 0x8e, 0x63, 0x16, 0x86, 0x92, 0x23, 0x76, 0x2f, 0x69, 0x08, 0x58, 0x8e, 0x43, 0xd3, + 0xa1, 0xf7, 0xa1, 0x2d, 0x32, 0x2e, 0x99, 0x12, 0xf2, 0x98, 0xd5, 0xec, 0x35, 0xfb, 0x6b, 0xc1, + 0x7a, 0xd5, 0xaf, 0xa8, 0x03, 0xb8, 0x51, 0x68, 0x89, 0xfd, 0x94, 0x9f, 0x70, 0x5b, 0x5a, 0x71, + 0x9d, 0xe5, 0xf8, 0xba, 0xe8, 0x57, 0xdc, 0x0d, 0xb8, 0xc2, 0x10, 0xb9, 0x1a, 0xc7, 0x61, 0x77, + 0x45, 0xcb, 0xad, 0xea, 0x7a, 0x27, 0x74, 0xbf, 0x10, 0xb8, 0x1e, 0xf0, 0x28, 0x46, 0xc5, 0xe5, + 0x70, 0x77, 0x14, 0xf0, 0xf7, 0xf4, 0x31, 0x5c, 0x9d, 0x4a, 0x91, 0x1c, 0x8b, 0x6a, 0x07, 0xdb, + 0xdd, 0x5f, 0x3f, 0x36, 0x3b, 0xa5, 0xdb, 0x52, 0x77, 0xa4, 0x64, 0x9c, 0x46, 0x81, 0x55, 0xb0, + 0xab, 0x4f, 0xf5, 0xa1, 0x15, 0xa7, 0x53, 0xa1, 0xbd, 0x59, 0x5b, 0x1d, 0xef, 0x54, 0xa4, 0x5e, + 0x19, 0x4d, 0xa0, 0x19, 0x8f, 0xda, 0x9f, 0x8f, 0xe6, 0x03, 0xeb, 0xd9, 0xc9, 0x59, 0xf7, 0x1b, + 0x81, 0x9b, 0xb5, 0x59, 0x30, 0x13, 0x29, 0xf2, 0xf3, 0x1b, 0xe8, 0x2b, 0x81, 0xf6, 0x13, 0x7e, + 0x51, 0xe2, 0x39, 0x20, 0x70, 0xeb, 0xcc, 0x34, 0xe7, 0x1c, 0xd0, 0xd6, 0x77, 0x02, 0xcd, 0x97, + 0x18, 0xd1, 0x17, 0x60, 0x9d, 0x9a, 0x8b, 0xde, 0xa9, 0x89, 0xd4, 0xf3, 0xb3, 0x7b, 0xff, 0x06, + 0x4b, 0x3b, 0x01, 0x5c, 0xab, 0xf9, 0xa4, 0x77, 0x6b, 0x47, 0xce, 0xfe, 0x11, 0xdb, 0xfd, 0x1f, + 0x6c, 0x34, 0xed, 0x95, 0x4f, 0x47, 0xf3, 0x01, 0xd9, 0x7e, 0xfe, 0x73, 0xe1, 0x90, 0xc3, 0x85, + 0x43, 0xfe, 0x2c, 0x1c, 0x72, 0xb0, 0x74, 0x1a, 0x87, 0x4b, 0xa7, 0xf1, 0x7b, 0xe9, 0x34, 0xde, + 0x6c, 0x46, 0xb1, 0x7a, 0xfb, 0x61, 0xcf, 0x9b, 0x88, 0xc4, 0x7f, 0x6a, 0xe4, 0x5e, 0x71, 0xb5, + 0x2f, 0xe4, 0x3b, 0xbf, 0x5a, 0x16, 0x33, 0xb3, 0x2e, 0x3e, 0x66, 0x1c, 0xf7, 0x2e, 0xeb, 0x1b, + 0xff, 0xf0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3a, 0x5f, 0x36, 0xdd, 0x4a, 0x04, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -631,6 +496,22 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.AssetId) > 0 { + for iNdEx := len(m.AssetId) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.AssetId[iNdEx]) + copy(dAtA[i:], m.AssetId[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.AssetId[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.AvsOwnerAddress) > 0 { + i -= len(m.AvsOwnerAddress) + copy(dAtA[i:], m.AvsOwnerAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.AvsOwnerAddress))) + i-- + dAtA[i] = 0x22 + } if len(m.OperatorAddress) > 0 { for iNdEx := len(m.OperatorAddress) - 1; iNdEx >= 0; iNdEx-- { i -= len(m.OperatorAddress[iNdEx]) @@ -640,10 +521,10 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if len(m.AVSAddress) > 0 { - i -= len(m.AVSAddress) - copy(dAtA[i:], m.AVSAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.AVSAddress))) + if len(m.AvsAddress) > 0 { + i -= len(m.AvsAddress) + copy(dAtA[i:], m.AvsAddress) + i = encodeVarintTx(dAtA, i, uint64(len(m.AvsAddress))) i-- dAtA[i] = 0x12 } @@ -657,48 +538,6 @@ func (m *AVSInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *AVSManager) 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 *AVSManager) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *AVSManager) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.AVSOperatorRelation) > 0 { - for k := range m.AVSOperatorRelation { - v := m.AVSOperatorRelation[k] - baseI := i - i -= len(v) - copy(dAtA[i:], v) - i = encodeVarintTx(dAtA, i, uint64(len(v))) - i-- - dAtA[i] = 0x12 - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTx(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTx(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - func (m *RegisterAVSReq) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -867,71 +706,6 @@ func (m *DeRegisterAVSResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateParams) 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 *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Params != nil { - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Authority) > 0 { - i -= len(m.Authority) - copy(dAtA[i:], m.Authority) - i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateParamsResponse) 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 *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateParamsResponse) 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 @@ -953,7 +727,7 @@ func (m *AVSInfo) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.AVSAddress) + l = len(m.AvsAddress) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -963,21 +737,14 @@ func (m *AVSInfo) Size() (n int) { n += 1 + l + sovTx(uint64(l)) } } - return n -} - -func (m *AVSManager) Size() (n int) { - if m == nil { - return 0 + l = len(m.AvsOwnerAddress) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) } - var l int - _ = l - if len(m.AVSOperatorRelation) > 0 { - for k, v := range m.AVSOperatorRelation { - _ = k - _ = v - mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + 1 + len(v) + sovTx(uint64(len(v))) - n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) + if len(m.AssetId) > 0 { + for _, s := range m.AssetId { + l = len(s) + n += 1 + l + sovTx(uint64(l)) } } return n @@ -1051,32 +818,6 @@ func (m *DeRegisterAVSResponse) Size() (n int) { return n } -func (m *MsgUpdateParams) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Authority) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Params != nil { - l = m.Params.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpdateParamsResponse) 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 } @@ -1146,7 +887,7 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AvsAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1174,7 +915,7 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.AVSAddress = string(dAtA[iNdEx:postIndex]) + m.AvsAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 3: if wireType != 2 { @@ -1208,236 +949,9 @@ func (m *AVSInfo) Unmarshal(dAtA []byte) error { } m.OperatorAddress = append(m.OperatorAddress, 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 *AVSManager) 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: AVSManager: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: AVSManager: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSOperatorRelation", 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.AVSOperatorRelation == nil { - m.AVSOperatorRelation = make(map[string]string) - } - var mapkey string - var mapvalue string - for iNdEx < postIndex { - entryPreIndex := 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) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthTx - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTx - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var stringLenmapvalue uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapvalue |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapvalue := int(stringLenmapvalue) - if intStringLenmapvalue < 0 { - return ErrInvalidLengthTx - } - postStringIndexmapvalue := iNdEx + intStringLenmapvalue - if postStringIndexmapvalue < 0 { - return ErrInvalidLengthTx - } - if postStringIndexmapvalue > l { - return io.ErrUnexpectedEOF - } - mapvalue = string(dAtA[iNdEx:postStringIndexmapvalue]) - iNdEx = postStringIndexmapvalue - } else { - iNdEx = entryPreIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.AVSOperatorRelation[mapkey] = mapvalue - 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 *RegisterAVSReq) 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: RegisterAVSReq: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RegisterAVSReq: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: + case 4: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AvsOwnerAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1465,13 +979,13 @@ func (m *RegisterAVSReq) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.FromAddress = string(dAtA[iNdEx:postIndex]) + m.AvsOwnerAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 2: + case 5: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field AssetId", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -1481,27 +995,23 @@ func (m *RegisterAVSReq) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - if m.Info == nil { - m.Info = &AVSInfo{} - } - if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.AssetId = append(m.AssetId, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -1524,7 +1034,7 @@ func (m *RegisterAVSReq) Unmarshal(dAtA []byte) error { } return nil } -func (m *RegisterAVSResponse) Unmarshal(dAtA []byte) error { +func (m *RegisterAVSReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1547,10 +1057,10 @@ func (m *RegisterAVSResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: RegisterAVSResponse: wiretype end group for non-group") + return fmt.Errorf("proto: RegisterAVSReq: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: RegisterAVSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RegisterAVSReq: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1642,7 +1152,7 @@ func (m *RegisterAVSResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeRegisterAVSReq) Unmarshal(dAtA []byte) error { +func (m *RegisterAVSResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1665,10 +1175,10 @@ func (m *DeRegisterAVSReq) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeRegisterAVSReq: wiretype end group for non-group") + return fmt.Errorf("proto: RegisterAVSResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeRegisterAVSReq: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: RegisterAVSResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1760,7 +1270,7 @@ func (m *DeRegisterAVSReq) Unmarshal(dAtA []byte) error { } return nil } -func (m *DeRegisterAVSResponse) Unmarshal(dAtA []byte) error { +func (m *DeRegisterAVSReq) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1783,10 +1293,10 @@ func (m *DeRegisterAVSResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: DeRegisterAVSResponse: wiretype end group for non-group") + return fmt.Errorf("proto: DeRegisterAVSReq: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: DeRegisterAVSResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeRegisterAVSReq: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -1878,7 +1388,7 @@ func (m *DeRegisterAVSResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { +func (m *DeRegisterAVSResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1901,15 +1411,15 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") + return fmt.Errorf("proto: DeRegisterAVSResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: DeRegisterAVSResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field FromAddress", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1937,11 +1447,11 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Authority = string(dAtA[iNdEx:postIndex]) + m.FromAddress = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Info", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1968,10 +1478,10 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.Params == nil { - m.Params = &Params{} + if m.Info == nil { + m.Info = &AVSInfo{} } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.Info.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1996,56 +1506,6 @@ func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateParamsResponse) 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: MsgUpdateParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateParamsResponse: 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 diff --git a/x/deposit/keeper/cross_chain_tx_process.go b/x/deposit/keeper/cross_chain_tx_process.go index 6d3422f73..831dd88e6 100644 --- a/x/deposit/keeper/cross_chain_tx_process.go +++ b/x/deposit/keeper/cross_chain_tx_process.go @@ -6,7 +6,7 @@ import ( errorsmod "cosmossdk.io/errors" sdkmath "cosmossdk.io/math" "github.com/ExocoreNetwork/exocore/x/assets/types" - despoittypes "github.com/ExocoreNetwork/exocore/x/deposit/types" + deposittypes "github.com/ExocoreNetwork/exocore/x/deposit/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -126,12 +126,12 @@ func (k Keeper) PostTxProcessing(ctx sdk.Context, msg core.Message, receipt *eth func (k Keeper) Deposit(ctx sdk.Context, params *DepositParams) error { // check params parameter before executing deposit operation if params.OpAmount.IsNegative() { - return errorsmod.Wrap(despoittypes.ErrDepositAmountIsNegative, fmt.Sprintf("the amount is:%s", params.OpAmount)) + return errorsmod.Wrap(deposittypes.ErrDepositAmountIsNegative, fmt.Sprintf("the amount is:%s", params.OpAmount)) } stakeID, assetID := types.GetStakeIDAndAssetID(params.ClientChainLzID, params.StakerAddress, params.AssetsAddress) // check if asset exist if !k.assetsKeeper.IsStakingAsset(ctx, assetID) { - return errorsmod.Wrap(despoittypes.ErrDepositAssetNotExist, fmt.Sprintf("the assetID is:%s", assetID)) + return errorsmod.Wrap(deposittypes.ErrDepositAssetNotExist, fmt.Sprintf("the assetID is:%s", assetID)) } changeAmount := types.StakerSingleAssetChangeInfo{ TotalDepositAmount: params.OpAmount, diff --git a/x/taskmanageravs/client/cli/query.go b/x/taskmanageravs/client/cli/query.go deleted file mode 100644 index 1601ccb26..000000000 --- a/x/taskmanageravs/client/cli/query.go +++ /dev/null @@ -1,32 +0,0 @@ -package cli - -import ( - "fmt" - // "strings" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - // "github.com/cosmos/cosmos-sdk/client/flags" - // sdk "github.com/cosmos/cosmos-sdk/types" - - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -// GetQueryCmd returns the cli query commands for this module -func GetQueryCmd(queryRoute string) *cobra.Command { - // Group taskmanageravs queries under a subcommand - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("Querying commands for the %s module", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - cmd.AddCommand(CmdQueryParams()) - // this line is used by starport scaffolding # 1 - - return cmd -} - diff --git a/x/taskmanageravs/client/cli/query_params.go b/x/taskmanageravs/client/cli/query_params.go deleted file mode 100644 index eb0f5b7b3..000000000 --- a/x/taskmanageravs/client/cli/query_params.go +++ /dev/null @@ -1,36 +0,0 @@ -package cli - -import ( - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" - - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -func CmdQueryParams() *cobra.Command { - cmd := &cobra.Command{ - Use: "params", - Short: "shows the parameters of the module", - Args: cobra.NoArgs, - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientQueryContext(cmd) - if err != nil { - return err - } - - queryClient := types.NewQueryClient(clientCtx) - - res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddQueryFlagsToCmd(cmd) - - return cmd -} diff --git a/x/taskmanageravs/client/cli/tx.go b/x/taskmanageravs/client/cli/tx.go deleted file mode 100644 index c804745e9..000000000 --- a/x/taskmanageravs/client/cli/tx.go +++ /dev/null @@ -1,76 +0,0 @@ -package cli - -import ( - "fmt" - "strconv" - "time" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - - // "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - taskTypes "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - "github.com/cosmos/cosmos-sdk/client/tx" -) - -var ( - DefaultRelativePacketTimeoutTimestamp = uint64((time.Duration(10) * time.Minute).Nanoseconds()) -) - -const ( - flagPacketTimeoutTimestamp = "packet-timeout-timestamp" - listSeparator = "," -) - -// GetTxCmd returns the transaction commands for this module -func GetTxCmd() *cobra.Command { - cmd := &cobra.Command{ - Use: types.ModuleName, - Short: fmt.Sprintf("%s transactions subcommands", types.ModuleName), - DisableFlagParsing: true, - SuggestionsMinimumDistance: 2, - RunE: client.ValidateCmd, - } - - // this line is used by starport scaffolding # 1 - cmd.AddCommand( - CreateTask(), - ) - return cmd -} - -func CreateTask() *cobra.Command { - cmd := &cobra.Command{ - Use: "Set task params to taskManager module", - Short: "Set task params to taskManager module", - Args: cobra.ExactArgs(2), - RunE: func(cmd *cobra.Command, args []string) error { - cliCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - taskId, err := strconv.Atoi(args[2]) - if err != nil { - return err - } - - quorumThresholdPercentage, err := strconv.ParseUint(args[3], 10, 32) - if err != nil { - return err - } - task := &taskTypes.TaskInfo{ - Name: args[0], - MetaInfo: args[1], - TaskId: uint64(taskId), - ThresholdPercentage: quorumThresholdPercentage, - } - return tx.GenerateOrBroadcastTxCLI(cliCtx, cmd.Flags(), task) - }, - } - - flags.AddTxFlagsToCmd(cmd) - return cmd -} diff --git a/x/taskmanageravs/genesis.go b/x/taskmanageravs/genesis.go deleted file mode 100644 index 3c3a1e300..000000000 --- a/x/taskmanageravs/genesis.go +++ /dev/null @@ -1,23 +0,0 @@ -package taskmanageravs - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/keeper" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -// InitGenesis initializes the module's state from a provided genesis state. -func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) { - // this line is used by starport scaffolding # genesis/module/init - k.SetParams(ctx, genState.Params) -} - -// ExportGenesis returns the module's exported genesis -func ExportGenesis(ctx sdk.Context, k keeper.Keeper) *types.GenesisState { - genesis := types.DefaultGenesis() - genesis.Params = k.GetParams(ctx) - - // this line is used by starport scaffolding # genesis/module/export - - return genesis -} diff --git a/x/taskmanageravs/genesis_test.go b/x/taskmanageravs/genesis_test.go deleted file mode 100644 index 2ce12492c..000000000 --- a/x/taskmanageravs/genesis_test.go +++ /dev/null @@ -1,31 +0,0 @@ -package taskmanageravs_test - -import ( - "testing" - - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/testutil/nullify" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - "github.com/stretchr/testify/require" -) - -func TestGenesis(t *testing.T) { - genesisState := types.GenesisState{ - Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state - } - - k, ctx := keepertest.TaskmanageravsKeeper(t) - taskmanageravs.InitGenesis(ctx, *k, genesisState) - got := taskmanageravs.ExportGenesis(ctx, *k) - require.NotNil(t, got) - - nullify.Fill(&genesisState) - nullify.Fill(got) - - - - // this line is used by starport scaffolding # genesis/test/assert -} diff --git a/x/taskmanageravs/keeper/keeper.go b/x/taskmanageravs/keeper/keeper.go deleted file mode 100644 index 0f2cb8f44..000000000 --- a/x/taskmanageravs/keeper/keeper.go +++ /dev/null @@ -1,54 +0,0 @@ -package keeper - -import ( - "fmt" - - "github.com/cometbft/cometbft/libs/log" - storetypes "github.com/cosmos/cosmos-sdk/store/types" - "github.com/cosmos/cosmos-sdk/codec" - sdk "github.com/cosmos/cosmos-sdk/types" - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - - - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -type ( - Keeper struct { - cdc codec.BinaryCodec - storeKey storetypes.StoreKey - memKey storetypes.StoreKey - paramstore paramtypes.Subspace - - - } -) - -func NewKeeper( - cdc codec.BinaryCodec, - storeKey, - memKey storetypes.StoreKey, - ps paramtypes.Subspace, - - -) *Keeper { - // set KeyTable if it has not already been set - if !ps.HasKeyTable() { - ps = ps.WithKeyTable(types.ParamKeyTable()) - } - - return &Keeper{ - cdc: cdc, - storeKey: storeKey, - memKey: memKey, - paramstore: ps, - - - } -} - - - -func (k Keeper) Logger(ctx sdk.Context) log.Logger { - return ctx.Logger().With("module", fmt.Sprintf("x/%s", types.ModuleName)) -} diff --git a/x/taskmanageravs/keeper/msg_server.go b/x/taskmanageravs/keeper/msg_server.go deleted file mode 100644 index 4775301f3..000000000 --- a/x/taskmanageravs/keeper/msg_server.go +++ /dev/null @@ -1,17 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -type msgServer struct { - Keeper -} - -// NewMsgServerImpl returns an implementation of the MsgServer interface -// for the provided Keeper. -func NewMsgServerImpl(keeper Keeper) types.MsgServer { - return &msgServer{Keeper: keeper} -} - -var _ types.MsgServer = msgServer{} diff --git a/x/taskmanageravs/keeper/msg_server_test.go b/x/taskmanageravs/keeper/msg_server_test.go deleted file mode 100644 index 80c9785ad..000000000 --- a/x/taskmanageravs/keeper/msg_server_test.go +++ /dev/null @@ -1,23 +0,0 @@ -package keeper_test - -import ( - "context" - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/keeper" - keepertest "github.com/ExocoreNetwork/exocore/testutil/keeper" -) - -func setupMsgServer(t testing.TB) (types.MsgServer, context.Context) { - k, ctx := keepertest.TaskmanageravsKeeper(t) - return keeper.NewMsgServerImpl(*k), sdk.WrapSDKContext(ctx) -} - -func TestMsgServer(t *testing.T) { - ms, ctx := setupMsgServer(t) - require.NotNil(t, ms) - require.NotNil(t, ctx) -} diff --git a/x/taskmanageravs/keeper/params.go b/x/taskmanageravs/keeper/params.go deleted file mode 100644 index e12fffdf7..000000000 --- a/x/taskmanageravs/keeper/params.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// GetParams get all parameters as types.Params -func (k Keeper) GetParams(ctx sdk.Context) types.Params { - return types.NewParams( - ) -} - -// SetParams set the params -func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { - k.paramstore.SetParamSet(ctx, ¶ms) -} - diff --git a/x/taskmanageravs/keeper/params_test.go b/x/taskmanageravs/keeper/params_test.go deleted file mode 100644 index cb18f1f04..000000000 --- a/x/taskmanageravs/keeper/params_test.go +++ /dev/null @@ -1,18 +0,0 @@ -package keeper_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - testkeeper "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -func TestGetParams(t *testing.T) { - k, ctx := testkeeper.TaskmanageravsKeeper(t) - params := types.DefaultParams() - - k.SetParams(ctx, params) - - require.EqualValues(t, params, k.GetParams(ctx)) -} diff --git a/x/taskmanageravs/keeper/query.go b/x/taskmanageravs/keeper/query.go deleted file mode 100644 index 202ea9ba7..000000000 --- a/x/taskmanageravs/keeper/query.go +++ /dev/null @@ -1,7 +0,0 @@ -package keeper - -import ( - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -var _ types.QueryServer = Keeper{} diff --git a/x/taskmanageravs/keeper/query_params.go b/x/taskmanageravs/keeper/query_params.go deleted file mode 100644 index 9364d17f3..000000000 --- a/x/taskmanageravs/keeper/query_params.go +++ /dev/null @@ -1,19 +0,0 @@ -package keeper - -import ( - "context" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" -) - -func (k Keeper) Params(goCtx context.Context, req *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { - if req == nil { - return nil, status.Error(codes.InvalidArgument, "invalid request") - } - ctx := sdk.UnwrapSDKContext(goCtx) - - return &types.QueryParamsResponse{Params: k.GetParams(ctx)}, nil -} diff --git a/x/taskmanageravs/keeper/query_params_test.go b/x/taskmanageravs/keeper/query_params_test.go deleted file mode 100644 index dc68ce243..000000000 --- a/x/taskmanageravs/keeper/query_params_test.go +++ /dev/null @@ -1,21 +0,0 @@ -package keeper_test - -import ( - "testing" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" - testkeeper "github.com/ExocoreNetwork/exocore/testutil/keeper" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -func TestParamsQuery(t *testing.T) { - keeper, ctx := testkeeper.TaskmanageravsKeeper(t) - wctx := sdk.WrapSDKContext(ctx) - params := types.DefaultParams() - keeper.SetParams(ctx, params) - - response, err := keeper.Params(wctx, &types.QueryParamsRequest{}) - require.NoError(t, err) - require.Equal(t, &types.QueryParamsResponse{Params: params}, response) -} diff --git a/x/taskmanageravs/module.go b/x/taskmanageravs/module.go deleted file mode 100644 index 1356304c2..000000000 --- a/x/taskmanageravs/module.go +++ /dev/null @@ -1,150 +0,0 @@ -package taskmanageravs - -import ( - "context" - "encoding/json" - "fmt" - // this line is used by starport scaffolding # 1 - - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/spf13/cobra" - - abci "github.com/cometbft/cometbft/abci/types" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - cdctypes "github.com/cosmos/cosmos-sdk/codec/types" - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/module" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/keeper" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/client/cli" - -) - -var ( - _ module.AppModule = AppModule{} - _ module.AppModuleBasic = AppModuleBasic{} - -) - -// ---------------------------------------------------------------------------- -// AppModuleBasic -// ---------------------------------------------------------------------------- - -// AppModuleBasic implements the AppModuleBasic interface that defines the independent methods a Cosmos SDK module needs to implement. -type AppModuleBasic struct { - cdc codec.BinaryCodec -} - -func NewAppModuleBasic(cdc codec.BinaryCodec) AppModuleBasic { - return AppModuleBasic{cdc: cdc} -} - -// Name returns the name of the module as a string -func (AppModuleBasic) Name() string { - return types.ModuleName -} - -// RegisterLegacyAminoCodec registers the amino codec for the module, which is used to marshal and unmarshal structs to/from []byte in order to persist them in the module's KVStore -func (AppModuleBasic) RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { - types.RegisterCodec(cdc) -} - -// RegisterInterfaces registers a module's interface types and their concrete implementations as proto.Message -func (a AppModuleBasic) RegisterInterfaces(reg cdctypes.InterfaceRegistry) { - types.RegisterInterfaces(reg) -} - -// DefaultGenesis returns a default GenesisState for the module, marshalled to json.RawMessage. The default GenesisState need to be defined by the module developer and is primarily used for testing -func (AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { - return cdc.MustMarshalJSON(types.DefaultGenesis()) -} - -// ValidateGenesis used to validate the GenesisState, given in its json.RawMessage form -func (AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, bz json.RawMessage) error { - var genState types.GenesisState - if err := cdc.UnmarshalJSON(bz, &genState); err != nil { - return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) - } - return genState.Validate() -} - -// RegisterGRPCGatewayRoutes registers the gRPC Gateway routes for the module -func (AppModuleBasic) RegisterGRPCGatewayRoutes(clientCtx client.Context, mux *runtime.ServeMux) { - types.RegisterQueryHandlerClient(context.Background(), mux, types.NewQueryClient(clientCtx)) -} - -// GetTxCmd returns the root Tx command for the module. The subcommands of this root command are used by end-users to generate new transactions containing messages defined in the module -func (a AppModuleBasic) GetTxCmd() *cobra.Command { - return cli.GetTxCmd() -} - -// GetQueryCmd returns the root query command for the module. The subcommands of this root command are used by end-users to generate new queries to the subset of the state defined by the module -func (AppModuleBasic) GetQueryCmd() *cobra.Command { - return cli.GetQueryCmd(types.StoreKey) -} - -// ---------------------------------------------------------------------------- -// AppModule -// ---------------------------------------------------------------------------- - -// AppModule implements the AppModule interface that defines the inter-dependent methods that modules need to implement -type AppModule struct { - AppModuleBasic - - keeper keeper.Keeper - accountKeeper types.AccountKeeper - bankKeeper types.BankKeeper -} - -func NewAppModule( - cdc codec.Codec, - keeper keeper.Keeper, - accountKeeper types.AccountKeeper, - bankKeeper types.BankKeeper, -) AppModule { - return AppModule{ - AppModuleBasic: NewAppModuleBasic(cdc), - keeper: keeper, - accountKeeper: accountKeeper, - bankKeeper: bankKeeper, - } -} - -// 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) -} - -// RegisterInvariants registers the invariants of the module. If an invariant deviates from its predicted value, the InvariantRegistry triggers appropriate logic (most often the chain will be halted) -func (am AppModule) RegisterInvariants(_ sdk.InvariantRegistry) {} - -// InitGenesis performs the module's genesis initialization. It returns no validator updates. -func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, gs json.RawMessage) []abci.ValidatorUpdate { - var genState types.GenesisState - // Initialize global index to index in genesis state - cdc.MustUnmarshalJSON(gs, &genState) - - InitGenesis(ctx, am.keeper, genState) - - return []abci.ValidatorUpdate{} -} - -// ExportGenesis returns the module's exported genesis state as raw JSON bytes. -func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { - genState := ExportGenesis(ctx, am.keeper) - return cdc.MustMarshalJSON(genState) -} - -// ConsensusVersion is a sequence number for state-breaking change of the module. It should be incremented on each consensus-breaking change introduced by the module. To avoid wrong/empty versions, the initial version should be set to 1 -func (AppModule) ConsensusVersion() uint64 { return 1 } - -// BeginBlock contains the logic that is automatically triggered at the beginning of each block -func (am AppModule) BeginBlock(_ sdk.Context, _ abci.RequestBeginBlock) {} - -// EndBlock contains the logic that is automatically triggered at the end of each block -func (am AppModule) EndBlock(_ sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { - return []abci.ValidatorUpdate{} -} diff --git a/x/taskmanageravs/simulation/helpers.go b/x/taskmanageravs/simulation/helpers.go deleted file mode 100644 index 92c437c0d..000000000 --- a/x/taskmanageravs/simulation/helpers.go +++ /dev/null @@ -1,15 +0,0 @@ -package simulation - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - simtypes "github.com/cosmos/cosmos-sdk/types/simulation" -) - -// FindAccount find a specific address from an account list -func FindAccount(accs []simtypes.Account, address string) (simtypes.Account, bool) { - creator, err := sdk.AccAddressFromBech32(address) - if err != nil { - panic(err) - } - return simtypes.FindAccount(accs, creator) -} diff --git a/x/taskmanageravs/types/codec.go b/x/taskmanageravs/types/codec.go deleted file mode 100644 index fb6871d22..000000000 --- a/x/taskmanageravs/types/codec.go +++ /dev/null @@ -1,23 +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 - "github.com/cosmos/cosmos-sdk/types/msgservice" -) - -func RegisterCodec(cdc *codec.LegacyAmino) { - // this line is used by starport scaffolding # 2 -} - -func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { - // this line is used by starport scaffolding # 3 - - msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) -} - -var ( - Amino = codec.NewLegacyAmino() - ModuleCdc = codec.NewProtoCodec(cdctypes.NewInterfaceRegistry()) -) diff --git a/x/taskmanageravs/types/errors.go b/x/taskmanageravs/types/errors.go deleted file mode 100644 index 34ca1412a..000000000 --- a/x/taskmanageravs/types/errors.go +++ /dev/null @@ -1,13 +0,0 @@ -package types - -// DONTCOVER - -import ( - sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" -) - -// x/taskmanageravs module sentinel errors -var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") - -) diff --git a/x/taskmanageravs/types/expected_keepers.go b/x/taskmanageravs/types/expected_keepers.go deleted file mode 100644 index 04bc4e967..000000000 --- a/x/taskmanageravs/types/expected_keepers.go +++ /dev/null @@ -1,20 +0,0 @@ -package types - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - - - -// AccountKeeper defines the expected account keeper used for simulations (noalias) -type AccountKeeper interface { - GetAccount(ctx sdk.Context, addr sdk.AccAddress) types.AccountI - // Methods imported from account should be defined here -} - -// BankKeeper defines the expected interface needed to retrieve account balances. -type BankKeeper interface { - SpendableCoins(ctx sdk.Context, addr sdk.AccAddress) sdk.Coins - // Methods imported from bank should be defined here -} diff --git a/x/taskmanageravs/types/genesis.go b/x/taskmanageravs/types/genesis.go deleted file mode 100644 index c41be0742..000000000 --- a/x/taskmanageravs/types/genesis.go +++ /dev/null @@ -1,24 +0,0 @@ -package types - -import ( -// this line is used by starport scaffolding # genesis/types/import -) - -// DefaultIndex is the default global index -const DefaultIndex uint64 = 1 - -// DefaultGenesis returns the default genesis state -func DefaultGenesis() *GenesisState { - return &GenesisState{ - // this line is used by starport scaffolding # genesis/types/default - Params: DefaultParams(), - } -} - -// Validate performs basic genesis state validation returning an error upon any -// failure. -func (gs GenesisState) Validate() error { - // this line is used by starport scaffolding # genesis/types/validate - - return gs.Params.Validate() -} diff --git a/x/taskmanageravs/types/genesis.pb.go b/x/taskmanageravs/types/genesis.pb.go deleted file mode 100644 index e85fb70cc..000000000 --- a/x/taskmanageravs/types/genesis.pb.go +++ /dev/null @@ -1,323 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/taskmanageravs/genesis.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// GenesisState defines the taskmanageravs module's genesis state. -type GenesisState struct { - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *GenesisState) Reset() { *m = GenesisState{} } -func (m *GenesisState) String() string { return proto.CompactTextString(m) } -func (*GenesisState) ProtoMessage() {} -func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_e135dd7e592266ea, []int{0} -} -func (m *GenesisState) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *GenesisState) XXX_Merge(src proto.Message) { - xxx_messageInfo_GenesisState.Merge(m, src) -} -func (m *GenesisState) XXX_Size() int { - return m.Size() -} -func (m *GenesisState) XXX_DiscardUnknown() { - xxx_messageInfo_GenesisState.DiscardUnknown(m) -} - -var xxx_messageInfo_GenesisState proto.InternalMessageInfo - -func (m *GenesisState) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*GenesisState)(nil), "exocore.taskmanageravs.GenesisState") -} - -func init() { - proto.RegisterFile("exocore/taskmanageravs/genesis.proto", fileDescriptor_e135dd7e592266ea) -} - -var fileDescriptor_e135dd7e592266ea = []byte{ - // 204 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x49, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0x2f, 0x49, 0x2c, 0xce, 0xce, 0x4d, 0xcc, 0x4b, 0x4c, 0x4f, 0x2d, 0x4a, - 0x2c, 0x2b, 0xd6, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, - 0x17, 0x12, 0x83, 0xaa, 0xd2, 0x43, 0x55, 0x25, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa2, - 0x0f, 0x62, 0x41, 0x54, 0x4b, 0x29, 0xe3, 0x30, 0xb3, 0x20, 0xb1, 0x28, 0x31, 0x17, 0x6a, 0xa4, - 0x92, 0x0f, 0x17, 0x8f, 0x3b, 0xc4, 0x8e, 0xe0, 0x92, 0xc4, 0x92, 0x54, 0x21, 0x1b, 0x2e, 0x36, - 0x88, 0xbc, 0x04, 0xa3, 0x02, 0xa3, 0x06, 0xb7, 0x91, 0x9c, 0x1e, 0x76, 0x3b, 0xf5, 0x02, 0xc0, - 0xaa, 0x9c, 0x58, 0x4e, 0xdc, 0x93, 0x67, 0x08, 0x82, 0xea, 0x71, 0x0a, 0x3a, 0xf1, 0x48, 0x8e, - 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, - 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0x8b, 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, - 0xfc, 0x5c, 0x7d, 0x57, 0x88, 0x89, 0x7e, 0xa9, 0x25, 0xe5, 0xf9, 0x45, 0xd9, 0xfa, 0x30, 0x67, - 0x56, 0xa0, 0x3b, 0xb4, 0xa4, 0xb2, 0x20, 0xb5, 0x38, 0x89, 0x0d, 0xec, 0x50, 0x63, 0x40, 0x00, - 0x00, 0x00, 0xff, 0xff, 0xe6, 0x36, 0x08, 0xc7, 0x23, 0x01, 0x00, 0x00, -} - -func (m *GenesisState) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintGenesis(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { - offset -= sovGenesis(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *GenesisState) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovGenesis(uint64(l)) - return n -} - -func sovGenesis(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozGenesis(x uint64) (n int) { - return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *GenesisState) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowGenesis - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthGenesis - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthGenesis - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipGenesis(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthGenesis - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipGenesis(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowGenesis - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthGenesis - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupGenesis - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthGenesis - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/taskmanageravs/types/genesis_test.go b/x/taskmanageravs/types/genesis_test.go deleted file mode 100644 index 44207e493..000000000 --- a/x/taskmanageravs/types/genesis_test.go +++ /dev/null @@ -1,41 +0,0 @@ -package types_test - -import ( - "testing" - - "github.com/stretchr/testify/require" - "github.com/ExocoreNetwork/exocore/x/taskmanageravs/types" -) - -func TestGenesisState_Validate(t *testing.T) { - tests := []struct { - desc string - genState *types.GenesisState - valid bool - } { - { - desc: "default is valid", - genState: types.DefaultGenesis(), - valid: true, - }, - { - desc: "valid genesis state", - genState: &types.GenesisState{ - - // this line is used by starport scaffolding # types/genesis/validField - }, - valid: true, - }, - // this line is used by starport scaffolding # types/genesis/testcase - } - for _, tc := range tests { - t.Run(tc.desc, func(t *testing.T) { - err := tc.genState.Validate() - if tc.valid { - require.NoError(t, err) - } else { - require.Error(t, err) - } - }) - } -} \ No newline at end of file diff --git a/x/taskmanageravs/types/keys.go b/x/taskmanageravs/types/keys.go deleted file mode 100644 index ec2a5ec06..000000000 --- a/x/taskmanageravs/types/keys.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -const ( - // ModuleName defines the module name - ModuleName = "taskmanageravs" - - // StoreKey defines the primary module store key - StoreKey = ModuleName - - // RouterKey defines the module's message routing key - RouterKey = ModuleName - - // MemStoreKey defines the in-memory store key - MemStoreKey = "mem_taskmanageravs" - - -) - - - -func KeyPrefix(p string) []byte { - return []byte(p) -} diff --git a/x/taskmanageravs/types/params.go b/x/taskmanageravs/types/params.go deleted file mode 100644 index 52a8a059f..000000000 --- a/x/taskmanageravs/types/params.go +++ /dev/null @@ -1,47 +0,0 @@ -package types - -import ( - - - paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" - "gopkg.in/yaml.v2" -) - -var _ paramtypes.ParamSet = (*Params)(nil) - - - -// ParamKeyTable the param key table for launch module -func ParamKeyTable() paramtypes.KeyTable { - return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) -} - -// NewParams creates a new Params instance -func NewParams( -) Params { - return Params{ - } -} - -// DefaultParams returns a default set of parameters -func DefaultParams() Params { - return NewParams( - ) -} - -// ParamSetPairs get the params.ParamSet -func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { - return paramtypes.ParamSetPairs{ - } -} - -// Validate validates the set of params -func (p Params) Validate() error { - return nil -} - -// String implements the Stringer interface. -func (p Params) String() string { - out, _ := yaml.Marshal(p) - return string(out) -} diff --git a/x/taskmanageravs/types/params.pb.go b/x/taskmanageravs/types/params.pb.go deleted file mode 100644 index 257c0c310..000000000 --- a/x/taskmanageravs/types/params.pb.go +++ /dev/null @@ -1,267 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/taskmanageravs/params.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/gogoproto/gogoproto" - proto "github.com/cosmos/gogoproto/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Params defines the parameters for the module. -type Params struct { -} - -func (m *Params) Reset() { *m = Params{} } -func (*Params) ProtoMessage() {} -func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_9851cd4b575e9d94, []int{0} -} -func (m *Params) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Params.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Params) XXX_Merge(src proto.Message) { - xxx_messageInfo_Params.Merge(m, src) -} -func (m *Params) XXX_Size() int { - return m.Size() -} -func (m *Params) XXX_DiscardUnknown() { - xxx_messageInfo_Params.DiscardUnknown(m) -} - -var xxx_messageInfo_Params proto.InternalMessageInfo - -func init() { - proto.RegisterType((*Params)(nil), "exocore.taskmanageravs.Params") -} - -func init() { - proto.RegisterFile("exocore/taskmanageravs/params.proto", fileDescriptor_9851cd4b575e9d94) -} - -var fileDescriptor_9851cd4b575e9d94 = []byte{ - // 162 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4e, 0xad, 0xc8, 0x4f, - 0xce, 0x2f, 0x4a, 0xd5, 0x2f, 0x49, 0x2c, 0xce, 0xce, 0x4d, 0xcc, 0x4b, 0x4c, 0x4f, 0x2d, 0x4a, - 0x2c, 0x2b, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x2d, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, - 0x12, 0x83, 0x2a, 0xd2, 0x43, 0x55, 0x24, 0x25, 0x92, 0x9e, 0x9f, 0x9e, 0x0f, 0x56, 0xa2, 0x0f, - 0x62, 0x41, 0x54, 0x2b, 0xf1, 0x71, 0xb1, 0x05, 0x80, 0x75, 0x5b, 0xb1, 0xcc, 0x58, 0x20, 0xcf, - 0xe0, 0x14, 0x74, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, - 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x16, 0xe9, 0x99, - 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xae, 0x10, 0x2b, 0xfc, 0x52, 0x4b, 0xca, - 0xf3, 0x8b, 0xb2, 0xf5, 0x61, 0xce, 0xaa, 0x40, 0x77, 0x58, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, - 0x1b, 0xd8, 0x2a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xbc, 0x92, 0x25, 0xbf, 0x00, - 0x00, 0x00, -} - -func (m *Params) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Params) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintParams(dAtA []byte, offset int, v uint64) int { - offset -= sovParams(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Params) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovParams(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozParams(x uint64) (n int) { - return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Params) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowParams - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Params: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipParams(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthParams - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipParams(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowParams - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthParams - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupParams - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthParams - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/taskmanageravs/types/query.pb.go b/x/taskmanageravs/types/query.pb.go deleted file mode 100644 index 447492d5d..000000000 --- a/x/taskmanageravs/types/query.pb.go +++ /dev/null @@ -1,540 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/taskmanageravs/query.proto - -package types - -import ( - context "context" - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/query" - _ "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 - -// QueryParamsRequest is request type for the Query/Params RPC method. -type QueryParamsRequest struct { -} - -func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } -func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } -func (*QueryParamsRequest) ProtoMessage() {} -func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_a379a79b4cdb497c, []int{0} -} -func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsRequest.Merge(m, src) -} -func (m *QueryParamsRequest) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsRequest) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo - -// QueryParamsResponse is response type for the Query/Params RPC method. -type QueryParamsResponse struct { - // params holds all the parameters of this module. - Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` -} - -func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } -func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } -func (*QueryParamsResponse) ProtoMessage() {} -func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_a379a79b4cdb497c, []int{1} -} -func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryParamsResponse.Merge(m, src) -} -func (m *QueryParamsResponse) XXX_Size() int { - return m.Size() -} -func (m *QueryParamsResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo - -func (m *QueryParamsResponse) GetParams() Params { - if m != nil { - return m.Params - } - return Params{} -} - -func init() { - proto.RegisterType((*QueryParamsRequest)(nil), "exocore.taskmanageravs.QueryParamsRequest") - proto.RegisterType((*QueryParamsResponse)(nil), "exocore.taskmanageravs.QueryParamsResponse") -} - -func init() { - proto.RegisterFile("exocore/taskmanageravs/query.proto", fileDescriptor_a379a79b4cdb497c) -} - -var fileDescriptor_a379a79b4cdb497c = []byte{ - // 312 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x90, 0xb1, 0x4b, 0x3b, 0x31, - 0x14, 0xc7, 0x2f, 0x3f, 0x7e, 0x76, 0x38, 0xb7, 0xb3, 0x88, 0x14, 0x89, 0x72, 0x2e, 0x52, 0xf1, - 0x42, 0x2b, 0x82, 0x83, 0x53, 0xc1, 0x55, 0xb4, 0x6e, 0x6e, 0xef, 0xca, 0x23, 0x1e, 0xf5, 0xf2, - 0xd2, 0x24, 0xad, 0xed, 0xea, 0x5f, 0x20, 0xb8, 0x38, 0xfb, 0xd7, 0x74, 0x2c, 0xb8, 0x38, 0x89, - 0xb4, 0xfe, 0x21, 0xd2, 0xcb, 0x2d, 0x55, 0x4f, 0xdc, 0xc2, 0xcb, 0xe7, 0xfb, 0xc9, 0x37, 0x2f, - 0x8c, 0x71, 0x4c, 0x3d, 0x32, 0x28, 0x1c, 0xd8, 0x7e, 0x0e, 0x0a, 0x24, 0x1a, 0x18, 0x59, 0x31, - 0x18, 0xa2, 0x99, 0x24, 0xda, 0x90, 0xa3, 0x68, 0xb3, 0x64, 0x92, 0x55, 0xa6, 0x51, 0x97, 0x24, - 0xa9, 0x40, 0xc4, 0xf2, 0xe4, 0xe9, 0xc6, 0xb6, 0x24, 0x92, 0xb7, 0x28, 0x40, 0x67, 0x02, 0x94, - 0x22, 0x07, 0x2e, 0x23, 0x65, 0xcb, 0xdb, 0x66, 0x8f, 0x6c, 0x4e, 0x56, 0xa4, 0x60, 0xd1, 0x3f, - 0x22, 0x46, 0xad, 0x14, 0x1d, 0xb4, 0x84, 0x06, 0x99, 0xa9, 0x02, 0x2e, 0xd9, 0xbd, 0x8a, 0x6e, - 0x1a, 0x0c, 0xe4, 0xa5, 0x30, 0xae, 0x87, 0xd1, 0xe5, 0x52, 0x73, 0x51, 0x0c, 0xbb, 0x38, 0x18, - 0xa2, 0x75, 0xf1, 0x55, 0xb8, 0xb1, 0x32, 0xb5, 0x9a, 0x94, 0xc5, 0xe8, 0x34, 0xac, 0xf9, 0xf0, - 0x16, 0xdb, 0x65, 0xfb, 0xeb, 0x6d, 0x9e, 0xfc, 0xfc, 0xb5, 0xc4, 0xe7, 0x3a, 0xff, 0xa7, 0x6f, - 0x3b, 0x41, 0xb7, 0xcc, 0xb4, 0x9f, 0x59, 0xb8, 0x56, 0x58, 0xa3, 0x27, 0x16, 0xd6, 0x3c, 0x12, - 0x35, 0xab, 0x14, 0xdf, 0x5b, 0x35, 0x0e, 0xfe, 0xc4, 0xfa, 0xae, 0xf1, 0xf1, 0xfd, 0xcb, 0xc7, - 0xe3, 0x3f, 0x11, 0x1d, 0x8a, 0x33, 0x1f, 0x3a, 0x47, 0x77, 0x47, 0xa6, 0x2f, 0x7e, 0xdd, 0x4a, - 0xa7, 0x3b, 0x9d, 0x73, 0x36, 0x9b, 0x73, 0xf6, 0x3e, 0xe7, 0xec, 0x61, 0xc1, 0x83, 0xd9, 0x82, - 0x07, 0xaf, 0x0b, 0x1e, 0x5c, 0x9f, 0xc8, 0xcc, 0xdd, 0x0c, 0xd3, 0xa4, 0x47, 0x79, 0x95, 0x72, - 0xfc, 0x55, 0xea, 0x26, 0x1a, 0x6d, 0x5a, 0x2b, 0x56, 0x7d, 0xf4, 0x19, 0x00, 0x00, 0xff, 0xff, - 0x96, 0x51, 0x46, 0x11, 0x2d, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// QueryClient is the client API for Query service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type QueryClient interface { - // Parameters queries the parameters of the module. - Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) -} - -type queryClient struct { - cc grpc1.ClientConn -} - -func NewQueryClient(cc grpc1.ClientConn) QueryClient { - return &queryClient{cc} -} - -func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { - out := new(QueryParamsResponse) - err := c.cc.Invoke(ctx, "/exocore.taskmanageravs.Query/Params", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// QueryServer is the server API for Query service. -type QueryServer interface { - // Parameters queries the parameters of the module. - Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) -} - -// UnimplementedQueryServer can be embedded to have forward compatible implementations. -type UnimplementedQueryServer struct { -} - -func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") -} - -func RegisterQueryServer(s grpc1.Server, srv QueryServer) { - s.RegisterService(&_Query_serviceDesc, srv) -} - -func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryParamsRequest) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(QueryServer).Params(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.taskmanageravs.Query/Params", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) - } - return interceptor(ctx, in, info, handler) -} - -var _Query_serviceDesc = grpc.ServiceDesc{ - ServiceName: "exocore.taskmanageravs.Query", - HandlerType: (*QueryServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "Params", - Handler: _Query_Params_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "exocore/taskmanageravs/query.proto", -} - -func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - { - size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintQuery(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0xa - return len(dAtA) - i, nil -} - -func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { - offset -= sovQuery(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *QueryParamsRequest) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *QueryParamsResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = m.Params.Size() - n += 1 + l + sovQuery(uint64(l)) - return n -} - -func sovQuery(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozQuery(x uint64) (n int) { - return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowQuery - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthQuery - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthQuery - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipQuery(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthQuery - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipQuery(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowQuery - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthQuery - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupQuery - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthQuery - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") -) diff --git a/x/taskmanageravs/types/query.pb.gw.go b/x/taskmanageravs/types/query.pb.gw.go deleted file mode 100644 index 242b751a7..000000000 --- a/x/taskmanageravs/types/query.pb.gw.go +++ /dev/null @@ -1,148 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: exocore/taskmanageravs/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_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_Params_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_Params_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_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ExocoreNetwork", "exocore", "taskmanageravs", "params"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage -) diff --git a/x/taskmanageravs/types/tx.pb.go b/x/taskmanageravs/types/tx.pb.go deleted file mode 100644 index 6a3cd3f46..000000000 --- a/x/taskmanageravs/types/tx.pb.go +++ /dev/null @@ -1,1180 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: exocore/taskmanageravs/tx.proto - -package types - -import ( - context "context" - fmt "fmt" - grpc1 "github.com/cosmos/gogoproto/grpc" - proto "github.com/cosmos/gogoproto/proto" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type TaskInfo struct { - Name string `protobuf:"bytes,1,opt,name=Name,proto3" json:"Name,omitempty"` - MetaInfo string `protobuf:"bytes,2,opt,name=MetaInfo,proto3" json:"MetaInfo,omitempty"` - TaskId uint64 `protobuf:"varint,3,opt,name=TaskId,proto3" json:"TaskId,omitempty"` - // each task needs to reach at least thresholdPercentage of operator signatures. - ThresholdPercentage uint64 `protobuf:"varint,4,opt,name=thresholdPercentage,proto3" json:"thresholdPercentage,omitempty"` -} - -func (m *TaskInfo) Reset() { *m = TaskInfo{} } -func (m *TaskInfo) String() string { return proto.CompactTextString(m) } -func (*TaskInfo) ProtoMessage() {} -func (*TaskInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c8692217960aa4f9, []int{0} -} -func (m *TaskInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskInfo.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 *TaskInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskInfo.Merge(m, src) -} -func (m *TaskInfo) XXX_Size() int { - return m.Size() -} -func (m *TaskInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TaskInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskInfo proto.InternalMessageInfo - -func (m *TaskInfo) GetName() string { - if m != nil { - return m.Name - } - return "" -} - -func (m *TaskInfo) GetMetaInfo() string { - if m != nil { - return m.MetaInfo - } - return "" -} - -func (m *TaskInfo) GetTaskId() uint64 { - if m != nil { - return m.TaskId - } - return 0 -} - -func (m *TaskInfo) GetThresholdPercentage() uint64 { - if m != nil { - return m.ThresholdPercentage - } - return 0 -} - -type TaskManagerInfo struct { - TaskManager map[string]*TaskInfo `protobuf:"bytes,1,rep,name=TaskManager,proto3" json:"TaskManager,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` -} - -func (m *TaskManagerInfo) Reset() { *m = TaskManagerInfo{} } -func (m *TaskManagerInfo) String() string { return proto.CompactTextString(m) } -func (*TaskManagerInfo) ProtoMessage() {} -func (*TaskManagerInfo) Descriptor() ([]byte, []int) { - return fileDescriptor_c8692217960aa4f9, []int{1} -} -func (m *TaskManagerInfo) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *TaskManagerInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_TaskManagerInfo.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 *TaskManagerInfo) XXX_Merge(src proto.Message) { - xxx_messageInfo_TaskManagerInfo.Merge(m, src) -} -func (m *TaskManagerInfo) XXX_Size() int { - return m.Size() -} -func (m *TaskManagerInfo) XXX_DiscardUnknown() { - xxx_messageInfo_TaskManagerInfo.DiscardUnknown(m) -} - -var xxx_messageInfo_TaskManagerInfo proto.InternalMessageInfo - -func (m *TaskManagerInfo) GetTaskManager() map[string]*TaskInfo { - if m != nil { - return m.TaskManager - } - return nil -} - -type RegisterAVSTaskReq struct { - AVSAddress string `protobuf:"bytes,1,opt,name=AVSAddress,proto3" json:"AVSAddress,omitempty"` - Task *TaskInfo `protobuf:"bytes,2,opt,name=task,proto3" json:"task,omitempty"` -} - -func (m *RegisterAVSTaskReq) Reset() { *m = RegisterAVSTaskReq{} } -func (m *RegisterAVSTaskReq) String() string { return proto.CompactTextString(m) } -func (*RegisterAVSTaskReq) ProtoMessage() {} -func (*RegisterAVSTaskReq) Descriptor() ([]byte, []int) { - return fileDescriptor_c8692217960aa4f9, []int{2} -} -func (m *RegisterAVSTaskReq) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RegisterAVSTaskReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RegisterAVSTaskReq.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 *RegisterAVSTaskReq) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterAVSTaskReq.Merge(m, src) -} -func (m *RegisterAVSTaskReq) XXX_Size() int { - return m.Size() -} -func (m *RegisterAVSTaskReq) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterAVSTaskReq.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterAVSTaskReq proto.InternalMessageInfo - -func (m *RegisterAVSTaskReq) GetAVSAddress() string { - if m != nil { - return m.AVSAddress - } - return "" -} - -func (m *RegisterAVSTaskReq) GetTask() *TaskInfo { - if m != nil { - return m.Task - } - return nil -} - -type RegisterAVSTaskResponse struct { -} - -func (m *RegisterAVSTaskResponse) Reset() { *m = RegisterAVSTaskResponse{} } -func (m *RegisterAVSTaskResponse) String() string { return proto.CompactTextString(m) } -func (*RegisterAVSTaskResponse) ProtoMessage() {} -func (*RegisterAVSTaskResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_c8692217960aa4f9, []int{3} -} -func (m *RegisterAVSTaskResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *RegisterAVSTaskResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_RegisterAVSTaskResponse.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 *RegisterAVSTaskResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_RegisterAVSTaskResponse.Merge(m, src) -} -func (m *RegisterAVSTaskResponse) XXX_Size() int { - return m.Size() -} -func (m *RegisterAVSTaskResponse) XXX_DiscardUnknown() { - xxx_messageInfo_RegisterAVSTaskResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_RegisterAVSTaskResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*TaskInfo)(nil), "exocore.taskmanageravs.TaskInfo") - proto.RegisterType((*TaskManagerInfo)(nil), "exocore.taskmanageravs.TaskManagerInfo") - proto.RegisterMapType((map[string]*TaskInfo)(nil), "exocore.taskmanageravs.TaskManagerInfo.TaskManagerEntry") - proto.RegisterType((*RegisterAVSTaskReq)(nil), "exocore.taskmanageravs.RegisterAVSTaskReq") - proto.RegisterType((*RegisterAVSTaskResponse)(nil), "exocore.taskmanageravs.RegisterAVSTaskResponse") -} - -func init() { proto.RegisterFile("exocore/taskmanageravs/tx.proto", fileDescriptor_c8692217960aa4f9) } - -var fileDescriptor_c8692217960aa4f9 = []byte{ - // 382 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4f, 0xcf, 0xd2, 0x40, - 0x10, 0xc6, 0x59, 0x5a, 0x09, 0x0e, 0x07, 0xc8, 0x9a, 0x60, 0xe5, 0x50, 0x9b, 0x9e, 0x88, 0x87, - 0xd6, 0xa0, 0x31, 0xc4, 0x1b, 0x26, 0x1c, 0x3c, 0x40, 0x4c, 0x31, 0x1c, 0x38, 0xb9, 0xd0, 0xb1, - 0x60, 0xa1, 0x8b, 0xbb, 0x0b, 0xc2, 0xdd, 0x0f, 0xe0, 0xc7, 0xf2, 0x26, 0x47, 0x8f, 0x06, 0xbe, - 0x88, 0xe9, 0xb6, 0x9a, 0xbe, 0xc0, 0xfb, 0x86, 0xdb, 0xfc, 0xf9, 0xcd, 0xf3, 0xcc, 0x24, 0x03, - 0xcf, 0x71, 0xc7, 0x67, 0x5c, 0xa0, 0xaf, 0x98, 0x8c, 0x57, 0x2c, 0x61, 0x11, 0x0a, 0xb6, 0x95, - 0xbe, 0xda, 0x79, 0x6b, 0xc1, 0x15, 0xa7, 0xcd, 0x1c, 0xf0, 0xee, 0x02, 0xee, 0x77, 0x02, 0xd5, - 0x8f, 0x4c, 0xc6, 0xef, 0x93, 0xcf, 0x9c, 0x52, 0x30, 0x87, 0x6c, 0x85, 0x16, 0x71, 0x48, 0xfb, - 0x71, 0xa0, 0x63, 0xda, 0x82, 0xea, 0x00, 0x15, 0x4b, 0xfb, 0x56, 0x59, 0xd7, 0xff, 0xe7, 0xb4, - 0x09, 0x15, 0x3d, 0x1b, 0x5a, 0x86, 0x43, 0xda, 0x66, 0x90, 0x67, 0xf4, 0x25, 0x3c, 0x51, 0x73, - 0x81, 0x72, 0xce, 0x97, 0xe1, 0x07, 0x14, 0x33, 0x4c, 0x14, 0x8b, 0xd0, 0x32, 0x35, 0x74, 0xad, - 0xe5, 0xfe, 0x22, 0x50, 0x4f, 0x87, 0x07, 0xd9, 0x66, 0x5a, 0x7d, 0x02, 0xb5, 0x42, 0xc9, 0x22, - 0x8e, 0xd1, 0xae, 0x75, 0xba, 0xde, 0xf5, 0x43, 0xbc, 0xb3, 0xe9, 0x62, 0xde, 0x4f, 0x94, 0xd8, - 0x07, 0x45, 0xb1, 0xd6, 0x27, 0x68, 0x9c, 0x03, 0xb4, 0x01, 0x46, 0x8c, 0xfb, 0xfc, 0xf8, 0x34, - 0xa4, 0x6f, 0xe0, 0xd1, 0x96, 0x2d, 0x37, 0xa8, 0x0f, 0xaf, 0x75, 0x9c, 0x87, 0xbc, 0x53, 0xd3, - 0x20, 0xc3, 0xdf, 0x96, 0xbb, 0xc4, 0xfd, 0x02, 0x34, 0xc0, 0x68, 0x21, 0x15, 0x8a, 0xde, 0x78, - 0x94, 0x12, 0x01, 0x7e, 0xa5, 0x36, 0x40, 0x6f, 0x3c, 0xea, 0x85, 0xa1, 0x40, 0x29, 0x73, 0xab, - 0x42, 0x85, 0xbe, 0x06, 0x33, 0xd5, 0xbe, 0xd9, 0x50, 0xd3, 0xee, 0x33, 0x78, 0x7a, 0xe1, 0x25, - 0xd7, 0x3c, 0x91, 0xd8, 0xd9, 0x80, 0x31, 0x90, 0x11, 0x4d, 0xa0, 0x7e, 0x46, 0xd0, 0x17, 0xf7, - 0x89, 0x5f, 0xae, 0xdd, 0xf2, 0x6f, 0x66, 0x33, 0xdb, 0x77, 0xc1, 0xcf, 0xa3, 0x4d, 0x0e, 0x47, - 0x9b, 0xfc, 0x39, 0xda, 0xe4, 0xc7, 0xc9, 0x2e, 0x1d, 0x4e, 0x76, 0xe9, 0xf7, 0xc9, 0x2e, 0x4d, - 0xba, 0xd1, 0x42, 0xcd, 0x37, 0x53, 0x6f, 0xc6, 0x57, 0x7e, 0x3f, 0x13, 0x1d, 0xa2, 0xfa, 0xc6, - 0x45, 0xec, 0xff, 0xfb, 0xe1, 0xdd, 0xc5, 0x17, 0xef, 0xd7, 0x28, 0xa7, 0x15, 0xfd, 0xc9, 0xaf, - 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x4d, 0xf7, 0xa6, 0x31, 0xec, 0x02, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - RegisterAVSTask(ctx context.Context, in *RegisterAVSTaskReq, opts ...grpc.CallOption) (*RegisterAVSTaskResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) RegisterAVSTask(ctx context.Context, in *RegisterAVSTaskReq, opts ...grpc.CallOption) (*RegisterAVSTaskResponse, error) { - out := new(RegisterAVSTaskResponse) - err := c.cc.Invoke(ctx, "/exocore.taskmanageravs.Msg/RegisterAVSTask", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil -} - -// MsgServer is the server API for Msg service. -type MsgServer interface { - RegisterAVSTask(context.Context, *RegisterAVSTaskReq) (*RegisterAVSTaskResponse, error) -} - -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { -} - -func (*UnimplementedMsgServer) RegisterAVSTask(ctx context.Context, req *RegisterAVSTaskReq) (*RegisterAVSTaskResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method RegisterAVSTask not implemented") -} - -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) -} - -func _Msg_RegisterAVSTask_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(RegisterAVSTaskReq) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).RegisterAVSTask(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/exocore.taskmanageravs.Msg/RegisterAVSTask", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).RegisterAVSTask(ctx, req.(*RegisterAVSTaskReq)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "exocore.taskmanageravs.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "RegisterAVSTask", - Handler: _Msg_RegisterAVSTask_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "exocore/taskmanageravs/tx.proto", -} - -func (m *TaskInfo) 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 *TaskInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.ThresholdPercentage != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.ThresholdPercentage)) - i-- - dAtA[i] = 0x20 - } - if m.TaskId != 0 { - i = encodeVarintTx(dAtA, i, uint64(m.TaskId)) - i-- - dAtA[i] = 0x18 - } - if len(m.MetaInfo) > 0 { - i -= len(m.MetaInfo) - copy(dAtA[i:], m.MetaInfo) - i = encodeVarintTx(dAtA, i, uint64(len(m.MetaInfo))) - i-- - dAtA[i] = 0x12 - } - if len(m.Name) > 0 { - i -= len(m.Name) - copy(dAtA[i:], m.Name) - i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *TaskManagerInfo) 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 *TaskManagerInfo) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *TaskManagerInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.TaskManager) > 0 { - for k := range m.TaskManager { - v := m.TaskManager[k] - baseI := i - if v != nil { - { - size, err := v.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - i -= len(k) - copy(dAtA[i:], k) - i = encodeVarintTx(dAtA, i, uint64(len(k))) - i-- - dAtA[i] = 0xa - i = encodeVarintTx(dAtA, i, uint64(baseI-i)) - i-- - dAtA[i] = 0xa - } - } - return len(dAtA) - i, nil -} - -func (m *RegisterAVSTaskReq) 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 *RegisterAVSTaskReq) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RegisterAVSTaskReq) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if m.Task != nil { - { - size, err := m.Task.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.AVSAddress) > 0 { - i -= len(m.AVSAddress) - copy(dAtA[i:], m.AVSAddress) - i = encodeVarintTx(dAtA, i, uint64(len(m.AVSAddress))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *RegisterAVSTaskResponse) 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 *RegisterAVSTaskResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *RegisterAVSTaskResponse) 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 *TaskInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Name) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.MetaInfo) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.TaskId != 0 { - n += 1 + sovTx(uint64(m.TaskId)) - } - if m.ThresholdPercentage != 0 { - n += 1 + sovTx(uint64(m.ThresholdPercentage)) - } - return n -} - -func (m *TaskManagerInfo) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - if len(m.TaskManager) > 0 { - for k, v := range m.TaskManager { - _ = k - _ = v - l = 0 - if v != nil { - l = v.Size() - l += 1 + sovTx(uint64(l)) - } - mapEntrySize := 1 + len(k) + sovTx(uint64(len(k))) + l - n += mapEntrySize + 1 + sovTx(uint64(mapEntrySize)) - } - } - return n -} - -func (m *RegisterAVSTaskReq) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.AVSAddress) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.Task != nil { - l = m.Task.Size() - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *RegisterAVSTaskResponse) 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 *TaskInfo) 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: TaskInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Name = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field MetaInfo", 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.MetaInfo = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskId", wireType) - } - m.TaskId = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.TaskId |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - case 4: - if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ThresholdPercentage", wireType) - } - m.ThresholdPercentage = 0 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - m.ThresholdPercentage |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - 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 *TaskManagerInfo) 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: TaskManagerInfo: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: TaskManagerInfo: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field TaskManager", 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.TaskManager == nil { - m.TaskManager = make(map[string]*TaskInfo) - } - var mapkey string - var mapvalue *TaskInfo - for iNdEx < postIndex { - entryPreIndex := 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) - if fieldNum == 1 { - var stringLenmapkey uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLenmapkey |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLenmapkey := int(stringLenmapkey) - if intStringLenmapkey < 0 { - return ErrInvalidLengthTx - } - postStringIndexmapkey := iNdEx + intStringLenmapkey - if postStringIndexmapkey < 0 { - return ErrInvalidLengthTx - } - if postStringIndexmapkey > l { - return io.ErrUnexpectedEOF - } - mapkey = string(dAtA[iNdEx:postStringIndexmapkey]) - iNdEx = postStringIndexmapkey - } else if fieldNum == 2 { - var mapmsglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - mapmsglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if mapmsglen < 0 { - return ErrInvalidLengthTx - } - postmsgIndex := iNdEx + mapmsglen - if postmsgIndex < 0 { - return ErrInvalidLengthTx - } - if postmsgIndex > l { - return io.ErrUnexpectedEOF - } - mapvalue = &TaskInfo{} - if err := mapvalue.Unmarshal(dAtA[iNdEx:postmsgIndex]); err != nil { - return err - } - iNdEx = postmsgIndex - } else { - iNdEx = entryPreIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > postIndex { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - m.TaskManager[mapkey] = mapvalue - 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 *RegisterAVSTaskReq) 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: RegisterAVSTaskReq: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RegisterAVSTaskReq: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AVSAddress", 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.AVSAddress = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Task", 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.Task == nil { - m.Task = &TaskInfo{} - } - if err := m.Task.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 *RegisterAVSTaskResponse) 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: RegisterAVSTaskResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: RegisterAVSTaskResponse: 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/taskmanageravs/types/types.go b/x/taskmanageravs/types/types.go deleted file mode 100644 index ab1254f4c..000000000 --- a/x/taskmanageravs/types/types.go +++ /dev/null @@ -1 +0,0 @@ -package types