From cbabd03103c11fcebe8492f36835eb746b1c9b12 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 15 Jul 2024 20:14:32 +0530 Subject: [PATCH 01/64] fix(go mod): cometbft vuln fix upgrade Signed-off-by: Deepanshu Tripathi --- go.mod | 3 ++- go.sum | 7 ++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/go.mod b/go.mod index 5d06fce12..cbd61d7bd 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/AssetMantle/schema v0.0.0-20240206102051-27352b802163 github.com/CosmWasm/wasmd v0.45.0 github.com/Shopify/sarama v1.19.0 - github.com/cometbft/cometbft v0.37.5 + github.com/cometbft/cometbft v0.37.7 github.com/cometbft/cometbft-db v0.8.0 github.com/cosmos/cosmos-sdk v0.47.11 github.com/cosmos/gogoproto v1.4.10 @@ -115,6 +115,7 @@ require ( github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect github.com/huandu/skiplist v1.2.0 // indirect diff --git a/go.sum b/go.sum index d16e1ca8b..eb563e423 100644 --- a/go.sum +++ b/go.sum @@ -209,7 +209,6 @@ git.sr.ht/~sircmpwn/getopt v0.0.0-20191230200459-23622cc906b3/go.mod h1:wMEGFFFN git.sr.ht/~sircmpwn/go-bare v0.0.0-20210406120253-ab86bc2846d9/go.mod h1:BVJwbDfVjCjoFiKrhkei6NdGcZYpkDkdyCdg1ukytRA= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 h1:/vQbFIOMbk2FiG/kXiLl8BRyzTWDw7gX/Hz7Dd5eDMs= github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4/go.mod h1:hN7oaIRCjzsZ2dE+yG5k+rsdt3qcwykqK6HVGcKwsw4= -github.com/AssetMantle/schema v0.0.0-20240206102051-27352b802163/go.mod h1:SindcyQCFIEKPOp4mNrnegXrJ2uwQfq3D1r+G93Gz3Q= github.com/Azure/azure-sdk-for-go/sdk/azcore v0.21.1/go.mod h1:fBF9PQNqB8scdgpZ3ufzaLntG0AG7C1WjPMsiFOmfHM= github.com/Azure/azure-sdk-for-go/sdk/internal v0.8.3/go.mod h1:KLF4gFr6DcKFZwSuH8w8yEK6DpFl3LP5rhdvAb7Yz5I= github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v0.3.0/go.mod h1:tPaiy8S5bQ+S5sOiDlINkp7+Ef339+Nz5L5XO+cnOHo= @@ -378,8 +377,8 @@ github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE github.com/coinbase/kryptology v1.8.0/go.mod h1:RYXOAPdzOGUe3qlSFkMGn58i3xUA8hmxYHksuq+8ciI= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.37.5 h1:/U/TlgMh4NdnXNo+YU9T2NMCWyhXNDF34Mx582jlvq0= -github.com/cometbft/cometbft v0.37.5/go.mod h1:QC+mU0lBhKn8r9qvmnq53Dmf3DWBt4VtkcKw2C81wxY= +github.com/cometbft/cometbft v0.37.7 h1:pwC0PNfGcbKbAKyK/sWm+LwuiYmT00C3bF2nEnnjJ/k= +github.com/cometbft/cometbft v0.37.7/go.mod h1:gFGCFXNGDci6tMLemANPGTfU+j4+oH63PjeLe0iIjJk= github.com/cometbft/cometbft-db v0.8.0 h1:vUMDaH3ApkX8m0KZvOFFy9b5DZHBAjsnEuo9AKVZpjo= github.com/cometbft/cometbft-db v0.8.0/go.mod h1:6ASCP4pfhmrCBpfk01/9E1SI29nD3HfVHrY4PG8x5c0= github.com/confio/ics23/go v0.9.0 h1:cWs+wdbS2KRPZezoaaj+qBleXgUk5WOQFMP3CQFGTr4= @@ -775,6 +774,8 @@ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.5-0.20210104140557-80c98217689d/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= From 881bcd9a65139effa2d0a31443dae2aa45edf64e Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 15 Jul 2024 20:41:37 +0530 Subject: [PATCH 02/64] chore(module manager): code cleanup Signed-off-by: Deepanshu Tripathi --- helpers/base/module_manager.go | 2 -- 1 file changed, 2 deletions(-) diff --git a/helpers/base/module_manager.go b/helpers/base/module_manager.go index b632c4cd5..8079a18a3 100644 --- a/helpers/base/module_manager.go +++ b/helpers/base/module_manager.go @@ -16,10 +16,8 @@ import ( type moduleManager struct { basicModules []helpers.BasicModule orderInitGenesis []string - orderExportGenesis []string orderBeginBlockers []string orderEndBlockers []string - orderMigrations []string } var _ helpers.ModuleManager = (*moduleManager)(nil) From 8690a2db872ae79a6ce74532148823d36ad91ebc Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Wed, 17 Jul 2024 14:08:31 +0530 Subject: [PATCH 03/64] refactor(prams): removing hasProposalContents impl Signed-off-by: Deepanshu Tripathi --- helpers/module.go | 1 - helpers/simulator.go | 2 +- x/assets/simulator/proposals.go | 23 +++++++++--------- x/classifications/simulator/proposals.go | 25 ++++++++++---------- x/identities/simulator/proposals.go | 25 ++++++++++---------- x/maintainers/simulator/proposals.go | 25 ++++++++++---------- x/metas/simulator/proposals.go | 23 +++++++++--------- x/orders/simulator/proposals.go | 23 +++++++++--------- x/splits/simulator/proposals.go | 30 ++++++++++++------------ 9 files changed, 91 insertions(+), 86 deletions(-) diff --git a/helpers/module.go b/helpers/module.go index 2e5fbd6b2..c04acc4e1 100644 --- a/helpers/module.go +++ b/helpers/module.go @@ -23,7 +23,6 @@ type Module interface { sdkModuleTypes.HasServices sdkModuleTypes.AppModuleSimulation - sdkModuleTypes.HasProposalContents sdkModuleTypes.HasProposalMsgs GetAuxiliary(string) Auxiliary diff --git a/helpers/simulator.go b/helpers/simulator.go index 449cbf92c..6f79e4948 100644 --- a/helpers/simulator.go +++ b/helpers/simulator.go @@ -14,6 +14,6 @@ import ( type Simulator interface { RandomizedGenesisState(*module.SimulationState) WeightedOperations(module.SimulationState, Module) simulation.WeightedOperations - WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent ParamChangeList(*rand.Rand) []simulationTypes.LegacyParamChange + ProposalMessages(module.SimulationState) []simulationTypes.WeightedProposalMsg } diff --git a/x/assets/simulator/proposals.go b/x/assets/simulator/proposals.go index 776c4f2bc..3125e3c1a 100644 --- a/x/assets/simulator/proposals.go +++ b/x/assets/simulator/proposals.go @@ -4,6 +4,7 @@ package simulator import ( + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "math/rand" @@ -13,19 +14,19 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdkTypes.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/classifications/simulator/proposals.go b/x/classifications/simulator/proposals.go index 72d20f254..2990dc422 100644 --- a/x/classifications/simulator/proposals.go +++ b/x/classifications/simulator/proposals.go @@ -4,28 +4,29 @@ package simulator import ( + sdkTypes "github.com/cosmos/cosmos-sdk/types" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "math/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/identities/simulator/proposals.go b/x/identities/simulator/proposals.go index 72d20f254..2990dc422 100644 --- a/x/identities/simulator/proposals.go +++ b/x/identities/simulator/proposals.go @@ -4,28 +4,29 @@ package simulator import ( + sdkTypes "github.com/cosmos/cosmos-sdk/types" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "math/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/maintainers/simulator/proposals.go b/x/maintainers/simulator/proposals.go index 72d20f254..2990dc422 100644 --- a/x/maintainers/simulator/proposals.go +++ b/x/maintainers/simulator/proposals.go @@ -4,28 +4,29 @@ package simulator import ( + sdkTypes "github.com/cosmos/cosmos-sdk/types" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "math/rand" - sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/metas/simulator/proposals.go b/x/metas/simulator/proposals.go index 776c4f2bc..3125e3c1a 100644 --- a/x/metas/simulator/proposals.go +++ b/x/metas/simulator/proposals.go @@ -4,6 +4,7 @@ package simulator import ( + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "math/rand" @@ -13,19 +14,19 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdkTypes.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/orders/simulator/proposals.go b/x/orders/simulator/proposals.go index 776c4f2bc..3125e3c1a 100644 --- a/x/orders/simulator/proposals.go +++ b/x/orders/simulator/proposals.go @@ -4,6 +4,7 @@ package simulator import ( + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "math/rand" @@ -13,19 +14,19 @@ import ( "github.com/cosmos/cosmos-sdk/x/simulation" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdkTypes.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} diff --git a/x/splits/simulator/proposals.go b/x/splits/simulator/proposals.go index 72d20f254..53aac918f 100644 --- a/x/splits/simulator/proposals.go +++ b/x/splits/simulator/proposals.go @@ -4,28 +4,28 @@ package simulator import ( - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - - sdk "github.com/cosmos/cosmos-sdk/types" + sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) -func (simulator) WeightedProposalContentList(module.SimulationState) []simulationTypes.WeightedProposalContent { - return []simulationTypes.WeightedProposalContent{ - simulation.NewWeightedProposalContent( +func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { + return []simulationTypes.WeightedProposalMsg{ + simulation.NewWeightedProposalMsg( OpWeightSubmitTextProposal, DefaultWeightTextProposal, - simulateTextProposalContent, + func(r *rand.Rand, _ sdkTypes.Context, simulationAccounts []simulationTypes.Account) sdkTypes.Msg { + msgSubmitProposal, err := v1beta1.NewMsgSubmitProposal(v1beta1.NewTextProposal(simulationTypes.RandStringOfLength(r, 140), simulationTypes.RandStringOfLength(r, 5000)), govSimulation.GenDepositParamsMinDeposit(r), simulationAccounts[r.Intn(len(simulationAccounts))].Address) + if err != nil { + panic(err) + } + + return msgSubmitProposal + }, ), } } - -func simulateTextProposalContent(r *rand.Rand, _ sdk.Context, _ []simulationTypes.Account) simulationTypes.Content { - return v1beta1.NewTextProposal( - simulationTypes.RandStringOfLength(r, 140), - simulationTypes.RandStringOfLength(r, 5000), - ) -} From a93ca621a31063f223375576f1e6a239e3a2276e Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Wed, 17 Jul 2024 14:09:19 +0530 Subject: [PATCH 04/64] refactor(prams): removing hasProposalContents impl Signed-off-by: Deepanshu Tripathi --- helpers/base/module.go | 35 ++++++++++------------------------- 1 file changed, 10 insertions(+), 25 deletions(-) diff --git a/helpers/base/module.go b/helpers/base/module.go index fb3e3a839..30c0642ff 100644 --- a/helpers/base/module.go +++ b/helpers/base/module.go @@ -49,15 +49,6 @@ type module struct { var _ helpers.Module = (*module)(nil) -func (module module) IsOnePerModuleType() { - //TODO implement me - panic("implement me") -} - -func (module module) IsAppModule() { - //TODO implement me - panic("implement me") -} func (module module) Name() string { return module.name } @@ -104,7 +95,7 @@ func (module module) RegisterGRPCGatewayRoutes(context client.Context, serveMux func (module module) GetTxCmd() *cobra.Command { rootTransactionCommand := &cobra.Command{ Use: module.name, - Short: "GetProperty root transaction command.", + Short: module.name + " root transaction command.", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, @@ -124,7 +115,7 @@ func (module module) GetTxCmd() *cobra.Command { func (module module) GetQueryCmd() *cobra.Command { rootQueryCommand := &cobra.Command{ Use: module.name, - Short: "GetProperty root query command.", + Short: module.Name() + " root query command.", DisableFlagParsing: true, SuggestionsMinimumDistance: 2, RunE: client.ValidateCmd, @@ -145,27 +136,24 @@ func (module module) GenerateGenesisState(simulationState *sdkModuleTypes.Simula module.simulatorPrototype().RandomizedGenesisState(simulationState) } func (module module) ProposalMsgs(simulationState sdkModuleTypes.SimulationState) []simulationTypes.WeightedProposalMsg { - //TODO implement me - panic("implement me") -} -func (module module) ProposalContents(simulationState sdkModuleTypes.SimulationState) []simulationTypes.WeightedProposalContent { - return module.simulatorPrototype().WeightedProposalContentList(simulationState) + return module.simulatorPrototype().ProposalMessages(simulationState) } func (module module) RandomizedParams(r *rand.Rand) []simulationTypes.LegacyParamChange { return module.simulatorPrototype().ParamChangeList(r) } -func (module module) RegisterStoreDecoder(storeDecoderRegistry sdkTypes.StoreDecoderRegistry) { - storeDecoderRegistry[module.name] = module.mapperPrototype().StoreDecoder -} func (module module) WeightedOperations(simulationState sdkModuleTypes.SimulationState) []simulationTypes.WeightedOperation { return module.simulatorPrototype().WeightedOperations(simulationState, module) } +func (module module) RegisterStoreDecoder(storeDecoderRegistry sdkTypes.StoreDecoderRegistry) { + storeDecoderRegistry[module.name] = module.mapperPrototype().StoreDecoder +} func (module module) RegisterInvariants(invariantRegistry sdkTypes.InvariantRegistry) { module.invariantsPrototype().Register(invariantRegistry) } +func (module module) QuerierRoute() string { + return module.name +} -// TODO remove if unnecessary -// // func (module module) Route() sdkTypes.Route { // return sdkTypes.NewRoute(module.Name(), func(context sdkTypes.Context, msg sdkTypes.Msg) (*sdkTypes.Result, error) { // if module.transactions == nil { @@ -180,10 +168,7 @@ func (module module) RegisterInvariants(invariantRegistry sdkTypes.InvariantRegi // return nil, fmt.Errorf("message type %T is not supported by module %s", msg, module.Name()) // }) // } -func (module module) QuerierRoute() string { - return module.name -} - +// // func (module module) LegacyQuerierHandler(_ *sdkCodec.LegacyAmino) sdkTypes.Querier { // return func(context sdkTypes.Context, path []string, requestQuery abciTypes.RequestQuery) ([]byte, error) { // if module.queries == nil { From b09835cadd657ff6e64a5f6948d74a9d7af358a2 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 22 Jul 2024 18:30:37 +0530 Subject: [PATCH 05/64] refactor(service): cosmos.msg.v1.service Signed-off-by: Deepanshu Tripathi --- .../modules/x/assets/transactions/burn/service.proto | 6 +++--- .../modules/x/assets/transactions/define/service.proto | 6 +++--- .../modules/x/assets/transactions/deputize/service.proto | 6 +++--- .../modules/x/assets/transactions/mint/service.proto | 6 +++--- .../modules/x/assets/transactions/mutate/service.proto | 6 +++--- .../modules/x/assets/transactions/renumerate/service.proto | 6 +++--- .../modules/x/assets/transactions/revoke/service.proto | 6 +++--- .../modules/x/assets/transactions/send/service.proto | 6 +++--- .../modules/x/assets/transactions/unwrap/service.proto | 6 +++--- .../modules/x/assets/transactions/wrap/service.proto | 6 +++--- .../modules/x/identities/transactions/define/service.proto | 6 +++--- .../x/identities/transactions/deputize/service.proto | 6 +++--- .../modules/x/identities/transactions/issue/service.proto | 6 +++--- .../modules/x/identities/transactions/name/service.proto | 6 +++--- .../x/identities/transactions/provision/service.proto | 6 +++--- .../modules/x/identities/transactions/quash/service.proto | 6 +++--- .../modules/x/identities/transactions/revoke/service.proto | 6 +++--- .../x/identities/transactions/unprovision/service.proto | 6 +++--- .../modules/x/identities/transactions/update/service.proto | 6 +++--- .../modules/x/metas/transactions/reveal/service.proto | 6 +++--- .../modules/x/orders/transactions/cancel/service.proto | 6 +++--- .../modules/x/orders/transactions/define/service.proto | 6 +++--- .../modules/x/orders/transactions/deputize/service.proto | 6 +++--- .../modules/x/orders/transactions/get/service.proto | 6 +++--- .../modules/x/orders/transactions/immediate/service.proto | 6 +++--- .../modules/x/orders/transactions/make/service.proto | 6 +++--- .../modules/x/orders/transactions/modify/service.proto | 6 +++--- .../modules/x/orders/transactions/put/service.proto | 6 +++--- .../modules/x/orders/transactions/revoke/service.proto | 6 +++--- .../modules/x/orders/transactions/take/service.proto | 6 +++--- 30 files changed, 90 insertions(+), 90 deletions(-) diff --git a/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto b/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto index bea0fab47..b6f5a8a59 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.burn; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/burn/message.proto"; import "AssetMantle/modules/x/assets/transactions/burn/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/burn"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/define/service.proto b/proto/AssetMantle/modules/x/assets/transactions/define/service.proto index 6b7247c72..3e0ce4eae 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/define/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/define/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.define; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/define/message.proto"; import "AssetMantle/modules/x/assets/transactions/define/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/define"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto b/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto index bc965c715..3ef897f93 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.deputize; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/deputize/message.proto"; import "AssetMantle/modules/x/assets/transactions/deputize/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/deputize"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto b/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto index 8f940e1b9..b6e304168 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.mint; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/mint/message.proto"; import "AssetMantle/modules/x/assets/transactions/mint/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/mint"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto b/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto index 5f944dfa7..3a718058b 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.mutate; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/mutate/message.proto"; import "AssetMantle/modules/x/assets/transactions/mutate/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/mutate"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto b/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto index 11e4e3104..2f79d12b7 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.renumerate; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/renumerate/message.proto"; import "AssetMantle/modules/x/assets/transactions/renumerate/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/renumerate"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto b/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto index 3f96f967d..f78620c70 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.revoke; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/revoke/message.proto"; import "AssetMantle/modules/x/assets/transactions/revoke/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/revoke"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/send/service.proto b/proto/AssetMantle/modules/x/assets/transactions/send/service.proto index 042df99f1..b7e84c3ad 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/send/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/send/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.send; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/send/message.proto"; import "AssetMantle/modules/x/assets/transactions/send/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/send"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto b/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto index 5af84a5da..5028e690b 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.unwrap; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/unwrap/message.proto"; import "AssetMantle/modules/x/assets/transactions/unwrap/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/unwrap"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto b/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto index c07823424..d02bc49b0 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.wrap; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/wrap/message.proto"; import "AssetMantle/modules/x/assets/transactions/wrap/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/assets/wrap"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/define/service.proto b/proto/AssetMantle/modules/x/identities/transactions/define/service.proto index aea6f9a4f..dc09c7529 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/define/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/define/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.define; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/define/message.proto"; import "AssetMantle/modules/x/identities/transactions/define/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/define"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto b/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto index e998852cb..e75791c7f 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.deputize; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/deputize/message.proto"; import "AssetMantle/modules/x/identities/transactions/deputize/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/deputize"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto b/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto index 27fbb3fab..028f73bfb 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.issue; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/issue/message.proto"; import "AssetMantle/modules/x/identities/transactions/issue/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/issue"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/name/service.proto b/proto/AssetMantle/modules/x/identities/transactions/name/service.proto index a17b6967f..486530078 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/name/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/name/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.name; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/name/message.proto"; import "AssetMantle/modules/x/identities/transactions/name/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/name"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto b/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto index 04c36a738..bf3bac97c 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.provision; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/provision/message.proto"; import "AssetMantle/modules/x/identities/transactions/provision/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/provision"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto b/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto index 0ceaf7c9a..a7e3428f5 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.quash; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/quash/message.proto"; import "AssetMantle/modules/x/identities/transactions/quash/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/quash"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto b/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto index c31f672b1..1cfc20f9d 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.revoke; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/revoke/message.proto"; import "AssetMantle/modules/x/identities/transactions/revoke/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/revoke"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto b/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto index 5d095e63a..e530b5b4a 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.unprovision; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/unprovision/message.proto"; import "AssetMantle/modules/x/identities/transactions/unprovision/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/unprovision"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/update/service.proto b/proto/AssetMantle/modules/x/identities/transactions/update/service.proto index c3097be2e..26ab816fe 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/update/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/update/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.update; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/update/message.proto"; import "AssetMantle/modules/x/identities/transactions/update/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/identities/update"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto b/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto index 38eb685ea..5f220ea47 100644 --- a/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto +++ b/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.metas.transactions.reveal; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/metas/transactions/reveal/message.proto"; import "AssetMantle/modules/x/metas/transactions/reveal/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/metas/reveal"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto b/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto index cbc547c0f..44b5d9f17 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.cancel; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/cancel/message.proto"; import "AssetMantle/modules/x/orders/transactions/cancel/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/cancel"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/define/service.proto b/proto/AssetMantle/modules/x/orders/transactions/define/service.proto index 0998b6177..4b0fd8197 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/define/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/define/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.define; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/define/message.proto"; import "AssetMantle/modules/x/orders/transactions/define/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/define"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto b/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto index e2c0be378..c1a988763 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.deputize; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/deputize/message.proto"; import "AssetMantle/modules/x/orders/transactions/deputize/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/deputize"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/get/service.proto b/proto/AssetMantle/modules/x/orders/transactions/get/service.proto index 3bbecbea1..155a640df 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/get/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/get/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.get; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/get/message.proto"; import "AssetMantle/modules/x/orders/transactions/get/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/get"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto b/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto index 41308c955..ab585f884 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.immediate; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/immediate/message.proto"; import "AssetMantle/modules/x/orders/transactions/immediate/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/immediate"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/make/service.proto b/proto/AssetMantle/modules/x/orders/transactions/make/service.proto index ca2a50e6e..3de650727 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/make/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/make/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.make; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/make/message.proto"; import "AssetMantle/modules/x/orders/transactions/make/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/make"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto b/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto index 0ab307995..ce68877ee 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.modify; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/modify/message.proto"; import "AssetMantle/modules/x/orders/transactions/modify/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/modify"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/put/service.proto b/proto/AssetMantle/modules/x/orders/transactions/put/service.proto index 1b8210d75..3119d20eb 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/put/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/put/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.put; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/put/message.proto"; import "AssetMantle/modules/x/orders/transactions/put/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/put"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto b/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto index 0b174c1fd..aac94ddb4 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.revoke; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/revoke/message.proto"; import "AssetMantle/modules/x/orders/transactions/revoke/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/revoke"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/take/service.proto b/proto/AssetMantle/modules/x/orders/transactions/take/service.proto index a47e398f9..e5e5b4ce1 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/take/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/take/service.proto @@ -1,12 +1,12 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.take; +import "cosmos/msg/v1/msg.proto"; import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/take/message.proto"; import "AssetMantle/modules/x/orders/transactions/take/transaction_response.proto"; service Msg { - rpc Handle(Message) returns (TransactionResponse) { - option (google.api.http).post = "/mantle/orders/take"; - } + option (cosmos.msg.v1.service) = true; + rpc Handle(Message) returns (TransactionResponse) {} } \ No newline at end of file From 4a21234c5e3cb57e973c2ea27f21fbaf21d474dd Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 22 Jul 2024 18:42:12 +0530 Subject: [PATCH 06/64] refactor(service): cosmos.msg.v1.service Signed-off-by: Deepanshu Tripathi --- x/assets/transactions/burn/service.pb.go | 49 +++++++++--------- x/assets/transactions/define/service.pb.go | 49 +++++++++--------- x/assets/transactions/deputize/service.pb.go | 50 +++++++++--------- x/assets/transactions/mint/service.pb.go | 49 +++++++++--------- x/assets/transactions/mutate/service.pb.go | 49 +++++++++--------- .../transactions/renumerate/service.pb.go | 50 +++++++++--------- x/assets/transactions/revoke/service.pb.go | 49 +++++++++--------- x/assets/transactions/send/service.pb.go | 49 +++++++++--------- x/assets/transactions/unwrap/service.pb.go | 49 +++++++++--------- x/assets/transactions/wrap/service.pb.go | 49 +++++++++--------- .../transactions/define/service.pb.go | 50 +++++++++--------- .../transactions/deputize/service.pb.go | 50 +++++++++--------- x/identities/transactions/issue/service.pb.go | 50 +++++++++--------- x/identities/transactions/name/service.pb.go | 50 +++++++++--------- .../transactions/provision/service.pb.go | 50 +++++++++--------- x/identities/transactions/quash/service.pb.go | 50 +++++++++--------- .../transactions/revoke/service.pb.go | 50 +++++++++--------- .../transactions/unprovision/service.pb.go | 51 ++++++++++--------- .../transactions/update/service.pb.go | 50 +++++++++--------- x/metas/transactions/reveal/service.pb.go | 49 +++++++++--------- x/orders/transactions/cancel/service.pb.go | 50 +++++++++--------- x/orders/transactions/define/service.pb.go | 49 +++++++++--------- x/orders/transactions/deputize/service.pb.go | 48 ++++++++--------- x/orders/transactions/get/service.pb.go | 50 +++++++++--------- x/orders/transactions/immediate/service.pb.go | 50 +++++++++--------- x/orders/transactions/make/service.pb.go | 49 +++++++++--------- x/orders/transactions/modify/service.pb.go | 50 +++++++++--------- x/orders/transactions/put/service.pb.go | 50 +++++++++--------- x/orders/transactions/revoke/service.pb.go | 50 +++++++++--------- x/orders/transactions/take/service.pb.go | 49 +++++++++--------- 30 files changed, 767 insertions(+), 720 deletions(-) diff --git a/x/assets/transactions/burn/service.pb.go b/x/assets/transactions/burn/service.pb.go index e6c010ed1..58345f45c 100644 --- a/x/assets/transactions/burn/service.pb.go +++ b/x/assets/transactions/burn/service.pb.go @@ -6,6 +6,7 @@ package burn import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_64d6f26faf8cce14 = []byte{ - // 354 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x07, 0xf0, 0x26, 0x42, 0x87, 0xe0, 0x54, 0x71, 0x89, 0x92, 0xa1, 0x0f, 0x70, 0x07, 0xed, - 0x20, 0x1e, 0x2e, 0x8d, 0x83, 0x3a, 0x04, 0x8a, 0x76, 0x08, 0x12, 0x90, 0x6b, 0x7a, 0xc4, 0x40, - 0x72, 0x57, 0xf2, 0x5d, 0xa4, 0xb3, 0x4f, 0x20, 0xf8, 0x06, 0xba, 0xe9, 0x8b, 0x88, 0x53, 0xc1, - 0xc5, 0x51, 0x12, 0x27, 0x77, 0x77, 0x49, 0xef, 0xc0, 0xeb, 0x78, 0xeb, 0x17, 0x7e, 0xff, 0xfc, - 0xbf, 0x2f, 0xf1, 0x4e, 0x26, 0x00, 0x4c, 0x46, 0x94, 0xcb, 0x82, 0xe1, 0x52, 0x2c, 0xea, 0x82, - 0x01, 0x5e, 0x61, 0xda, 0x4d, 0x01, 0xcb, 0x8a, 0x72, 0xa0, 0xa9, 0xcc, 0x05, 0x07, 0x3c, 0xaf, - 0x2b, 0x8e, 0x81, 0x55, 0x77, 0x79, 0xca, 0xd0, 0xb2, 0x12, 0x52, 0x0c, 0x90, 0xa1, 0x91, 0xd6, - 0x68, 0x85, 0x94, 0x46, 0xa6, 0x46, 0x9d, 0xf6, 0x0f, 0x33, 0x21, 0xb2, 0x82, 0x61, 0xba, 0xcc, - 0x31, 0xe5, 0x5c, 0x48, 0xaa, 0x1e, 0x6e, 0xd2, 0x7c, 0xdb, 0x2e, 0x25, 0x03, 0xa0, 0x99, 0xee, - 0xe2, 0x5f, 0x58, 0x6a, 0x63, 0x72, 0x53, 0x31, 0x58, 0x0a, 0x0e, 0x3a, 0x6a, 0xf4, 0xea, 0x78, - 0x3b, 0x11, 0x64, 0x83, 0x67, 0xc7, 0xeb, 0x9f, 0x53, 0xbe, 0x28, 0xd8, 0xe0, 0xc8, 0x72, 0x55, - 0x14, 0xa9, 0x72, 0xfe, 0xa9, 0x2d, 0x9c, 0xfd, 0x4f, 0x2e, 0x75, 0xad, 0xe1, 0xc1, 0xfd, 0xc7, - 0xf7, 0xa3, 0xbb, 0x3f, 0xdc, 0xc3, 0xa5, 0xda, 0x4f, 0x6f, 0xd5, 0x81, 0xf0, 0xd7, 0x7d, 0x6b, - 0x02, 0x67, 0xdd, 0x04, 0xce, 0x57, 0x13, 0x38, 0x0f, 0x6d, 0xd0, 0x5b, 0xb7, 0x41, 0xef, 0xb3, - 0x0d, 0x7a, 0xde, 0x28, 0x15, 0xa5, 0xe5, 0xfb, 0xc3, 0xdd, 0x2b, 0xf5, 0x89, 0xa7, 0xdd, 0x29, - 0xa6, 0xce, 0xf5, 0x71, 0x96, 0xcb, 0xdb, 0x7a, 0x8e, 0x52, 0x51, 0x62, 0xbb, 0x13, 0x3f, 0xb9, - 0xfd, 0x49, 0x14, 0x4f, 0x66, 0xe1, 0x8b, 0xbb, 0x55, 0x22, 0xd2, 0x25, 0x62, 0x35, 0x05, 0x73, - 0x65, 0x40, 0x61, 0x5d, 0xf1, 0xf7, 0x2d, 0x90, 0x68, 0x90, 0xc4, 0x89, 0x02, 0x89, 0x09, 0x92, - 0x0e, 0x34, 0x2e, 0xb1, 0x03, 0xc9, 0xd9, 0x34, 0x8c, 0x98, 0xa4, 0x0b, 0x2a, 0xe9, 0x8f, 0x3b, - 0x36, 0x30, 0x21, 0x5a, 0x13, 0x12, 0x13, 0x95, 0x0a, 0x84, 0x98, 0x01, 0x84, 0x74, 0x09, 0xf3, - 0xfe, 0xe6, 0x67, 0x19, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x01, 0x3b, 0x12, 0xe9, 0x43, 0x03, - 0x00, 0x00, + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xeb, 0x40, + 0x1c, 0x07, 0xf0, 0x5c, 0x1e, 0xaf, 0x43, 0x78, 0x53, 0x97, 0x07, 0xe1, 0x91, 0xe1, 0x8d, 0x0e, + 0x77, 0xd8, 0x0e, 0xe2, 0xe1, 0xd2, 0x38, 0xa8, 0x43, 0xa0, 0x68, 0x87, 0x20, 0x01, 0xb9, 0xa6, + 0x47, 0x0c, 0x24, 0x77, 0x25, 0xbf, 0x4b, 0xe9, 0xe8, 0xe8, 0xe8, 0xe6, 0xee, 0xe8, 0xe4, 0x9f, + 0x21, 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x77, 0x77, 0x89, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, + 0x0b, 0x9f, 0x6f, 0xbe, 0xf7, 0xcb, 0x05, 0x47, 0x13, 0x00, 0xae, 0x12, 0x26, 0x54, 0xc5, 0x49, + 0x2d, 0x17, 0x6d, 0xc5, 0x81, 0xac, 0x09, 0xeb, 0xa7, 0x40, 0x54, 0xc3, 0x04, 0xb0, 0x5c, 0x95, + 0x52, 0x00, 0x99, 0xb7, 0x8d, 0x20, 0xc0, 0x9b, 0x55, 0x99, 0x73, 0xbc, 0x6c, 0xa4, 0x92, 0x43, + 0x6c, 0x69, 0x6c, 0x34, 0x5e, 0x63, 0xad, 0xb1, 0xad, 0x71, 0xaf, 0xc3, 0xbf, 0xb9, 0x84, 0x5a, + 0x02, 0xa9, 0xa1, 0x20, 0xab, 0xfd, 0xfe, 0xa1, 0x83, 0xc2, 0x7f, 0x85, 0x94, 0x45, 0xc5, 0x09, + 0x5b, 0x96, 0x84, 0x09, 0x21, 0x15, 0xd3, 0x4a, 0xbf, 0x75, 0x2d, 0x59, 0x73, 0x00, 0x56, 0x98, + 0x92, 0xe1, 0x99, 0xa3, 0xb6, 0x26, 0x57, 0x0d, 0x87, 0xa5, 0x14, 0x60, 0xa2, 0x46, 0xf7, 0x28, + 0xf8, 0x95, 0x40, 0x31, 0xbc, 0x45, 0xc1, 0xe0, 0x94, 0x89, 0x45, 0xc5, 0x87, 0x07, 0x8e, 0x3b, + 0xc0, 0x89, 0x2e, 0x17, 0x1e, 0xbb, 0xc2, 0xd9, 0xcf, 0xe4, 0xdc, 0xd4, 0xfa, 0xef, 0x85, 0xbf, + 0x6f, 0xde, 0x9f, 0xf6, 0x50, 0xfc, 0xe9, 0x3f, 0x77, 0x11, 0xda, 0x74, 0x11, 0x7a, 0xeb, 0x22, + 0x74, 0xb7, 0x8d, 0xbc, 0xcd, 0x36, 0xf2, 0x5e, 0xb7, 0x91, 0x17, 0x8c, 0x72, 0x59, 0x3b, 0x7e, + 0x2b, 0xfe, 0x73, 0xa1, 0xff, 0xf3, 0xb4, 0x3f, 0xf6, 0x14, 0x5d, 0x1e, 0x16, 0xa5, 0xba, 0x6e, + 0xe7, 0x38, 0x97, 0x35, 0x71, 0x5b, 0xe7, 0x83, 0x3f, 0x98, 0x24, 0xe9, 0x64, 0x16, 0x3f, 0xfa, + 0x3b, 0x25, 0x12, 0x53, 0x22, 0xd5, 0x53, 0xb0, 0x8f, 0x07, 0x38, 0x6e, 0x1b, 0xf1, 0xb2, 0x03, + 0x32, 0x03, 0xb2, 0x34, 0xd3, 0x20, 0xb3, 0x41, 0xd6, 0x83, 0xce, 0xa7, 0x6e, 0x20, 0x3b, 0x99, + 0xc6, 0x09, 0x57, 0x6c, 0xc1, 0x14, 0xfb, 0xf0, 0xc7, 0x16, 0xa6, 0xd4, 0x68, 0x4a, 0x53, 0xaa, + 0x53, 0x81, 0x52, 0x3b, 0x80, 0xd2, 0x3e, 0x61, 0x3e, 0xf8, 0xbe, 0x18, 0xe3, 0xaf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x86, 0xb8, 0x68, 0xd7, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/define/service.pb.go b/x/assets/transactions/define/service.pb.go index b1ca794e3..48fa1f483 100644 --- a/x/assets/transactions/define/service.pb.go +++ b/x/assets/transactions/define/service.pb.go @@ -6,6 +6,7 @@ package define import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_1e8e48cb5e3393e4 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xc3, 0x40, - 0x18, 0x06, 0xf0, 0x26, 0x85, 0x0e, 0xc1, 0xa9, 0x20, 0x42, 0xd0, 0x0c, 0xfd, 0x00, 0x77, 0xe2, - 0x9f, 0xc1, 0x53, 0x84, 0x96, 0x8a, 0x82, 0x04, 0x8a, 0x76, 0x08, 0x12, 0x90, 0x6b, 0x72, 0xc6, - 0x40, 0x72, 0x57, 0xf2, 0x5e, 0xa5, 0xab, 0x7e, 0x02, 0xc1, 0x6f, 0xe0, 0xa6, 0x9b, 0xdf, 0x42, - 0x9c, 0x0a, 0x2e, 0x8e, 0x92, 0x3a, 0xf9, 0x29, 0xa4, 0xbd, 0x03, 0xaf, 0xe3, 0xad, 0x6f, 0xf8, - 0x3d, 0x3c, 0xef, 0xe5, 0xf5, 0x8e, 0xbb, 0x00, 0x4c, 0x86, 0x94, 0xcb, 0x82, 0xe1, 0x52, 0xa4, - 0x93, 0x82, 0x01, 0x9e, 0x62, 0xba, 0x98, 0x02, 0x96, 0x15, 0xe5, 0x40, 0x13, 0x99, 0x0b, 0x0e, - 0x38, 0x65, 0x37, 0x39, 0x67, 0x18, 0x58, 0x75, 0x97, 0x27, 0x0c, 0x8d, 0x2b, 0x21, 0x45, 0x7b, - 0xdb, 0xf0, 0x48, 0x7b, 0x34, 0x45, 0xca, 0x23, 0xd3, 0x23, 0xe5, 0xfd, 0xcd, 0x4c, 0x88, 0xac, - 0x60, 0x98, 0x8e, 0x73, 0x4c, 0x39, 0x17, 0x92, 0xaa, 0xcf, 0xcb, 0x3c, 0xdf, 0xbe, 0x4f, 0xc9, - 0x00, 0x68, 0xa6, 0xfb, 0xf8, 0xe7, 0xd6, 0xde, 0x98, 0x5d, 0x57, 0x0c, 0xc6, 0x82, 0x83, 0x0e, - 0xdb, 0x79, 0x73, 0xbc, 0x66, 0x08, 0x59, 0xfb, 0xc5, 0xf1, 0x5a, 0x67, 0x94, 0xa7, 0x05, 0x6b, - 0x1f, 0x20, 0xdb, 0x85, 0x51, 0xa8, 0x0a, 0xfa, 0x27, 0xf6, 0x74, 0xf8, 0x3f, 0xbb, 0xd0, 0xd5, - 0x3a, 0x5b, 0x0f, 0x9f, 0x3f, 0x4f, 0xee, 0x46, 0x67, 0x1d, 0x97, 0x6a, 0x4b, 0xbd, 0x9b, 0x22, - 0xbd, 0xfb, 0xe6, 0x7b, 0x1d, 0x38, 0xb3, 0x3a, 0x70, 0xbe, 0xeb, 0xc0, 0x79, 0x9c, 0x07, 0x8d, - 0xd9, 0x3c, 0x68, 0x7c, 0xcd, 0x83, 0x86, 0xb7, 0x97, 0x88, 0xd2, 0xba, 0x43, 0x6f, 0xed, 0x52, - 0xfd, 0xf0, 0xc1, 0xe2, 0x49, 0x06, 0xce, 0xd5, 0x61, 0x96, 0xcb, 0xdb, 0xc9, 0x08, 0x25, 0xa2, - 0xc4, 0xb6, 0x8f, 0xfd, 0xec, 0xb6, 0xba, 0x61, 0xd4, 0x1d, 0xf6, 0x5f, 0xdd, 0x95, 0xc3, 0x09, - 0x75, 0x91, 0x48, 0xd5, 0x03, 0x73, 0x71, 0x40, 0xfd, 0xa5, 0xfd, 0x58, 0x21, 0xb1, 0x26, 0x71, - 0x14, 0x2b, 0x12, 0x9b, 0x24, 0x56, 0xa4, 0x76, 0x8f, 0x6c, 0x49, 0x7c, 0x3a, 0xe8, 0x85, 0x4c, - 0xd2, 0x94, 0x4a, 0xfa, 0xeb, 0xee, 0x1b, 0x9c, 0x10, 0xed, 0x09, 0x89, 0x08, 0x51, 0x09, 0x84, - 0x98, 0x11, 0x84, 0xa8, 0x8c, 0x51, 0x6b, 0x79, 0x3e, 0xbb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0xea, 0xc0, 0xb9, 0x27, 0x5d, 0x03, 0x00, 0x00, + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0x83, 0xa3, 0xc3, + 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x2a, 0x0a, 0x12, 0x28, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, + 0x19, 0x03, 0xc9, 0x5d, 0xc9, 0x73, 0x2d, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, + 0x10, 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, + 0x84, 0xcf, 0x37, 0xdf, 0xbb, 0x3c, 0xfe, 0x71, 0x17, 0x80, 0xc9, 0x88, 0x72, 0x59, 0x32, 0x5c, + 0x89, 0x6c, 0x52, 0x32, 0xc0, 0x33, 0x4c, 0x97, 0x53, 0xc0, 0xb2, 0xa6, 0x1c, 0x68, 0x2a, 0x0b, + 0xc1, 0x01, 0x67, 0xec, 0xa6, 0xe0, 0x0c, 0x03, 0xab, 0xa7, 0x45, 0xca, 0xd0, 0xb8, 0x16, 0x52, + 0x74, 0xb6, 0x0c, 0x8f, 0xb4, 0x47, 0x33, 0xa4, 0x3c, 0x32, 0x3d, 0x52, 0x3e, 0xf8, 0x97, 0x0a, + 0xa8, 0x04, 0xe0, 0x0a, 0x72, 0x3c, 0xdd, 0x5e, 0x3e, 0x54, 0x54, 0xf0, 0x3f, 0x17, 0x22, 0x2f, + 0x19, 0xa6, 0xe3, 0x02, 0x53, 0xce, 0x85, 0xa4, 0xca, 0xa9, 0xb7, 0xf6, 0x45, 0x2b, 0x06, 0x40, + 0x73, 0x5d, 0x34, 0x38, 0xb7, 0xf6, 0xc6, 0xec, 0xba, 0x66, 0x30, 0x16, 0x1c, 0x74, 0xd8, 0xce, + 0x93, 0xeb, 0xb7, 0x22, 0xc8, 0x3b, 0x0f, 0xae, 0xdf, 0x3e, 0xa3, 0x3c, 0x2b, 0x59, 0xe7, 0x00, + 0xd9, 0xde, 0x04, 0x8a, 0x54, 0xc1, 0xe0, 0xc4, 0x9e, 0x0e, 0x7f, 0x67, 0x17, 0xba, 0xda, 0x86, + 0x13, 0xfc, 0xb9, 0xfb, 0x7a, 0xdd, 0x74, 0x7b, 0xf7, 0xad, 0xb7, 0x26, 0x74, 0xe7, 0x4d, 0xe8, + 0x7e, 0x36, 0xa1, 0xfb, 0xb8, 0x08, 0x9d, 0xf9, 0x22, 0x74, 0x3e, 0x16, 0xa1, 0xe3, 0xef, 0xa5, + 0xa2, 0xb2, 0xfe, 0x5a, 0xef, 0xef, 0xa5, 0xfa, 0xe7, 0x83, 0xe5, 0xe1, 0x07, 0xee, 0xd5, 0x61, + 0x5e, 0xc8, 0xdb, 0xc9, 0x08, 0xa5, 0xa2, 0xc2, 0xb6, 0xd7, 0xfa, 0xec, 0xb5, 0xbb, 0x51, 0xdc, + 0x1d, 0xf6, 0x5f, 0xbc, 0xb5, 0xdd, 0x89, 0x74, 0x91, 0x58, 0xd5, 0x03, 0xf3, 0x88, 0x80, 0xfa, + 0x2b, 0xfb, 0xbe, 0x46, 0x12, 0x4d, 0x92, 0x38, 0x51, 0x24, 0x31, 0x49, 0xa2, 0x48, 0xe3, 0x1d, + 0xd9, 0x92, 0xe4, 0x74, 0xd0, 0x8b, 0x98, 0xa4, 0x19, 0x95, 0xf4, 0xdb, 0xdb, 0x37, 0x38, 0x21, + 0xda, 0x13, 0x12, 0x13, 0xa2, 0x12, 0x08, 0x31, 0x23, 0x08, 0x51, 0x19, 0xa3, 0xf6, 0x6a, 0x51, + 0x76, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x6e, 0x18, 0xb9, 0x60, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/deputize/service.pb.go b/x/assets/transactions/deputize/service.pb.go index 87033b529..1418e4548 100644 --- a/x/assets/transactions/deputize/service.pb.go +++ b/x/assets/transactions/deputize/service.pb.go @@ -6,6 +6,7 @@ package deputize import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_da0b5d193ea2455f = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xc1, 0x4a, 0xeb, 0x40, - 0x14, 0x86, 0x9b, 0x14, 0xba, 0x08, 0x77, 0xd5, 0xcd, 0xe5, 0x86, 0x4b, 0x2e, 0xf4, 0x01, 0x66, - 0xa0, 0x17, 0x14, 0x46, 0x14, 0x5b, 0x0a, 0x75, 0x13, 0x28, 0xda, 0x45, 0x90, 0x80, 0x4c, 0x93, - 0x21, 0x06, 0x92, 0x99, 0x90, 0x33, 0x95, 0xe2, 0xd2, 0xbd, 0x20, 0xf8, 0x06, 0x2e, 0xdd, 0xb8, - 0xf4, 0x15, 0xc4, 0x55, 0xc1, 0x8d, 0x4b, 0x49, 0x5d, 0xf9, 0x14, 0xd2, 0xce, 0x04, 0xa7, 0xcb, - 0x66, 0x7b, 0x98, 0xef, 0xe3, 0xff, 0xcf, 0x1c, 0xe7, 0x78, 0x00, 0xc0, 0xa4, 0x4f, 0xb9, 0xcc, - 0x18, 0xce, 0x45, 0x3c, 0xcf, 0x18, 0xe0, 0x05, 0xa6, 0xeb, 0x29, 0x60, 0x59, 0x52, 0x0e, 0x34, - 0x92, 0xa9, 0xe0, 0x80, 0x63, 0x56, 0xcc, 0x65, 0x7a, 0xcd, 0x30, 0xb0, 0xf2, 0x2a, 0x8d, 0x18, - 0x2a, 0x4a, 0x21, 0x45, 0xb7, 0x6f, 0x18, 0x90, 0x36, 0xa0, 0x05, 0x52, 0x06, 0x64, 0x1a, 0x50, - 0x6d, 0x70, 0xff, 0x26, 0x42, 0x24, 0x19, 0xc3, 0xb4, 0x48, 0x31, 0xe5, 0x5c, 0x48, 0xaa, 0x1e, - 0x6c, 0x8c, 0x6e, 0x93, 0x4c, 0x39, 0x03, 0xa0, 0x89, 0xce, 0xe4, 0xfa, 0x0d, 0x0c, 0xc6, 0xf4, - 0xa2, 0x64, 0x50, 0x08, 0x0e, 0x5a, 0xd7, 0x7f, 0xb6, 0x9c, 0xb6, 0x0f, 0x49, 0xf7, 0xc9, 0x72, - 0x3a, 0x27, 0x94, 0xc7, 0x19, 0xeb, 0x1e, 0xa0, 0xdd, 0x6b, 0x23, 0x5f, 0x85, 0x74, 0xc7, 0x4d, - 0xe0, 0xe9, 0xcf, 0xf4, 0x54, 0xc7, 0xeb, 0xfd, 0xbb, 0x79, 0xfb, 0xbc, 0xb7, 0xff, 0xf4, 0x7e, - 0xe3, 0x5c, 0x75, 0xd5, 0x0d, 0x6b, 0x68, 0x78, 0xdb, 0x7e, 0xa9, 0x3c, 0x6b, 0x59, 0x79, 0xd6, - 0x47, 0xe5, 0x59, 0x77, 0x2b, 0xaf, 0xb5, 0x5c, 0x79, 0xad, 0xf7, 0x95, 0xd7, 0x72, 0xf6, 0x22, - 0x91, 0x37, 0xc8, 0x31, 0xfc, 0x75, 0xa6, 0xbe, 0x7f, 0xb2, 0x5e, 0xcd, 0xc4, 0x3a, 0x3f, 0x4c, - 0x52, 0x79, 0x39, 0x9f, 0xa1, 0x48, 0xe4, 0x78, 0xf7, 0xb5, 0x3f, 0xd8, 0x9d, 0x81, 0x1f, 0x0c, - 0xa6, 0xa3, 0x47, 0x7b, 0xeb, 0x90, 0x7c, 0x1d, 0x26, 0x50, 0x11, 0xc1, 0xac, 0x0f, 0x68, 0xa4, - 0xe9, 0xd7, 0x2d, 0x28, 0xd4, 0x50, 0x18, 0x84, 0x0a, 0x0a, 0x4d, 0x28, 0xac, 0xa1, 0xca, 0x3e, - 0xda, 0x1d, 0x0a, 0xc7, 0x93, 0xa1, 0xcf, 0x24, 0x8d, 0xa9, 0xa4, 0x5f, 0xf6, 0xbe, 0x21, 0x20, - 0x44, 0x1b, 0x08, 0x09, 0x08, 0x51, 0x0e, 0x42, 0x4c, 0x09, 0x21, 0xb5, 0x65, 0xd6, 0xd9, 0x1c, - 0xd4, 0xff, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x4c, 0xcf, 0xe6, 0xfa, 0x77, 0x03, 0x00, 0x00, + // 372 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0xc7, 0x93, 0x94, 0xb7, 0x43, 0x78, 0xa7, 0x2e, 0x2f, 0x84, 0x97, 0x0c, 0x8e, 0x0e, 0x77, + 0x58, 0x41, 0xe1, 0x44, 0xb1, 0xa5, 0x50, 0x97, 0x40, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8e, + 0x18, 0x48, 0xee, 0x42, 0x9e, 0x6b, 0x29, 0x4e, 0x7e, 0x01, 0xa1, 0xdf, 0x40, 0x70, 0x74, 0xf2, + 0x63, 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x4f, 0x21, 0xf5, 0xae, 0x78, 0x1d, 0x9b, 0x29, + 0xf0, 0x84, 0xdf, 0xef, 0xfe, 0xf7, 0xbf, 0xc7, 0x3d, 0xef, 0x01, 0x30, 0x19, 0x50, 0x2e, 0x73, + 0x86, 0x0b, 0x91, 0x4c, 0x73, 0x06, 0x78, 0x8e, 0xe9, 0x7a, 0x0a, 0x58, 0x56, 0x94, 0x03, 0x8d, + 0x65, 0x26, 0x38, 0xe0, 0x84, 0x95, 0x53, 0x99, 0xdd, 0x31, 0x0c, 0xac, 0x9a, 0x65, 0x31, 0x43, + 0x65, 0x25, 0xa4, 0xe8, 0x74, 0x0d, 0x03, 0xd2, 0x06, 0x34, 0x47, 0xca, 0x80, 0x4c, 0x03, 0xda, + 0x18, 0xbc, 0x7f, 0xb1, 0x80, 0x42, 0x00, 0x2e, 0x20, 0xc5, 0xb3, 0x83, 0xf5, 0x47, 0xc9, 0xbc, + 0xff, 0xa9, 0x10, 0x69, 0xce, 0x30, 0x2d, 0x33, 0x4c, 0x39, 0x17, 0x92, 0x2a, 0x52, 0xfd, 0x6d, + 0x12, 0xb6, 0x60, 0x00, 0x34, 0xd5, 0x61, 0xbd, 0xa0, 0x81, 0xc1, 0x98, 0xde, 0x54, 0x0c, 0x4a, + 0xc1, 0x41, 0xeb, 0xba, 0x8f, 0xb6, 0xdb, 0x0a, 0x20, 0xed, 0x2c, 0x6c, 0xb7, 0x7d, 0x41, 0x79, + 0x92, 0xb3, 0xce, 0x09, 0xda, 0xbd, 0x0f, 0x14, 0xa8, 0x90, 0xde, 0xb0, 0x09, 0x3c, 0xfe, 0x9d, + 0x5e, 0xea, 0x78, 0x7b, 0x96, 0xf7, 0xe7, 0xfe, 0xf3, 0x65, 0xdf, 0xee, 0x3f, 0xb4, 0x5e, 0x6b, + 0xdf, 0x5e, 0xd6, 0xbe, 0xfd, 0x51, 0xfb, 0xf6, 0x62, 0xe5, 0x5b, 0xcb, 0x95, 0x6f, 0xbd, 0xaf, + 0x7c, 0xcb, 0x3d, 0x8a, 0x45, 0xd1, 0xe0, 0xbc, 0xfe, 0xdf, 0x2b, 0xf5, 0xfe, 0xa3, 0x75, 0x05, + 0x23, 0xfb, 0xfa, 0x34, 0xcd, 0xe4, 0xed, 0x74, 0x82, 0x62, 0x51, 0xe0, 0xdd, 0xeb, 0x7d, 0x72, + 0xda, 0xbd, 0x20, 0xec, 0x8d, 0x07, 0xcf, 0xce, 0xd6, 0x26, 0x05, 0x3a, 0x4c, 0xa8, 0x22, 0x82, + 0x79, 0x4d, 0x40, 0x03, 0x4d, 0xbf, 0x6d, 0x41, 0x91, 0x86, 0xa2, 0x30, 0x52, 0x50, 0x64, 0x42, + 0xd1, 0x06, 0xaa, 0x9d, 0xb3, 0xdd, 0xa1, 0x68, 0x38, 0xea, 0x07, 0x4c, 0xd2, 0x84, 0x4a, 0xfa, + 0xe5, 0x1c, 0x1b, 0x02, 0x42, 0xb4, 0x81, 0x90, 0x90, 0x10, 0xe5, 0x20, 0xc4, 0x94, 0x10, 0xb2, + 0xb1, 0x4c, 0xda, 0x3f, 0x8b, 0x73, 0xf8, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x57, 0xe6, 0x4e, + 0x78, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/mint/service.pb.go b/x/assets/transactions/mint/service.pb.go index b9fcbd87c..ad55ef26b 100644 --- a/x/assets/transactions/mint/service.pb.go +++ b/x/assets/transactions/mint/service.pb.go @@ -6,6 +6,7 @@ package mint import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_eea46adca244dcb0 = []byte{ - // 353 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x07, 0xf0, 0x26, 0x42, 0x87, 0xe0, 0x54, 0x71, 0x89, 0x92, 0xa1, 0x0f, 0x70, 0x07, 0xed, - 0x20, 0x1e, 0x2e, 0xad, 0x83, 0x3a, 0x1c, 0x14, 0xed, 0x10, 0x24, 0x20, 0xd7, 0xf4, 0x88, 0x81, - 0xe4, 0xae, 0xe4, 0xbb, 0x4a, 0x67, 0x9f, 0x40, 0xf0, 0x0d, 0x74, 0xd3, 0x17, 0x11, 0xa7, 0x82, - 0x8b, 0xa3, 0x24, 0x4e, 0xee, 0xee, 0x92, 0xde, 0x81, 0xd7, 0xf1, 0xd6, 0x2f, 0xfc, 0xfe, 0xf9, - 0x7f, 0x5f, 0x12, 0x9c, 0x8c, 0x00, 0xb8, 0xa2, 0x4c, 0xa8, 0x82, 0xe3, 0x52, 0xce, 0x97, 0x05, - 0x07, 0xbc, 0xc2, 0xac, 0x9d, 0x02, 0x56, 0x15, 0x13, 0xc0, 0x52, 0x95, 0x4b, 0x01, 0xb8, 0xcc, - 0x85, 0xc2, 0xc0, 0xab, 0xbb, 0x3c, 0xe5, 0x68, 0x51, 0x49, 0x25, 0x7b, 0xc8, 0xd2, 0xc8, 0x68, - 0xb4, 0x42, 0x5a, 0x23, 0x5b, 0xa3, 0x56, 0x87, 0x87, 0x99, 0x94, 0x59, 0xc1, 0x31, 0x5b, 0xe4, - 0x98, 0x09, 0x21, 0x15, 0xd3, 0x0f, 0x37, 0x69, 0xa1, 0x6b, 0x97, 0x92, 0x03, 0xb0, 0xcc, 0x74, - 0x09, 0x2f, 0x1c, 0xb5, 0x35, 0xb9, 0xa9, 0x38, 0x2c, 0xa4, 0x00, 0x13, 0x35, 0x78, 0xf5, 0x82, - 0x1d, 0x0a, 0x59, 0xef, 0xd9, 0x0b, 0xba, 0xe7, 0x4c, 0xcc, 0x0b, 0xde, 0x3b, 0x72, 0x5c, 0x15, - 0x51, 0x5d, 0x2e, 0x3c, 0x75, 0x85, 0xd3, 0xff, 0xc9, 0xa5, 0xa9, 0xd5, 0x3f, 0xb8, 0xff, 0xf8, - 0x7e, 0xf4, 0xf7, 0xfb, 0x7b, 0xb8, 0xd4, 0xfb, 0x99, 0xad, 0x5a, 0x30, 0xfe, 0xf5, 0xdf, 0xea, - 0xc8, 0x5b, 0xd7, 0x91, 0xf7, 0x55, 0x47, 0xde, 0x43, 0x13, 0x75, 0xd6, 0x4d, 0xd4, 0xf9, 0x6c, - 0xa2, 0x4e, 0x30, 0x48, 0x65, 0xe9, 0xf8, 0xfe, 0xf1, 0xee, 0x95, 0xfe, 0xc4, 0x93, 0xf6, 0x14, - 0x13, 0xef, 0xfa, 0x38, 0xcb, 0xd5, 0xed, 0x72, 0x86, 0x52, 0x59, 0x62, 0xb7, 0x13, 0x3f, 0xf9, - 0xdd, 0x11, 0x8d, 0x47, 0x53, 0xfa, 0xe2, 0x6f, 0x95, 0xa0, 0xa6, 0x44, 0xac, 0xa7, 0x60, 0xaf, - 0x0c, 0x88, 0xe6, 0x42, 0xbd, 0x6f, 0x81, 0xc4, 0x80, 0x24, 0x4e, 0x34, 0x48, 0x6c, 0x90, 0xb4, - 0xa0, 0xf6, 0x89, 0x1b, 0x48, 0xce, 0x26, 0x63, 0xca, 0x15, 0x9b, 0x33, 0xc5, 0x7e, 0xfc, 0xa1, - 0x85, 0x09, 0x31, 0x9a, 0x90, 0x98, 0xe8, 0x54, 0x20, 0xc4, 0x0e, 0x20, 0xa4, 0x4d, 0x98, 0x75, - 0x37, 0x3f, 0xcb, 0xf0, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x21, 0x69, 0xe7, 0x43, 0x03, 0x00, - 0x00, + // 362 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xeb, 0x40, + 0x1c, 0x07, 0xf0, 0x24, 0x8f, 0xd7, 0x21, 0xbc, 0xa9, 0xcb, 0x83, 0xf0, 0xc8, 0xf0, 0x46, 0x87, + 0x3b, 0x6c, 0x07, 0xf1, 0x70, 0x69, 0x1d, 0xd4, 0xe1, 0xa0, 0x68, 0x87, 0x20, 0x01, 0xb9, 0xa6, + 0x47, 0x0c, 0xe4, 0xee, 0x4a, 0x7e, 0xd7, 0xd2, 0xd1, 0xd1, 0xd1, 0xcd, 0xdd, 0xd1, 0xc9, 0x3f, + 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xee, 0xee, 0x12, 0xef, 0xc0, 0xeb, 0x78, 0x53, 0xe0, + 0x17, 0x3e, 0xdf, 0x7c, 0xef, 0x97, 0x8b, 0x8f, 0x46, 0x00, 0x5c, 0x53, 0x26, 0x75, 0xcd, 0xb1, + 0x50, 0xf3, 0x65, 0xcd, 0x01, 0xaf, 0x31, 0xeb, 0xa6, 0x80, 0x75, 0xc3, 0x24, 0xb0, 0x42, 0x57, + 0x4a, 0x02, 0x16, 0x95, 0xd4, 0x18, 0x78, 0xb3, 0xaa, 0x0a, 0x8e, 0x16, 0x8d, 0xd2, 0xaa, 0x8f, + 0x1c, 0x8d, 0xac, 0x46, 0x6b, 0x64, 0x34, 0x72, 0x35, 0xea, 0x74, 0xf2, 0xb7, 0x50, 0x20, 0x14, + 0x60, 0x01, 0x25, 0x5e, 0xed, 0x77, 0x0f, 0x13, 0x94, 0xfc, 0x2b, 0x95, 0x2a, 0x6b, 0x8e, 0xd9, + 0xa2, 0xc2, 0x4c, 0x4a, 0xa5, 0x99, 0x51, 0xe6, 0xad, 0x6f, 0x49, 0xc1, 0x01, 0x58, 0x69, 0x4b, + 0x26, 0x67, 0x9e, 0xda, 0x99, 0x5c, 0x35, 0x1c, 0x16, 0x4a, 0x82, 0x8d, 0x1a, 0xdc, 0x87, 0xf1, + 0x2f, 0x0a, 0x65, 0xff, 0x36, 0x8c, 0x7b, 0xa7, 0x4c, 0xce, 0x6b, 0xde, 0x3f, 0xf0, 0xdc, 0x01, + 0xa2, 0xa6, 0x5c, 0x72, 0xec, 0x0b, 0xa7, 0x3f, 0x93, 0x73, 0x5b, 0xeb, 0x7f, 0x90, 0xfc, 0xbe, + 0x79, 0x7f, 0xda, 0x0b, 0xc7, 0x9f, 0xd1, 0x73, 0x9b, 0x86, 0x9b, 0x36, 0x0d, 0xdf, 0xda, 0x34, + 0xbc, 0xdb, 0xa6, 0xc1, 0x66, 0x9b, 0x06, 0xaf, 0xdb, 0x34, 0x88, 0x07, 0x85, 0x12, 0x9e, 0xdf, + 0x1a, 0xff, 0xb9, 0x30, 0xff, 0x79, 0xd2, 0x1d, 0x7b, 0x12, 0x5e, 0x1e, 0x96, 0x95, 0xbe, 0x5e, + 0xce, 0x50, 0xa1, 0x04, 0xf6, 0x5b, 0xe7, 0x43, 0xd4, 0x1b, 0xd1, 0x6c, 0x34, 0xa5, 0x8f, 0xd1, + 0x4e, 0x09, 0x6a, 0x4b, 0x64, 0x66, 0x0a, 0xee, 0xf1, 0x00, 0xd1, 0x4a, 0xea, 0x97, 0x1d, 0x90, + 0x5b, 0x90, 0x67, 0xb9, 0x01, 0xb9, 0x0b, 0xf2, 0x0e, 0xb4, 0x11, 0xf1, 0x03, 0xf9, 0xc9, 0x64, + 0x4c, 0xb9, 0x66, 0x73, 0xa6, 0xd9, 0x47, 0x34, 0x74, 0x30, 0x21, 0x56, 0x13, 0x92, 0x11, 0x93, + 0x0a, 0x84, 0xb8, 0x01, 0x84, 0x74, 0x09, 0xb3, 0xde, 0xf7, 0xc5, 0x18, 0x7e, 0x05, 0x00, 0x00, + 0xff, 0xff, 0xfe, 0x34, 0xc7, 0x2f, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/mutate/service.pb.go b/x/assets/transactions/mutate/service.pb.go index db5cfd106..0ef727630 100644 --- a/x/assets/transactions/mutate/service.pb.go +++ b/x/assets/transactions/mutate/service.pb.go @@ -6,6 +6,7 @@ package mutate import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_0cec9114e6ce7c03 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xcf, 0x4a, 0xeb, 0x40, - 0x14, 0x06, 0xf0, 0x26, 0x85, 0x2e, 0xc2, 0x5d, 0x15, 0x2e, 0x42, 0xd0, 0x2c, 0xfa, 0x00, 0x33, - 0xe2, 0x9f, 0x85, 0xa3, 0x08, 0x2d, 0x88, 0x82, 0x0c, 0x14, 0xed, 0x22, 0x48, 0x40, 0xa6, 0xe9, - 0x10, 0x03, 0xc9, 0x4c, 0xc9, 0x99, 0x4a, 0xb7, 0xfa, 0x04, 0x82, 0x6f, 0xe0, 0x4e, 0x77, 0xbe, - 0x85, 0xb8, 0x2a, 0xb8, 0x71, 0x29, 0xa9, 0x2b, 0x9f, 0x42, 0x9a, 0x19, 0x70, 0xba, 0x9c, 0xed, - 0x09, 0xbf, 0x8f, 0xef, 0x4c, 0x4e, 0x70, 0xdc, 0x07, 0xe0, 0x8a, 0x32, 0xa1, 0x0a, 0x8e, 0x4b, - 0x39, 0x99, 0x15, 0x1c, 0xf0, 0x1c, 0xb3, 0xd5, 0x14, 0xb0, 0xaa, 0x98, 0x00, 0x96, 0xaa, 0x5c, - 0x0a, 0xc0, 0xe5, 0x4c, 0x31, 0xc5, 0x31, 0xf0, 0xea, 0x36, 0x4f, 0x39, 0x9a, 0x56, 0x52, 0xc9, - 0xee, 0xb6, 0xe5, 0x91, 0xf1, 0x68, 0x8e, 0xb4, 0x47, 0xb6, 0x47, 0xda, 0x87, 0x9b, 0x99, 0x94, - 0x59, 0xc1, 0x31, 0x9b, 0xe6, 0x98, 0x09, 0x21, 0x15, 0xd3, 0x9f, 0x9b, 0xbc, 0xd0, 0xbd, 0x4f, - 0xc9, 0x01, 0x58, 0x66, 0xfa, 0x84, 0xe7, 0xce, 0xde, 0x9a, 0x5d, 0x57, 0x1c, 0xa6, 0x52, 0x80, - 0x09, 0xdb, 0x79, 0xf5, 0x82, 0x36, 0x85, 0xac, 0xfb, 0xec, 0x05, 0x9d, 0x33, 0x26, 0x26, 0x05, - 0xef, 0x1e, 0x20, 0xd7, 0x85, 0x11, 0xd5, 0x05, 0xc3, 0x13, 0x77, 0x3a, 0xfa, 0x9b, 0x5d, 0x98, - 0x6a, 0xbd, 0xad, 0xfb, 0x8f, 0xef, 0x47, 0x7f, 0xa3, 0xf7, 0x1f, 0x97, 0x7a, 0x4b, 0xb3, 0x9b, - 0x26, 0x83, 0xbb, 0xf6, 0x5b, 0x1d, 0x79, 0x8b, 0x3a, 0xf2, 0xbe, 0xea, 0xc8, 0x7b, 0x58, 0x46, - 0xad, 0xc5, 0x32, 0x6a, 0x7d, 0x2e, 0xa3, 0x56, 0xb0, 0x97, 0xca, 0xd2, 0xb9, 0xc3, 0xe0, 0xdf, - 0xa5, 0xfe, 0xe1, 0xc3, 0xd5, 0x93, 0x0c, 0xbd, 0xab, 0xc3, 0x2c, 0x57, 0x37, 0xb3, 0x31, 0x4a, - 0x65, 0x89, 0x5d, 0x1f, 0xfb, 0xc9, 0xef, 0xf4, 0x69, 0xdc, 0x1f, 0xd1, 0x17, 0x7f, 0xed, 0x70, - 0xa8, 0x29, 0x12, 0xeb, 0x7a, 0x60, 0x2f, 0x0e, 0x88, 0x36, 0xf6, 0x7d, 0x8d, 0x24, 0x86, 0x24, - 0x71, 0xa2, 0x49, 0x62, 0x93, 0x44, 0x93, 0xda, 0x3f, 0x72, 0x25, 0xc9, 0xe9, 0x70, 0x40, 0xb9, - 0x62, 0x13, 0xa6, 0xd8, 0x8f, 0xbf, 0x6f, 0x71, 0x42, 0x8c, 0x27, 0x24, 0x26, 0x44, 0x27, 0x10, - 0x62, 0x47, 0x10, 0xa2, 0x33, 0xc6, 0x9d, 0xe6, 0x7c, 0x76, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, - 0x80, 0x6e, 0xa3, 0xb9, 0x5d, 0x03, 0x00, 0x00, + // 365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xd7, 0x21, 0xfc, 0xa6, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, + 0xfe, 0x1d, 0x3c, 0x45, 0x68, 0x41, 0x14, 0xe4, 0xa0, 0x68, 0x87, 0x20, 0x01, 0xb9, 0xa6, 0x47, + 0x0c, 0x24, 0x77, 0x25, 0xcf, 0xb5, 0x74, 0xd4, 0xdd, 0xc1, 0xdd, 0xcd, 0xd1, 0xc9, 0x97, 0x21, + 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x5f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, 0x84, + 0xcf, 0x37, 0xdf, 0xbb, 0x3c, 0xe1, 0x69, 0x17, 0x80, 0x2b, 0xca, 0x84, 0x2a, 0x39, 0xae, 0xe4, + 0x68, 0x52, 0x72, 0xc0, 0x33, 0xcc, 0x96, 0x53, 0xc0, 0xaa, 0x66, 0x02, 0x58, 0xa6, 0x0a, 0x29, + 0x00, 0x57, 0x13, 0xc5, 0x14, 0xc7, 0xc0, 0xeb, 0x69, 0x91, 0x71, 0x34, 0xae, 0xa5, 0x92, 0x9d, + 0x1d, 0xcb, 0x23, 0xe3, 0xd1, 0x0c, 0x69, 0x8f, 0x6c, 0x8f, 0xb4, 0x8f, 0x36, 0x32, 0x09, 0x95, + 0x04, 0x5c, 0x41, 0x8e, 0xa7, 0xbb, 0xcb, 0x87, 0x8e, 0x8a, 0x36, 0x73, 0x29, 0xf3, 0x92, 0x63, + 0x36, 0x2e, 0x30, 0x13, 0x42, 0x2a, 0xa6, 0x9d, 0x7e, 0xeb, 0x5e, 0xb4, 0xe2, 0x00, 0x2c, 0x37, + 0x45, 0xa3, 0x4b, 0x67, 0x6f, 0xcd, 0x6e, 0x6b, 0x0e, 0x63, 0x29, 0xc0, 0x84, 0xed, 0x3d, 0xfb, + 0x61, 0x8b, 0x42, 0xde, 0x79, 0xf4, 0xc3, 0xf6, 0x05, 0x13, 0xa3, 0x92, 0x77, 0x8e, 0x90, 0xeb, + 0x4d, 0x20, 0xaa, 0x0b, 0x46, 0x67, 0xee, 0x74, 0xf0, 0x37, 0xbb, 0x32, 0xd5, 0xb6, 0xbc, 0xe8, + 0xdf, 0xfd, 0xf7, 0xdb, 0xb6, 0xdf, 0x7b, 0x68, 0xbd, 0x37, 0xb1, 0x3f, 0x6f, 0x62, 0xff, 0xab, + 0x89, 0xfd, 0xa7, 0x45, 0xec, 0xcd, 0x17, 0xb1, 0xf7, 0xb9, 0x88, 0xbd, 0xf0, 0x20, 0x93, 0x95, + 0xf3, 0xd7, 0x7a, 0xff, 0xaf, 0xf5, 0x3f, 0xef, 0x2f, 0x0f, 0xdf, 0xf7, 0x6f, 0x8e, 0xf3, 0x42, + 0xdd, 0x4d, 0x86, 0x28, 0x93, 0x15, 0x76, 0xbd, 0xd6, 0x97, 0xa0, 0xdd, 0xa5, 0x49, 0x77, 0x40, + 0x5f, 0x83, 0xb5, 0xdd, 0xa1, 0xa6, 0x48, 0xa2, 0xeb, 0x81, 0x7d, 0x44, 0x40, 0x74, 0x65, 0x3f, + 0xd6, 0x48, 0x6a, 0x48, 0x9a, 0xa4, 0x9a, 0xa4, 0x36, 0x49, 0x35, 0x69, 0x82, 0x13, 0x57, 0x92, + 0x9e, 0xf7, 0x7b, 0x94, 0x2b, 0x36, 0x62, 0x8a, 0xfd, 0x04, 0x87, 0x16, 0x27, 0xc4, 0x78, 0x42, + 0x12, 0x42, 0x74, 0x02, 0x21, 0x76, 0x04, 0x21, 0x3a, 0x63, 0xd8, 0x5e, 0x2d, 0xca, 0xfe, 0x6f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xab, 0x85, 0x7f, 0x7c, 0x60, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/renumerate/service.pb.go b/x/assets/transactions/renumerate/service.pb.go index 0b30a071b..b7cfe3de7 100644 --- a/x/assets/transactions/renumerate/service.pb.go +++ b/x/assets/transactions/renumerate/service.pb.go @@ -6,6 +6,7 @@ package renumerate import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_88dc66d07d98c2a7 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x84, 0x6f, 0xea, 0xf6, 0x45, 0x09, 0xd8, 0x1f, 0x70, 0x07, 0xea, - 0xa0, 0x07, 0xa2, 0xcd, 0xa2, 0x0e, 0xc1, 0x52, 0x3b, 0x04, 0x09, 0xc8, 0x35, 0x3d, 0x62, 0x20, - 0xb9, 0x2b, 0x79, 0xaf, 0xd2, 0xd9, 0x5f, 0x20, 0x38, 0xb9, 0x3a, 0xba, 0x3b, 0xba, 0x8b, 0x53, - 0xc1, 0xc5, 0x51, 0x52, 0x27, 0x7f, 0x85, 0xb4, 0x77, 0x98, 0xeb, 0x7a, 0xeb, 0x4b, 0x9e, 0x87, - 0xe7, 0xbd, 0xbc, 0x5e, 0xd8, 0x07, 0x60, 0x32, 0xa2, 0x5c, 0x16, 0x0c, 0x97, 0x62, 0x32, 0x2b, - 0x18, 0xe0, 0x39, 0xa6, 0xab, 0x29, 0x60, 0x59, 0x51, 0x0e, 0x34, 0x95, 0xb9, 0xe0, 0x80, 0x2b, - 0xc6, 0x67, 0x25, 0xab, 0xa8, 0x64, 0x18, 0x58, 0x75, 0x9b, 0xa7, 0x0c, 0x4d, 0x2b, 0x21, 0x45, - 0x77, 0xdf, 0x70, 0x20, 0xed, 0x40, 0x73, 0xa4, 0x1c, 0xc8, 0x74, 0xa0, 0xc6, 0xe1, 0x6f, 0x67, - 0x42, 0x64, 0x05, 0xc3, 0x74, 0x9a, 0x63, 0xca, 0xb9, 0x90, 0x54, 0x7d, 0xb2, 0x76, 0xfa, 0x76, - 0x5d, 0x25, 0x03, 0xa0, 0x99, 0xee, 0xf2, 0x2f, 0xac, 0x1c, 0xc6, 0xfc, 0xba, 0x62, 0x30, 0x15, - 0x1c, 0xb4, 0x70, 0xf7, 0xd5, 0xf1, 0xda, 0x11, 0x64, 0xdd, 0x17, 0xc7, 0xeb, 0x9c, 0x51, 0x3e, - 0x29, 0x58, 0xf7, 0x08, 0xd9, 0x2c, 0x8f, 0x22, 0x15, 0xea, 0x9f, 0xdb, 0xe1, 0xa3, 0x66, 0x3e, - 0xd4, 0x89, 0xbd, 0x9d, 0xbb, 0x8f, 0xef, 0x07, 0x77, 0xab, 0xf7, 0x1f, 0x97, 0x6a, 0x63, 0xbd, - 0x67, 0x83, 0x85, 0x8f, 0xed, 0xb7, 0x3a, 0x70, 0x16, 0x75, 0xe0, 0x7c, 0xd5, 0x81, 0x73, 0xbf, - 0x0c, 0x5a, 0x8b, 0x65, 0xd0, 0xfa, 0x5c, 0x06, 0x2d, 0xef, 0x20, 0x15, 0xa5, 0x55, 0x4b, 0xf8, - 0xef, 0x52, 0x1d, 0xc3, 0x60, 0xf5, 0x44, 0x03, 0xe7, 0xea, 0x38, 0xcb, 0xe5, 0xcd, 0x6c, 0x8c, - 0x52, 0x51, 0x62, 0x9b, 0x1f, 0xf0, 0xe4, 0x76, 0xfa, 0x51, 0xdc, 0x1f, 0x0d, 0x9f, 0xdd, 0x8d, - 0xc3, 0x8a, 0x74, 0x50, 0xac, 0x32, 0xc1, 0x7c, 0x04, 0x40, 0xc3, 0x3f, 0xfe, 0x7d, 0x03, 0x4b, - 0x34, 0x96, 0xc4, 0x89, 0xc2, 0x12, 0x13, 0x4b, 0x1a, 0xac, 0x76, 0x4f, 0x6c, 0xb0, 0xe4, 0x74, - 0x10, 0x46, 0x4c, 0xd2, 0x09, 0x95, 0xf4, 0xc7, 0x3d, 0x34, 0x14, 0x84, 0x68, 0x07, 0x21, 0x31, - 0x21, 0xca, 0x42, 0x88, 0xa9, 0x21, 0xa4, 0xf1, 0x8c, 0x3b, 0xeb, 0x13, 0xdb, 0xfb, 0x0d, 0x00, - 0x00, 0xff, 0xff, 0xf2, 0x78, 0x99, 0xb1, 0x91, 0x03, 0x00, 0x00, + // 372 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, + 0x1c, 0xc7, 0x93, 0x94, 0xa7, 0x43, 0x78, 0xa6, 0x2e, 0x0f, 0x84, 0x87, 0x0c, 0x8e, 0x0e, 0x77, + 0xf8, 0x67, 0xd0, 0x03, 0xd1, 0x66, 0x51, 0x87, 0x60, 0xa9, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1e, + 0x31, 0x90, 0xdc, 0x95, 0xfc, 0xae, 0xa5, 0xa3, 0x2f, 0xc1, 0xc1, 0xc5, 0x55, 0x37, 0x27, 0x5f, + 0x86, 0x38, 0x75, 0x74, 0x94, 0x74, 0x10, 0x7c, 0x15, 0x52, 0xef, 0x30, 0xd7, 0xf5, 0xa6, 0x83, + 0xdf, 0xf1, 0xf9, 0xdc, 0xf7, 0x7e, 0x7c, 0xfd, 0xa8, 0x0f, 0xc0, 0x64, 0x4c, 0xb9, 0x2c, 0x19, + 0xae, 0xc4, 0x64, 0x56, 0x32, 0xc0, 0x0b, 0x4c, 0xd7, 0x53, 0xc0, 0xb2, 0xa6, 0x1c, 0x68, 0x26, + 0x0b, 0xc1, 0x01, 0xd7, 0x8c, 0xcf, 0x2a, 0x56, 0x53, 0xc9, 0x30, 0xb0, 0x7a, 0x5e, 0x64, 0x0c, + 0x4d, 0x6b, 0x21, 0x45, 0x6f, 0xdf, 0x70, 0x20, 0xed, 0x40, 0x0b, 0xa4, 0x1c, 0xc8, 0x74, 0xa0, + 0xd6, 0x11, 0xfc, 0xcb, 0x04, 0x54, 0x02, 0x70, 0x05, 0x39, 0x9e, 0xef, 0xac, 0x0f, 0xa5, 0x0b, + 0xfe, 0xe7, 0x42, 0xe4, 0x25, 0xc3, 0x74, 0x5a, 0x60, 0xca, 0xb9, 0x90, 0x54, 0xb1, 0xea, 0xd6, + 0x2e, 0x70, 0xc5, 0x00, 0x68, 0xae, 0x03, 0x07, 0x17, 0x56, 0x0e, 0x63, 0x7e, 0x5d, 0x33, 0x98, + 0x0a, 0x0e, 0x5a, 0xb8, 0xfb, 0xe4, 0xfa, 0x9d, 0x18, 0xf2, 0xde, 0xbd, 0xeb, 0x77, 0xcf, 0x28, + 0x9f, 0x94, 0xac, 0x77, 0x84, 0x6c, 0xb6, 0x82, 0x62, 0x15, 0x34, 0x38, 0xb7, 0xc3, 0x47, 0xed, + 0x7c, 0xa8, 0x23, 0x6e, 0x39, 0xc1, 0x9f, 0xdb, 0xcf, 0x97, 0x6d, 0x37, 0x7a, 0xe8, 0xbc, 0x36, + 0xa1, 0xbb, 0x6c, 0x42, 0xf7, 0xa3, 0x09, 0xdd, 0xbb, 0x55, 0xe8, 0x2c, 0x57, 0xa1, 0xf3, 0xbe, + 0x0a, 0x1d, 0xff, 0x20, 0x13, 0x95, 0xd5, 0x8b, 0xd1, 0xdf, 0x4b, 0xd5, 0x85, 0xc1, 0x7a, 0x11, + 0x03, 0xf7, 0xea, 0x38, 0x2f, 0xe4, 0xcd, 0x6c, 0x8c, 0x32, 0x51, 0x61, 0x9b, 0x35, 0x3f, 0x7a, + 0xdd, 0x7e, 0x9c, 0xf4, 0x47, 0xc3, 0x67, 0x6f, 0xa3, 0x57, 0xb1, 0x0e, 0x94, 0xa8, 0x98, 0x60, + 0x7e, 0x15, 0xd0, 0xf0, 0x97, 0x7f, 0xdb, 0xc0, 0x52, 0x8d, 0xa5, 0x49, 0xaa, 0xb0, 0xd4, 0xc4, + 0xd2, 0x16, 0x6b, 0xbc, 0x13, 0x1b, 0x2c, 0x3d, 0x1d, 0x44, 0x31, 0x93, 0x74, 0x42, 0x25, 0xfd, + 0xf2, 0x0e, 0x0d, 0x05, 0x21, 0xda, 0x41, 0x48, 0x42, 0x88, 0xb2, 0x10, 0x62, 0x6a, 0x08, 0x69, + 0x3d, 0xe3, 0xee, 0x4f, 0x91, 0xf6, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xd2, 0xfb, 0xc7, + 0x90, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/revoke/service.pb.go b/x/assets/transactions/revoke/service.pb.go index 022cc9cde..f965cf45c 100644 --- a/x/assets/transactions/revoke/service.pb.go +++ b/x/assets/transactions/revoke/service.pb.go @@ -6,6 +6,7 @@ package revoke import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_5cc15353cc44c580 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xc3, 0x40, - 0x18, 0x06, 0xf0, 0x26, 0x85, 0x0e, 0xc1, 0xa9, 0x20, 0x42, 0xd0, 0x0c, 0xfd, 0x00, 0x77, 0xe2, - 0x9f, 0xc1, 0x53, 0x84, 0x16, 0x44, 0x41, 0x02, 0xa5, 0x76, 0x08, 0x12, 0x90, 0x6b, 0x7a, 0xc4, - 0x60, 0x72, 0x57, 0xf2, 0x5e, 0x4b, 0x57, 0xfd, 0x04, 0x82, 0xdf, 0xc0, 0x4d, 0x37, 0xbf, 0x85, - 0x38, 0x15, 0x5c, 0x1c, 0x25, 0x75, 0xf2, 0x53, 0x48, 0x73, 0x07, 0x5e, 0xc7, 0x5b, 0xdf, 0xf0, - 0x7b, 0x78, 0xde, 0xcb, 0xeb, 0x9d, 0x76, 0x01, 0x98, 0x0c, 0x29, 0x97, 0x39, 0xc3, 0x85, 0x18, - 0x4f, 0x73, 0x06, 0x78, 0x8e, 0xe9, 0x6a, 0x0a, 0x58, 0x96, 0x94, 0x03, 0x4d, 0x64, 0x26, 0x38, - 0xe0, 0x92, 0xcd, 0xc4, 0x1d, 0xc3, 0xc0, 0xca, 0x59, 0x96, 0x30, 0x34, 0x29, 0x85, 0x14, 0xed, - 0x5d, 0xc3, 0x23, 0xed, 0xd1, 0x1c, 0x29, 0x8f, 0x4c, 0x8f, 0x94, 0xf7, 0xb7, 0x53, 0x21, 0xd2, - 0x9c, 0x61, 0x3a, 0xc9, 0x30, 0xe5, 0x5c, 0x48, 0xaa, 0x3e, 0xd7, 0x79, 0xbe, 0x7d, 0x9f, 0x82, - 0x01, 0xd0, 0x54, 0xf7, 0xf1, 0x2f, 0xad, 0xbd, 0x31, 0xbb, 0x29, 0x19, 0x4c, 0x04, 0x07, 0x1d, - 0xb6, 0xf7, 0xe6, 0x78, 0xcd, 0x10, 0xd2, 0xf6, 0x8b, 0xe3, 0xb5, 0x2e, 0x28, 0x1f, 0xe7, 0xac, - 0x7d, 0x84, 0x6c, 0x17, 0x46, 0xa1, 0x2a, 0xe8, 0x9f, 0xd9, 0xd3, 0xe1, 0xff, 0x6c, 0xa0, 0xab, - 0x75, 0x76, 0x1e, 0x3e, 0x7f, 0x9e, 0xdc, 0xad, 0xce, 0x26, 0x2e, 0xd4, 0x96, 0x7a, 0x37, 0x45, - 0x7a, 0xf7, 0xcd, 0xf7, 0x2a, 0x70, 0x16, 0x55, 0xe0, 0x7c, 0x57, 0x81, 0xf3, 0xb8, 0x0c, 0x1a, - 0x8b, 0x65, 0xd0, 0xf8, 0x5a, 0x06, 0x0d, 0xef, 0x20, 0x11, 0x85, 0x75, 0x87, 0xde, 0xc6, 0x95, - 0xfa, 0xe1, 0xfd, 0xd5, 0x93, 0xf4, 0x9d, 0xeb, 0xe3, 0x34, 0x93, 0xb7, 0xd3, 0x11, 0x4a, 0x44, - 0x81, 0x6d, 0x1f, 0xfb, 0xd9, 0x6d, 0x75, 0xc3, 0xa8, 0x3b, 0x1c, 0xbc, 0xba, 0x6b, 0x87, 0x13, - 0xea, 0x22, 0x91, 0xaa, 0x07, 0xe6, 0xe2, 0x80, 0x06, 0xb5, 0xfd, 0x58, 0x23, 0xb1, 0x26, 0x71, - 0x14, 0x2b, 0x12, 0x9b, 0x24, 0x56, 0xa4, 0x72, 0x4f, 0x6c, 0x49, 0x7c, 0xde, 0xef, 0x85, 0x4c, - 0xd2, 0x31, 0x95, 0xf4, 0xd7, 0x3d, 0x34, 0x38, 0x21, 0xda, 0x13, 0x12, 0x11, 0xa2, 0x12, 0x08, - 0x31, 0x23, 0x08, 0x51, 0x19, 0xa3, 0x56, 0x7d, 0x3e, 0xfb, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, - 0x1a, 0x70, 0x8e, 0x02, 0x5d, 0x03, 0x00, 0x00, + // 368 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x6b, 0xe3, 0x30, + 0x18, 0x06, 0x70, 0xcb, 0xe1, 0x32, 0x98, 0x9b, 0xb2, 0x1c, 0x98, 0xc3, 0xc3, 0x8d, 0x37, 0x48, + 0xfd, 0x3b, 0x54, 0x2d, 0x85, 0x04, 0x4a, 0x0b, 0xc5, 0x10, 0xd2, 0x0c, 0xa6, 0x18, 0x8a, 0xe2, + 0x08, 0xd7, 0xd4, 0x96, 0x82, 0x5f, 0x25, 0x64, 0x6c, 0xf7, 0x0e, 0xdd, 0xbb, 0x75, 0xec, 0xd4, + 0x8f, 0x51, 0x3a, 0x65, 0xec, 0x58, 0x9c, 0xa1, 0xd0, 0x4f, 0x51, 0x12, 0x09, 0xaa, 0x8c, 0x9a, + 0x0c, 0xaf, 0xf9, 0x3d, 0x7e, 0x24, 0xbf, 0xc1, 0x71, 0x17, 0x80, 0xab, 0x98, 0x09, 0x55, 0x72, + 0x52, 0xc9, 0xf1, 0xb4, 0xe4, 0x40, 0xe6, 0x84, 0xad, 0xa6, 0x40, 0x54, 0xcd, 0x04, 0xb0, 0x4c, + 0x15, 0x52, 0x00, 0xa9, 0xf9, 0x4c, 0xde, 0x70, 0x02, 0xbc, 0x9e, 0x15, 0x19, 0xc7, 0x93, 0x5a, + 0x2a, 0xd9, 0xd9, 0xb2, 0x3c, 0x36, 0x1e, 0xcf, 0xb1, 0xf6, 0xd8, 0xf6, 0x58, 0xfb, 0xf0, 0x4f, + 0x26, 0xa1, 0x92, 0x40, 0x2a, 0xc8, 0xc9, 0x6c, 0x7b, 0xf5, 0xd0, 0x51, 0xe1, 0xdf, 0x5c, 0xca, + 0xbc, 0xe4, 0x84, 0x4d, 0x0a, 0xc2, 0x84, 0x90, 0x8a, 0x69, 0xa7, 0xdf, 0xba, 0x17, 0xad, 0x38, + 0x00, 0xcb, 0x4d, 0xd1, 0xf0, 0xdc, 0xd9, 0x5b, 0xb3, 0xab, 0x9a, 0xc3, 0x44, 0x0a, 0x30, 0x61, + 0x3b, 0x8f, 0x28, 0x68, 0xc5, 0x90, 0x77, 0xee, 0x51, 0xd0, 0x3e, 0x63, 0x62, 0x5c, 0xf2, 0xce, + 0x01, 0x76, 0xbd, 0x09, 0x1c, 0xeb, 0x82, 0xe1, 0x89, 0x3b, 0x1d, 0xfe, 0xcc, 0x06, 0xa6, 0xda, + 0x3f, 0x2f, 0xfc, 0x75, 0xfb, 0xf9, 0xf2, 0x1f, 0xf5, 0xee, 0x5a, 0xaf, 0x4d, 0x84, 0x16, 0x4d, + 0x84, 0x3e, 0x9a, 0x08, 0x3d, 0x2c, 0x23, 0x6f, 0xb1, 0x8c, 0xbc, 0xf7, 0x65, 0xe4, 0x05, 0x7b, + 0x99, 0xac, 0x9c, 0xbf, 0xd6, 0xfb, 0x7d, 0xa1, 0xff, 0x79, 0x7f, 0x75, 0xf8, 0x3e, 0xba, 0x3c, + 0xcc, 0x0b, 0x75, 0x3d, 0x1d, 0xe1, 0x4c, 0x56, 0xc4, 0xf5, 0x5a, 0x9f, 0xfc, 0x76, 0x37, 0x4e, + 0xba, 0xc3, 0xc1, 0xb3, 0xbf, 0xb1, 0x3b, 0xb1, 0x29, 0x92, 0xe8, 0x7a, 0x60, 0x1f, 0x11, 0xf0, + 0x60, 0x6d, 0xdf, 0x36, 0x48, 0x6a, 0x48, 0x9a, 0xa4, 0x9a, 0xa4, 0x36, 0x49, 0x35, 0x69, 0xfc, + 0x23, 0x57, 0x92, 0x9e, 0xf6, 0x7b, 0x31, 0x57, 0x6c, 0xcc, 0x14, 0xfb, 0xf2, 0xf7, 0x2d, 0x4e, + 0xa9, 0xf1, 0x94, 0x26, 0x94, 0xea, 0x04, 0x4a, 0xed, 0x08, 0x4a, 0x75, 0xc6, 0xa8, 0xbd, 0x5e, + 0x94, 0xdd, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x5c, 0x57, 0x15, 0x60, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/send/service.pb.go b/x/assets/transactions/send/service.pb.go index fadd5aae8..d62b10ddd 100644 --- a/x/assets/transactions/send/service.pb.go +++ b/x/assets/transactions/send/service.pb.go @@ -6,6 +6,7 @@ package send import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_95a46fce5d59d239 = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x26, 0x2f, 0x74, 0x08, 0xef, 0x54, 0x71, 0x89, 0x92, 0xa1, 0x1f, 0xe0, 0x0e, - 0xda, 0x41, 0x3c, 0x5c, 0x5a, 0x07, 0x75, 0x08, 0x14, 0xdb, 0x21, 0x48, 0x40, 0xae, 0xc9, 0x11, - 0x03, 0xc9, 0x5d, 0xc9, 0x73, 0x95, 0xce, 0x7e, 0x02, 0xc1, 0x6f, 0xa0, 0x9b, 0x7e, 0x11, 0x71, - 0x2a, 0xb8, 0x38, 0x4a, 0xea, 0xe4, 0xee, 0x2e, 0xd7, 0x3b, 0xf0, 0x3a, 0xde, 0xfa, 0x84, 0xdf, - 0x3f, 0xff, 0xe7, 0x49, 0x82, 0x93, 0x11, 0x00, 0x93, 0x31, 0xe5, 0xb2, 0x62, 0xb8, 0x16, 0xf9, - 0xb2, 0x62, 0x80, 0x57, 0x98, 0xaa, 0x29, 0x60, 0xd9, 0x50, 0x0e, 0x34, 0x93, 0xa5, 0xe0, 0x80, - 0x81, 0xf1, 0x1c, 0x03, 0x6b, 0x6e, 0xcb, 0x8c, 0xa1, 0x45, 0x23, 0xa4, 0xe8, 0x21, 0x4b, 0x23, - 0xa3, 0xd1, 0x0a, 0x69, 0x8d, 0x6c, 0x8d, 0x94, 0x0e, 0x0f, 0x0b, 0x21, 0x8a, 0x8a, 0x61, 0xba, - 0x28, 0x31, 0xe5, 0x5c, 0x48, 0xaa, 0x1f, 0x6e, 0xd3, 0x42, 0xd7, 0x2e, 0x35, 0x03, 0xa0, 0x85, - 0xe9, 0x12, 0x5e, 0x38, 0x6a, 0x6b, 0x72, 0xdd, 0x30, 0x58, 0x08, 0x0e, 0x26, 0x6a, 0xf0, 0xe2, - 0x05, 0xff, 0x62, 0x28, 0x7a, 0x4f, 0x5e, 0xd0, 0x3d, 0xa7, 0x3c, 0xaf, 0x58, 0xef, 0xc8, 0x71, - 0x55, 0x14, 0xeb, 0x72, 0xe1, 0xa9, 0x2b, 0x9c, 0xfd, 0x4d, 0x2e, 0x4d, 0xad, 0xfe, 0xc1, 0xdd, - 0xfb, 0xd7, 0x83, 0xbf, 0xdf, 0xdf, 0xc3, 0xb5, 0xde, 0xcf, 0x6c, 0xa5, 0xc0, 0xf8, 0xc7, 0x7f, - 0x6d, 0x23, 0x6f, 0xdd, 0x46, 0xde, 0x67, 0x1b, 0x79, 0xf7, 0x9b, 0xa8, 0xb3, 0xde, 0x44, 0x9d, - 0x8f, 0x4d, 0xd4, 0x09, 0x06, 0x99, 0xa8, 0x1d, 0xdf, 0x3f, 0xfe, 0x3f, 0xd5, 0x9f, 0x78, 0xa2, - 0x4e, 0x31, 0xf1, 0xae, 0x8e, 0x8b, 0x52, 0xde, 0x2c, 0xe7, 0x28, 0x13, 0x35, 0x76, 0x3b, 0xf1, - 0xa3, 0xdf, 0x1d, 0xc5, 0xc9, 0x68, 0x36, 0x7d, 0xf6, 0x77, 0x4a, 0xc4, 0xa6, 0x44, 0xa2, 0xa7, - 0x60, 0xaf, 0x0c, 0x68, 0xca, 0x78, 0xfe, 0xb6, 0x03, 0x52, 0x03, 0xd2, 0x24, 0xd5, 0x20, 0xb5, - 0x41, 0xaa, 0x40, 0xeb, 0x13, 0x37, 0x90, 0x9e, 0x4d, 0xc6, 0x31, 0x93, 0x34, 0xa7, 0x92, 0x7e, - 0xfb, 0x43, 0x0b, 0x13, 0x62, 0x34, 0x21, 0x09, 0xd1, 0xa9, 0x40, 0x88, 0x1d, 0x40, 0x88, 0x4a, - 0x98, 0x77, 0xb7, 0x3f, 0xcb, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0xd1, 0x51, 0xd5, 0xee, 0x43, - 0x03, 0x00, 0x00, + // 361 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xf3, 0x40, + 0x18, 0x06, 0xf0, 0x5c, 0x3e, 0xbe, 0x0e, 0xe1, 0x9b, 0xba, 0x7c, 0x10, 0x24, 0x83, 0xa3, 0xc3, + 0x1d, 0xb6, 0x83, 0x78, 0xb8, 0xb4, 0x0e, 0xea, 0x10, 0x28, 0xb6, 0x43, 0x90, 0x80, 0x5c, 0x93, + 0x23, 0x06, 0x92, 0xbb, 0x92, 0xf7, 0x5a, 0x3a, 0x3a, 0x3a, 0xba, 0xb9, 0x3b, 0x3a, 0xf9, 0x67, + 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0xdd, 0x5d, 0xe2, 0x1d, 0x78, 0x1d, 0x6f, 0x0a, 0xbc, + 0xe1, 0xf7, 0xe4, 0xb9, 0x37, 0x17, 0x9c, 0x8c, 0x00, 0xb8, 0x8a, 0x99, 0x50, 0x15, 0x27, 0xb5, + 0xcc, 0x97, 0x15, 0x07, 0xb2, 0x26, 0xac, 0x9b, 0x02, 0x51, 0x0d, 0x13, 0xc0, 0x32, 0x55, 0x4a, + 0x01, 0x04, 0xb8, 0xc8, 0x09, 0xf0, 0x66, 0x55, 0x66, 0x1c, 0x2f, 0x1a, 0xa9, 0x64, 0x1f, 0x5b, + 0x1a, 0x1b, 0x8d, 0xd7, 0x58, 0x6b, 0x6c, 0x6b, 0xdc, 0xe9, 0xf0, 0x7f, 0x26, 0xa1, 0x96, 0x40, + 0x6a, 0x28, 0xc8, 0xea, 0xb0, 0x7b, 0xe8, 0xa0, 0x70, 0xaf, 0x90, 0xb2, 0xa8, 0x38, 0x61, 0x8b, + 0x92, 0x30, 0x21, 0xa4, 0x62, 0x5a, 0xe9, 0xb7, 0xae, 0x25, 0x6b, 0x0e, 0xc0, 0x0a, 0x53, 0x32, + 0xbc, 0x70, 0xd4, 0xd6, 0xe4, 0xba, 0xe1, 0xb0, 0x90, 0x02, 0x4c, 0xd4, 0xe0, 0x01, 0x05, 0x7f, + 0x62, 0x28, 0xfa, 0x77, 0x28, 0xe8, 0x9d, 0x33, 0x91, 0x57, 0xbc, 0x7f, 0xe4, 0xb8, 0x03, 0x1c, + 0xeb, 0x72, 0xe1, 0xa9, 0x2b, 0x9c, 0xfd, 0x4e, 0x2e, 0x4d, 0xad, 0x7d, 0x2f, 0xfc, 0x7b, 0xfb, + 0xf1, 0x7c, 0x80, 0xc6, 0x5f, 0xfe, 0x4b, 0x1b, 0xa1, 0x4d, 0x1b, 0xa1, 0xf7, 0x36, 0x42, 0xf7, + 0xdb, 0xc8, 0xdb, 0x6c, 0x23, 0xef, 0x6d, 0x1b, 0x79, 0xc1, 0x20, 0x93, 0xb5, 0xe3, 0xb7, 0xc6, + 0xff, 0xa6, 0xfa, 0x3f, 0x4f, 0xba, 0x63, 0x4f, 0xd0, 0xd5, 0x71, 0x51, 0xaa, 0x9b, 0xe5, 0x1c, + 0x67, 0xb2, 0x26, 0x6e, 0xeb, 0x7c, 0xf4, 0x7b, 0xa3, 0x38, 0x19, 0xcd, 0xa6, 0x4f, 0xfe, 0x4e, + 0x89, 0xd8, 0x94, 0x48, 0xf4, 0x14, 0xec, 0xe3, 0x01, 0x9e, 0x72, 0x91, 0xbf, 0xee, 0x80, 0xd4, + 0x80, 0x34, 0x49, 0x35, 0x48, 0x6d, 0x90, 0x76, 0xa0, 0xf5, 0xa9, 0x1b, 0x48, 0xcf, 0x26, 0xe3, + 0x98, 0x2b, 0x96, 0x33, 0xc5, 0x3e, 0xfd, 0xa1, 0x85, 0x29, 0x35, 0x9a, 0xd2, 0x84, 0xea, 0x54, + 0xa0, 0xd4, 0x0e, 0xa0, 0xb4, 0x4b, 0x98, 0xf7, 0x7e, 0x2e, 0xc6, 0xf0, 0x3b, 0x00, 0x00, 0xff, + 0xff, 0xa5, 0x99, 0xa5, 0xf2, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/unwrap/service.pb.go b/x/assets/transactions/unwrap/service.pb.go index c5d0a20d2..57d19518d 100644 --- a/x/assets/transactions/unwrap/service.pb.go +++ b/x/assets/transactions/unwrap/service.pb.go @@ -6,6 +6,7 @@ package unwrap import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_590bf0044c41d756 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x4f, 0x4a, 0xc3, 0x40, - 0x14, 0x06, 0xf0, 0x26, 0x85, 0x2e, 0x82, 0xab, 0x82, 0x08, 0x41, 0xb3, 0xe8, 0x01, 0x66, 0xc4, - 0x3f, 0x0b, 0x47, 0x11, 0x5a, 0x10, 0x05, 0x09, 0x14, 0x6d, 0x21, 0x48, 0x40, 0xa6, 0xe9, 0x10, - 0x03, 0xc9, 0x4c, 0xc8, 0x9b, 0x6a, 0xb7, 0x7a, 0x02, 0xc1, 0x1b, 0xb8, 0xd3, 0x9d, 0xb7, 0x10, - 0x57, 0x05, 0x37, 0x2e, 0x25, 0x75, 0xe5, 0x29, 0xa4, 0x9d, 0x01, 0xa7, 0xcb, 0xd9, 0xbe, 0xf0, - 0xfb, 0xf8, 0xde, 0xe4, 0x79, 0xc7, 0x5d, 0x00, 0x26, 0x43, 0xca, 0x65, 0xce, 0x70, 0x21, 0xc6, - 0x93, 0x9c, 0x01, 0x9e, 0x62, 0xba, 0x98, 0x02, 0x96, 0x15, 0xe5, 0x40, 0x13, 0x99, 0x09, 0x0e, - 0x78, 0xc2, 0xef, 0x2a, 0x5a, 0x62, 0x60, 0xd5, 0x6d, 0x96, 0x30, 0x54, 0x56, 0x42, 0x8a, 0xf6, - 0xb6, 0xe1, 0x91, 0xf6, 0x68, 0x8a, 0x94, 0x47, 0xa6, 0x47, 0xca, 0xfb, 0x9b, 0xa9, 0x10, 0x69, - 0xce, 0x30, 0x2d, 0x33, 0x4c, 0x39, 0x17, 0x92, 0xaa, 0xcf, 0xcb, 0x3c, 0xdf, 0xbe, 0x4f, 0xc1, - 0x00, 0x68, 0xaa, 0xfb, 0xf8, 0xe7, 0xd6, 0xde, 0x98, 0x5d, 0x57, 0x0c, 0x4a, 0xc1, 0x41, 0x87, - 0xed, 0xbc, 0x39, 0x5e, 0x33, 0x84, 0xb4, 0xfd, 0xe2, 0x78, 0xad, 0x33, 0xca, 0xc7, 0x39, 0x6b, - 0x1f, 0x20, 0xdb, 0x85, 0x51, 0xa8, 0x0a, 0xfa, 0x27, 0xf6, 0x74, 0xf0, 0x3f, 0xbb, 0xd0, 0xd5, - 0x3a, 0x5b, 0x0f, 0x9f, 0x3f, 0x4f, 0xee, 0x46, 0x67, 0x1d, 0x17, 0x6a, 0x4b, 0xbd, 0x9b, 0x22, - 0xbd, 0xfb, 0xe6, 0x7b, 0x1d, 0x38, 0xb3, 0x3a, 0x70, 0xbe, 0xeb, 0xc0, 0x79, 0x9c, 0x07, 0x8d, - 0xd9, 0x3c, 0x68, 0x7c, 0xcd, 0x83, 0x86, 0xb7, 0x97, 0x88, 0xc2, 0xba, 0x43, 0x6f, 0xed, 0x52, - 0xfd, 0xf0, 0xfe, 0xe2, 0x49, 0xfa, 0xce, 0xd5, 0x61, 0x9a, 0xc9, 0x9b, 0xc9, 0x08, 0x25, 0xa2, - 0xc0, 0xb6, 0x8f, 0xfd, 0xec, 0xb6, 0xba, 0x61, 0xd4, 0x1d, 0x0c, 0x5f, 0xdd, 0x95, 0xc3, 0x09, - 0x75, 0x91, 0x48, 0xd5, 0x03, 0x73, 0x71, 0x40, 0xc3, 0xa5, 0xfd, 0x58, 0x21, 0xb1, 0x26, 0x71, - 0x14, 0x2b, 0x12, 0x9b, 0x24, 0x56, 0xa4, 0x76, 0x8f, 0x6c, 0x49, 0x7c, 0xda, 0xef, 0x85, 0x4c, - 0xd2, 0x31, 0x95, 0xf4, 0xd7, 0xdd, 0x37, 0x38, 0x21, 0xda, 0x13, 0x12, 0x11, 0xa2, 0x12, 0x08, - 0x31, 0x23, 0x08, 0x51, 0x19, 0xa3, 0xd6, 0xf2, 0x7c, 0x76, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, - 0x4a, 0xe6, 0x26, 0x51, 0x5d, 0x03, 0x00, 0x00, + // 367 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0x83, 0xa3, 0xc3, + 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x09, 0x14, 0x6d, 0x21, 0x48, 0x40, 0xae, 0xe9, + 0x11, 0x03, 0xc9, 0x5d, 0xc8, 0x73, 0xad, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, + 0x10, 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, + 0x84, 0xcf, 0x37, 0xdf, 0xbb, 0x3c, 0xfe, 0x71, 0x17, 0x80, 0xc9, 0x88, 0x72, 0x59, 0x30, 0x5c, + 0x8a, 0xf1, 0xa4, 0x60, 0x80, 0x67, 0x98, 0x2e, 0xa7, 0x80, 0x65, 0x4d, 0x39, 0xd0, 0x54, 0xe6, + 0x82, 0x03, 0x9e, 0xf0, 0xdb, 0x9a, 0x56, 0x18, 0x58, 0x3d, 0xcd, 0x53, 0x86, 0xaa, 0x5a, 0x48, + 0xd1, 0xd9, 0x32, 0x3c, 0xd2, 0x1e, 0xcd, 0x90, 0xf2, 0xc8, 0xf4, 0x48, 0xf9, 0xe0, 0x5f, 0x2a, + 0xa0, 0x14, 0x80, 0x4b, 0xc8, 0xf0, 0x74, 0x7b, 0xf9, 0x50, 0x51, 0xc1, 0xff, 0x4c, 0x88, 0xac, + 0x60, 0x98, 0x56, 0x39, 0xa6, 0x9c, 0x0b, 0x49, 0x95, 0x53, 0x6f, 0xed, 0x8b, 0x96, 0x0c, 0x80, + 0x66, 0xba, 0x68, 0x70, 0x6e, 0xed, 0x8d, 0xd9, 0x75, 0xcd, 0xa0, 0x12, 0x1c, 0x74, 0xd8, 0xce, + 0x93, 0xeb, 0xb7, 0x22, 0xc8, 0x3a, 0x0f, 0xae, 0xdf, 0x3e, 0xa3, 0x7c, 0x5c, 0xb0, 0xce, 0x01, + 0xb2, 0xbd, 0x09, 0x14, 0xa9, 0x82, 0xc1, 0x89, 0x3d, 0x1d, 0xfc, 0xce, 0x2e, 0x74, 0xb5, 0x0d, + 0x27, 0xf8, 0x73, 0xf7, 0xf5, 0xba, 0xe9, 0xf6, 0xee, 0x5b, 0x6f, 0x4d, 0xe8, 0xce, 0x9b, 0xd0, + 0xfd, 0x6c, 0x42, 0xf7, 0x71, 0x11, 0x3a, 0xf3, 0x45, 0xe8, 0x7c, 0x2c, 0x42, 0xc7, 0xdf, 0x4b, + 0x45, 0x69, 0xfd, 0xb5, 0xde, 0xdf, 0x4b, 0xf5, 0xcf, 0xfb, 0xcb, 0xc3, 0xf7, 0xdd, 0xab, 0xc3, + 0x2c, 0x97, 0x37, 0x93, 0x11, 0x4a, 0x45, 0x89, 0x6d, 0xaf, 0xf5, 0xd9, 0x6b, 0x77, 0xa3, 0xb8, + 0x3b, 0x18, 0xbe, 0x78, 0x6b, 0xbb, 0x13, 0xe9, 0x22, 0xb1, 0xaa, 0x07, 0xe6, 0x11, 0x01, 0x0d, + 0x57, 0xf6, 0x7d, 0x8d, 0x24, 0x9a, 0x24, 0x71, 0xa2, 0x48, 0x62, 0x92, 0x44, 0x91, 0xc6, 0x3b, + 0xb2, 0x25, 0xc9, 0x69, 0xbf, 0x17, 0x31, 0x49, 0xc7, 0x54, 0xd2, 0x6f, 0x6f, 0xdf, 0xe0, 0x84, + 0x68, 0x4f, 0x48, 0x4c, 0x88, 0x4a, 0x20, 0xc4, 0x8c, 0x20, 0x44, 0x65, 0x8c, 0xda, 0xab, 0x45, + 0xd9, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xaf, 0xf4, 0x2c, 0x60, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/wrap/service.pb.go b/x/assets/transactions/wrap/service.pb.go index 5d1c1fed9..2ac9145bb 100644 --- a/x/assets/transactions/wrap/service.pb.go +++ b/x/assets/transactions/wrap/service.pb.go @@ -6,6 +6,7 @@ package wrap import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_ccaf91d5b35dd610 = []byte{ - // 359 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xeb, 0x50, - 0x14, 0x07, 0xf0, 0x26, 0x0f, 0x3a, 0x84, 0x37, 0xf5, 0xf1, 0x96, 0xbc, 0x47, 0x86, 0x7e, 0x80, - 0x7b, 0xa1, 0x1d, 0xc4, 0x8b, 0x4b, 0xeb, 0xa0, 0x0e, 0x81, 0xa2, 0x85, 0x06, 0x09, 0xc8, 0x69, - 0x7a, 0x89, 0x81, 0x24, 0x37, 0xe4, 0xdc, 0x6a, 0x67, 0x3f, 0x81, 0xe0, 0x37, 0xd0, 0x4d, 0xbf, - 0x88, 0x38, 0x15, 0x5c, 0x1c, 0x25, 0x75, 0x72, 0x77, 0x97, 0xf4, 0x5e, 0xf0, 0x76, 0xbc, 0xeb, - 0x09, 0xbf, 0x7f, 0xfe, 0xe7, 0x24, 0xde, 0xc1, 0x08, 0x91, 0xcb, 0x10, 0x4a, 0x99, 0x73, 0x5a, - 0x88, 0xc5, 0x32, 0xe7, 0x48, 0x57, 0x14, 0xda, 0x29, 0x52, 0x59, 0x43, 0x89, 0x90, 0xc8, 0x4c, - 0x94, 0x48, 0xaf, 0x6b, 0xa8, 0x28, 0xf2, 0xfa, 0x2a, 0x4b, 0x38, 0xa9, 0x6a, 0x21, 0x45, 0x8f, - 0x18, 0x9a, 0x68, 0x4d, 0x56, 0x44, 0x69, 0x62, 0x6a, 0xd2, 0x6a, 0xff, 0x7f, 0x2a, 0x44, 0x9a, - 0x73, 0x0a, 0x55, 0x46, 0xa1, 0x2c, 0x85, 0x04, 0xf5, 0x70, 0x9b, 0xe6, 0xdb, 0x76, 0x29, 0x38, - 0x22, 0xa4, 0xba, 0x8b, 0x7f, 0x62, 0xa9, 0x8d, 0xc9, 0x45, 0xcd, 0xb1, 0x12, 0x25, 0xea, 0xa8, - 0xc1, 0x93, 0xe3, 0xfd, 0x0a, 0x31, 0xed, 0x3d, 0x38, 0x5e, 0xf7, 0x18, 0xca, 0x45, 0xce, 0x7b, - 0x7b, 0x96, 0xab, 0x92, 0x50, 0x95, 0xf3, 0x0f, 0x6d, 0xe1, 0xf4, 0x67, 0x72, 0xaa, 0x6b, 0xf5, - 0xff, 0xdd, 0xbc, 0x7e, 0xdc, 0xb9, 0x7f, 0xfb, 0x7f, 0x68, 0xa1, 0xf6, 0xd3, 0x5b, 0xb5, 0x60, - 0xfc, 0xe5, 0x3e, 0x37, 0x81, 0xb3, 0x6e, 0x02, 0xe7, 0xbd, 0x09, 0x9c, 0xdb, 0x4d, 0xd0, 0x59, - 0x6f, 0x82, 0xce, 0xdb, 0x26, 0xe8, 0x78, 0x83, 0x44, 0x14, 0x96, 0xef, 0x1f, 0xff, 0x3e, 0x53, - 0x9f, 0x78, 0xd2, 0x9e, 0x62, 0xe2, 0x9c, 0xef, 0xa7, 0x99, 0xbc, 0x5c, 0xce, 0x49, 0x22, 0x0a, - 0x6a, 0x77, 0xe2, 0x7b, 0xb7, 0x3b, 0x0a, 0xa3, 0xd1, 0x74, 0xf6, 0xe8, 0xee, 0x94, 0x08, 0x75, - 0x89, 0x48, 0x4d, 0xd1, 0x5c, 0x19, 0xc9, 0xac, 0x86, 0xea, 0x65, 0x07, 0xc4, 0x1a, 0xc4, 0x51, - 0xac, 0x40, 0x6c, 0x82, 0xb8, 0x05, 0x8d, 0xcb, 0xec, 0x40, 0x7c, 0x34, 0x19, 0x87, 0x5c, 0xc2, - 0x02, 0x24, 0x7c, 0xba, 0x43, 0x03, 0x33, 0xa6, 0x35, 0x63, 0x11, 0x53, 0xa9, 0xc8, 0x98, 0x19, - 0xc0, 0x58, 0x9b, 0x30, 0xef, 0x6e, 0x7f, 0x96, 0xe1, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, - 0x5a, 0x3a, 0xb2, 0x43, 0x03, 0x00, 0x00, + // 360 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xc3, 0x40, + 0x14, 0x06, 0xf0, 0x24, 0x62, 0x87, 0xe0, 0xd4, 0x45, 0x08, 0x92, 0xc1, 0xd1, 0xe1, 0x0e, 0xdb, + 0x41, 0x3c, 0x5c, 0x5a, 0x07, 0x75, 0x08, 0x14, 0x2d, 0x34, 0x48, 0x40, 0x5e, 0xd3, 0x23, 0x06, + 0x92, 0x5c, 0xc8, 0xbb, 0xd6, 0x8e, 0x8e, 0x8e, 0x6e, 0xee, 0x8e, 0x4e, 0xfe, 0x19, 0xe2, 0xd4, + 0xd1, 0x51, 0xd2, 0x41, 0x70, 0x77, 0x97, 0x78, 0x01, 0xaf, 0xe3, 0x4d, 0x81, 0x17, 0x7e, 0x5f, + 0xbe, 0x7b, 0x39, 0xf7, 0x64, 0x80, 0xc8, 0x65, 0x00, 0x85, 0xcc, 0x38, 0xcd, 0xc5, 0x6c, 0x9e, + 0x71, 0xa4, 0x4b, 0x0a, 0xcd, 0x14, 0xa9, 0xac, 0xa0, 0x40, 0x88, 0x65, 0x2a, 0x0a, 0xa4, 0x77, + 0x15, 0x94, 0x14, 0x79, 0xb5, 0x48, 0x63, 0x4e, 0xca, 0x4a, 0x48, 0xd1, 0x25, 0x9a, 0x26, 0xad, + 0x26, 0x4b, 0xa2, 0x34, 0xd1, 0x35, 0x69, 0xb4, 0xb7, 0x1b, 0x0b, 0xcc, 0x05, 0xd2, 0x1c, 0x13, + 0xba, 0x38, 0x6c, 0x1e, 0x2a, 0xc8, 0xdb, 0x4b, 0x84, 0x48, 0x32, 0x4e, 0xa1, 0x4c, 0x29, 0x14, + 0x85, 0x90, 0xa0, 0x94, 0x7a, 0x6b, 0x5a, 0x32, 0xe7, 0x88, 0x90, 0xb4, 0x25, 0xbd, 0x0b, 0x43, + 0xad, 0x4d, 0x6e, 0x2a, 0x8e, 0xa5, 0x28, 0xb0, 0x8d, 0xea, 0x3d, 0xd9, 0xee, 0x56, 0x80, 0x49, + 0xf7, 0xc1, 0x76, 0x3b, 0xe7, 0x50, 0xcc, 0x32, 0xde, 0x3d, 0x32, 0xdc, 0x01, 0x09, 0x54, 0x39, + 0xef, 0xd4, 0x14, 0x8e, 0xff, 0x27, 0x97, 0x6d, 0xad, 0x7d, 0xcb, 0xdb, 0xbe, 0xff, 0x7a, 0x3d, + 0xb0, 0x87, 0x3f, 0xce, 0x5b, 0xed, 0xdb, 0xab, 0xda, 0xb7, 0x3f, 0x6b, 0xdf, 0x7e, 0x5c, 0xfb, + 0xd6, 0x6a, 0xed, 0x5b, 0x1f, 0x6b, 0xdf, 0x72, 0x7b, 0xb1, 0xc8, 0x0d, 0xbf, 0x35, 0xdc, 0xb9, + 0x52, 0xff, 0x79, 0xd4, 0x1c, 0x7b, 0x64, 0x5f, 0x1f, 0x27, 0xa9, 0xbc, 0x9d, 0x4f, 0x49, 0x2c, + 0x72, 0x6a, 0xb6, 0xce, 0x67, 0xa7, 0x33, 0x08, 0xc2, 0xc1, 0x78, 0xf2, 0xe2, 0x6c, 0x94, 0x08, + 0xda, 0x12, 0xa1, 0x9a, 0xa2, 0x7e, 0x3c, 0x24, 0x93, 0x0a, 0xca, 0xf7, 0x0d, 0x10, 0xb5, 0x20, + 0x0a, 0x23, 0x05, 0x22, 0x1d, 0x44, 0x0d, 0xa8, 0x1d, 0x66, 0x06, 0xa2, 0xb3, 0xd1, 0x30, 0xe0, + 0x12, 0x66, 0x20, 0xe1, 0xdb, 0xe9, 0x6b, 0x98, 0xb1, 0x56, 0x33, 0x16, 0x32, 0x95, 0x8a, 0x8c, + 0xe9, 0x01, 0x8c, 0x35, 0x09, 0xd3, 0xce, 0xdf, 0xc5, 0xe8, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, + 0xf1, 0x7f, 0x01, 0xaf, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/define/service.pb.go b/x/identities/transactions/define/service.pb.go index c10ff3c43..3dcebb375 100644 --- a/x/identities/transactions/define/service.pb.go +++ b/x/identities/transactions/define/service.pb.go @@ -6,6 +6,7 @@ package define import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_0c544b9b622019f8 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0x80, 0x9b, 0x14, 0x3a, 0x04, 0xa7, 0x6e, 0x46, 0x09, 0xd8, 0x1f, 0x70, 0x07, 0xea, 0xa0, - 0x07, 0xa2, 0x0d, 0x05, 0xed, 0x10, 0x2c, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, 0x33, 0x1e, 0x24, - 0x77, 0x25, 0x77, 0x95, 0xce, 0xfe, 0x02, 0xc1, 0xc9, 0xd5, 0xd1, 0xdd, 0xd1, 0x5d, 0x9c, 0x0a, - 0x2e, 0x8e, 0x92, 0x3a, 0xf9, 0x2b, 0xc4, 0x5e, 0x20, 0xd7, 0x35, 0xeb, 0x0b, 0xdf, 0xc7, 0xf7, - 0x72, 0xcf, 0xf1, 0xfb, 0x52, 0x82, 0x0a, 0x28, 0x57, 0x19, 0xe0, 0x5c, 0x24, 0xb3, 0x0c, 0x24, - 0x9e, 0x63, 0x96, 0x00, 0x57, 0x4c, 0x31, 0x90, 0x58, 0x15, 0x94, 0x4b, 0x1a, 0x2b, 0x26, 0xb8, - 0xc4, 0x09, 0xdc, 0x30, 0x0e, 0x58, 0x42, 0x71, 0xc7, 0x62, 0x40, 0xd3, 0x42, 0x28, 0xd1, 0xdd, - 0x37, 0x1c, 0xa8, 0x72, 0xa0, 0x39, 0xaa, 0x1d, 0xc8, 0x74, 0x20, 0xed, 0x70, 0xb7, 0x53, 0x21, - 0xd2, 0x0c, 0x30, 0x9d, 0x32, 0x4c, 0x39, 0x17, 0x8a, 0xea, 0xcf, 0x2b, 0xa7, 0xdb, 0xac, 0x2b, - 0x07, 0x29, 0x69, 0x5a, 0x75, 0xb9, 0xe7, 0x8d, 0x1c, 0xc6, 0xec, 0xba, 0x00, 0x39, 0x15, 0x5c, - 0x56, 0xc2, 0xdd, 0x37, 0xcb, 0x69, 0x07, 0x32, 0xed, 0xbe, 0x5a, 0x4e, 0xe7, 0x8c, 0xf2, 0x24, - 0x83, 0xee, 0x11, 0x6a, 0xb2, 0x3c, 0x0a, 0x74, 0xa8, 0x3b, 0x6c, 0x86, 0x8f, 0xeb, 0xd9, 0x45, - 0x95, 0xd8, 0xdb, 0xb9, 0xff, 0xfc, 0x79, 0xb4, 0xb7, 0x7a, 0x9b, 0x38, 0xd7, 0x1b, 0x1b, 0x7b, - 0x6a, 0xcc, 0x7f, 0x6a, 0xbf, 0x97, 0x9e, 0xb5, 0x28, 0x3d, 0xeb, 0xbb, 0xf4, 0xac, 0x87, 0xa5, - 0xd7, 0x5a, 0x2c, 0xbd, 0xd6, 0xd7, 0xd2, 0x6b, 0x39, 0x07, 0xb1, 0xc8, 0x1b, 0xb5, 0xf8, 0x1b, - 0x97, 0xfa, 0x18, 0x46, 0xff, 0xbf, 0x68, 0x64, 0x5d, 0x1d, 0xa7, 0x4c, 0xdd, 0xce, 0x26, 0x28, - 0x16, 0x39, 0x6e, 0xf2, 0x00, 0xcf, 0x76, 0xa7, 0x1f, 0x84, 0xc3, 0xf1, 0xe0, 0xc5, 0x5e, 0x3b, - 0xac, 0xa0, 0x0a, 0x0a, 0xd1, 0xb0, 0x0e, 0x1a, 0x9b, 0x41, 0x83, 0x15, 0xff, 0xb1, 0x86, 0x45, - 0x15, 0x16, 0x85, 0x51, 0x8d, 0x45, 0x26, 0x16, 0x69, 0xac, 0xb4, 0x4f, 0x9a, 0x60, 0xd1, 0xe9, - 0xc8, 0x0f, 0x40, 0xd1, 0x84, 0x2a, 0xfa, 0x6b, 0x1f, 0x1a, 0x0a, 0x42, 0x2a, 0x07, 0x21, 0x21, - 0x21, 0xb5, 0x85, 0x10, 0x53, 0x43, 0x88, 0xf6, 0x4c, 0x3a, 0xab, 0x13, 0xdb, 0xfb, 0x0b, 0x00, - 0x00, 0xff, 0xff, 0x25, 0x4e, 0x10, 0x53, 0x91, 0x03, 0x00, 0x00, + // 374 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, + 0x18, 0xc0, 0x93, 0x94, 0xb7, 0x43, 0x78, 0xa7, 0x2e, 0x2f, 0x84, 0x97, 0x0c, 0xef, 0xf8, 0x0e, + 0x77, 0xf8, 0x67, 0xd0, 0x03, 0xd1, 0x86, 0x82, 0x76, 0x08, 0x16, 0xed, 0x10, 0x24, 0x20, 0xd7, + 0xe4, 0x8c, 0x07, 0xc9, 0x5d, 0xc9, 0x73, 0x2d, 0x1d, 0xfd, 0x08, 0x0e, 0x2e, 0xae, 0xba, 0x39, + 0xf9, 0x31, 0xc4, 0xa9, 0xa3, 0xa3, 0xa4, 0x83, 0xe0, 0xa7, 0x90, 0xf6, 0x02, 0x49, 0xd7, 0x9b, + 0x02, 0x4f, 0xf8, 0xfd, 0xee, 0xc7, 0xc3, 0xe3, 0x06, 0x7d, 0x00, 0xa6, 0x42, 0x2a, 0x54, 0xce, + 0x70, 0x21, 0xd3, 0x59, 0xce, 0x00, 0x2f, 0x30, 0x4f, 0x99, 0x50, 0x5c, 0x71, 0x06, 0x58, 0x95, + 0x54, 0x00, 0x4d, 0x14, 0x97, 0x02, 0x70, 0xca, 0x6e, 0xb8, 0x60, 0x18, 0x58, 0x39, 0xe7, 0x09, + 0x43, 0xd3, 0x52, 0x2a, 0xd9, 0xdb, 0x6f, 0x39, 0x50, 0xed, 0x40, 0x0b, 0xd4, 0x38, 0x50, 0xdb, + 0x81, 0xb4, 0xc3, 0xfb, 0x93, 0x48, 0x28, 0x24, 0xe0, 0x02, 0x32, 0x3c, 0xdf, 0x59, 0x7f, 0xb4, + 0xce, 0xfb, 0x9b, 0x49, 0x99, 0xe5, 0x0c, 0xd3, 0x29, 0xc7, 0x54, 0x08, 0xa9, 0xa8, 0xe6, 0xf4, + 0x5f, 0xb3, 0xe0, 0x82, 0x01, 0xd0, 0xac, 0x0e, 0xf6, 0xce, 0x8d, 0x1c, 0xad, 0xd9, 0x75, 0xc9, + 0x60, 0x2a, 0x05, 0xd4, 0xc2, 0xdd, 0x67, 0xdb, 0xed, 0x84, 0x90, 0xf5, 0x1e, 0x6c, 0xb7, 0x7b, + 0x46, 0x45, 0x9a, 0xb3, 0xde, 0x11, 0x32, 0xd9, 0x0a, 0x0a, 0x75, 0xa8, 0x37, 0x34, 0xc3, 0xc7, + 0xcd, 0xec, 0xa2, 0x4e, 0xfc, 0x67, 0x79, 0xbf, 0xee, 0xbe, 0x5e, 0xff, 0xdb, 0xc1, 0x63, 0xe7, + 0xad, 0xf2, 0xed, 0x65, 0xe5, 0xdb, 0x9f, 0x95, 0x6f, 0xdf, 0xaf, 0x7c, 0x6b, 0xb9, 0xf2, 0xad, + 0x8f, 0x95, 0x6f, 0xb9, 0x07, 0x89, 0x2c, 0x8c, 0x5e, 0x0c, 0x7e, 0x5f, 0xea, 0x5b, 0x18, 0xad, + 0x17, 0x31, 0xb2, 0xaf, 0x8e, 0x33, 0xae, 0x6e, 0x67, 0x13, 0x94, 0xc8, 0x02, 0x9b, 0xac, 0xf9, + 0xc9, 0xe9, 0xf6, 0xc3, 0x68, 0x38, 0x1e, 0xbc, 0x38, 0x5b, 0x77, 0x15, 0xd6, 0x41, 0x11, 0x1a, + 0x36, 0x41, 0xe3, 0x76, 0xd0, 0x60, 0xc3, 0xbf, 0x6f, 0x61, 0x71, 0x8d, 0xc5, 0x51, 0xdc, 0x60, + 0x71, 0x1b, 0x8b, 0x35, 0x56, 0x39, 0x27, 0x26, 0x58, 0x7c, 0x3a, 0x0a, 0x42, 0xa6, 0x68, 0x4a, + 0x15, 0xfd, 0x76, 0x0e, 0x5b, 0x0a, 0x42, 0x6a, 0x07, 0x21, 0x11, 0x21, 0x8d, 0x85, 0x90, 0xb6, + 0x86, 0x10, 0xed, 0x99, 0x74, 0x37, 0x87, 0xb4, 0xf7, 0x13, 0x00, 0x00, 0xff, 0xff, 0xef, 0xef, + 0xc1, 0xb5, 0x90, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/deputize/service.pb.go b/x/identities/transactions/deputize/service.pb.go index ee451e8c0..bc71ad9bf 100644 --- a/x/identities/transactions/deputize/service.pb.go +++ b/x/identities/transactions/deputize/service.pb.go @@ -6,6 +6,7 @@ package deputize import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_c6e0a52473ac78cc = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x07, 0xf0, 0x26, 0x85, 0x0e, 0xc1, 0xa9, 0x63, 0xd4, 0x0c, 0x75, 0xbf, 0x03, 0x05, 0x87, - 0x73, 0x90, 0x86, 0x82, 0x16, 0x09, 0x54, 0xed, 0x10, 0x24, 0x20, 0xd7, 0xe4, 0x88, 0x07, 0xc9, - 0x5d, 0xc8, 0x5d, 0xa5, 0x38, 0xfa, 0x04, 0x82, 0x6f, 0x20, 0xb8, 0xf8, 0x0a, 0x8e, 0x2e, 0xe2, - 0x54, 0x70, 0x71, 0x94, 0xd4, 0xc9, 0xa7, 0x10, 0x9b, 0x0b, 0xb9, 0xae, 0xb7, 0x1e, 0xf9, 0xff, - 0xf8, 0x7f, 0x5f, 0x3e, 0x67, 0x34, 0x14, 0x82, 0xc8, 0x00, 0x33, 0x99, 0x11, 0x98, 0xf3, 0x64, - 0x9e, 0x11, 0x01, 0x17, 0x90, 0x26, 0x84, 0x49, 0x2a, 0x29, 0x11, 0x50, 0x96, 0x98, 0x09, 0x1c, - 0x4b, 0xca, 0x99, 0x80, 0x09, 0x29, 0xe6, 0x92, 0xde, 0x11, 0x28, 0x48, 0x79, 0x4b, 0x63, 0x02, - 0x8a, 0x92, 0x4b, 0xde, 0x3f, 0xd4, 0x14, 0xa0, 0x14, 0xb0, 0x00, 0xad, 0x02, 0x74, 0x05, 0x34, - 0x8a, 0xbb, 0x93, 0x72, 0x9e, 0x66, 0x04, 0xe2, 0x82, 0x42, 0xcc, 0x18, 0x97, 0xb8, 0xfe, 0x60, - 0xad, 0xba, 0xa6, 0xdd, 0x72, 0x22, 0x04, 0x4e, 0x55, 0x37, 0xf7, 0xdc, 0x50, 0xd1, 0x5e, 0xaf, - 0x4b, 0x22, 0x0a, 0xce, 0x84, 0x22, 0xf7, 0xdf, 0x2c, 0xa7, 0x1b, 0x88, 0xb4, 0xff, 0x6a, 0x39, - 0xbd, 0x53, 0xcc, 0x92, 0x8c, 0xf4, 0x8f, 0x81, 0xd9, 0x0a, 0x40, 0x50, 0x97, 0x75, 0xcf, 0x4c, - 0x81, 0x69, 0xfb, 0x7a, 0xa1, 0x6a, 0x0e, 0xf6, 0xee, 0x3f, 0x7f, 0x1e, 0xed, 0xdd, 0xc1, 0x36, - 0xcc, 0xeb, 0xb9, 0xb5, 0x69, 0x9b, 0xa0, 0xff, 0xdc, 0x7d, 0xaf, 0x3c, 0x6b, 0x59, 0x79, 0xd6, - 0x77, 0xe5, 0x59, 0x0f, 0x2b, 0xaf, 0xb3, 0x5c, 0x79, 0x9d, 0xaf, 0x95, 0xd7, 0x71, 0x50, 0xcc, - 0x73, 0xc3, 0x3e, 0xfe, 0xd6, 0x65, 0x7d, 0x1a, 0x93, 0xff, 0x55, 0x4d, 0xac, 0xab, 0x61, 0x4a, - 0xe5, 0xcd, 0x7c, 0x06, 0x62, 0x9e, 0x43, 0xb3, 0x5f, 0xf1, 0x64, 0xf7, 0x86, 0x41, 0x38, 0x9e, - 0x8e, 0x5e, 0xec, 0x8d, 0x43, 0x0b, 0x54, 0xa9, 0x10, 0x8c, 0xdb, 0x52, 0x53, 0xbd, 0xd4, 0x48, - 0x09, 0x1f, 0x1b, 0xc1, 0x48, 0x05, 0xa3, 0x30, 0x6a, 0x83, 0x91, 0x1e, 0x8c, 0x9a, 0x60, 0x65, - 0xfb, 0x66, 0xc1, 0xe8, 0x64, 0xe2, 0x07, 0x44, 0xe2, 0x04, 0x4b, 0xfc, 0x6b, 0x1f, 0x69, 0x08, - 0x42, 0x4a, 0x41, 0x28, 0x44, 0xa8, 0x75, 0x10, 0xd2, 0x21, 0x84, 0x1a, 0x69, 0xd6, 0x5b, 0x1f, - 0xdd, 0xc1, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb2, 0x77, 0xb6, 0xbb, 0xab, 0x03, 0x00, 0x00, + // 373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x10, 0x24, 0x83, 0xa3, 0xc3, 0x1d, 0x2a, + 0x38, 0x9c, 0x83, 0x34, 0x14, 0xb4, 0x48, 0xa0, 0x6a, 0x87, 0x20, 0x01, 0xb9, 0x26, 0x47, 0x3c, + 0x48, 0xee, 0x42, 0xde, 0xb5, 0x14, 0x27, 0x3f, 0x82, 0xa3, 0xb3, 0x20, 0x82, 0x93, 0x1f, 0x43, + 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0x7e, 0x0a, 0xa9, 0xb9, 0x92, 0x74, 0xcd, 0x14, 0x78, 0xe1, + 0xff, 0xbb, 0x3f, 0x8f, 0x67, 0x0f, 0xfa, 0x00, 0x4c, 0xf9, 0x54, 0xa8, 0x94, 0xe1, 0x4c, 0xc6, + 0xd3, 0x94, 0x01, 0x9e, 0x63, 0x1e, 0x33, 0xa1, 0xb8, 0xe2, 0x0c, 0xb0, 0x2a, 0xa8, 0x00, 0x1a, + 0x29, 0x2e, 0x05, 0xe0, 0x98, 0xe5, 0x53, 0xc5, 0xef, 0x19, 0x06, 0x56, 0xcc, 0x78, 0xc4, 0x50, + 0x5e, 0x48, 0x25, 0x7b, 0xc7, 0x0d, 0x05, 0x69, 0x05, 0xcd, 0x51, 0xad, 0xa0, 0xa6, 0x82, 0xd6, + 0x8a, 0xb3, 0x13, 0x49, 0xc8, 0x24, 0xe0, 0x0c, 0x12, 0x3c, 0x3b, 0x58, 0x7d, 0x2a, 0xd0, 0xd9, + 0x4d, 0xa4, 0x4c, 0x52, 0x86, 0x69, 0xce, 0x31, 0x15, 0x42, 0x2a, 0x5a, 0x25, 0xab, 0xbf, 0x6d, + 0x4b, 0x67, 0x0c, 0x80, 0x26, 0xba, 0xb4, 0x73, 0xd9, 0x52, 0x69, 0x4c, 0x6f, 0x0b, 0x06, 0xb9, + 0x14, 0xa0, 0xc9, 0xc3, 0x57, 0xd3, 0xee, 0xf8, 0x90, 0xf4, 0x9e, 0x4c, 0xbb, 0x7b, 0x4e, 0x45, + 0x9c, 0xb2, 0xde, 0x29, 0x6a, 0xb7, 0x1b, 0xe4, 0x57, 0x65, 0x9d, 0x8b, 0xb6, 0xc0, 0xb8, 0x9e, + 0x5e, 0xe9, 0x9a, 0x7b, 0x86, 0xb3, 0xf5, 0xf0, 0xf3, 0xbe, 0x6f, 0x7a, 0x2f, 0x9d, 0x8f, 0xd2, + 0x35, 0x17, 0xa5, 0x6b, 0x7e, 0x97, 0xae, 0xf9, 0xb8, 0x74, 0x8d, 0xc5, 0xd2, 0x35, 0xbe, 0x96, + 0xae, 0x61, 0x93, 0x48, 0x66, 0x2d, 0xdf, 0xf4, 0xb6, 0xaf, 0xab, 0xbb, 0x18, 0xad, 0xd6, 0x31, + 0x32, 0x6f, 0xfa, 0x09, 0x57, 0x77, 0xd3, 0x09, 0x8a, 0x64, 0x86, 0xdb, 0xad, 0xfb, 0xd9, 0xea, + 0xf6, 0xfd, 0x60, 0x38, 0x1e, 0xbc, 0x59, 0x1b, 0x57, 0xe6, 0xeb, 0x52, 0x01, 0x1a, 0xd6, 0xa5, + 0xc6, 0xcd, 0x52, 0x03, 0x2d, 0x7c, 0x6e, 0x04, 0x43, 0x1d, 0x0c, 0x83, 0xb0, 0x0e, 0x86, 0xcd, + 0x60, 0xb8, 0x0e, 0x96, 0x96, 0xd7, 0x2e, 0x18, 0x9e, 0x8d, 0x3c, 0x9f, 0x29, 0x1a, 0x53, 0x45, + 0x7f, 0xad, 0x93, 0x06, 0x42, 0x88, 0x56, 0x08, 0x09, 0x08, 0xa9, 0x1d, 0x42, 0x9a, 0x10, 0x21, + 0x6b, 0x69, 0xd2, 0xfd, 0x3f, 0xac, 0xa3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0xa7, 0xb1, + 0x9d, 0xa8, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/issue/service.pb.go b/x/identities/transactions/issue/service.pb.go index aa839fcd5..1dcc5d858 100644 --- a/x/identities/transactions/issue/service.pb.go +++ b/x/identities/transactions/issue/service.pb.go @@ -6,6 +6,7 @@ package issue import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_67f6e03c262c4d59 = []byte{ - // 362 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x04, 0xa7, 0x4e, 0x12, 0x24, 0x48, 0x1f, 0xe0, 0x0e, 0xec, 0xa0, - 0x1c, 0xa2, 0xb4, 0x8b, 0xcd, 0x10, 0x29, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, 0x11, 0x0f, 0x92, - 0xbb, 0x92, 0xff, 0x2a, 0x9d, 0x7d, 0x02, 0xa1, 0x6f, 0xe0, 0xe8, 0xe8, 0xe8, 0x13, 0x88, 0x53, - 0xc1, 0xc5, 0x51, 0x52, 0x27, 0x9f, 0x42, 0x9a, 0x04, 0x72, 0x5d, 0x6f, 0xbd, 0xe3, 0xfb, 0xf8, - 0xfe, 0x9f, 0xdf, 0x19, 0x8d, 0x00, 0x98, 0x0a, 0xa8, 0x50, 0x19, 0xc3, 0xb9, 0x4c, 0x96, 0x19, - 0x03, 0xbc, 0xc2, 0x3c, 0x61, 0x42, 0x71, 0xc5, 0x19, 0x60, 0x55, 0x50, 0x01, 0x34, 0x56, 0x5c, - 0x0a, 0xc0, 0x1c, 0x60, 0xc9, 0x30, 0xb0, 0xe2, 0x91, 0xc7, 0x0c, 0x2d, 0x0a, 0xa9, 0x64, 0x7f, - 0xa8, 0x29, 0x50, 0xa3, 0x40, 0x2b, 0xd4, 0x2a, 0x90, 0xae, 0x40, 0x95, 0xc2, 0x3d, 0x4a, 0xa5, - 0x4c, 0x33, 0x86, 0xe9, 0x82, 0x63, 0x2a, 0x84, 0x54, 0xb4, 0xfe, 0xad, 0x94, 0xae, 0x51, 0x55, - 0xce, 0x00, 0x68, 0xda, 0x54, 0xb9, 0xd7, 0x26, 0x0a, 0xed, 0xe9, 0xbe, 0x60, 0xb0, 0x90, 0x02, - 0x1a, 0xdf, 0xc9, 0xbb, 0xe5, 0x74, 0x03, 0x48, 0xfb, 0x6f, 0x96, 0xd3, 0x9b, 0x50, 0x91, 0x64, - 0xac, 0x7f, 0x8e, 0x0c, 0x26, 0x47, 0x41, 0x9d, 0xe9, 0x4e, 0x8c, 0xe8, 0x59, 0xfb, 0x74, 0xd3, - 0x04, 0x0e, 0x8e, 0x9f, 0xbe, 0x7e, 0xd7, 0xb6, 0x3b, 0x38, 0xc4, 0x79, 0x3d, 0xae, 0x36, 0x64, - 0x45, 0x8d, 0xd7, 0xdd, 0x8f, 0xd2, 0xb3, 0x36, 0xa5, 0x67, 0xfd, 0x94, 0x9e, 0xf5, 0xbc, 0xf5, - 0x3a, 0x9b, 0xad, 0xd7, 0xf9, 0xde, 0x7a, 0x1d, 0xe7, 0x34, 0x96, 0xb9, 0x49, 0xc9, 0xf8, 0xe0, - 0xb6, 0xbe, 0x82, 0xe9, 0x6e, 0x3d, 0x53, 0xeb, 0xee, 0x22, 0xe5, 0xea, 0x61, 0x39, 0x47, 0xb1, - 0xcc, 0xb1, 0xc1, 0xee, 0x5f, 0xec, 0xde, 0x28, 0x08, 0xfd, 0x99, 0xff, 0x6a, 0xef, 0x1d, 0x54, - 0xd0, 0xe4, 0x84, 0xc8, 0x6f, 0x73, 0x66, 0x7a, 0x8e, 0xbf, 0xc3, 0x3f, 0xf7, 0xa8, 0xa8, 0xa1, - 0xa2, 0x30, 0x6a, 0xa9, 0x48, 0xa7, 0xa2, 0x8a, 0x2a, 0xed, 0x4b, 0x03, 0x2a, 0xba, 0x9a, 0x8e, - 0x03, 0xa6, 0x68, 0x42, 0x15, 0xfd, 0xb3, 0xcf, 0x34, 0x03, 0x21, 0x8d, 0x82, 0x90, 0x90, 0x90, - 0x56, 0x42, 0x88, 0x6e, 0x21, 0xa4, 0xd2, 0xcc, 0x7b, 0xd5, 0x65, 0x0d, 0xff, 0x03, 0x00, 0x00, - 0xff, 0xff, 0x01, 0x5a, 0xf6, 0xd3, 0x84, 0x03, 0x00, 0x00, + // 372 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x80, 0x93, 0x94, 0xaf, 0x43, 0xf8, 0xa6, 0x2e, 0x1f, 0x84, 0x8f, 0x0c, 0xdf, 0xf8, 0x0d, + 0x77, 0x68, 0x07, 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x86, 0x48, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, + 0x8e, 0x78, 0x90, 0xdc, 0x95, 0xbc, 0xd7, 0xd2, 0xd1, 0x9f, 0x20, 0xfa, 0x0b, 0x74, 0x74, 0xf2, + 0x67, 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x5f, 0x21, 0x4d, 0x02, 0xb9, 0xae, 0x37, 0x05, + 0xde, 0xf0, 0x3c, 0xf7, 0xf0, 0xf2, 0xba, 0xa3, 0x11, 0x00, 0x53, 0x21, 0x15, 0x2a, 0x67, 0xb8, + 0x90, 0xe9, 0x32, 0x67, 0x80, 0xd7, 0x98, 0xa7, 0x4c, 0x28, 0xae, 0x38, 0x03, 0xac, 0x4a, 0x2a, + 0x80, 0x26, 0x8a, 0x4b, 0x01, 0x98, 0x03, 0x2c, 0x19, 0x06, 0x56, 0xae, 0x78, 0xc2, 0xd0, 0xa2, + 0x94, 0x4a, 0x0e, 0x86, 0x9a, 0x02, 0xb5, 0x0a, 0xb4, 0x46, 0x9d, 0x02, 0xe9, 0x0a, 0x54, 0x2b, + 0xbc, 0x3f, 0x89, 0x84, 0x42, 0x02, 0x2e, 0x20, 0xc3, 0xab, 0x83, 0xdd, 0xa7, 0xb1, 0x79, 0x7f, + 0x33, 0x29, 0xb3, 0x9c, 0x61, 0xba, 0xe0, 0x98, 0x0a, 0x21, 0x15, 0x6d, 0xb0, 0xe6, 0xaf, 0x51, + 0x6e, 0xc1, 0x00, 0x68, 0xd6, 0xe6, 0x7a, 0x17, 0x26, 0x0a, 0x6d, 0x74, 0x53, 0x32, 0x58, 0x48, + 0x01, 0xad, 0xef, 0xf0, 0xc9, 0x76, 0x7b, 0x21, 0x64, 0x83, 0x07, 0xdb, 0xed, 0x4f, 0xa8, 0x48, + 0x73, 0x36, 0x38, 0x41, 0x06, 0x2b, 0x41, 0x61, 0x93, 0xe9, 0x4d, 0x8c, 0xe8, 0x59, 0x37, 0xba, + 0x6c, 0x03, 0xff, 0x59, 0xde, 0xaf, 0xbb, 0xaf, 0xd7, 0xff, 0xf6, 0xf8, 0xb1, 0xf7, 0x56, 0xf9, + 0xf6, 0xa6, 0xf2, 0xed, 0xcf, 0xca, 0xb7, 0xef, 0xb7, 0xbe, 0xb5, 0xd9, 0xfa, 0xd6, 0xc7, 0xd6, + 0xb7, 0xdc, 0xa3, 0x44, 0x16, 0x26, 0x0f, 0x8e, 0x7f, 0x5f, 0x35, 0x57, 0x30, 0xdd, 0x6d, 0x61, + 0x6a, 0x5f, 0x9f, 0x66, 0x5c, 0xdd, 0x2e, 0xe7, 0x28, 0x91, 0x05, 0x36, 0x58, 0xf1, 0xb3, 0xd3, + 0x1f, 0x85, 0x51, 0x30, 0x0b, 0x5e, 0x9c, 0xbd, 0x83, 0x0a, 0xdb, 0x9c, 0x08, 0x05, 0x5d, 0xce, + 0x4c, 0xcf, 0x09, 0x76, 0xf8, 0xfb, 0x1e, 0x15, 0xb7, 0x54, 0x1c, 0xc5, 0x1d, 0x15, 0xeb, 0x54, + 0x5c, 0x53, 0x95, 0x73, 0x66, 0x40, 0xc5, 0xe7, 0xd3, 0x71, 0xc8, 0x14, 0x4d, 0xa9, 0xa2, 0xdf, + 0xce, 0xb1, 0x66, 0x20, 0xa4, 0x55, 0x10, 0x12, 0x11, 0xd2, 0x49, 0x08, 0xd1, 0x2d, 0x84, 0xd4, + 0x9a, 0x79, 0xbf, 0x3e, 0xa0, 0xe1, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xb9, 0x1d, 0xaf, + 0x84, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/name/service.pb.go b/x/identities/transactions/name/service.pb.go index aa3223290..95816ac2a 100644 --- a/x/identities/transactions/name/service.pb.go +++ b/x/identities/transactions/name/service.pb.go @@ -6,6 +6,7 @@ package name import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_5f93b42fa6f5fa12 = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x84, 0x6f, 0xea, 0xf2, 0xf1, 0x85, 0x8f, 0x7c, 0xd0, 0x1f, 0x70, - 0x07, 0xfd, 0x40, 0xe1, 0x44, 0xb1, 0x5d, 0x6a, 0x87, 0x94, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, - 0xbc, 0xc4, 0x40, 0xee, 0xae, 0xe4, 0xae, 0xd2, 0xd9, 0x5d, 0x10, 0xfc, 0x07, 0x8e, 0x2e, 0x8e, - 0xfe, 0x05, 0x71, 0x2a, 0xb8, 0x38, 0x4a, 0xea, 0xe4, 0xaf, 0x90, 0x34, 0x07, 0xb9, 0x8e, 0xcd, - 0x7a, 0xe1, 0x79, 0x78, 0xde, 0x37, 0xaf, 0x73, 0x3a, 0x90, 0x12, 0x94, 0x4f, 0xb9, 0xca, 0x00, - 0x33, 0x11, 0x2f, 0x33, 0x90, 0x78, 0x85, 0xd3, 0x18, 0xb8, 0x4a, 0x55, 0x0a, 0x12, 0xab, 0x9c, - 0x72, 0x49, 0x23, 0x95, 0x0a, 0x2e, 0x31, 0xa7, 0x0c, 0xb0, 0x84, 0xfc, 0x26, 0x8d, 0x00, 0x2d, - 0x72, 0xa1, 0x44, 0xb7, 0x6f, 0x18, 0x90, 0x36, 0xa0, 0x15, 0xaa, 0x0d, 0xc8, 0x34, 0xa0, 0xd2, - 0xe0, 0xfe, 0x4d, 0x84, 0x48, 0x32, 0xc0, 0x74, 0x91, 0x62, 0xca, 0xb9, 0x50, 0xb4, 0xfa, 0xb8, - 0x35, 0xba, 0x4d, 0x9a, 0x18, 0x48, 0x49, 0x13, 0xdd, 0xe4, 0xfa, 0x0d, 0x0c, 0xc6, 0xcb, 0x55, - 0x0e, 0x72, 0x21, 0xb8, 0xd4, 0xba, 0xfe, 0x8b, 0xe5, 0xb4, 0x7d, 0x99, 0x74, 0x9f, 0x2d, 0xa7, - 0x73, 0x46, 0x79, 0x9c, 0x41, 0xf7, 0x08, 0xed, 0x3f, 0x36, 0xf2, 0xab, 0x48, 0x77, 0xd4, 0x04, - 0x9e, 0xd5, 0x2f, 0xe7, 0x3a, 0xaf, 0xf7, 0xef, 0xf6, 0xfd, 0xeb, 0xc1, 0xfe, 0xd3, 0xfb, 0x8d, - 0x59, 0x35, 0xab, 0x31, 0x61, 0x09, 0x0d, 0xef, 0xda, 0xaf, 0x85, 0x67, 0xad, 0x0b, 0xcf, 0xfa, - 0x2c, 0x3c, 0xeb, 0x7e, 0xe3, 0xb5, 0xd6, 0x1b, 0xaf, 0xf5, 0xb1, 0xf1, 0x5a, 0xce, 0x41, 0x24, - 0x58, 0x83, 0x8e, 0xe1, 0xaf, 0x8b, 0xea, 0xf7, 0x4f, 0xcb, 0xd5, 0x4c, 0xad, 0xcb, 0xe3, 0x24, - 0x55, 0xd7, 0xcb, 0x39, 0x8a, 0x04, 0xc3, 0xfb, 0xaf, 0xfd, 0xd1, 0xee, 0x0c, 0xfc, 0x60, 0x3c, - 0x9b, 0x3c, 0xd9, 0x3b, 0x87, 0xe4, 0xeb, 0x98, 0x00, 0x8d, 0xeb, 0x98, 0x99, 0x19, 0x33, 0xa1, - 0x0c, 0xde, 0x76, 0xa0, 0x50, 0x43, 0x61, 0x10, 0xd6, 0x50, 0x68, 0x42, 0x61, 0x09, 0x15, 0xf6, - 0xc9, 0xfe, 0x50, 0x38, 0x9a, 0x0e, 0x7d, 0x50, 0x34, 0xa6, 0x8a, 0x7e, 0xdb, 0x87, 0x86, 0x80, - 0x10, 0x6d, 0x20, 0x24, 0x20, 0xa4, 0x76, 0x10, 0x62, 0x4a, 0x08, 0x29, 0x2d, 0xf3, 0xce, 0xf6, - 0xa0, 0xfe, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xbb, 0x6c, 0x35, 0x57, 0x77, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0x80, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x58, 0x41, + 0xe1, 0x44, 0xb1, 0x5d, 0x6a, 0x87, 0x94, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, + 0xbb, 0x2b, 0xf9, 0xaf, 0xa5, 0xa3, 0x2f, 0x20, 0xf4, 0x0d, 0x04, 0x47, 0x27, 0x1f, 0x43, 0x9c, + 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0x3e, 0x85, 0xc4, 0x04, 0x72, 0x1d, 0x9b, 0x29, 0xf0, 0x87, 0xef, + 0xcb, 0xc7, 0x9f, 0xdf, 0xbe, 0xee, 0x01, 0x30, 0xe5, 0x51, 0xa1, 0x52, 0x86, 0xb9, 0x8c, 0xe6, + 0x29, 0x03, 0xbc, 0xc4, 0x49, 0xc4, 0x84, 0x4a, 0x54, 0xc2, 0x00, 0xab, 0x8c, 0x0a, 0xa0, 0xa1, + 0x4a, 0xa4, 0x00, 0x2c, 0x28, 0x67, 0x18, 0x58, 0xb6, 0x48, 0x42, 0x86, 0x66, 0x99, 0x54, 0xb2, + 0xd3, 0xd5, 0x0c, 0xa8, 0x32, 0xa0, 0x25, 0xaa, 0x0d, 0x48, 0x37, 0xa0, 0xc2, 0xe0, 0x1c, 0x84, + 0x12, 0xb8, 0x04, 0xcc, 0x21, 0xc6, 0x8b, 0x93, 0xe2, 0x51, 0xca, 0x9c, 0xc3, 0x58, 0xca, 0x38, + 0x65, 0x98, 0xce, 0x12, 0x4c, 0x85, 0x90, 0x8a, 0x96, 0x54, 0xf9, 0xb6, 0x49, 0x2c, 0x67, 0x00, + 0x34, 0xae, 0x62, 0x1d, 0xaf, 0x81, 0x41, 0x9b, 0x3c, 0x64, 0x0c, 0x66, 0x52, 0x40, 0xa5, 0xeb, + 0xbe, 0x98, 0x76, 0xcb, 0x83, 0xb8, 0xb3, 0x32, 0xed, 0xf6, 0x0d, 0x15, 0x51, 0xca, 0x3a, 0x17, + 0x68, 0xf7, 0x7d, 0x20, 0xaf, 0x8c, 0x74, 0x06, 0x4d, 0xe0, 0x49, 0x3d, 0xb9, 0xad, 0xf2, 0x8e, + 0x0c, 0x67, 0xef, 0xe9, 0xe7, 0xfd, 0xd8, 0xec, 0x3f, 0xb7, 0x3e, 0x72, 0xd7, 0x5c, 0xe7, 0xae, + 0xf9, 0x9d, 0xbb, 0xe6, 0x6a, 0xe3, 0x1a, 0xeb, 0x8d, 0x6b, 0x7c, 0x6d, 0x5c, 0xc3, 0x3e, 0x0b, + 0x25, 0x6f, 0xf0, 0xbd, 0xfe, 0xfe, 0x5d, 0xf9, 0xff, 0xc7, 0xc5, 0x0a, 0xc6, 0xe6, 0xfd, 0x65, + 0x9c, 0xa8, 0xc7, 0xf9, 0x14, 0x85, 0x92, 0xe3, 0xdd, 0xd7, 0xfb, 0x6a, 0xb5, 0x7b, 0x9e, 0x3f, + 0x9c, 0x8c, 0xde, 0xac, 0xad, 0x4b, 0xf2, 0xaa, 0x18, 0x1f, 0x0d, 0xeb, 0x98, 0x89, 0x1e, 0x33, + 0xa2, 0x9c, 0x7d, 0x6e, 0x41, 0x41, 0x05, 0x05, 0x7e, 0x50, 0x43, 0x81, 0x0e, 0x05, 0x05, 0x94, + 0x5b, 0x57, 0xbb, 0x43, 0xc1, 0x60, 0xdc, 0xf7, 0x98, 0xa2, 0x11, 0x55, 0xf4, 0xd7, 0x3a, 0xd7, + 0x04, 0x84, 0x54, 0x06, 0x42, 0x7c, 0x42, 0x6a, 0x07, 0x21, 0xba, 0x84, 0x90, 0xc2, 0x32, 0x6d, + 0xff, 0x1f, 0xce, 0xe9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x47, 0xc6, 0xa9, 0x78, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/provision/service.pb.go b/x/identities/transactions/provision/service.pb.go index b89865a1f..dd80a3bfe 100644 --- a/x/identities/transactions/provision/service.pb.go +++ b/x/identities/transactions/provision/service.pb.go @@ -6,6 +6,7 @@ package provision import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_d21f8e25d50e279b = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x04, 0xa7, 0x8e, 0xa1, 0x64, 0x28, 0xce, 0x77, 0xa0, 0x83, 0x70, - 0x3a, 0xd8, 0x88, 0x68, 0xc1, 0x40, 0xa8, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0xf1, 0x20, 0xb9, - 0x0b, 0xb9, 0x6b, 0xe9, 0xec, 0x13, 0x08, 0xbe, 0x81, 0xa3, 0xbe, 0x83, 0xa3, 0x88, 0x53, 0xc1, - 0xc5, 0x51, 0x52, 0x27, 0x9f, 0x42, 0xb4, 0x67, 0x72, 0x5d, 0x6f, 0x3d, 0xf2, 0x7d, 0x7c, 0xff, - 0x9f, 0xdf, 0x39, 0x1d, 0x09, 0x41, 0x64, 0x80, 0x99, 0xcc, 0x09, 0x2c, 0x78, 0x3a, 0xcf, 0x89, - 0x80, 0x4b, 0x48, 0x53, 0xc2, 0x24, 0x95, 0x94, 0x08, 0x28, 0x2b, 0xcc, 0x04, 0x4e, 0x24, 0xe5, - 0x4c, 0xc0, 0xb2, 0xe2, 0x0b, 0x2a, 0x28, 0x67, 0x50, 0x90, 0x6a, 0x41, 0x13, 0x02, 0xca, 0x8a, - 0x4b, 0xde, 0x3f, 0xd0, 0x34, 0x40, 0x69, 0xc0, 0x12, 0xb4, 0x1a, 0xa0, 0x6b, 0x40, 0xa3, 0x71, - 0x07, 0x19, 0xe7, 0x59, 0x4e, 0x20, 0x2e, 0x29, 0xc4, 0x8c, 0x71, 0x89, 0x9b, 0x2f, 0x24, 0x77, - 0x8d, 0xeb, 0x0a, 0x22, 0x04, 0xce, 0x54, 0x9d, 0x3b, 0x31, 0xd5, 0x68, 0xcf, 0xd7, 0x15, 0x11, - 0x25, 0x67, 0x42, 0x39, 0xf7, 0x5e, 0x2c, 0xa7, 0x1b, 0x88, 0xac, 0xff, 0x6c, 0x39, 0xbd, 0x73, - 0xcc, 0xd2, 0x9c, 0xf4, 0x8f, 0x81, 0xe1, 0x16, 0x40, 0xb0, 0xc9, 0x75, 0x2f, 0x8c, 0x0d, 0xd3, - 0xf6, 0x79, 0xa2, 0x42, 0x87, 0xbb, 0xb7, 0xef, 0x5f, 0xf7, 0xb6, 0x37, 0x1c, 0xc0, 0x62, 0x33, - 0xba, 0x36, 0x70, 0x43, 0xfa, 0x4f, 0xdd, 0xd7, 0xda, 0xb3, 0x56, 0xb5, 0x67, 0x7d, 0xd6, 0x9e, - 0x75, 0xb7, 0xf6, 0x3a, 0xab, 0xb5, 0xd7, 0xf9, 0x58, 0x7b, 0x1d, 0xe7, 0x30, 0xe1, 0x85, 0x69, - 0x91, 0xbf, 0x73, 0xb9, 0xb9, 0x90, 0xf0, 0x77, 0x5d, 0xa1, 0x75, 0xe5, 0x67, 0x54, 0xde, 0xcc, - 0x67, 0x20, 0xe1, 0x05, 0x34, 0xfc, 0x1f, 0x0f, 0x76, 0x6f, 0x14, 0x44, 0xe3, 0x69, 0xf8, 0x68, - 0x6f, 0x1d, 0x5c, 0xa0, 0xb2, 0x22, 0x30, 0x6e, 0xb3, 0xa6, 0x7a, 0x56, 0xf8, 0xaf, 0x78, 0xdb, - 0x22, 0x63, 0x45, 0xc6, 0x51, 0xdc, 0x92, 0xb1, 0x4e, 0xc6, 0x0d, 0x59, 0xdb, 0x27, 0x86, 0x64, - 0x7c, 0x16, 0xfa, 0x01, 0x91, 0x38, 0xc5, 0x12, 0x7f, 0xdb, 0x47, 0x9a, 0x05, 0x21, 0xa5, 0x41, - 0x28, 0x42, 0xa8, 0x15, 0x21, 0xa4, 0x9b, 0x10, 0x6a, 0x54, 0xb3, 0xde, 0xdf, 0xf5, 0xed, 0xff, - 0x04, 0x00, 0x00, 0xff, 0xff, 0xec, 0xbe, 0xb8, 0x74, 0xb8, 0x03, 0x00, 0x00, + // 378 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x6b, 0xdb, 0x40, + 0x14, 0x07, 0x70, 0x49, 0xa6, 0x1e, 0x44, 0x27, 0x2f, 0x05, 0x51, 0x34, 0x74, 0xec, 0x70, 0x47, + 0xdb, 0xa1, 0x70, 0xed, 0x50, 0xab, 0x84, 0xc4, 0x10, 0x81, 0x70, 0x3c, 0x88, 0x20, 0x08, 0x67, + 0xe9, 0x50, 0x0e, 0xa4, 0x7b, 0x42, 0xef, 0x6c, 0x3c, 0xe6, 0x23, 0x64, 0xce, 0x98, 0x2d, 0xc9, + 0x92, 0x8f, 0x11, 0x32, 0x79, 0xcc, 0x18, 0xe4, 0x21, 0x90, 0x4f, 0x11, 0x1c, 0x2b, 0x92, 0xbc, + 0x6a, 0x3a, 0x78, 0xf0, 0xff, 0xdd, 0x9f, 0xc7, 0xb3, 0x0f, 0xc6, 0x88, 0x42, 0xfb, 0x5c, 0xe9, + 0x4c, 0xd0, 0x1c, 0x92, 0x45, 0x26, 0x90, 0xae, 0xa8, 0x4c, 0x84, 0xd2, 0x52, 0x4b, 0x81, 0x54, + 0x97, 0x5c, 0x21, 0x8f, 0xb5, 0x04, 0x85, 0xb4, 0x28, 0x61, 0x29, 0x51, 0x82, 0xa2, 0x28, 0xca, + 0xa5, 0x8c, 0x05, 0x29, 0x4a, 0xd0, 0x30, 0xfa, 0xdd, 0x61, 0x48, 0xcd, 0x90, 0x15, 0x69, 0x19, + 0xd2, 0x65, 0x48, 0xc3, 0x38, 0x5f, 0x62, 0xc0, 0x1c, 0x90, 0xe6, 0x98, 0xd2, 0xe5, 0x8f, 0xed, + 0xb3, 0x13, 0x9d, 0xaf, 0x29, 0x40, 0x9a, 0x09, 0xca, 0x0b, 0x49, 0xb9, 0x52, 0xa0, 0x79, 0x13, + 0xd5, 0xe0, 0xf4, 0xae, 0x9d, 0x0b, 0x44, 0x9e, 0xd6, 0xb5, 0x9d, 0x69, 0x5f, 0xa6, 0x33, 0x3e, + 0x2b, 0x05, 0x16, 0xa0, 0xb0, 0x36, 0x7f, 0xde, 0x98, 0xf6, 0xc0, 0xc7, 0x74, 0x74, 0x65, 0xda, + 0xc3, 0x23, 0xae, 0x92, 0x4c, 0x8c, 0xfe, 0x91, 0x9e, 0xeb, 0x21, 0xfe, 0xae, 0xae, 0x73, 0xdc, + 0x5b, 0x98, 0xb5, 0xe3, 0x69, 0x5d, 0xf4, 0x9b, 0xe1, 0x7c, 0xba, 0x78, 0xb9, 0xff, 0x6e, 0x7a, + 0x77, 0x83, 0x87, 0xca, 0x35, 0xd7, 0x95, 0x6b, 0x3e, 0x57, 0xae, 0x79, 0xb9, 0x71, 0x8d, 0xf5, + 0xc6, 0x35, 0x9e, 0x36, 0xae, 0x61, 0xff, 0x89, 0x21, 0xef, 0xfb, 0xa9, 0xf7, 0xf9, 0x64, 0x77, + 0x1d, 0xc1, 0x76, 0x23, 0x81, 0x79, 0xea, 0xa5, 0x52, 0x9f, 0x2f, 0xe6, 0x24, 0x86, 0x9c, 0xf6, + 0x5c, 0xf9, 0xb5, 0x35, 0x1c, 0xfb, 0xe1, 0x64, 0x16, 0xdc, 0x5a, 0x7b, 0xc7, 0xe6, 0xd7, 0xb5, + 0x42, 0x32, 0x69, 0x6b, 0xcd, 0xba, 0xb5, 0x82, 0x0f, 0xe2, 0x71, 0x2f, 0x19, 0xd5, 0xc9, 0x28, + 0x8c, 0xda, 0x64, 0xd4, 0x4d, 0x46, 0x4d, 0xb2, 0xb2, 0xfe, 0xf7, 0x4c, 0x46, 0x87, 0x81, 0xe7, + 0x0b, 0xcd, 0x13, 0xae, 0xf9, 0xab, 0xf5, 0xb7, 0xa3, 0x30, 0x56, 0x33, 0x8c, 0x85, 0x8c, 0xb5, + 0x10, 0x63, 0x5d, 0x89, 0xb1, 0x86, 0x9a, 0x0f, 0xdf, 0x0f, 0xec, 0xd7, 0x5b, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x8c, 0xc8, 0x37, 0xaa, 0xb4, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/quash/service.pb.go b/x/identities/transactions/quash/service.pb.go index ff1a67556..51806ba78 100644 --- a/x/identities/transactions/quash/service.pb.go +++ b/x/identities/transactions/quash/service.pb.go @@ -6,6 +6,7 @@ package quash import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_8f0ffa14eacab991 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x04, 0xa7, 0x4e, 0x12, 0x24, 0x48, 0x1f, 0xe0, 0x0e, 0xec, 0xa0, - 0x1c, 0xa2, 0xb4, 0x8b, 0xed, 0x10, 0x69, 0xb5, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x23, 0x3d, 0x48, - 0xee, 0x6a, 0xee, 0x2a, 0x9d, 0x7d, 0x02, 0xa1, 0x6f, 0xe0, 0xe8, 0xe8, 0xe8, 0x13, 0x88, 0x53, - 0xc1, 0xc5, 0x51, 0x12, 0x27, 0x9f, 0x42, 0x9a, 0x1c, 0xe4, 0xba, 0xde, 0x7a, 0xc7, 0xf7, 0xf1, - 0xfd, 0x3f, 0xbf, 0x33, 0x18, 0x08, 0x41, 0xa4, 0x8f, 0x99, 0x4c, 0x09, 0xcc, 0x78, 0xbc, 0x4a, - 0x89, 0x80, 0x6b, 0x48, 0x63, 0xc2, 0x24, 0x95, 0x94, 0x08, 0x28, 0x73, 0xcc, 0x04, 0x8e, 0x24, - 0xe5, 0x4c, 0xc0, 0x87, 0x15, 0x16, 0x0b, 0x28, 0x48, 0xfe, 0x48, 0x23, 0x02, 0x96, 0x39, 0x97, - 0xbc, 0xdb, 0xd7, 0x14, 0x40, 0x29, 0xc0, 0x1a, 0x34, 0x0a, 0xa0, 0x2b, 0x40, 0xa5, 0x70, 0x8f, - 0x12, 0xce, 0x93, 0x94, 0x40, 0xbc, 0xa4, 0x10, 0x33, 0xc6, 0x25, 0xae, 0x7f, 0x2b, 0xa5, 0x6b, - 0x54, 0x95, 0x11, 0x21, 0x70, 0xa2, 0xaa, 0xdc, 0x6b, 0x13, 0x85, 0xf6, 0x74, 0x9f, 0x13, 0xb1, - 0xe4, 0x4c, 0x28, 0xdf, 0xc9, 0xbb, 0xe5, 0xb4, 0x7d, 0x91, 0x74, 0xdf, 0x2c, 0xa7, 0x33, 0xc2, - 0x2c, 0x4e, 0x49, 0xf7, 0x1c, 0x18, 0x4c, 0x0e, 0xfc, 0x3a, 0xd3, 0x1d, 0x19, 0xd1, 0xb3, 0xe6, - 0xe9, 0x46, 0x05, 0xf6, 0x8e, 0x9f, 0xbe, 0x7e, 0x37, 0xb6, 0xdb, 0x3b, 0x84, 0x59, 0x3d, 0xae, - 0x36, 0x64, 0x45, 0x0d, 0x37, 0xed, 0x8f, 0xc2, 0xb3, 0xb6, 0x85, 0x67, 0xfd, 0x14, 0x9e, 0xf5, - 0x5c, 0x7a, 0xad, 0x6d, 0xe9, 0xb5, 0xbe, 0x4b, 0xaf, 0xe5, 0x9c, 0x46, 0x3c, 0x33, 0x29, 0x19, - 0x1e, 0xdc, 0xd6, 0x57, 0x30, 0xd9, 0xad, 0x67, 0x62, 0xdd, 0x5d, 0x24, 0x54, 0x2e, 0x56, 0x73, - 0x10, 0xf1, 0x0c, 0x1a, 0xec, 0xfe, 0xc5, 0xee, 0x0c, 0xfc, 0x60, 0x3c, 0x9b, 0xbe, 0xda, 0x7b, - 0x07, 0xe5, 0xab, 0x9c, 0x00, 0x8c, 0x9b, 0x9c, 0x99, 0x9e, 0x33, 0xdd, 0xe1, 0x9f, 0x7b, 0x54, - 0xa8, 0xa8, 0x30, 0x08, 0x1b, 0x2a, 0xd4, 0xa9, 0xb0, 0xa2, 0x0a, 0xfb, 0xd2, 0x80, 0x0a, 0xaf, - 0x26, 0x43, 0x9f, 0x48, 0x1c, 0x63, 0x89, 0xff, 0xec, 0x33, 0xcd, 0x80, 0x90, 0x52, 0x20, 0x14, - 0x20, 0xd4, 0x48, 0x10, 0xd2, 0x2d, 0x08, 0x55, 0x9a, 0x79, 0xa7, 0xba, 0xac, 0xfe, 0x7f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x44, 0xb6, 0x4b, 0xdc, 0x84, 0x03, 0x00, 0x00, + // 371 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x80, 0x93, 0x94, 0xaf, 0x43, 0xf8, 0xa6, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x68, + 0x07, 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x87, 0x48, 0xab, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x69, + 0x20, 0xb9, 0xab, 0x79, 0xaf, 0xa5, 0xa3, 0x3f, 0x41, 0xf4, 0x17, 0xe8, 0xe8, 0xe4, 0xcf, 0x10, + 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0xbf, 0x42, 0x9a, 0x04, 0x72, 0x5d, 0x6f, 0x0a, 0xbc, 0xe1, + 0x79, 0xee, 0xe1, 0xe5, 0xb5, 0x7b, 0x3d, 0x00, 0x26, 0x3d, 0xca, 0x65, 0xca, 0x70, 0x26, 0xa2, + 0x45, 0xca, 0x00, 0xaf, 0x70, 0x12, 0x31, 0x2e, 0x13, 0x99, 0x30, 0xc0, 0x32, 0xa7, 0x1c, 0x68, + 0x28, 0x13, 0xc1, 0x01, 0xdf, 0x2f, 0x28, 0xcc, 0x30, 0xb0, 0x7c, 0x99, 0x84, 0x0c, 0xcd, 0x73, + 0x21, 0x45, 0xa7, 0xab, 0x28, 0x50, 0xad, 0x40, 0x2b, 0xd4, 0x28, 0x90, 0xaa, 0x40, 0xa5, 0xc2, + 0xd9, 0x0b, 0x05, 0x64, 0x02, 0x70, 0x06, 0x31, 0x5e, 0x1e, 0x6d, 0x3f, 0x95, 0xcd, 0xd9, 0x8f, + 0x85, 0x88, 0x53, 0x86, 0xe9, 0x3c, 0xc1, 0x94, 0x73, 0x21, 0x69, 0x85, 0x55, 0x7f, 0xb5, 0x72, + 0x33, 0x06, 0x40, 0xe3, 0x3a, 0xd7, 0xb9, 0xd2, 0x51, 0x28, 0xa3, 0xbb, 0x9c, 0xc1, 0x5c, 0x70, + 0xa8, 0x7d, 0xc7, 0x2f, 0xa6, 0xdd, 0xf2, 0x20, 0xee, 0x3c, 0x99, 0x76, 0x7b, 0x40, 0x79, 0x94, + 0xb2, 0xce, 0x19, 0xd2, 0x58, 0x09, 0xf2, 0xaa, 0x4c, 0x67, 0xa0, 0x45, 0x4f, 0x9a, 0xd1, 0x75, + 0x1d, 0x78, 0x60, 0x38, 0xff, 0x1e, 0x7e, 0xde, 0x0f, 0xcd, 0xfe, 0x73, 0xeb, 0xa3, 0x70, 0xcd, + 0x75, 0xe1, 0x9a, 0xdf, 0x85, 0x6b, 0x3e, 0x6e, 0x5c, 0x63, 0xbd, 0x71, 0x8d, 0xaf, 0x8d, 0x6b, + 0xd8, 0x27, 0xa1, 0xc8, 0x74, 0x1e, 0xec, 0xff, 0xbf, 0xa9, 0xae, 0x60, 0xb4, 0xdd, 0xc2, 0xc8, + 0xbc, 0x3d, 0x8f, 0x13, 0x39, 0x5b, 0x4c, 0x51, 0x28, 0x32, 0xac, 0xb1, 0xe2, 0x57, 0xab, 0xdd, + 0xf3, 0xfc, 0xe1, 0x64, 0xfc, 0x66, 0xed, 0x1c, 0x94, 0x57, 0xe7, 0xf8, 0x68, 0xd8, 0xe4, 0x4c, + 0xd4, 0x9c, 0xf1, 0x16, 0xff, 0xdc, 0xa1, 0x82, 0x9a, 0x0a, 0xfc, 0xa0, 0xa1, 0x02, 0x95, 0x0a, + 0x4a, 0xaa, 0xb0, 0x2e, 0x34, 0xa8, 0xe0, 0x72, 0xd4, 0xf7, 0x98, 0xa4, 0x11, 0x95, 0xf4, 0xd7, + 0x3a, 0x55, 0x0c, 0x84, 0xd4, 0x0a, 0x42, 0x7c, 0x42, 0x1a, 0x09, 0x21, 0xaa, 0x85, 0x90, 0x52, + 0x33, 0x6d, 0x97, 0x07, 0xd4, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x4c, 0x17, 0x60, 0x84, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/revoke/service.pb.go b/x/identities/transactions/revoke/service.pb.go index c0206af82..d68c4a243 100644 --- a/x/identities/transactions/revoke/service.pb.go +++ b/x/identities/transactions/revoke/service.pb.go @@ -6,6 +6,7 @@ package revoke import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_e76110c17ab23cba = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0x80, 0x9b, 0x14, 0x3a, 0x04, 0xa7, 0x6e, 0x46, 0x09, 0xd8, 0x1f, 0x70, 0x07, 0xea, 0xa0, - 0x07, 0xa2, 0xcd, 0xa2, 0x1d, 0x82, 0xa5, 0x76, 0x08, 0x12, 0x90, 0x6b, 0xf2, 0x88, 0xc1, 0xe4, - 0xae, 0xe4, 0xae, 0xa5, 0xb3, 0xbf, 0x40, 0x70, 0x72, 0x75, 0x74, 0x77, 0x74, 0x17, 0xa7, 0x82, - 0x8b, 0xa3, 0xa4, 0x4e, 0xfe, 0x0a, 0xb1, 0x17, 0xc8, 0x75, 0xbd, 0xf5, 0x85, 0xef, 0xe3, 0x7b, - 0xb9, 0xe7, 0xf8, 0x7d, 0x21, 0x40, 0x06, 0x94, 0xc9, 0x1c, 0x70, 0xc1, 0x93, 0x59, 0x0e, 0x02, - 0x2f, 0x70, 0x96, 0x00, 0x93, 0x99, 0xcc, 0x40, 0x60, 0x59, 0x52, 0x26, 0x68, 0x2c, 0x33, 0xce, - 0x04, 0x2e, 0x61, 0xce, 0xef, 0x00, 0x0b, 0x28, 0xe7, 0x59, 0x0c, 0x68, 0x5a, 0x72, 0xc9, 0xbb, - 0x87, 0x9a, 0x03, 0xd5, 0x0e, 0xb4, 0x40, 0x8d, 0x03, 0xe9, 0x0e, 0xa4, 0x1c, 0xee, 0x6e, 0xca, - 0x79, 0x9a, 0x03, 0xa6, 0xd3, 0x0c, 0x53, 0xc6, 0xb8, 0xa4, 0xea, 0xf3, 0xda, 0xe9, 0x9a, 0x75, - 0x15, 0x20, 0x04, 0x4d, 0xeb, 0x2e, 0xf7, 0xd2, 0xc8, 0xa1, 0xcd, 0x6e, 0x4a, 0x10, 0x53, 0xce, - 0x44, 0x2d, 0xdc, 0x7f, 0xb3, 0x9c, 0x76, 0x20, 0xd2, 0xee, 0xab, 0xe5, 0x74, 0x2e, 0x28, 0x4b, - 0x72, 0xe8, 0x9e, 0x20, 0x93, 0xe5, 0x51, 0xa0, 0x42, 0xdd, 0x81, 0x19, 0x3e, 0x6e, 0x66, 0xa3, - 0x3a, 0xb1, 0xb7, 0x77, 0xff, 0xf9, 0xf3, 0x68, 0xef, 0xf4, 0xb6, 0x71, 0xa1, 0x36, 0xd6, 0xf6, - 0x54, 0x98, 0xff, 0xd4, 0x7e, 0xaf, 0x3c, 0x6b, 0x59, 0x79, 0xd6, 0x77, 0xe5, 0x59, 0x0f, 0x2b, - 0xaf, 0xb5, 0x5c, 0x79, 0xad, 0xaf, 0x95, 0xd7, 0x72, 0x8e, 0x62, 0x5e, 0x18, 0xb5, 0xf8, 0x5b, - 0x57, 0xea, 0x18, 0x86, 0xff, 0xbf, 0x68, 0x68, 0x5d, 0x9f, 0xa6, 0x99, 0xbc, 0x9d, 0x4d, 0x50, - 0xcc, 0x0b, 0x6c, 0xf2, 0x00, 0xcf, 0x76, 0xa7, 0x1f, 0x84, 0x83, 0xf1, 0xe8, 0xc5, 0xde, 0x38, - 0xac, 0xa0, 0x0e, 0x0a, 0xd1, 0xa0, 0x09, 0x1a, 0xeb, 0x41, 0xa3, 0x35, 0xff, 0xb1, 0x81, 0x45, - 0x35, 0x16, 0x85, 0x51, 0x83, 0x45, 0x3a, 0x16, 0x29, 0xac, 0xb2, 0xcf, 0x4c, 0xb0, 0xe8, 0x7c, - 0xe8, 0x07, 0x20, 0x69, 0x42, 0x25, 0xfd, 0xb5, 0x8f, 0x35, 0x05, 0x21, 0xb5, 0x83, 0x90, 0x90, - 0x90, 0xc6, 0x42, 0x88, 0xae, 0x21, 0x44, 0x79, 0x26, 0x9d, 0xf5, 0x89, 0x1d, 0xfc, 0x05, 0x00, - 0x00, 0xff, 0xff, 0x60, 0x1b, 0xdf, 0xa1, 0x91, 0x03, 0x00, 0x00, + // 373 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, + 0x18, 0xc0, 0x93, 0x94, 0xb7, 0x43, 0x78, 0xa7, 0x2e, 0x2f, 0x84, 0x97, 0x0c, 0x8e, 0x0e, 0x77, + 0xf8, 0x67, 0xd0, 0x03, 0xd1, 0x66, 0xd1, 0x0e, 0xc1, 0x52, 0x3b, 0x04, 0x09, 0xc8, 0x35, 0x79, + 0x88, 0xc1, 0xe4, 0xae, 0xe4, 0xb9, 0x96, 0x8e, 0x7e, 0x04, 0x07, 0x17, 0x57, 0xdd, 0x9c, 0xfc, + 0x18, 0xe2, 0xd4, 0xd1, 0x51, 0xd2, 0x41, 0xf0, 0x53, 0x48, 0x7b, 0x81, 0xa4, 0x6b, 0xa6, 0xc0, + 0x13, 0x7e, 0xbf, 0xfb, 0xf1, 0xf0, 0xd8, 0x5e, 0x1f, 0x11, 0x94, 0xcf, 0x85, 0xca, 0x80, 0xe6, + 0x32, 0x9e, 0x65, 0x80, 0x74, 0x41, 0xd3, 0x18, 0x84, 0x4a, 0x55, 0x0a, 0x48, 0x55, 0xc1, 0x05, + 0xf2, 0x48, 0xa5, 0x52, 0x20, 0x2d, 0x60, 0x2e, 0xef, 0x80, 0x22, 0x14, 0xf3, 0x34, 0x02, 0x32, + 0x2d, 0xa4, 0x92, 0xbd, 0xc3, 0x86, 0x83, 0x54, 0x0e, 0xb2, 0x20, 0xb5, 0x83, 0x34, 0x1d, 0x44, + 0x3b, 0x9c, 0x7f, 0x91, 0xc4, 0x5c, 0x22, 0xcd, 0x31, 0xa1, 0xf3, 0xbd, 0xf5, 0x47, 0xeb, 0x9c, + 0xff, 0x89, 0x94, 0x49, 0x06, 0x94, 0x4f, 0x53, 0xca, 0x85, 0x90, 0x8a, 0x6b, 0x4e, 0xff, 0x6d, + 0x17, 0x9c, 0x03, 0x22, 0x4f, 0xaa, 0x60, 0xe7, 0xb2, 0x95, 0xa3, 0x31, 0xbb, 0x29, 0x00, 0xa7, + 0x52, 0x60, 0x25, 0xdc, 0x7f, 0x31, 0xed, 0x8e, 0x8f, 0x49, 0xef, 0xd1, 0xb4, 0xbb, 0x17, 0x5c, + 0xc4, 0x19, 0xf4, 0x4e, 0x48, 0x9b, 0xad, 0x10, 0x5f, 0x87, 0x3a, 0x83, 0x76, 0xf8, 0xb8, 0x9e, + 0x8d, 0xaa, 0xc4, 0x1d, 0xc3, 0xf9, 0x73, 0xff, 0xfd, 0xb6, 0x6b, 0x7a, 0x4f, 0x9d, 0xf7, 0xd2, + 0x35, 0x97, 0xa5, 0x6b, 0x7e, 0x95, 0xae, 0xf9, 0xb0, 0x72, 0x8d, 0xe5, 0xca, 0x35, 0x3e, 0x57, + 0xae, 0x61, 0x1f, 0x45, 0x32, 0x6f, 0xf5, 0xa2, 0xf7, 0xf7, 0x4a, 0xdf, 0xc2, 0x70, 0xbd, 0x88, + 0xa1, 0x79, 0x7d, 0x9a, 0xa4, 0xea, 0x76, 0x36, 0x21, 0x91, 0xcc, 0x69, 0x9b, 0x35, 0x3f, 0x5b, + 0xdd, 0xbe, 0x1f, 0x0c, 0xc6, 0xa3, 0x57, 0x6b, 0xeb, 0xae, 0xfc, 0x2a, 0x28, 0x20, 0x83, 0x3a, + 0x68, 0xdc, 0x0c, 0x1a, 0x6d, 0xf8, 0x8f, 0x2d, 0x2c, 0xac, 0xb0, 0x30, 0x08, 0x6b, 0x2c, 0x6c, + 0x62, 0xa1, 0xc6, 0x4a, 0xeb, 0xac, 0x0d, 0x16, 0x9e, 0x0f, 0x3d, 0x1f, 0x14, 0x8f, 0xb9, 0xe2, + 0x3f, 0xd6, 0x71, 0x43, 0xc1, 0x58, 0xe5, 0x60, 0x2c, 0x60, 0xac, 0xb6, 0x30, 0xd6, 0xd4, 0x30, + 0xa6, 0x3d, 0x93, 0xee, 0xe6, 0x90, 0x0e, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x61, 0x99, 0x3d, + 0xc5, 0x90, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/unprovision/service.pb.go b/x/identities/transactions/unprovision/service.pb.go index ac320fe28..58e653dc2 100644 --- a/x/identities/transactions/unprovision/service.pb.go +++ b/x/identities/transactions/unprovision/service.pb.go @@ -6,6 +6,7 @@ package unprovision import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,31 +32,31 @@ func init() { } var fileDescriptor_cb37a005e91ee120 = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd2, 0xb1, 0x4a, 0xfb, 0x40, - 0x1c, 0x07, 0xf0, 0x26, 0x85, 0x0e, 0xe1, 0x3f, 0x75, 0x0c, 0x7f, 0x0e, 0xe9, 0xe0, 0x78, 0x07, - 0x3a, 0x79, 0xa0, 0xd0, 0xa0, 0xd4, 0x0e, 0x91, 0xa2, 0x29, 0x04, 0x09, 0xc8, 0x35, 0x39, 0xe2, - 0x41, 0x72, 0x17, 0x72, 0xd7, 0xd2, 0xd9, 0x27, 0x10, 0x7c, 0x03, 0x47, 0x5f, 0xc0, 0x17, 0x70, - 0x10, 0x71, 0x28, 0xb8, 0x38, 0x4a, 0xea, 0xe4, 0x53, 0x88, 0xcd, 0x41, 0xae, 0x6b, 0x3a, 0xff, - 0xf2, 0xfd, 0xf0, 0xcd, 0xef, 0x7e, 0xce, 0x68, 0x28, 0x25, 0x55, 0x3e, 0xe1, 0x2a, 0xa3, 0x28, - 0x17, 0xc9, 0x3c, 0xa3, 0x12, 0x2d, 0x11, 0x4b, 0x28, 0x57, 0x4c, 0x31, 0x2a, 0x91, 0x2a, 0x09, - 0x97, 0x24, 0x56, 0x4c, 0x70, 0x89, 0xe6, 0xbc, 0x28, 0xc5, 0x82, 0x49, 0x26, 0x38, 0x92, 0xb4, - 0x5c, 0xb0, 0x98, 0xc2, 0xa2, 0x14, 0x4a, 0xf4, 0x8f, 0x0c, 0x08, 0x6a, 0x08, 0x2e, 0x61, 0x03, - 0x41, 0x13, 0x82, 0x06, 0xe4, 0xfe, 0x4f, 0x85, 0x48, 0x33, 0x8a, 0x48, 0xc1, 0x10, 0xe1, 0x5c, - 0x28, 0x52, 0x7f, 0xb3, 0x81, 0xdd, 0x1d, 0x1a, 0xe6, 0x54, 0x4a, 0x92, 0xea, 0x86, 0x6e, 0xd0, - 0x1e, 0x32, 0x06, 0x37, 0x25, 0x95, 0x85, 0xe0, 0x52, 0xab, 0x07, 0xef, 0x96, 0xd3, 0xf5, 0x65, - 0xda, 0x7f, 0xb1, 0x9c, 0xde, 0x39, 0xe1, 0x49, 0x46, 0xfb, 0x1e, 0x6c, 0xbd, 0x0b, 0xe8, 0xd7, - 0x95, 0xdd, 0x8b, 0x1d, 0x8c, 0xa0, 0x19, 0x5c, 0xea, 0xb2, 0x83, 0xfd, 0xbb, 0x8f, 0xef, 0x07, - 0x7b, 0x6f, 0x00, 0x50, 0x5e, 0x2f, 0xc0, 0xf8, 0x6d, 0x23, 0xeb, 0x3d, 0x77, 0x5f, 0x2b, 0x60, - 0xad, 0x2a, 0x60, 0x7d, 0x55, 0xc0, 0xba, 0x5f, 0x83, 0xce, 0x6a, 0x0d, 0x3a, 0x9f, 0x6b, 0xd0, - 0x71, 0x8e, 0x63, 0x91, 0xb7, 0x6f, 0xe5, 0xfd, 0xbb, 0xaa, 0xef, 0x65, 0xf2, 0xb7, 0xb6, 0x89, - 0x75, 0x7d, 0x9a, 0x32, 0x75, 0x3b, 0x9f, 0xc1, 0x58, 0xe4, 0xa8, 0xf5, 0xcb, 0x3c, 0xda, 0xbd, - 0xa1, 0x1f, 0x8e, 0x83, 0xe9, 0x93, 0xbd, 0x75, 0x80, 0xbe, 0xae, 0x16, 0xc2, 0x71, 0x53, 0x2d, - 0x30, 0xab, 0x4d, 0x1b, 0xe4, 0x6d, 0x2b, 0x1b, 0xe9, 0x6c, 0x14, 0x46, 0x4d, 0x36, 0x32, 0xb3, - 0x91, 0x91, 0xad, 0xec, 0xb3, 0xd6, 0xd9, 0x68, 0x34, 0xf1, 0x7c, 0xaa, 0x48, 0x42, 0x14, 0xf9, - 0xb1, 0x4f, 0x0c, 0x07, 0x63, 0x0d, 0x61, 0x1c, 0x62, 0xdc, 0x50, 0x18, 0x9b, 0x16, 0xc6, 0x06, - 0x36, 0xeb, 0x6d, 0xee, 0xf1, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0x17, 0x9e, 0x8e, 0x0d, 0xd2, - 0x03, 0x00, 0x00, + // 379 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd2, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0xc3, 0x3b, 0xbe, + 0xc3, 0x1d, 0xea, 0xe4, 0x81, 0x42, 0x83, 0x52, 0x3b, 0x44, 0x8a, 0xa6, 0x10, 0x24, 0x20, 0xd7, + 0xe4, 0x88, 0x07, 0xc9, 0x5d, 0xc8, 0x73, 0x2d, 0x1d, 0xfd, 0x08, 0x7e, 0x02, 0x07, 0x47, 0x41, + 0x70, 0xf3, 0x2b, 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x4f, 0x21, 0x35, 0x81, 0x5c, 0xd7, + 0x74, 0xba, 0xe1, 0xe1, 0xff, 0xbb, 0x3f, 0x0f, 0x8f, 0x3d, 0x1a, 0x02, 0x30, 0xe5, 0x53, 0xa1, + 0x32, 0x86, 0x73, 0x99, 0xcc, 0x33, 0x06, 0x78, 0x89, 0x79, 0xc2, 0x84, 0xe2, 0x8a, 0x33, 0xc0, + 0xaa, 0xa4, 0x02, 0x68, 0xac, 0xb8, 0x14, 0x80, 0xe7, 0xa2, 0x28, 0xe5, 0x82, 0x03, 0x97, 0x02, + 0x03, 0x2b, 0x17, 0x3c, 0x66, 0xa8, 0x28, 0xa5, 0x92, 0x83, 0x43, 0x0d, 0x42, 0x0d, 0x84, 0x96, + 0xa8, 0x85, 0x90, 0x0e, 0x21, 0x0d, 0x72, 0xfe, 0xc4, 0x12, 0x72, 0x09, 0x38, 0x87, 0x14, 0x2f, + 0xf6, 0x36, 0x4f, 0x6d, 0x3a, 0x7f, 0x53, 0x29, 0xd3, 0x8c, 0x61, 0x5a, 0x70, 0x4c, 0x85, 0x90, + 0x8a, 0xd6, 0xe1, 0x7a, 0xba, 0x43, 0xf5, 0x9c, 0x01, 0xd0, 0xb4, 0xa9, 0xee, 0x04, 0xdd, 0x21, + 0x6d, 0x70, 0x5d, 0x32, 0x28, 0xa4, 0x80, 0x46, 0xdd, 0x7f, 0x32, 0xed, 0x9e, 0x0f, 0xe9, 0xe0, + 0xde, 0xb4, 0xfb, 0x67, 0x54, 0x24, 0x19, 0x1b, 0x78, 0xa8, 0xf3, 0x92, 0x90, 0x5f, 0x57, 0x76, + 0xce, 0x77, 0x30, 0x82, 0x76, 0x70, 0xd1, 0x94, 0xfd, 0x67, 0x38, 0xbf, 0x6e, 0x3f, 0x9f, 0xff, + 0x9b, 0xde, 0x4b, 0xef, 0xb5, 0x72, 0xcd, 0x55, 0xe5, 0x9a, 0x1f, 0x95, 0x6b, 0xde, 0xad, 0x5d, + 0x63, 0xb5, 0x76, 0x8d, 0xf7, 0xb5, 0x6b, 0xd8, 0x47, 0xb1, 0xcc, 0xbb, 0x7f, 0xeb, 0xfd, 0xbe, + 0xac, 0x2f, 0x65, 0xb2, 0xd9, 0xcb, 0xc4, 0xbc, 0x3a, 0x49, 0xb9, 0xba, 0x99, 0xcf, 0x50, 0x2c, + 0x73, 0xdc, 0x79, 0xf5, 0x0f, 0x56, 0x7f, 0xe8, 0x87, 0xe3, 0x60, 0xfa, 0x68, 0x6d, 0x9d, 0x9e, + 0xdf, 0x54, 0x0b, 0xd1, 0xb8, 0xad, 0x16, 0xe8, 0xd5, 0xa6, 0x2d, 0xf2, 0xb6, 0x95, 0x8d, 0x9a, + 0x6c, 0x14, 0x46, 0x6d, 0x36, 0xd2, 0xb3, 0x91, 0x96, 0xad, 0xac, 0xd3, 0xce, 0xd9, 0x68, 0x34, + 0xf1, 0x7c, 0xa6, 0x68, 0x42, 0x15, 0xfd, 0xb2, 0x8e, 0x35, 0x87, 0x90, 0x06, 0x22, 0x24, 0x24, + 0xa4, 0xa5, 0x08, 0xd1, 0x2d, 0x42, 0x34, 0x6c, 0xd6, 0xff, 0x39, 0xb8, 0x83, 0xef, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xa7, 0x02, 0x03, 0xa6, 0xcc, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/update/service.pb.go b/x/identities/transactions/update/service.pb.go index 1041c976f..41d7798c0 100644 --- a/x/identities/transactions/update/service.pb.go +++ b/x/identities/transactions/update/service.pb.go @@ -6,6 +6,7 @@ package update import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_188ef3d964dd38f9 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x84, 0x6f, 0xea, 0xf6, 0x45, 0x09, 0xd8, 0x1f, 0x70, 0x07, 0xea, - 0xa0, 0x07, 0xa2, 0xcd, 0xa2, 0x1d, 0x82, 0x45, 0x5b, 0x08, 0x12, 0x90, 0x6b, 0x72, 0xc4, 0x83, - 0xe4, 0x2e, 0xe4, 0xae, 0xd2, 0xd9, 0x5f, 0x20, 0x38, 0xb9, 0x3a, 0xba, 0x3b, 0xba, 0x8b, 0x53, - 0xc1, 0xc5, 0x51, 0x52, 0x27, 0x7f, 0x85, 0xd8, 0x3b, 0xc8, 0x75, 0xbd, 0xf5, 0x0d, 0xcf, 0xc3, - 0xf3, 0xe6, 0x5e, 0x2f, 0x1c, 0x0a, 0x41, 0x64, 0x84, 0x99, 0x2c, 0x08, 0x2c, 0x79, 0x36, 0x2f, - 0x88, 0x80, 0x0b, 0x48, 0x33, 0xc2, 0x24, 0x95, 0x94, 0x08, 0x28, 0x6b, 0xcc, 0x04, 0x4e, 0x25, - 0xe5, 0x4c, 0xc0, 0x79, 0x95, 0x61, 0x49, 0xa0, 0x20, 0xf5, 0x2d, 0x4d, 0x09, 0xa8, 0x6a, 0x2e, - 0x79, 0x7f, 0xdf, 0x70, 0x00, 0xed, 0x00, 0x0b, 0xd0, 0x3a, 0x80, 0xe9, 0x00, 0xca, 0xe1, 0x6f, - 0xe7, 0x9c, 0xe7, 0x05, 0x81, 0xb8, 0xa2, 0x10, 0x33, 0xc6, 0x25, 0x56, 0x9f, 0xd7, 0x4e, 0xdf, - 0xae, 0xab, 0x24, 0x42, 0xe0, 0x5c, 0x77, 0xf9, 0xe7, 0x56, 0x0e, 0x63, 0x76, 0x5d, 0x13, 0x51, - 0x71, 0x26, 0xb4, 0x70, 0xf7, 0xd5, 0xf1, 0xba, 0x91, 0xc8, 0xfb, 0x2f, 0x8e, 0xd7, 0x3b, 0xc3, - 0x2c, 0x2b, 0x48, 0xff, 0x08, 0xd8, 0x2c, 0x0f, 0x22, 0x15, 0xea, 0x8f, 0xec, 0xf0, 0x49, 0x3b, - 0xbb, 0xd0, 0x89, 0x83, 0x9d, 0xbb, 0x8f, 0xef, 0x07, 0x77, 0x6b, 0xf0, 0x1f, 0x96, 0x6a, 0x63, - 0x63, 0x4f, 0x85, 0x85, 0x8f, 0xdd, 0xb7, 0x26, 0x70, 0x96, 0x4d, 0xe0, 0x7c, 0x35, 0x81, 0x73, - 0xbf, 0x0a, 0x3a, 0xcb, 0x55, 0xd0, 0xf9, 0x5c, 0x05, 0x1d, 0xef, 0x20, 0xe5, 0xa5, 0x55, 0x4b, - 0xf8, 0xef, 0x52, 0x1d, 0xc3, 0xf8, 0xef, 0x17, 0x8d, 0x9d, 0xab, 0xe3, 0x9c, 0xca, 0x9b, 0xf9, - 0x0c, 0xa4, 0xbc, 0x84, 0x36, 0x0f, 0xf0, 0xe4, 0xf6, 0x86, 0x51, 0x3c, 0x9a, 0x4c, 0x9f, 0xdd, - 0x8d, 0xc3, 0x8a, 0x74, 0x50, 0x0c, 0x46, 0x6d, 0xd0, 0xc4, 0x0c, 0x9a, 0xae, 0xf9, 0xf7, 0x0d, - 0x2c, 0xd1, 0x58, 0x12, 0x27, 0x2d, 0x96, 0x98, 0x58, 0xa2, 0xb0, 0xc6, 0x3d, 0xb1, 0xc1, 0x92, - 0xd3, 0x71, 0x18, 0x11, 0x89, 0x33, 0x2c, 0xf1, 0x8f, 0x7b, 0x68, 0x28, 0x10, 0xd2, 0x0e, 0x84, - 0x62, 0x84, 0x5a, 0x0b, 0x42, 0xa6, 0x06, 0x21, 0xe5, 0x99, 0xf5, 0xd6, 0x27, 0xb6, 0xf7, 0x1b, - 0x00, 0x00, 0xff, 0xff, 0x3d, 0x50, 0x9e, 0x46, 0x91, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xc3, 0x40, + 0x14, 0xc0, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0xf8, 0x67, + 0xd0, 0x03, 0xd1, 0x66, 0xd1, 0x0e, 0xc1, 0xa2, 0x2d, 0x04, 0x09, 0xc8, 0x35, 0x39, 0x62, 0x20, + 0xb9, 0x0b, 0x79, 0xd7, 0xd2, 0xd1, 0x8f, 0xe0, 0xe0, 0xe2, 0xaa, 0x9b, 0x93, 0x1f, 0x43, 0x9c, + 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0x7e, 0x0a, 0x69, 0x2f, 0x90, 0x74, 0xbd, 0x29, 0xf0, 0xc2, 0xef, + 0x77, 0x3f, 0x1e, 0xcf, 0xf6, 0xfa, 0x00, 0x4c, 0xfa, 0x94, 0xcb, 0x8c, 0xe1, 0x5c, 0xc4, 0xd3, + 0x8c, 0x01, 0x9e, 0xe3, 0x34, 0x66, 0x5c, 0xa6, 0x32, 0x65, 0x80, 0x65, 0x49, 0x39, 0xd0, 0x48, + 0xa6, 0x82, 0x03, 0x9e, 0x16, 0x31, 0x95, 0x0c, 0x03, 0x2b, 0x67, 0x69, 0xc4, 0x50, 0x51, 0x0a, + 0x29, 0x7a, 0xc7, 0x2d, 0x07, 0xaa, 0x1d, 0x68, 0x8e, 0x1a, 0x07, 0x6a, 0x3b, 0x90, 0x72, 0x38, + 0x3b, 0x91, 0x80, 0x5c, 0x00, 0xce, 0x21, 0xc1, 0xb3, 0x83, 0xd5, 0x47, 0xe9, 0x9c, 0xdd, 0x44, + 0x88, 0x24, 0x63, 0x98, 0x16, 0x29, 0xa6, 0x9c, 0x0b, 0x49, 0x15, 0xa7, 0xfe, 0xea, 0x05, 0xe7, + 0x0c, 0x80, 0x26, 0x75, 0xb0, 0x73, 0xad, 0xe5, 0x68, 0xcd, 0xee, 0x4b, 0x06, 0x85, 0xe0, 0x50, + 0x0b, 0x0f, 0xdf, 0x4c, 0xbb, 0xe3, 0x43, 0xd2, 0x7b, 0x36, 0xed, 0xee, 0x15, 0xe5, 0x71, 0xc6, + 0x7a, 0x67, 0x48, 0x67, 0x2b, 0xc8, 0x57, 0xa1, 0xce, 0x40, 0x0f, 0x1f, 0x35, 0xb3, 0x9b, 0x3a, + 0x71, 0xcf, 0x70, 0xb6, 0x1e, 0x7f, 0x3f, 0xf6, 0x4d, 0xef, 0xa5, 0xf3, 0x59, 0xb9, 0xe6, 0xa2, + 0x72, 0xcd, 0x9f, 0xca, 0x35, 0x9f, 0x96, 0xae, 0xb1, 0x58, 0xba, 0xc6, 0xf7, 0xd2, 0x35, 0xec, + 0x93, 0x48, 0xe4, 0x5a, 0x2f, 0x7a, 0xdb, 0xb7, 0xea, 0x16, 0x86, 0xab, 0x45, 0x0c, 0xcd, 0xbb, + 0xf3, 0x24, 0x95, 0x0f, 0xd3, 0x09, 0x8a, 0x44, 0x8e, 0x75, 0xd6, 0xfc, 0x6a, 0x75, 0xfb, 0x7e, + 0x30, 0x18, 0x8d, 0xdf, 0xad, 0x8d, 0xbb, 0xf2, 0xeb, 0xa0, 0x00, 0x0d, 0x9a, 0xa0, 0x51, 0x3b, + 0x68, 0xbc, 0xe6, 0xbf, 0x36, 0xb0, 0xb0, 0xc6, 0xc2, 0x20, 0x6c, 0xb0, 0xb0, 0x8d, 0x85, 0x0a, + 0xab, 0xac, 0x0b, 0x1d, 0x2c, 0xbc, 0x1c, 0x7a, 0x3e, 0x93, 0x34, 0xa6, 0x92, 0xfe, 0x59, 0xa7, + 0x2d, 0x05, 0x21, 0xb5, 0x83, 0x90, 0x80, 0x90, 0xc6, 0x42, 0x48, 0x5b, 0x43, 0x88, 0xf2, 0x4c, + 0xba, 0xeb, 0x43, 0x3a, 0xfa, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x31, 0x3c, 0x77, 0x90, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/metas/transactions/reveal/service.pb.go b/x/metas/transactions/reveal/service.pb.go index 46888a0db..6ec7bba91 100644 --- a/x/metas/transactions/reveal/service.pb.go +++ b/x/metas/transactions/reveal/service.pb.go @@ -6,6 +6,7 @@ package reveal import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_afd3f92ba94b138a = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4a, 0x03, 0x31, - 0x18, 0x07, 0xf0, 0xde, 0x09, 0x1d, 0x0e, 0xa7, 0x22, 0x0e, 0x47, 0xb9, 0xa1, 0x0f, 0x90, 0x80, - 0x75, 0x90, 0x88, 0x43, 0x8b, 0xa0, 0x08, 0x81, 0x52, 0x3b, 0x1c, 0x72, 0x20, 0xe9, 0x35, 0x9c, - 0x07, 0x97, 0xa4, 0x5c, 0xd2, 0xd2, 0xd9, 0x27, 0x10, 0x7c, 0x03, 0x07, 0x07, 0x07, 0x9f, 0x43, - 0x9c, 0x0a, 0x2e, 0x8e, 0x72, 0x75, 0xf2, 0x15, 0x5c, 0xa4, 0x49, 0xc0, 0x74, 0xcc, 0x9a, 0xf0, - 0xfb, 0xf3, 0xff, 0x92, 0x2f, 0x3a, 0x1b, 0x48, 0x49, 0x15, 0x26, 0x5c, 0x55, 0x14, 0x32, 0x31, - 0x5b, 0x54, 0x54, 0xc2, 0x15, 0x64, 0x54, 0x11, 0x09, 0x55, 0x4d, 0xb8, 0x24, 0xb9, 0x2a, 0x05, - 0x97, 0xb0, 0xa6, 0x4b, 0x4a, 0x2a, 0x28, 0x69, 0xbd, 0x2c, 0x73, 0x0a, 0xe6, 0xb5, 0x50, 0xa2, - 0x03, 0x1d, 0x0e, 0x2c, 0x07, 0x2b, 0xa0, 0x39, 0x70, 0x39, 0x30, 0x3c, 0xee, 0x16, 0x42, 0x14, - 0x15, 0x85, 0x64, 0x5e, 0x42, 0xc2, 0xb9, 0x50, 0xc4, 0x5c, 0xeb, 0xb8, 0xd8, 0xbb, 0x0d, 0xa3, - 0x52, 0x92, 0xc2, 0xb6, 0x89, 0xaf, 0x7c, 0xb9, 0x73, 0x76, 0x5b, 0x53, 0x39, 0x17, 0x5c, 0xda, - 0xac, 0xa3, 0xd7, 0x20, 0xda, 0xc3, 0xb2, 0xe8, 0x3c, 0x07, 0x51, 0xfb, 0x92, 0xf0, 0x59, 0x45, - 0x3b, 0x27, 0xc0, 0x73, 0x5a, 0x80, 0x4d, 0xbd, 0xf8, 0xdc, 0x5b, 0x4e, 0xfe, 0xcf, 0xc6, 0xb6, - 0x58, 0xaf, 0x7b, 0xff, 0xf1, 0xfd, 0x18, 0x1e, 0xf6, 0x0e, 0x20, 0xb3, 0x23, 0xea, 0xc1, 0x8c, - 0x18, 0xfe, 0x86, 0x6f, 0x4d, 0x12, 0xac, 0x9b, 0x24, 0xf8, 0x6a, 0x92, 0xe0, 0x61, 0x93, 0xb4, - 0xd6, 0x9b, 0xa4, 0xf5, 0xb9, 0x49, 0x5a, 0x51, 0x3f, 0x17, 0xcc, 0xb7, 0xc1, 0x70, 0xff, 0xda, - 0xfc, 0xf4, 0x68, 0xfb, 0x1c, 0xa3, 0xe0, 0x06, 0x15, 0xa5, 0xba, 0x5b, 0x4c, 0x41, 0x2e, 0x18, - 0xf4, 0x7c, 0xe7, 0xa7, 0xb0, 0x3d, 0xc0, 0x29, 0x9e, 0x8c, 0x5f, 0xc2, 0x9d, 0x85, 0xc1, 0xb6, - 0x46, 0x0a, 0xb0, 0xae, 0x31, 0x71, 0x6b, 0x8c, 0x35, 0x7d, 0xdf, 0x11, 0x99, 0x15, 0x59, 0x9a, - 0x69, 0x91, 0xb9, 0x22, 0x33, 0xa2, 0x09, 0x4f, 0x3d, 0x45, 0x76, 0x31, 0x1a, 0x6e, 0x2f, 0x67, - 0x44, 0x91, 0x9f, 0xf0, 0xd8, 0xd1, 0x08, 0x59, 0x8e, 0x50, 0x8a, 0x90, 0x0e, 0x40, 0xc8, 0x4d, - 0x40, 0xc8, 0x44, 0x4c, 0xdb, 0x7a, 0x6b, 0xfa, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xe2, 0x9c, - 0x0e, 0xa0, 0x50, 0x03, 0x00, 0x00, + // 365 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0x2f, 0x6f, 0x87, 0xe0, 0xd4, 0x45, 0x08, 0x92, 0xc1, 0xd1, 0xe1, 0x0e, + 0xad, 0x83, 0x9c, 0x38, 0xb4, 0x08, 0x8a, 0x10, 0x28, 0xb5, 0x43, 0x90, 0x80, 0x5c, 0xd3, 0x23, + 0x06, 0x72, 0x77, 0x25, 0xcf, 0xb5, 0x74, 0x74, 0x76, 0x72, 0x75, 0x75, 0x74, 0xf2, 0x63, 0x88, + 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0xaf, 0xe0, 0x22, 0xcd, 0x1d, 0x78, 0x1d, 0x6f, 0x0a, 0xdc, + 0xf1, 0xfb, 0xe7, 0x9f, 0x27, 0x4f, 0x78, 0xd6, 0x07, 0x60, 0x2a, 0xa1, 0x42, 0x55, 0x0c, 0x73, + 0x39, 0x9d, 0x57, 0x0c, 0xf0, 0x12, 0x73, 0xa6, 0x28, 0x60, 0x55, 0x53, 0x01, 0x34, 0x57, 0xa5, + 0x14, 0x80, 0x6b, 0xb6, 0x60, 0xb4, 0xc2, 0xc0, 0xea, 0x45, 0x99, 0x33, 0x34, 0xab, 0xa5, 0x92, + 0x5d, 0x6c, 0x71, 0x64, 0x38, 0x5a, 0xa2, 0x96, 0x23, 0x9b, 0x23, 0xcd, 0xa3, 0xdd, 0x5c, 0x02, + 0x97, 0x80, 0x39, 0x14, 0x78, 0x71, 0xb8, 0x79, 0xe8, 0xa4, 0x68, 0xaf, 0x90, 0xb2, 0xa8, 0x18, + 0xa6, 0xb3, 0x12, 0x53, 0x21, 0xa4, 0xa2, 0xda, 0xe9, 0x5b, 0xe7, 0x9a, 0x9c, 0x01, 0xd0, 0xc2, + 0xd4, 0x8c, 0xae, 0x5c, 0xb9, 0x75, 0x76, 0x5b, 0x33, 0x98, 0x49, 0x01, 0x26, 0xeb, 0xe8, 0xc9, + 0x0f, 0xff, 0x25, 0x50, 0x74, 0x1f, 0xfc, 0xb0, 0x73, 0x49, 0xc5, 0xb4, 0x62, 0xdd, 0x13, 0xe4, + 0x38, 0x06, 0x94, 0xe8, 0x7a, 0xd1, 0xb9, 0xb3, 0x1c, 0xff, 0x9d, 0x8d, 0x4c, 0xb1, 0x7d, 0x2f, + 0xfa, 0x7f, 0xff, 0xf5, 0x7a, 0xe0, 0x0f, 0x7e, 0x82, 0xb7, 0x26, 0xf6, 0x57, 0x4d, 0xec, 0x7f, + 0x36, 0xb1, 0xff, 0xb8, 0x8e, 0xbd, 0xd5, 0x3a, 0xf6, 0x3e, 0xd6, 0xb1, 0x17, 0xf6, 0x72, 0xc9, + 0x5d, 0x5f, 0x36, 0xd8, 0xb9, 0xd6, 0x7f, 0x7b, 0xb8, 0xf9, 0xf2, 0xa1, 0x7f, 0x43, 0x8a, 0x52, + 0xdd, 0xcd, 0x27, 0x28, 0x97, 0x1c, 0x3b, 0x8e, 0xf4, 0x39, 0xe8, 0xf4, 0x93, 0x34, 0x19, 0x8f, + 0x5e, 0x82, 0xad, 0xa5, 0x49, 0x4c, 0x8d, 0x14, 0x25, 0x6d, 0x8d, 0xb1, 0x5d, 0x63, 0xd4, 0xd2, + 0xf7, 0x2d, 0x91, 0x19, 0x91, 0xa5, 0x59, 0x2b, 0x32, 0x5b, 0x64, 0x5a, 0x34, 0xc1, 0xa9, 0xa3, + 0xc8, 0x2e, 0x86, 0x83, 0xcd, 0xe5, 0x94, 0x2a, 0xfa, 0x1d, 0x1c, 0x5b, 0x9a, 0x10, 0xc3, 0x09, + 0x49, 0x09, 0x69, 0x03, 0x08, 0xb1, 0x13, 0x08, 0xd1, 0x11, 0x93, 0x4e, 0xbb, 0x20, 0xbd, 0xdf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x58, 0x33, 0x4f, 0x54, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/cancel/service.pb.go b/x/orders/transactions/cancel/service.pb.go index 84cb90d84..e0183f758 100644 --- a/x/orders/transactions/cancel/service.pb.go +++ b/x/orders/transactions/cancel/service.pb.go @@ -6,6 +6,7 @@ package cancel import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_309677b1d8455ef4 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xc3, 0x40, - 0x18, 0x06, 0xf0, 0x26, 0x85, 0x0e, 0xc1, 0xa9, 0x20, 0x42, 0xd0, 0x0c, 0xfd, 0x00, 0x77, 0xe2, - 0x9f, 0xc1, 0x53, 0x84, 0xb6, 0x88, 0x82, 0x84, 0x16, 0xed, 0x10, 0x24, 0x20, 0xd7, 0xe4, 0x88, - 0x81, 0xe4, 0xae, 0xe4, 0xae, 0xd2, 0x55, 0x3f, 0x81, 0xe0, 0x37, 0x70, 0xd3, 0xcd, 0x6f, 0x21, - 0x4e, 0x05, 0x17, 0x47, 0x49, 0x9d, 0xfc, 0x14, 0x62, 0xdf, 0x03, 0xaf, 0xe3, 0xad, 0x17, 0x7e, - 0x0f, 0xcf, 0xfb, 0xe6, 0xf5, 0x8e, 0xbb, 0x52, 0x32, 0x15, 0x52, 0xae, 0x0a, 0x86, 0x4b, 0x91, - 0x4e, 0x0b, 0x26, 0xf1, 0x0c, 0x8b, 0x2a, 0x65, 0x95, 0xc4, 0xaa, 0xa2, 0x5c, 0xd2, 0x44, 0xe5, - 0x82, 0x4b, 0x9c, 0x50, 0x9e, 0xb0, 0x02, 0x4b, 0x56, 0xdd, 0xe6, 0x09, 0x43, 0x93, 0x4a, 0x28, - 0xd1, 0xde, 0x36, 0x3c, 0xd2, 0x1e, 0xcd, 0x10, 0x78, 0x64, 0x7a, 0x04, 0xde, 0xdf, 0xcc, 0x84, - 0xc8, 0x0a, 0x86, 0xe9, 0x24, 0xc7, 0x94, 0x73, 0xa1, 0x28, 0x7c, 0x5e, 0xe6, 0xf9, 0xf6, 0x7d, - 0x4a, 0x26, 0x25, 0xcd, 0x74, 0x1f, 0xff, 0xdc, 0xda, 0x1b, 0x6f, 0xd7, 0x15, 0x93, 0x13, 0xc1, - 0xa5, 0x0e, 0xdb, 0x79, 0x75, 0xbc, 0x66, 0x28, 0xb3, 0xf6, 0xb3, 0xe3, 0xb5, 0xce, 0x28, 0x4f, - 0x0b, 0xd6, 0x3e, 0x40, 0xb6, 0x03, 0xa3, 0x10, 0x0a, 0xfa, 0x27, 0xf6, 0x74, 0xf4, 0xff, 0x76, - 0xa1, 0xab, 0x75, 0xb6, 0xee, 0x3f, 0xbe, 0x1f, 0xdd, 0x8d, 0xce, 0x3a, 0x2e, 0x61, 0x4a, 0x3d, - 0x1b, 0x90, 0xde, 0x5d, 0xf3, 0xad, 0x0e, 0x9c, 0x79, 0x1d, 0x38, 0x5f, 0x75, 0xe0, 0x3c, 0x2c, - 0x82, 0xc6, 0x7c, 0x11, 0x34, 0x3e, 0x17, 0x41, 0xc3, 0xdb, 0x4b, 0x44, 0x69, 0xdd, 0xa1, 0xb7, - 0x76, 0x09, 0x3f, 0x7c, 0xf8, 0xb7, 0x92, 0xa1, 0x73, 0x75, 0x98, 0xe5, 0xea, 0x66, 0x3a, 0x46, - 0x89, 0x28, 0xb1, 0xed, 0xb2, 0x9f, 0xdc, 0x56, 0x37, 0x8c, 0x06, 0xa3, 0xfe, 0x8b, 0xbb, 0x72, - 0x38, 0xa1, 0x2e, 0x12, 0xa1, 0x01, 0x14, 0x19, 0x99, 0x45, 0xfa, 0x4b, 0xfb, 0xbe, 0x42, 0x62, - 0x4d, 0xe2, 0x28, 0x06, 0x12, 0x9b, 0x24, 0x06, 0x52, 0xbb, 0x47, 0xb6, 0x24, 0x3e, 0x1d, 0xf6, - 0x42, 0xa6, 0x68, 0x4a, 0x15, 0xfd, 0x71, 0xf7, 0x0d, 0x4e, 0x88, 0xf6, 0x84, 0x44, 0x84, 0x40, - 0x02, 0x21, 0x66, 0x04, 0x21, 0x90, 0x31, 0x6e, 0x2d, 0xcf, 0x67, 0xf7, 0x37, 0x00, 0x00, 0xff, - 0xff, 0x85, 0x70, 0x97, 0x0c, 0x5d, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0xc3, 0x3b, 0xbe, + 0xc3, 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0xda, 0x22, 0x0a, 0x12, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, + 0x93, 0x23, 0x06, 0x92, 0xbb, 0x92, 0xe7, 0x5a, 0x3a, 0xea, 0xee, 0xe0, 0xee, 0xe6, 0xe8, 0xe4, + 0x9f, 0x21, 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0xff, 0x0a, 0x69, 0xef, 0xc0, 0xeb, 0x78, 0x53, + 0xe0, 0xc2, 0xe7, 0x9b, 0x6f, 0x9e, 0x7b, 0xfc, 0xe3, 0x2e, 0x00, 0x93, 0x11, 0xe5, 0xb2, 0x64, + 0xb8, 0x12, 0xd9, 0xb4, 0x64, 0x80, 0xe7, 0x58, 0xd4, 0x19, 0xab, 0x01, 0xcb, 0x9a, 0x72, 0xa0, + 0xa9, 0x2c, 0x04, 0x07, 0x9c, 0x52, 0x9e, 0xb2, 0x12, 0x03, 0xab, 0x67, 0x45, 0xca, 0xd0, 0xa4, + 0x16, 0x52, 0x74, 0xb6, 0x0c, 0x8f, 0xb4, 0x47, 0x73, 0xa4, 0x3c, 0x32, 0x3d, 0x52, 0x3e, 0xf8, + 0x93, 0x0a, 0xa8, 0x04, 0xe0, 0x0a, 0x72, 0x3c, 0xdb, 0x5e, 0x3d, 0x54, 0x54, 0xf0, 0x37, 0x17, + 0x22, 0x2f, 0x19, 0xa6, 0x93, 0x02, 0x53, 0xce, 0x85, 0xa4, 0xca, 0xa9, 0xb7, 0xf6, 0x45, 0x2b, + 0x06, 0x40, 0x73, 0x5d, 0x34, 0x38, 0xb7, 0xf6, 0xc6, 0xd9, 0x75, 0xcd, 0x60, 0x22, 0x38, 0xe8, + 0xb0, 0x9d, 0x47, 0xd7, 0x6f, 0x45, 0x90, 0x77, 0xee, 0x5d, 0xbf, 0x7d, 0x46, 0x79, 0x56, 0xb2, + 0xce, 0x01, 0xb2, 0x9d, 0x04, 0x8a, 0x54, 0xc1, 0xe0, 0xc4, 0x9e, 0x8e, 0x7e, 0xce, 0x2e, 0x74, + 0xb5, 0x7f, 0x4e, 0xf0, 0xeb, 0xf6, 0xf3, 0xe5, 0xbf, 0xdb, 0xbb, 0x6b, 0xbd, 0x36, 0xa1, 0xbb, + 0x68, 0x42, 0xf7, 0xa3, 0x09, 0xdd, 0x87, 0x65, 0xe8, 0x2c, 0x96, 0xa1, 0xf3, 0xbe, 0x0c, 0x1d, + 0x7f, 0x2f, 0x15, 0x95, 0xf5, 0xd7, 0x7a, 0xbf, 0x2f, 0xd5, 0x9d, 0x0f, 0x57, 0x3f, 0x3f, 0x74, + 0xaf, 0x0e, 0xf3, 0x42, 0xde, 0x4c, 0xc7, 0x28, 0x15, 0x15, 0xb6, 0x1d, 0xeb, 0x93, 0xd7, 0xee, + 0x46, 0xf1, 0x60, 0xd4, 0x7f, 0xf6, 0x36, 0x76, 0x27, 0xd2, 0x45, 0x62, 0x34, 0x50, 0x45, 0x46, + 0x66, 0x91, 0xfe, 0xda, 0xbe, 0x6d, 0x90, 0x44, 0x93, 0x24, 0x4e, 0x14, 0x49, 0x4c, 0x92, 0x28, + 0xd2, 0x78, 0x47, 0xb6, 0x24, 0x39, 0x1d, 0xf6, 0x22, 0x26, 0x69, 0x46, 0x25, 0xfd, 0xf2, 0xf6, + 0x0d, 0x4e, 0x88, 0xf6, 0x84, 0xc4, 0x84, 0xa8, 0x04, 0x42, 0xcc, 0x08, 0x42, 0x54, 0xc6, 0xb8, + 0xbd, 0x5e, 0x94, 0xdd, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x1d, 0x93, 0x02, 0x60, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/define/service.pb.go b/x/orders/transactions/define/service.pb.go index f89516db4..88c7510c4 100644 --- a/x/orders/transactions/define/service.pb.go +++ b/x/orders/transactions/define/service.pb.go @@ -6,6 +6,7 @@ package define import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_81719b2aa52d08bc = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xcf, 0x4a, 0xeb, 0x40, - 0x14, 0x06, 0xf0, 0x26, 0x85, 0x2e, 0xc2, 0x5d, 0x15, 0x2e, 0x42, 0xd0, 0x2c, 0xfa, 0x00, 0x33, - 0xe2, 0x9f, 0x85, 0xa3, 0x08, 0x2d, 0x15, 0x05, 0x09, 0x2d, 0xda, 0x45, 0x90, 0x80, 0x4c, 0x93, - 0x63, 0x0c, 0x24, 0x33, 0x25, 0x33, 0x95, 0x6e, 0xf5, 0x09, 0x04, 0xdf, 0xc0, 0x9d, 0xee, 0x7c, - 0x0b, 0x71, 0x55, 0x70, 0xe3, 0x52, 0x52, 0x57, 0x3e, 0x85, 0xd8, 0x19, 0x70, 0xba, 0x9c, 0xed, - 0x84, 0xdf, 0xc7, 0x77, 0x4e, 0x8e, 0x77, 0xd8, 0x15, 0x02, 0x64, 0x48, 0x99, 0x2c, 0x00, 0x97, - 0x3c, 0x9d, 0x16, 0x20, 0xf0, 0x0c, 0xf3, 0x2a, 0x85, 0x4a, 0x60, 0x59, 0x51, 0x26, 0x68, 0x22, - 0x73, 0xce, 0x04, 0x4e, 0xe1, 0x2a, 0x67, 0x80, 0x05, 0x54, 0x37, 0x79, 0x02, 0x68, 0x52, 0x71, - 0xc9, 0xdb, 0x9b, 0x86, 0x47, 0xda, 0xa3, 0x19, 0x52, 0x1e, 0x99, 0x1e, 0x29, 0xef, 0xaf, 0x67, - 0x9c, 0x67, 0x05, 0x60, 0x3a, 0xc9, 0x31, 0x65, 0x8c, 0x4b, 0xaa, 0x3e, 0x2f, 0xf3, 0x7c, 0xfb, - 0x3e, 0x25, 0x08, 0x41, 0x33, 0xdd, 0xc7, 0x3f, 0xb5, 0xf6, 0xc6, 0xdb, 0x65, 0x05, 0x62, 0xc2, - 0x99, 0xd0, 0x61, 0x5b, 0x2f, 0x8e, 0xd7, 0x0c, 0x45, 0xd6, 0x7e, 0x72, 0xbc, 0xd6, 0x09, 0x65, - 0x69, 0x01, 0xed, 0x3d, 0x64, 0x3b, 0x30, 0x0a, 0x55, 0x41, 0xff, 0xc8, 0x9e, 0x8e, 0xfe, 0xde, - 0xce, 0x74, 0xb5, 0xce, 0xc6, 0xdd, 0xfb, 0xd7, 0x83, 0xbb, 0xd6, 0xf9, 0x8f, 0x4b, 0x35, 0xa5, - 0x9e, 0x4d, 0x91, 0xde, 0x6d, 0xf3, 0xb5, 0x0e, 0x9c, 0x79, 0x1d, 0x38, 0x9f, 0x75, 0xe0, 0xdc, - 0x2f, 0x82, 0xc6, 0x7c, 0x11, 0x34, 0x3e, 0x16, 0x41, 0xc3, 0xdb, 0x49, 0x78, 0x69, 0xdd, 0xa1, - 0xf7, 0xef, 0x5c, 0xfd, 0xf0, 0xe1, 0xef, 0x4a, 0x86, 0xce, 0xc5, 0x7e, 0x96, 0xcb, 0xeb, 0xe9, - 0x18, 0x25, 0xbc, 0xc4, 0xb6, 0xcb, 0x7e, 0x74, 0x5b, 0xdd, 0x30, 0x1a, 0x8c, 0xfa, 0xcf, 0xee, - 0xca, 0xe1, 0x84, 0xba, 0x48, 0x84, 0x06, 0xaa, 0xc8, 0xc8, 0x2c, 0xd2, 0x5f, 0xda, 0xb7, 0x15, - 0x12, 0x6b, 0x12, 0x47, 0xb1, 0x22, 0xb1, 0x49, 0x62, 0x45, 0x6a, 0xf7, 0xc0, 0x96, 0xc4, 0xc7, - 0xc3, 0x5e, 0x08, 0x92, 0xa6, 0x54, 0xd2, 0x6f, 0x77, 0xd7, 0xe0, 0x84, 0x68, 0x4f, 0x48, 0x44, - 0x88, 0x4a, 0x20, 0xc4, 0x8c, 0x20, 0x44, 0x65, 0x8c, 0x5b, 0xcb, 0xf3, 0xd9, 0xfe, 0x09, 0x00, - 0x00, 0xff, 0xff, 0x0a, 0xba, 0xb6, 0x32, 0x5d, 0x03, 0x00, 0x00, + // 366 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xc3, 0x40, + 0x18, 0x06, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x10, 0x24, 0x83, 0xa3, 0xc3, 0x9d, 0x7f, + 0x07, 0x4f, 0x11, 0x5a, 0x2a, 0x0a, 0x12, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x33, 0x06, + 0x92, 0xbb, 0x92, 0xf7, 0x5a, 0x3a, 0xea, 0xee, 0xe0, 0xee, 0xe6, 0xe8, 0xe4, 0xc7, 0x10, 0xa7, + 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x9f, 0x42, 0xda, 0x0b, 0x78, 0x1d, 0x6f, 0x0a, 0x5c, 0xf8, 0x3d, + 0x79, 0xf2, 0xde, 0xeb, 0x9e, 0xb6, 0x01, 0x98, 0x0c, 0x28, 0x97, 0x39, 0xc3, 0x85, 0x48, 0xc6, + 0x39, 0x03, 0x3c, 0xc5, 0xa2, 0x4c, 0x58, 0x09, 0x58, 0x96, 0x94, 0x03, 0x8d, 0x65, 0x26, 0x38, + 0xe0, 0x84, 0xdd, 0x65, 0x9c, 0x61, 0x60, 0xe5, 0x24, 0x8b, 0x19, 0x1a, 0x95, 0x42, 0x8a, 0xd6, + 0x8e, 0xe6, 0x51, 0xed, 0xd1, 0x14, 0x29, 0x8f, 0x74, 0x8f, 0x94, 0xf7, 0x36, 0x62, 0x01, 0x85, + 0x00, 0x5c, 0x40, 0x8a, 0x27, 0xbb, 0x8b, 0x87, 0x8a, 0xf2, 0x36, 0x53, 0x21, 0xd2, 0x9c, 0x61, + 0x3a, 0xca, 0x30, 0xe5, 0x5c, 0x48, 0xaa, 0x9c, 0x7a, 0x6b, 0x5e, 0xb4, 0x60, 0x00, 0x34, 0xad, + 0x8b, 0x7a, 0x97, 0xc6, 0x5e, 0x3b, 0xbb, 0x2d, 0x19, 0x8c, 0x04, 0x87, 0x3a, 0x6c, 0xef, 0xc5, + 0x76, 0x1b, 0x01, 0xa4, 0xad, 0x27, 0xdb, 0x6d, 0x5e, 0x50, 0x9e, 0xe4, 0xac, 0x75, 0x84, 0x4c, + 0x27, 0x81, 0x02, 0x55, 0xd0, 0x3b, 0x33, 0xa7, 0x83, 0xff, 0xb3, 0xab, 0xba, 0xda, 0x96, 0xe5, + 0xad, 0x3d, 0xfc, 0xbc, 0x6f, 0xdb, 0x9d, 0xc7, 0xc6, 0x47, 0xe5, 0xdb, 0xb3, 0xca, 0xb7, 0xbf, + 0x2b, 0xdf, 0x7e, 0x9e, 0xfb, 0xd6, 0x6c, 0xee, 0x5b, 0x5f, 0x73, 0xdf, 0x72, 0x0f, 0x62, 0x51, + 0x18, 0x7f, 0xad, 0xb3, 0x7e, 0xad, 0xee, 0xbc, 0xbf, 0xf8, 0xf9, 0xbe, 0x7d, 0x73, 0x9c, 0x66, + 0xf2, 0x7e, 0x3c, 0x44, 0xb1, 0x28, 0xb0, 0xe9, 0x58, 0x5f, 0x9d, 0x66, 0x3b, 0x08, 0x7b, 0x83, + 0xee, 0x9b, 0xb3, 0xb2, 0x3b, 0x41, 0x5d, 0x24, 0x44, 0x3d, 0x55, 0x64, 0xa0, 0x17, 0xe9, 0x2e, + 0xed, 0xe7, 0x0a, 0x89, 0x6a, 0x12, 0x85, 0x91, 0x22, 0x91, 0x4e, 0x22, 0x45, 0x2a, 0xe7, 0xc4, + 0x94, 0x44, 0xe7, 0xfd, 0x4e, 0xc0, 0x24, 0x4d, 0xa8, 0xa4, 0xbf, 0xce, 0xa1, 0xc6, 0x09, 0xa9, + 0x3d, 0x21, 0x21, 0x21, 0x2a, 0x81, 0x10, 0x3d, 0x82, 0x10, 0x95, 0x31, 0x6c, 0x2e, 0x17, 0x65, + 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x3f, 0xe6, 0xd9, 0x60, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/deputize/service.pb.go b/x/orders/transactions/deputize/service.pb.go index 718ab3c73..d43e78269 100644 --- a/x/orders/transactions/deputize/service.pb.go +++ b/x/orders/transactions/deputize/service.pb.go @@ -6,6 +6,7 @@ package deputize import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_7f61c89944722a3a = []byte{ - // 365 bytes of a gzipped FileDescriptorProto + // 371 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x9b, 0x14, 0x3a, 0x04, 0xa7, 0x2e, 0x62, 0x90, 0x08, 0x7d, 0x80, 0x3b, 0xa8, 0xa0, - 0x70, 0xa2, 0xd8, 0x52, 0xa8, 0xcb, 0xd1, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, - 0xdc, 0x85, 0xdc, 0x55, 0x8a, 0xa3, 0xbb, 0x20, 0xf8, 0x06, 0x8e, 0x2e, 0x8e, 0xbe, 0x82, 0x38, - 0x15, 0x5c, 0x1c, 0x25, 0x75, 0xf2, 0x29, 0xc4, 0xde, 0x05, 0xaf, 0x63, 0xb3, 0x1e, 0xf9, 0x3e, - 0xbe, 0xff, 0xcf, 0xef, 0x9c, 0xf6, 0x84, 0xa0, 0x12, 0x13, 0x26, 0x53, 0x0a, 0x33, 0x1e, 0xcd, - 0x52, 0x2a, 0xe0, 0x1c, 0xf2, 0x22, 0xa2, 0x85, 0x80, 0xb2, 0x20, 0x4c, 0x90, 0x50, 0x26, 0x9c, - 0x09, 0x18, 0xd1, 0x7c, 0x26, 0x93, 0x5b, 0x0a, 0x05, 0x2d, 0x6e, 0x92, 0x90, 0x82, 0xbc, 0xe0, - 0x92, 0xb7, 0xbb, 0x86, 0x01, 0x68, 0x03, 0x98, 0x03, 0x65, 0x00, 0xa6, 0x01, 0x54, 0x06, 0x77, - 0x37, 0xe6, 0x3c, 0x4e, 0x29, 0x24, 0x79, 0x02, 0x09, 0x63, 0x5c, 0x12, 0xf5, 0xc1, 0xca, 0xe8, - 0xd6, 0x69, 0xca, 0xa8, 0x10, 0x24, 0xd6, 0x4d, 0x2e, 0xae, 0x61, 0x30, 0x5e, 0xaf, 0x0a, 0x2a, - 0x72, 0xce, 0x84, 0xd6, 0x75, 0x5f, 0x2d, 0xa7, 0x89, 0x45, 0xdc, 0x7e, 0xb1, 0x9c, 0xd6, 0x19, - 0x61, 0x51, 0x4a, 0xdb, 0x47, 0x60, 0xf3, 0xb1, 0x01, 0x56, 0x91, 0xee, 0xb0, 0x0e, 0x3c, 0xf9, - 0x7f, 0x3d, 0xd7, 0x79, 0x9d, 0xbd, 0xbb, 0x8f, 0xef, 0x47, 0x7b, 0xa7, 0xb3, 0x0d, 0x33, 0x35, - 0xab, 0x9e, 0xb0, 0x82, 0xfa, 0xf7, 0xcd, 0xb7, 0xd2, 0xb3, 0x16, 0xa5, 0x67, 0x7d, 0x95, 0x9e, - 0xf5, 0xb0, 0xf4, 0x1a, 0x8b, 0xa5, 0xd7, 0xf8, 0x5c, 0x7a, 0x0d, 0xe7, 0x20, 0xe4, 0x59, 0x8d, - 0x8e, 0xfe, 0xd6, 0x85, 0xfa, 0xfd, 0xe3, 0xbf, 0xd5, 0x8c, 0xad, 0xcb, 0xe3, 0x38, 0x91, 0xd7, - 0xb3, 0x29, 0x08, 0x79, 0x06, 0x37, 0x5f, 0xfb, 0x93, 0xdd, 0xea, 0x61, 0x7f, 0x34, 0x19, 0x3c, - 0xdb, 0x6b, 0x87, 0x84, 0x75, 0x8c, 0x0f, 0x46, 0x2a, 0x66, 0x62, 0xc6, 0x0c, 0x34, 0xfd, 0xbe, - 0x06, 0x05, 0x1a, 0x0a, 0xfc, 0x40, 0x41, 0x81, 0x09, 0x05, 0x15, 0x54, 0xda, 0x27, 0x9b, 0x43, - 0xc1, 0x70, 0xdc, 0xc7, 0x54, 0x92, 0x88, 0x48, 0xf2, 0x63, 0x1f, 0x1a, 0x02, 0x84, 0xb4, 0x01, - 0x21, 0x1f, 0x21, 0xe5, 0x40, 0xc8, 0x94, 0x20, 0x54, 0x59, 0xa6, 0xad, 0xd5, 0x41, 0xed, 0xff, - 0x06, 0x00, 0x00, 0xff, 0xff, 0x45, 0x5b, 0xa0, 0x3b, 0x77, 0x03, 0x00, 0x00, + 0x18, 0x80, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x58, 0x41, + 0xe1, 0x44, 0xb1, 0xa5, 0x50, 0x97, 0xd0, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, + 0xe4, 0x42, 0xfe, 0x6b, 0x29, 0x4e, 0xbe, 0x80, 0xd0, 0x37, 0x10, 0x1c, 0x9d, 0x7c, 0x0c, 0x71, + 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x14, 0x52, 0xef, 0x8a, 0xd7, 0xb1, 0x99, 0x02, 0x7f, 0xf8, + 0xbe, 0x7c, 0xfc, 0xf9, 0xed, 0xcb, 0x0e, 0x00, 0x13, 0x1e, 0xcd, 0x45, 0xca, 0x70, 0xc6, 0xa3, + 0x49, 0xca, 0x00, 0xcf, 0x30, 0x2f, 0x23, 0x56, 0x02, 0x16, 0x25, 0xcd, 0x81, 0x86, 0x22, 0xe1, + 0x39, 0xe0, 0x88, 0x15, 0x13, 0x91, 0x3c, 0x30, 0x0c, 0xac, 0x9c, 0x26, 0x21, 0x43, 0x45, 0xc9, + 0x05, 0x6f, 0xb5, 0x35, 0x03, 0x52, 0x06, 0x34, 0x43, 0xd2, 0x80, 0x74, 0x03, 0x5a, 0x1b, 0x9c, + 0xbd, 0x90, 0x43, 0xc6, 0x01, 0x67, 0x10, 0xe3, 0xe9, 0xd1, 0xea, 0x21, 0x65, 0xce, 0x7e, 0xcc, + 0x79, 0x9c, 0x32, 0x4c, 0x8b, 0x04, 0xd3, 0x3c, 0xe7, 0x82, 0x4a, 0x52, 0xbe, 0xad, 0x13, 0x9b, + 0x31, 0x00, 0x1a, 0xab, 0x58, 0xc7, 0xab, 0x61, 0xd0, 0xa6, 0x77, 0x25, 0x83, 0x82, 0xe7, 0xa0, + 0x74, 0xed, 0x67, 0xd3, 0x6e, 0x78, 0x10, 0xb7, 0xe6, 0xa6, 0xdd, 0xbc, 0xa2, 0x79, 0x94, 0xb2, + 0xd6, 0x19, 0xda, 0x7e, 0x1f, 0xc8, 0x93, 0x91, 0x4e, 0xbf, 0x0e, 0x3c, 0xfa, 0x9f, 0x5e, 0xab, + 0xbc, 0x03, 0xc3, 0xd9, 0x79, 0xfc, 0x7e, 0x3b, 0x34, 0xbb, 0x4f, 0x8d, 0xf7, 0xca, 0x35, 0x17, + 0x95, 0x6b, 0x7e, 0x55, 0xae, 0x39, 0x5f, 0xba, 0xc6, 0x62, 0xe9, 0x1a, 0x9f, 0x4b, 0xd7, 0xb0, + 0x4f, 0x42, 0x9e, 0xd5, 0xf8, 0x5e, 0x77, 0xf7, 0x46, 0xfe, 0xff, 0xe1, 0x6a, 0x05, 0x43, 0xf3, + 0xf6, 0x3c, 0x4e, 0xc4, 0xfd, 0x64, 0x8c, 0x42, 0x9e, 0xe1, 0xed, 0xd7, 0xfb, 0x62, 0x35, 0x3b, + 0x9e, 0x3f, 0x18, 0xf5, 0x5e, 0xad, 0x8d, 0x4b, 0xf2, 0x54, 0x8c, 0x8f, 0x06, 0x32, 0x66, 0xa4, + 0xc7, 0xf4, 0x14, 0xfd, 0xb1, 0x01, 0x05, 0x0a, 0x0a, 0xfc, 0x40, 0x42, 0x81, 0x0e, 0x05, 0x6b, + 0xa8, 0xb2, 0x2e, 0xb6, 0x87, 0x82, 0xfe, 0xb0, 0xeb, 0x31, 0x41, 0x23, 0x2a, 0xe8, 0x8f, 0x75, + 0xaa, 0x09, 0x08, 0x51, 0x06, 0x42, 0x7c, 0x42, 0xa4, 0x83, 0x10, 0x5d, 0x42, 0xc8, 0xda, 0x32, + 0x6e, 0xfe, 0x1d, 0xce, 0xf1, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xa8, 0x2d, 0x36, 0x78, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/get/service.pb.go b/x/orders/transactions/get/service.pb.go index 57cbb6888..b3159d285 100644 --- a/x/orders/transactions/get/service.pb.go +++ b/x/orders/transactions/get/service.pb.go @@ -6,6 +6,7 @@ package get import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_643e03a23de377cc = []byte{ - // 359 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x4b, 0xfb, 0x40, - 0x14, 0xc7, 0x9b, 0xfc, 0xa0, 0x43, 0xf8, 0x4d, 0xc1, 0x29, 0x48, 0x86, 0xee, 0xde, 0x61, 0x05, - 0xd1, 0x73, 0x6a, 0x96, 0x74, 0x09, 0x2d, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, 0xe3, 0x0c, 0x24, - 0xb9, 0x92, 0x7b, 0x95, 0xce, 0xfe, 0x05, 0x82, 0xff, 0x80, 0x38, 0x89, 0x7f, 0x89, 0x38, 0x15, - 0x5c, 0x1c, 0x25, 0x75, 0x72, 0xf1, 0x5f, 0x10, 0x7b, 0x07, 0xa6, 0x63, 0xd6, 0x97, 0xef, 0xe7, - 0xe5, 0xf3, 0xde, 0x3d, 0xe7, 0x6c, 0xa4, 0x14, 0x60, 0xc4, 0x2b, 0x2c, 0x80, 0x96, 0x32, 0x5b, - 0x16, 0xa0, 0xe8, 0x8a, 0xca, 0x3a, 0x83, 0x5a, 0x51, 0xac, 0x79, 0xa5, 0x78, 0x8a, 0xb9, 0xac, - 0x14, 0x15, 0x80, 0x54, 0x41, 0x7d, 0x93, 0xa7, 0x40, 0x16, 0xb5, 0x44, 0xe9, 0x1e, 0xb4, 0x60, - 0x62, 0x60, 0xb2, 0x22, 0x1a, 0x26, 0x6d, 0x98, 0x08, 0x40, 0x6f, 0x5f, 0x48, 0x29, 0x0a, 0xa0, - 0x7c, 0x91, 0x53, 0x5e, 0x55, 0x12, 0xb9, 0xfe, 0xb6, 0x6d, 0xe6, 0x75, 0x34, 0x29, 0x41, 0x29, - 0x2e, 0x8c, 0x89, 0x37, 0xee, 0x06, 0xb7, 0x0a, 0x57, 0x35, 0xa8, 0x85, 0xac, 0x94, 0xe9, 0x34, - 0x7c, 0xb2, 0x9c, 0x7f, 0x91, 0x12, 0xee, 0x83, 0xe5, 0xf4, 0xc7, 0xbc, 0xca, 0x0a, 0x70, 0x8f, - 0x49, 0xa7, 0x39, 0x49, 0xa4, 0xd5, 0xbc, 0xa0, 0x23, 0x37, 0xfb, 0x2b, 0x9c, 0x1b, 0xa9, 0x81, - 0x77, 0xfb, 0xf6, 0x79, 0x6f, 0xef, 0x0d, 0x5c, 0x5a, 0xea, 0xe1, 0xcc, 0x48, 0x02, 0x30, 0xf8, - 0xb6, 0x5f, 0x1a, 0xdf, 0x5a, 0x37, 0xbe, 0xf5, 0xd1, 0xf8, 0xd6, 0xdd, 0xc6, 0xef, 0xad, 0x37, - 0x7e, 0xef, 0x7d, 0xe3, 0xf7, 0x9c, 0xc3, 0x54, 0x96, 0xdd, 0xfe, 0x1e, 0xfc, 0xbf, 0xd0, 0x6f, - 0x3b, 0xfd, 0x5d, 0xc3, 0xd4, 0xba, 0x3c, 0x11, 0x39, 0x5e, 0x2f, 0xe7, 0x24, 0x95, 0x25, 0xed, - 0xb4, 0xdd, 0x47, 0xbb, 0x3f, 0x8a, 0xe2, 0xc9, 0x2c, 0x7c, 0xb6, 0x77, 0x0e, 0x24, 0x32, 0x0a, - 0x31, 0x99, 0x68, 0x85, 0x59, 0x5b, 0x21, 0x04, 0x7c, 0xdd, 0xc9, 0x27, 0x26, 0x9f, 0xc4, 0x89, - 0xce, 0x27, 0xed, 0x7c, 0x12, 0x02, 0x36, 0xf6, 0x69, 0xa7, 0x7c, 0x12, 0x4e, 0x83, 0x08, 0x90, - 0x67, 0x1c, 0xf9, 0x97, 0x3d, 0x6c, 0xb1, 0x8c, 0x19, 0x98, 0xb1, 0x98, 0x31, 0x8d, 0x33, 0xd6, - 0xe6, 0x19, 0x0b, 0x01, 0xe7, 0xfd, 0xed, 0x8d, 0x1c, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x8c, - 0x8d, 0xd7, 0x68, 0x36, 0x03, 0x00, 0x00, + // 369 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x6b, 0xe3, 0x30, + 0x14, 0xc7, 0x6d, 0x1f, 0x97, 0xc1, 0xdc, 0x94, 0xe5, 0xc0, 0x1c, 0x1e, 0x6e, 0x2c, 0x54, 0x22, + 0x29, 0x94, 0x56, 0x9d, 0xe2, 0xc5, 0x59, 0x4c, 0x42, 0x9b, 0xc1, 0x14, 0x43, 0x51, 0xec, 0x87, + 0x6a, 0xb0, 0xad, 0xe0, 0xa7, 0x84, 0x8c, 0x9d, 0x3a, 0x77, 0xe9, 0x17, 0xe8, 0xd8, 0xa9, 0x1f, + 0xa3, 0x74, 0xca, 0xd8, 0xb1, 0x38, 0x43, 0xa1, 0x4b, 0xbf, 0x42, 0x49, 0x65, 0xa8, 0x33, 0x6a, + 0x32, 0x3c, 0xff, 0x7f, 0x4f, 0x3f, 0x3d, 0x3d, 0xf7, 0x6c, 0x84, 0x08, 0x2a, 0xe2, 0x95, 0x2a, + 0x80, 0x96, 0x32, 0x5b, 0x16, 0x80, 0x74, 0x4d, 0x65, 0x9d, 0x41, 0x8d, 0x54, 0xd5, 0xbc, 0x42, + 0x9e, 0xaa, 0x5c, 0x56, 0x48, 0x05, 0x28, 0x8a, 0x50, 0xaf, 0xf2, 0x14, 0xc8, 0xa2, 0x96, 0x4a, + 0xf6, 0x0f, 0x3b, 0x30, 0x69, 0x61, 0xb2, 0x26, 0x1a, 0x26, 0x5d, 0x98, 0x08, 0x50, 0xde, 0xdf, + 0x54, 0x62, 0x29, 0x91, 0x96, 0x28, 0xe8, 0x6a, 0xb0, 0xfb, 0xe8, 0x3e, 0xde, 0x3f, 0x21, 0xa5, + 0x28, 0x80, 0xf2, 0x45, 0x4e, 0x79, 0x55, 0x49, 0xc5, 0x35, 0xa4, 0xff, 0x1a, 0x2a, 0x96, 0x80, + 0xc8, 0x45, 0xab, 0xe8, 0x8d, 0xcd, 0xe0, 0x4e, 0xe1, 0xaa, 0x06, 0x5c, 0xc8, 0x0a, 0xdb, 0x4e, + 0xc3, 0x7b, 0xdb, 0xfd, 0x15, 0xa1, 0xe8, 0xdf, 0xda, 0x6e, 0x6f, 0xcc, 0xab, 0xac, 0x80, 0xfe, + 0x31, 0x31, 0x1a, 0x00, 0x89, 0xb4, 0x9a, 0x17, 0x18, 0x72, 0xb3, 0x9f, 0xc2, 0x79, 0x2b, 0xf5, + 0xdf, 0xf2, 0x7e, 0xdf, 0xbc, 0x3f, 0x1d, 0xd8, 0xc1, 0xa7, 0xf3, 0xdc, 0xf8, 0xf6, 0xa6, 0xf1, + 0xed, 0xb7, 0xc6, 0xb7, 0xef, 0xb6, 0xbe, 0xb5, 0xd9, 0xfa, 0xd6, 0xeb, 0xd6, 0xb7, 0xdc, 0x41, + 0x2a, 0x4b, 0xb3, 0xa3, 0x82, 0x3f, 0x17, 0xfa, 0x85, 0xa7, 0xbb, 0x3b, 0x4f, 0xed, 0xcb, 0x13, + 0x91, 0xab, 0xeb, 0xe5, 0x9c, 0xa4, 0xb2, 0xa4, 0x46, 0xa3, 0x7c, 0x70, 0x7a, 0xa3, 0x28, 0x9e, + 0xcc, 0xc2, 0x47, 0x67, 0x6f, 0x4d, 0xa2, 0x56, 0x21, 0x26, 0x13, 0xad, 0x30, 0xeb, 0x2a, 0x84, + 0xa0, 0x5e, 0xf6, 0xf2, 0x49, 0x9b, 0x4f, 0xe2, 0x44, 0xe7, 0x93, 0x6e, 0x3e, 0x09, 0x41, 0x35, + 0xce, 0xa9, 0x51, 0x3e, 0x09, 0xa7, 0x41, 0x04, 0x8a, 0x67, 0x5c, 0xf1, 0x0f, 0x67, 0xd8, 0x61, + 0x19, 0x6b, 0x61, 0xc6, 0x62, 0xc6, 0x34, 0xce, 0x58, 0x97, 0x67, 0x2c, 0x04, 0x35, 0xef, 0x7d, + 0x2f, 0xc4, 0xd1, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x2a, 0x52, 0xf1, 0x3c, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/immediate/service.pb.go b/x/orders/transactions/immediate/service.pb.go index aa8e0030a..d0ad42dfc 100644 --- a/x/orders/transactions/immediate/service.pb.go +++ b/x/orders/transactions/immediate/service.pb.go @@ -6,6 +6,7 @@ package immediate import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_0dcccd3b865dd390 = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xfb, 0x40, - 0x18, 0xc0, 0x9b, 0x14, 0x3a, 0x84, 0xff, 0xd4, 0xe9, 0x4f, 0x90, 0x20, 0x7d, 0x80, 0x3b, 0xb0, - 0x83, 0x72, 0x88, 0xd2, 0x2e, 0xb6, 0x43, 0x6c, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8e, 0x18, - 0xc8, 0xdd, 0x95, 0xdc, 0x55, 0x3a, 0xfb, 0x04, 0x42, 0xdf, 0xc0, 0xd1, 0xd1, 0xd1, 0x27, 0x10, - 0xa7, 0x82, 0x8b, 0xa3, 0x24, 0x4e, 0x3e, 0x85, 0xd8, 0x3b, 0xe3, 0x75, 0xbd, 0xf5, 0xb8, 0xdf, - 0x8f, 0xdf, 0xf7, 0xf1, 0x79, 0x83, 0x81, 0x10, 0x44, 0x86, 0x98, 0xc9, 0x82, 0x40, 0xca, 0xd3, - 0x65, 0x41, 0x04, 0x5c, 0x41, 0x5e, 0xa6, 0xa4, 0x14, 0x50, 0x96, 0x98, 0x09, 0x9c, 0xc8, 0x9c, - 0x33, 0x01, 0x73, 0x4a, 0x49, 0x9a, 0x63, 0x49, 0xa0, 0x20, 0xe5, 0x6d, 0x9e, 0x10, 0xb0, 0x28, - 0xb9, 0xe4, 0xdd, 0xbe, 0xa1, 0x00, 0x5a, 0x01, 0x56, 0x40, 0x29, 0x80, 0xa9, 0x00, 0x8d, 0xc2, - 0xdf, 0xcb, 0x38, 0xcf, 0x0a, 0x02, 0xf1, 0x22, 0x87, 0x98, 0x31, 0x2e, 0xb1, 0xfa, 0xb1, 0x55, - 0xfa, 0x56, 0x55, 0x94, 0x08, 0x81, 0x33, 0x5d, 0xe5, 0x9f, 0xdb, 0x28, 0x8c, 0xe7, 0xeb, 0x92, - 0x88, 0x05, 0x67, 0x42, 0xfb, 0x0e, 0x9e, 0x1d, 0xaf, 0x1d, 0x8a, 0xac, 0xfb, 0xe4, 0x78, 0x9d, - 0x11, 0x66, 0x69, 0x41, 0xba, 0xc7, 0xc0, 0x62, 0x72, 0x10, 0xaa, 0x4c, 0x7f, 0x64, 0x45, 0xcf, - 0xfe, 0x9e, 0x2f, 0x74, 0x60, 0x6f, 0xff, 0xee, 0xed, 0x73, 0xed, 0xfa, 0xbd, 0xff, 0x90, 0xaa, - 0x71, 0xf5, 0x90, 0x0d, 0x35, 0x5c, 0xb7, 0x5f, 0xaa, 0xc0, 0xd9, 0x54, 0x81, 0xf3, 0x51, 0x05, - 0xce, 0x7d, 0x1d, 0xb4, 0x36, 0x75, 0xd0, 0x7a, 0xaf, 0x83, 0x96, 0x77, 0x98, 0x70, 0x6a, 0x53, - 0x32, 0xfc, 0x77, 0xa9, 0xae, 0x60, 0xfa, 0xb3, 0x9e, 0xa9, 0x73, 0x75, 0x92, 0xe5, 0xf2, 0x66, - 0x39, 0x07, 0x09, 0xa7, 0xd0, 0x62, 0xf7, 0x0f, 0x6e, 0x67, 0x10, 0x46, 0x93, 0xd9, 0xf8, 0xd1, - 0xdd, 0x39, 0xa8, 0x50, 0xe7, 0x44, 0x60, 0xa2, 0x72, 0x66, 0x66, 0xce, 0xf8, 0x17, 0x7f, 0xdd, - 0xa1, 0x62, 0x4d, 0xc5, 0x51, 0xac, 0xa8, 0xd8, 0xa4, 0xe2, 0x86, 0xaa, 0xdc, 0x53, 0x0b, 0x2a, - 0x3e, 0x9b, 0x0e, 0x43, 0x22, 0x71, 0x8a, 0x25, 0xfe, 0x72, 0x8f, 0x0c, 0x03, 0x42, 0x5a, 0x81, - 0x50, 0x84, 0x90, 0x92, 0x20, 0x64, 0x5a, 0x10, 0x6a, 0x34, 0xf3, 0xce, 0xf6, 0xb2, 0xfa, 0xdf, - 0x01, 0x00, 0x00, 0xff, 0xff, 0x8d, 0xa2, 0xe0, 0x1f, 0x84, 0x03, 0x00, 0x00, + // 369 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0x80, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x68, 0x07, + 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x87, 0xd8, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, + 0xcb, 0x95, 0xfc, 0xd7, 0xd2, 0xd1, 0x47, 0x10, 0x7d, 0x02, 0x1d, 0x9d, 0x7c, 0x0c, 0x71, 0xea, + 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x14, 0x52, 0x2f, 0xd6, 0xeb, 0x7a, 0x53, 0xe0, 0x0f, 0xdf, 0x77, + 0x1f, 0x3f, 0xbf, 0xdb, 0xe9, 0x00, 0x30, 0x19, 0xd0, 0x42, 0xe6, 0x0c, 0x73, 0x91, 0x4c, 0x73, + 0x06, 0x78, 0x8e, 0x45, 0x99, 0xb0, 0x12, 0xb0, 0x2c, 0x69, 0x01, 0x34, 0x96, 0x99, 0x28, 0x00, + 0x67, 0x9c, 0xb3, 0x24, 0xa3, 0x92, 0x61, 0x60, 0xe5, 0x2c, 0x8b, 0x19, 0x9a, 0x94, 0x42, 0x8a, + 0x56, 0x5b, 0x53, 0xa0, 0x5a, 0x81, 0xe6, 0x48, 0x29, 0x90, 0xae, 0x40, 0x6b, 0x85, 0xb7, 0x13, + 0x0b, 0xe0, 0x02, 0x30, 0x87, 0x14, 0xcf, 0x0e, 0x56, 0x1f, 0x65, 0xf3, 0x76, 0x53, 0x21, 0xd2, + 0x9c, 0x61, 0x3a, 0xc9, 0x30, 0x2d, 0x0a, 0x21, 0xa9, 0x42, 0xd5, 0x5f, 0xa3, 0x5c, 0xce, 0x00, + 0x68, 0x5a, 0xe7, 0x7a, 0x17, 0x26, 0x0a, 0x6d, 0x7c, 0x53, 0x32, 0x98, 0x88, 0x02, 0x6a, 0xdf, + 0xe1, 0x93, 0xed, 0x36, 0x02, 0x48, 0x5b, 0x0f, 0xb6, 0xdb, 0xec, 0xd1, 0x22, 0xc9, 0x59, 0xeb, + 0x04, 0x19, 0xac, 0x04, 0x05, 0x2a, 0xd3, 0xeb, 0x19, 0xd1, 0xa3, 0xff, 0xf1, 0x65, 0x1d, 0xb8, + 0x67, 0x79, 0x5b, 0x77, 0x5f, 0xaf, 0xfb, 0x76, 0xf7, 0xb1, 0xf1, 0x56, 0xf9, 0xf6, 0xa2, 0xf2, + 0xed, 0xcf, 0xca, 0xb7, 0xef, 0x97, 0xbe, 0xb5, 0x58, 0xfa, 0xd6, 0xc7, 0xd2, 0xb7, 0xdc, 0xa3, + 0x58, 0x70, 0x93, 0x07, 0xbb, 0xdb, 0x57, 0xea, 0x0a, 0x86, 0xab, 0x2d, 0x0c, 0xed, 0xeb, 0xd3, + 0x34, 0x93, 0xb7, 0xd3, 0x31, 0x8a, 0x05, 0xc7, 0x06, 0x2b, 0x7e, 0x76, 0x9a, 0x9d, 0x20, 0x1c, + 0x8c, 0xfa, 0x2f, 0xce, 0xc6, 0x41, 0x05, 0x75, 0x4e, 0x88, 0x06, 0x2a, 0x67, 0xa4, 0xe7, 0xf4, + 0xff, 0xf0, 0xf7, 0x0d, 0x2a, 0xaa, 0xa9, 0x28, 0x8c, 0x14, 0x15, 0xe9, 0x54, 0xb4, 0xa6, 0x2a, + 0xe7, 0xcc, 0x80, 0x8a, 0xce, 0x87, 0xdd, 0x80, 0x49, 0x9a, 0x50, 0x49, 0xbf, 0x9d, 0x63, 0xcd, + 0x40, 0x48, 0xad, 0x20, 0x24, 0x24, 0x44, 0x49, 0x08, 0xd1, 0x2d, 0x84, 0xac, 0x35, 0xe3, 0xe6, + 0xef, 0x01, 0xb5, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xac, 0x92, 0x90, 0x84, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/make/service.pb.go b/x/orders/transactions/make/service.pb.go index 7d10377d8..b1b23dd14 100644 --- a/x/orders/transactions/make/service.pb.go +++ b/x/orders/transactions/make/service.pb.go @@ -6,6 +6,7 @@ package make import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_fbbf961e1e7c95c7 = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0xc0, 0xf1, 0x26, 0x42, 0x87, 0xe0, 0x54, 0x71, 0x89, 0x92, 0xa1, 0x0f, 0x70, 0x07, 0xed, - 0x20, 0x1e, 0x2e, 0xad, 0x83, 0x3a, 0x1c, 0x2d, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, 0x47, 0x0c, - 0x4d, 0x72, 0x25, 0x77, 0x95, 0xce, 0x3e, 0x81, 0xe0, 0x1b, 0xe8, 0xa6, 0x2f, 0x22, 0x4e, 0x05, - 0x17, 0x47, 0x49, 0x9d, 0xdc, 0xdd, 0x25, 0xbd, 0x03, 0xaf, 0xe3, 0xad, 0x17, 0x7e, 0x5f, 0xfe, - 0xdf, 0x25, 0xde, 0xc9, 0x40, 0x08, 0x90, 0x94, 0x95, 0x32, 0x07, 0x5c, 0xf0, 0x64, 0x91, 0x83, - 0xc0, 0x4b, 0xcc, 0xab, 0x04, 0x2a, 0x81, 0x65, 0xc5, 0x4a, 0xc1, 0x62, 0x99, 0xf1, 0x52, 0xe0, - 0x82, 0xcd, 0x00, 0x0b, 0xa8, 0xee, 0xb2, 0x18, 0xd0, 0xbc, 0xe2, 0x92, 0x77, 0x90, 0xa1, 0x91, - 0xd6, 0x68, 0x89, 0x94, 0x46, 0xa6, 0x46, 0x8d, 0xf6, 0x0f, 0x53, 0xce, 0xd3, 0x1c, 0x30, 0x9b, - 0x67, 0x98, 0x95, 0x25, 0x97, 0x4c, 0x3d, 0xdc, 0x4c, 0xf3, 0x6d, 0x5b, 0x0a, 0x10, 0x82, 0xa5, - 0xba, 0xc5, 0xbf, 0xb0, 0xd4, 0xc6, 0xc9, 0x4d, 0x05, 0x62, 0xce, 0x4b, 0xa1, 0x47, 0xf5, 0x5e, - 0x1d, 0x6f, 0x87, 0x8a, 0xb4, 0xf3, 0xec, 0x78, 0xed, 0x73, 0x56, 0x26, 0x39, 0x74, 0x8e, 0x2c, - 0x57, 0x45, 0x54, 0xc5, 0xf9, 0xa7, 0xb6, 0x70, 0xf2, 0x7f, 0x72, 0xa9, 0xb3, 0xba, 0x07, 0xf7, - 0x1f, 0xdf, 0x8f, 0xee, 0x7e, 0x77, 0x0f, 0x17, 0x6a, 0x3f, 0xbd, 0x55, 0x03, 0x86, 0xbf, 0xee, - 0x5b, 0x1d, 0x38, 0xab, 0x3a, 0x70, 0xbe, 0xea, 0xc0, 0x79, 0x58, 0x07, 0xad, 0xd5, 0x3a, 0x68, - 0x7d, 0xae, 0x83, 0x96, 0xd7, 0x8b, 0x79, 0x61, 0xf9, 0xfe, 0xe1, 0xee, 0x95, 0xfa, 0xc4, 0xe3, - 0xe6, 0x2a, 0xc6, 0xce, 0xf5, 0x71, 0x9a, 0xc9, 0xdb, 0xc5, 0x14, 0xc5, 0xbc, 0xc0, 0x76, 0x57, - 0xfc, 0xe4, 0xb6, 0x07, 0x34, 0x1c, 0x4d, 0xe8, 0x8b, 0xbb, 0x15, 0x41, 0x75, 0x44, 0x88, 0x46, - 0x2a, 0x62, 0x62, 0x46, 0x50, 0x36, 0x83, 0xf7, 0x2d, 0x10, 0x69, 0x10, 0x85, 0x91, 0x02, 0x91, - 0x09, 0xa2, 0x06, 0xd4, 0x2e, 0xb1, 0x03, 0xd1, 0xd9, 0x78, 0x48, 0x41, 0xb2, 0x84, 0x49, 0xf6, - 0xe3, 0xf6, 0x0d, 0x4c, 0x88, 0xd6, 0x84, 0x84, 0x84, 0x28, 0x4f, 0x88, 0x39, 0x80, 0x90, 0x66, - 0xc2, 0xb4, 0xbd, 0xf9, 0x59, 0xfa, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x71, 0xb6, 0xf0, 0xc3, - 0x43, 0x03, 0x00, 0x00, + // 363 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xfb, 0x40, + 0x14, 0xc0, 0xf1, 0x24, 0x3f, 0x7e, 0x1d, 0x82, 0x53, 0x17, 0x21, 0x48, 0x06, 0x47, 0x87, 0x3b, + 0x6c, 0x07, 0xf1, 0x70, 0x69, 0x1d, 0xd4, 0xe1, 0x68, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8e, + 0x18, 0x9a, 0xe4, 0x4a, 0xde, 0xb5, 0x74, 0x74, 0x74, 0x74, 0x73, 0x77, 0x74, 0xf2, 0xcf, 0x10, + 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0xbb, 0xbb, 0xc4, 0x3b, 0xf0, 0x3a, 0xde, 0x14, 0xb8, 0xf0, + 0x79, 0xf9, 0xe6, 0x25, 0xfe, 0xc9, 0x00, 0x80, 0x4b, 0xca, 0x2a, 0x59, 0x70, 0x5c, 0x8a, 0x74, + 0x51, 0x70, 0xc0, 0x2b, 0x2c, 0xea, 0x94, 0xd7, 0x80, 0x65, 0xcd, 0x2a, 0x60, 0x89, 0xcc, 0x45, + 0x05, 0xb8, 0x64, 0x33, 0x8e, 0x81, 0xd7, 0xcb, 0x3c, 0xe1, 0x68, 0x5e, 0x0b, 0x29, 0xba, 0xc8, + 0xd0, 0x48, 0x6b, 0xb4, 0x42, 0x4a, 0x23, 0x53, 0xa3, 0x56, 0x07, 0xbb, 0x89, 0x80, 0x52, 0x00, + 0x2e, 0x21, 0xc3, 0xcb, 0xc3, 0xf6, 0xa2, 0x06, 0x05, 0x7b, 0x99, 0x10, 0x59, 0xc1, 0x31, 0x9b, + 0xe7, 0x98, 0x55, 0x95, 0x90, 0x4c, 0x29, 0x75, 0xd7, 0x36, 0xb2, 0xe4, 0x00, 0x2c, 0xd3, 0x91, + 0xc1, 0x85, 0xa5, 0x36, 0x4e, 0x6e, 0x6a, 0x0e, 0x73, 0x51, 0x81, 0x1e, 0xd5, 0x7b, 0x74, 0xfd, + 0x7f, 0x14, 0xb2, 0xee, 0xbd, 0xeb, 0x77, 0xce, 0x59, 0x95, 0x16, 0xbc, 0x7b, 0x64, 0xb9, 0x03, + 0x44, 0x55, 0x5c, 0x70, 0x6a, 0x0b, 0x27, 0x7f, 0x27, 0x97, 0x3a, 0x6b, 0xdf, 0x09, 0xfe, 0xdf, + 0x7d, 0xbe, 0x1c, 0xb8, 0xc3, 0x6f, 0xef, 0xb5, 0x09, 0xdd, 0x75, 0x13, 0xba, 0x1f, 0x4d, 0xe8, + 0x3e, 0x6c, 0x42, 0x67, 0xbd, 0x09, 0x9d, 0xf7, 0x4d, 0xe8, 0xf8, 0xbd, 0x44, 0x94, 0x96, 0xcf, + 0x1a, 0xee, 0x5c, 0xa9, 0xef, 0x3c, 0x6e, 0x5f, 0x7b, 0xec, 0x5e, 0x1f, 0x67, 0xb9, 0xbc, 0x5d, + 0x4c, 0x51, 0x22, 0x4a, 0x6c, 0xb7, 0xce, 0x27, 0xaf, 0x33, 0xa0, 0xd1, 0x68, 0x42, 0x9f, 0xbd, + 0xad, 0x08, 0xaa, 0x23, 0x22, 0x34, 0x52, 0x11, 0x13, 0x33, 0x82, 0xb2, 0x19, 0x7f, 0xdb, 0x02, + 0xb1, 0x06, 0x71, 0x14, 0x2b, 0x10, 0x9b, 0x20, 0x6e, 0x41, 0xe3, 0x11, 0x3b, 0x10, 0x9f, 0x8d, + 0x87, 0x94, 0x4b, 0x96, 0x32, 0xc9, 0xbe, 0xbc, 0xbe, 0x81, 0x09, 0xd1, 0x9a, 0x90, 0x88, 0x10, + 0xe5, 0x09, 0x31, 0x07, 0x10, 0xd2, 0x4e, 0x98, 0x76, 0x7e, 0x7f, 0x8c, 0xfe, 0x4f, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x07, 0x3b, 0x2e, 0x36, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/modify/service.pb.go b/x/orders/transactions/modify/service.pb.go index fb898bf22..4b670af1a 100644 --- a/x/orders/transactions/modify/service.pb.go +++ b/x/orders/transactions/modify/service.pb.go @@ -6,6 +6,7 @@ package modify import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_8ff4398d92b669f7 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x4f, 0x4b, 0xf3, 0x30, - 0x1c, 0x07, 0xf0, 0xb5, 0x83, 0x1d, 0xca, 0x73, 0x1a, 0x3c, 0x08, 0x45, 0x7b, 0xd8, 0x0b, 0x48, - 0xc4, 0x3f, 0x07, 0xa3, 0x08, 0x1b, 0x88, 0x82, 0x84, 0x0d, 0xdd, 0xa1, 0x48, 0x41, 0xb2, 0x36, - 0xab, 0x85, 0x36, 0x19, 0x4d, 0x26, 0xdb, 0x51, 0x5f, 0x81, 0xe0, 0x3b, 0xf0, 0xa6, 0x37, 0xdf, - 0x85, 0x78, 0x1a, 0x78, 0xf1, 0x28, 0x9d, 0x27, 0x5f, 0x85, 0xac, 0x09, 0x98, 0x1d, 0x73, 0x4d, - 0xfa, 0xf9, 0xf2, 0xfd, 0xa5, 0x3f, 0xef, 0xb8, 0x2b, 0x04, 0x95, 0x98, 0x30, 0x99, 0x53, 0x58, - 0xf0, 0x64, 0x9a, 0x53, 0x01, 0x67, 0x90, 0x97, 0x09, 0x2d, 0x05, 0x94, 0x25, 0x61, 0x82, 0xc4, - 0x32, 0xe3, 0x4c, 0xac, 0x6e, 0xb3, 0xf1, 0x1c, 0x0a, 0x5a, 0xde, 0x66, 0x31, 0x05, 0x93, 0x92, - 0x4b, 0xde, 0xde, 0x36, 0x3c, 0xd0, 0x1e, 0xcc, 0x80, 0xf2, 0xc0, 0xf4, 0x40, 0x79, 0x7f, 0x33, - 0xe5, 0x3c, 0xcd, 0x29, 0x24, 0x93, 0x0c, 0x12, 0xc6, 0xb8, 0x24, 0xea, 0xba, 0xce, 0xf3, 0xed, - 0xfb, 0x14, 0x54, 0x08, 0x92, 0xea, 0x3e, 0xfe, 0xb9, 0xb5, 0x37, 0xce, 0xae, 0x4b, 0x2a, 0x26, - 0x9c, 0x09, 0x1d, 0xb6, 0xf3, 0xea, 0x78, 0x4d, 0x2c, 0xd2, 0xf6, 0xb3, 0xe3, 0xb5, 0xce, 0x08, - 0x4b, 0x72, 0xda, 0x3e, 0x00, 0xb6, 0x03, 0x03, 0xac, 0x0a, 0xfa, 0x27, 0xf6, 0x74, 0xf8, 0x77, - 0x76, 0xa1, 0xab, 0x75, 0xb6, 0xee, 0x3f, 0xbe, 0x1f, 0xdd, 0x8d, 0xce, 0x7f, 0x58, 0xa8, 0x29, - 0xf5, 0x6c, 0x8a, 0xf4, 0xee, 0x9a, 0x6f, 0x55, 0xe0, 0x2c, 0xaa, 0xc0, 0xf9, 0xaa, 0x02, 0xe7, - 0x61, 0x19, 0x34, 0x16, 0xcb, 0xa0, 0xf1, 0xb9, 0x0c, 0x1a, 0xde, 0x5e, 0xcc, 0x0b, 0xeb, 0x0e, - 0xbd, 0x7f, 0x97, 0xea, 0x87, 0x0f, 0x56, 0x4f, 0x32, 0x70, 0xae, 0x0e, 0xd3, 0x4c, 0xde, 0x4c, - 0x47, 0x20, 0xe6, 0x05, 0xb4, 0x7d, 0xec, 0x27, 0xb7, 0xd5, 0xc5, 0x61, 0x7f, 0x88, 0x5f, 0xdc, - 0xb5, 0xc5, 0xc1, 0xba, 0x48, 0x08, 0xfa, 0xaa, 0xc8, 0xd0, 0x2c, 0x82, 0x6b, 0xfb, 0xbe, 0x46, - 0x22, 0x4d, 0xa2, 0x30, 0x52, 0x24, 0x32, 0x49, 0xa4, 0x48, 0xe5, 0x1e, 0xd9, 0x92, 0xe8, 0x74, - 0xd0, 0xc3, 0x54, 0x92, 0x84, 0x48, 0xf2, 0xe3, 0xee, 0x1b, 0x1c, 0x21, 0xed, 0x11, 0x0a, 0x11, - 0x52, 0x09, 0x08, 0x99, 0x11, 0xf5, 0x17, 0xd9, 0x78, 0x3e, 0x6a, 0xd5, 0xeb, 0xb3, 0xfb, 0x1b, - 0x00, 0x00, 0xff, 0xff, 0x21, 0xe2, 0xed, 0x06, 0x5d, 0x03, 0x00, 0x00, + // 369 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xf3, 0x40, + 0x1c, 0x07, 0xf0, 0x24, 0xe5, 0xe9, 0x10, 0x9e, 0xa9, 0x8b, 0x10, 0x24, 0x83, 0xa3, 0xc3, 0x9d, + 0x7f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x39, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x6b, + 0x0c, 0x24, 0xb9, 0x92, 0xdf, 0xb5, 0xb4, 0x9b, 0xee, 0x0e, 0xee, 0x6e, 0x8e, 0x4e, 0xbe, 0x0c, + 0x71, 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x2a, 0xa4, 0xbd, 0x80, 0xd7, 0xf1, 0xa6, 0xc0, 0x5d, + 0x3e, 0xdf, 0x7c, 0x73, 0xf7, 0x73, 0x4f, 0xdb, 0x00, 0x5c, 0x52, 0x56, 0xc8, 0x8c, 0xe3, 0x5c, + 0xc4, 0xe3, 0x8c, 0x03, 0x9e, 0x62, 0x51, 0xc6, 0xbc, 0x04, 0x2c, 0x4b, 0x56, 0x00, 0x8b, 0x64, + 0x2a, 0x0a, 0x58, 0xee, 0xa6, 0xc3, 0x19, 0x06, 0x5e, 0x4e, 0xd2, 0x88, 0xa3, 0x51, 0x29, 0xa4, + 0x68, 0xed, 0x68, 0x1e, 0xd5, 0x1e, 0x4d, 0x91, 0xf2, 0x48, 0xf7, 0x48, 0x79, 0x6f, 0x23, 0x12, + 0x90, 0x0b, 0xc0, 0x39, 0x24, 0x78, 0xb2, 0xbb, 0x7c, 0xa8, 0x28, 0x6f, 0x33, 0x11, 0x22, 0xc9, + 0x38, 0x66, 0xa3, 0x14, 0xb3, 0xa2, 0x10, 0x92, 0x29, 0xa7, 0x76, 0xcd, 0x8b, 0xe6, 0x1c, 0x80, + 0x25, 0x75, 0x51, 0xef, 0xd2, 0xd8, 0x6b, 0x6b, 0xb7, 0x25, 0x87, 0x91, 0x28, 0xa0, 0x0e, 0xdb, + 0x7b, 0xb6, 0xdd, 0x06, 0x85, 0xa4, 0xf5, 0x68, 0xbb, 0xcd, 0x0b, 0x56, 0xc4, 0x19, 0x6f, 0x1d, + 0x21, 0xd3, 0x93, 0x40, 0x54, 0x15, 0xf4, 0xce, 0xcc, 0x69, 0xff, 0x6f, 0xed, 0xaa, 0xae, 0xb6, + 0x65, 0x79, 0xff, 0xee, 0xbf, 0xdf, 0xb6, 0xed, 0xce, 0x43, 0xe3, 0xbd, 0xf2, 0xed, 0x79, 0xe5, + 0xdb, 0x5f, 0x95, 0x6f, 0x3f, 0x2d, 0x7c, 0x6b, 0xbe, 0xf0, 0xad, 0xcf, 0x85, 0x6f, 0xb9, 0x07, + 0x91, 0xc8, 0x8d, 0xbf, 0xd6, 0xf9, 0x7f, 0xad, 0xee, 0xbc, 0xb7, 0xfc, 0xf9, 0x9e, 0x7d, 0x73, + 0x9c, 0xa4, 0xf2, 0x6e, 0x3c, 0x40, 0x91, 0xc8, 0xb1, 0xe9, 0xb1, 0xbe, 0x38, 0xcd, 0x36, 0x0d, + 0xba, 0x7d, 0xfa, 0xea, 0xac, 0xcd, 0x0e, 0xad, 0x8b, 0x04, 0xa8, 0xab, 0x8a, 0xf4, 0xf5, 0x22, + 0x74, 0x65, 0x3f, 0xd6, 0x48, 0x58, 0x93, 0x30, 0x08, 0x15, 0x09, 0x75, 0x12, 0x2a, 0x52, 0x39, + 0x27, 0xa6, 0x24, 0x3c, 0xef, 0x75, 0x28, 0x97, 0x2c, 0x66, 0x92, 0xfd, 0x38, 0x87, 0x1a, 0x27, + 0xa4, 0xf6, 0x84, 0x04, 0x84, 0xa8, 0x04, 0x42, 0xf4, 0x88, 0xd5, 0x1b, 0xe9, 0x70, 0x36, 0x68, + 0xae, 0x06, 0x65, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x50, 0x3d, 0xb2, 0x60, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/put/service.pb.go b/x/orders/transactions/put/service.pb.go index d2b6bd0a6..c0775de06 100644 --- a/x/orders/transactions/put/service.pb.go +++ b/x/orders/transactions/put/service.pb.go @@ -6,6 +6,7 @@ package put import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_ca7dda5a8ae78412 = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0xc7, 0x9b, 0x08, 0x1d, 0x82, 0x53, 0x70, 0x0a, 0x92, 0xa1, 0xbb, 0x77, 0x58, 0x41, 0xf4, - 0x9c, 0x9a, 0xc5, 0x2e, 0xa1, 0x41, 0x3b, 0x04, 0x09, 0xc8, 0x35, 0x39, 0x62, 0x20, 0xc9, 0x85, - 0xdc, 0x3b, 0xe9, 0xec, 0x27, 0x10, 0xfc, 0x02, 0xe2, 0x24, 0x7e, 0x12, 0x71, 0x2a, 0xb8, 0x38, - 0x4a, 0xea, 0xe4, 0xe2, 0x57, 0x90, 0x9a, 0x03, 0xaf, 0xe3, 0xad, 0x2f, 0xff, 0xdf, 0xcb, 0xef, - 0xbd, 0x7b, 0xce, 0xd9, 0x44, 0x08, 0x06, 0x21, 0xad, 0xa1, 0x64, 0xb8, 0xe2, 0x99, 0x2c, 0x99, - 0xc0, 0x4b, 0xcc, 0xdb, 0x8c, 0xb5, 0x02, 0x43, 0x4b, 0x6b, 0x41, 0x53, 0x28, 0x78, 0x2d, 0x70, - 0x23, 0x01, 0x0b, 0xd6, 0xde, 0x16, 0x29, 0x43, 0x4d, 0xcb, 0x81, 0xbb, 0x07, 0x1a, 0x8c, 0x14, - 0x8c, 0x96, 0xa8, 0x87, 0x91, 0x0e, 0xa3, 0x46, 0x82, 0xb7, 0x9f, 0x73, 0x9e, 0x97, 0x0c, 0xd3, - 0xa6, 0xc0, 0xb4, 0xae, 0x39, 0x50, 0xf5, 0x6d, 0xd3, 0xcc, 0x33, 0x34, 0xa9, 0x98, 0x10, 0x34, - 0x57, 0x26, 0xde, 0xd4, 0x0c, 0xd6, 0x0a, 0xd7, 0x2d, 0x13, 0x0d, 0xaf, 0x85, 0xea, 0x34, 0x7e, - 0xb6, 0x9c, 0x9d, 0x50, 0xe4, 0xee, 0xa3, 0xe5, 0x0c, 0xa7, 0xb4, 0xce, 0x4a, 0xe6, 0x1e, 0x23, - 0xa3, 0x39, 0x51, 0xd8, 0xab, 0x79, 0x81, 0x21, 0x37, 0xff, 0x2f, 0x5c, 0x28, 0xa9, 0x91, 0x77, - 0xf7, 0xfe, 0xf5, 0x60, 0xef, 0x8d, 0x5c, 0x5c, 0xf5, 0xc3, 0xa9, 0x91, 0x1a, 0x09, 0xc1, 0x8f, - 0xfd, 0xda, 0xf9, 0xd6, 0xaa, 0xf3, 0xad, 0xcf, 0xce, 0xb7, 0xee, 0xd7, 0xfe, 0x60, 0xb5, 0xf6, - 0x07, 0x1f, 0x6b, 0x7f, 0xe0, 0x1c, 0xa6, 0xbc, 0x32, 0xfb, 0x7b, 0xb0, 0x7b, 0xd9, 0xbf, 0x6d, - 0xb4, 0x59, 0x43, 0x64, 0x5d, 0x9d, 0xe4, 0x05, 0xdc, 0xc8, 0x05, 0x4a, 0x79, 0x85, 0x8d, 0xb6, - 0xfb, 0x64, 0x0f, 0x27, 0x61, 0x3c, 0x9b, 0x47, 0x2f, 0xf6, 0xd6, 0x81, 0x84, 0x4a, 0x21, 0x46, - 0xb3, 0x5e, 0x61, 0xae, 0x2b, 0x44, 0x12, 0xde, 0xb6, 0xf2, 0x89, 0xca, 0x27, 0x71, 0xd2, 0xe7, - 0x13, 0x3d, 0x9f, 0x44, 0x12, 0x3a, 0xfb, 0xd4, 0x28, 0x9f, 0x9c, 0x47, 0x41, 0xc8, 0x80, 0x66, - 0x14, 0xe8, 0xb7, 0x3d, 0xd6, 0x58, 0x42, 0x14, 0x4c, 0x48, 0x4c, 0x48, 0x8f, 0x13, 0xa2, 0xf3, - 0x84, 0x44, 0x12, 0x16, 0xc3, 0xbf, 0x1b, 0x39, 0xfa, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xac, 0x88, - 0x4d, 0xfb, 0x36, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x4b, 0xe4, 0x40, + 0x14, 0xc7, 0x93, 0x1c, 0xb7, 0x45, 0xb8, 0x6a, 0x9b, 0x83, 0x70, 0xa4, 0xb8, 0x52, 0x70, 0x86, + 0x5d, 0x41, 0x74, 0xac, 0x36, 0x8d, 0xdb, 0x84, 0x0d, 0xba, 0x45, 0x90, 0x80, 0xcc, 0x26, 0x43, + 0x0c, 0x24, 0x99, 0x90, 0xf7, 0xb2, 0x6c, 0x69, 0x65, 0x6d, 0xe3, 0x17, 0xb0, 0xb4, 0xf2, 0x63, + 0x88, 0xd5, 0x96, 0x96, 0x92, 0x2d, 0x04, 0x1b, 0xbf, 0x82, 0xec, 0x66, 0xc0, 0x6c, 0x39, 0x55, + 0xe0, 0xe5, 0xff, 0x7b, 0xf3, 0x9b, 0x37, 0xcf, 0x3e, 0x9b, 0x00, 0x08, 0xf4, 0x79, 0x89, 0xb9, + 0xa0, 0x85, 0x4c, 0x9a, 0x5c, 0x00, 0x5d, 0x51, 0x59, 0x27, 0xa2, 0x06, 0x8a, 0x35, 0x2f, 0x81, + 0xc7, 0x98, 0xc9, 0x12, 0x68, 0xd5, 0x20, 0x05, 0x51, 0x2f, 0xb3, 0x58, 0x90, 0xaa, 0x96, 0x28, + 0x87, 0x87, 0x3d, 0x98, 0x28, 0x98, 0xac, 0x48, 0x07, 0x93, 0x3e, 0x4c, 0xaa, 0x06, 0x9d, 0xbf, + 0xb1, 0x84, 0x42, 0x02, 0x2d, 0x20, 0xa5, 0xcb, 0xd1, 0xf6, 0xd3, 0xf5, 0x71, 0xfe, 0xa5, 0x52, + 0xa6, 0xb9, 0xa0, 0xbc, 0xca, 0x28, 0x2f, 0x4b, 0x89, 0x5c, 0x41, 0xbb, 0xbf, 0x9a, 0x8a, 0x85, + 0x00, 0xe0, 0xa9, 0x52, 0x74, 0xa6, 0x7a, 0x70, 0xaf, 0x70, 0x5d, 0x0b, 0xa8, 0x64, 0x09, 0xaa, + 0xd3, 0xf8, 0xc1, 0xb4, 0x7f, 0xf9, 0x90, 0x0e, 0xef, 0x4c, 0x7b, 0x30, 0xe5, 0x65, 0x92, 0x8b, + 0xe1, 0x31, 0xd1, 0x1a, 0x00, 0xf1, 0x3b, 0x35, 0xc7, 0xd3, 0xe4, 0xe6, 0x3f, 0x85, 0x0b, 0x25, + 0xf5, 0xdf, 0x70, 0x7e, 0xdf, 0x7e, 0x3c, 0x1f, 0x98, 0xde, 0x97, 0xf5, 0xd2, 0xba, 0xe6, 0xba, + 0x75, 0xcd, 0xf7, 0xd6, 0x35, 0xef, 0x37, 0xae, 0xb1, 0xde, 0xb8, 0xc6, 0xdb, 0xc6, 0x35, 0xec, + 0x51, 0x2c, 0x0b, 0xbd, 0xa3, 0xbc, 0x3f, 0x97, 0xdd, 0x0b, 0x07, 0xdb, 0x3b, 0x07, 0xe6, 0xd5, + 0x49, 0x9a, 0xe1, 0x4d, 0xb3, 0x20, 0xb1, 0x2c, 0xa8, 0xd6, 0x28, 0x1f, 0xad, 0xc1, 0xc4, 0x0f, + 0x67, 0xf3, 0xe0, 0xc9, 0xda, 0x5b, 0x13, 0x5f, 0x29, 0x84, 0x64, 0xd6, 0x29, 0xcc, 0xfb, 0x0a, + 0x41, 0x83, 0xaf, 0x7b, 0xf9, 0x48, 0xe5, 0xa3, 0x30, 0xea, 0xf2, 0x51, 0x3f, 0x1f, 0x05, 0x0d, + 0xb6, 0xd6, 0xa9, 0x56, 0x3e, 0x3a, 0x0f, 0x3c, 0x5f, 0x20, 0x4f, 0x38, 0xf2, 0x4f, 0x6b, 0xdc, + 0x63, 0x19, 0x53, 0x30, 0x63, 0x21, 0x63, 0x1d, 0xce, 0x58, 0x9f, 0x67, 0x2c, 0x68, 0x70, 0x31, + 0xd8, 0x2d, 0xc4, 0xd1, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x73, 0xed, 0xbb, 0x3c, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/revoke/service.pb.go b/x/orders/transactions/revoke/service.pb.go index 01151309f..2f0697800 100644 --- a/x/orders/transactions/revoke/service.pb.go +++ b/x/orders/transactions/revoke/service.pb.go @@ -6,6 +6,7 @@ package revoke import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,31 @@ func init() { } var fileDescriptor_d9b7810b72c042ec = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xcf, 0x4a, 0xeb, 0x40, - 0x14, 0x06, 0xf0, 0x26, 0x85, 0x2e, 0xc2, 0x5d, 0x15, 0x2e, 0x42, 0xd0, 0x2c, 0xfa, 0x00, 0x33, - 0xe2, 0x9f, 0x85, 0xa3, 0x08, 0x2d, 0x88, 0x82, 0x84, 0x96, 0xda, 0x45, 0x90, 0x80, 0x4c, 0x93, - 0x43, 0x0c, 0x26, 0x99, 0x32, 0x33, 0x2d, 0xdd, 0xea, 0x13, 0x08, 0xbe, 0x81, 0x3b, 0xdd, 0xf9, - 0x16, 0xe2, 0xaa, 0xe0, 0xc6, 0xa5, 0xa4, 0xae, 0x7c, 0x0a, 0xb1, 0x33, 0xe0, 0x74, 0x39, 0xdb, - 0x09, 0xbf, 0x8f, 0xef, 0x9c, 0x1c, 0xef, 0xb8, 0x2b, 0x04, 0xc8, 0x90, 0x56, 0xb2, 0x00, 0x5c, - 0xb2, 0x74, 0x5a, 0x80, 0xc0, 0x73, 0xcc, 0x78, 0x0a, 0x5c, 0x60, 0xc9, 0x69, 0x25, 0x68, 0x22, - 0x73, 0x56, 0x09, 0xcc, 0x61, 0xc6, 0x6e, 0x00, 0x0b, 0xe0, 0xb3, 0x3c, 0x01, 0x34, 0xe1, 0x4c, - 0xb2, 0xf6, 0xb6, 0xe1, 0x91, 0xf6, 0x68, 0x8e, 0x94, 0x47, 0xa6, 0x47, 0xca, 0xfb, 0x9b, 0x19, - 0x63, 0x59, 0x01, 0x98, 0x4e, 0x72, 0x4c, 0xab, 0x8a, 0x49, 0xaa, 0x3e, 0xaf, 0xf2, 0x7c, 0xfb, - 0x3e, 0x25, 0x08, 0x41, 0x33, 0xdd, 0xc7, 0x3f, 0xb7, 0xf6, 0xc6, 0xdb, 0x15, 0x07, 0x31, 0x61, - 0x95, 0xd0, 0x61, 0x3b, 0x2f, 0x8e, 0xd7, 0x0c, 0x45, 0xd6, 0x7e, 0x72, 0xbc, 0xd6, 0x19, 0xad, - 0xd2, 0x02, 0xda, 0x07, 0xc8, 0x76, 0x60, 0x14, 0xaa, 0x82, 0xfe, 0x89, 0x3d, 0x1d, 0xfd, 0xbd, - 0x0d, 0x75, 0xb5, 0xce, 0xd6, 0xdd, 0xfb, 0xd7, 0x83, 0xbb, 0xd1, 0xf9, 0x8f, 0x4b, 0x35, 0xa5, - 0x9e, 0x4d, 0x91, 0xde, 0x6d, 0xf3, 0xb5, 0x0e, 0x9c, 0x45, 0x1d, 0x38, 0x9f, 0x75, 0xe0, 0xdc, - 0x2f, 0x83, 0xc6, 0x62, 0x19, 0x34, 0x3e, 0x96, 0x41, 0xc3, 0xdb, 0x4b, 0x58, 0x69, 0xdd, 0xa1, - 0xf7, 0xef, 0x42, 0xfd, 0xf0, 0xc1, 0xef, 0x4a, 0x06, 0xce, 0xe5, 0x61, 0x96, 0xcb, 0xeb, 0xe9, - 0x18, 0x25, 0xac, 0xc4, 0xb6, 0xcb, 0x7e, 0x74, 0x5b, 0xdd, 0x30, 0xea, 0x8f, 0x86, 0xcf, 0xee, - 0xda, 0xe1, 0x84, 0xba, 0x48, 0x84, 0xfa, 0xaa, 0xc8, 0xc8, 0x2c, 0x32, 0x5c, 0xd9, 0xb7, 0x35, - 0x12, 0x6b, 0x12, 0x47, 0xb1, 0x22, 0xb1, 0x49, 0x62, 0x45, 0x6a, 0xf7, 0xc8, 0x96, 0xc4, 0xa7, - 0x83, 0x5e, 0x08, 0x92, 0xa6, 0x54, 0xd2, 0x6f, 0x77, 0xdf, 0xe0, 0x84, 0x68, 0x4f, 0x48, 0x44, - 0x88, 0x4a, 0x20, 0xc4, 0x8c, 0x20, 0x44, 0x65, 0x8c, 0x5b, 0xab, 0xf3, 0xd9, 0xfd, 0x09, 0x00, - 0x00, 0xff, 0xff, 0xfa, 0x0a, 0x81, 0x17, 0x5d, 0x03, 0x00, 0x00, + // 370 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0xc3, 0x3b, 0xbe, + 0xc3, 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x09, 0x2d, 0xb5, 0x43, 0x90, 0x80, 0x5c, + 0x93, 0x23, 0x06, 0x93, 0x3c, 0x25, 0xcf, 0xb5, 0x74, 0xd4, 0xdd, 0xc1, 0xdd, 0xcd, 0xd1, 0xc9, + 0x3f, 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xfe, 0x15, 0xd2, 0x5e, 0xc0, 0xeb, 0x78, 0x53, + 0xe0, 0xc2, 0xe7, 0x9b, 0x6f, 0x9e, 0x7b, 0xdc, 0xe3, 0x2e, 0xa2, 0x90, 0x01, 0x2f, 0x65, 0x2e, + 0x68, 0x01, 0xc9, 0x34, 0x17, 0x48, 0xe7, 0x14, 0xaa, 0x44, 0x54, 0x48, 0x65, 0xc5, 0x4b, 0xe4, + 0xb1, 0xcc, 0xa0, 0x44, 0x5a, 0x89, 0x19, 0xdc, 0x08, 0x8a, 0xa2, 0x9a, 0x65, 0xb1, 0x20, 0x93, + 0x0a, 0x24, 0x74, 0xb6, 0x34, 0x4f, 0x1a, 0x4f, 0xe6, 0x44, 0x79, 0xa2, 0x7b, 0xa2, 0xbc, 0xf7, + 0x27, 0x06, 0x2c, 0x00, 0x69, 0x81, 0x29, 0x9d, 0x6d, 0xaf, 0x1e, 0x2a, 0xca, 0xfb, 0x9b, 0x02, + 0xa4, 0xb9, 0xa0, 0x7c, 0x92, 0x51, 0x5e, 0x96, 0x20, 0xb9, 0x72, 0xea, 0xad, 0x79, 0xd1, 0x42, + 0x20, 0xf2, 0xb4, 0x29, 0xea, 0x9d, 0x1b, 0x7b, 0xed, 0xec, 0xaa, 0x12, 0x38, 0x81, 0x12, 0x9b, + 0xb0, 0x9d, 0x47, 0xdb, 0x6d, 0x05, 0x98, 0x76, 0xee, 0x6d, 0xb7, 0x7d, 0xc6, 0xcb, 0x24, 0x17, + 0x9d, 0x03, 0x62, 0x3a, 0x09, 0x12, 0xa8, 0x82, 0xde, 0x89, 0x39, 0x1d, 0xfd, 0x9c, 0x0d, 0x9b, + 0x6a, 0xff, 0x2c, 0xef, 0xd7, 0xed, 0xe7, 0xcb, 0x7f, 0xbb, 0x77, 0xd7, 0x7a, 0xad, 0x7d, 0x7b, + 0x51, 0xfb, 0xf6, 0x47, 0xed, 0xdb, 0x0f, 0x4b, 0xdf, 0x5a, 0x2c, 0x7d, 0xeb, 0x7d, 0xe9, 0x5b, + 0xee, 0x5e, 0x0c, 0x85, 0xf1, 0xd7, 0x7a, 0xbf, 0x2f, 0xd4, 0x9d, 0x0f, 0x56, 0x3f, 0x3f, 0xb0, + 0x2f, 0x0f, 0xd3, 0x4c, 0x5e, 0x4f, 0xc7, 0x24, 0x86, 0x82, 0x9a, 0x8e, 0xf5, 0xc9, 0x69, 0x77, + 0x83, 0xb0, 0x3f, 0x1a, 0x3e, 0x3b, 0x1b, 0xbb, 0x13, 0x34, 0x45, 0x42, 0xd2, 0x57, 0x45, 0x46, + 0x7a, 0x91, 0xe1, 0xda, 0xbe, 0x6d, 0x90, 0xa8, 0x21, 0x51, 0x18, 0x29, 0x12, 0xe9, 0x24, 0x52, + 0xa4, 0x76, 0x8e, 0x4c, 0x49, 0x74, 0x3a, 0xe8, 0x05, 0x42, 0xf2, 0x84, 0x4b, 0xfe, 0xe5, 0xec, + 0x6b, 0x9c, 0xb1, 0xc6, 0x33, 0x16, 0x32, 0xa6, 0x12, 0x18, 0xd3, 0x23, 0x18, 0x53, 0x19, 0xe3, + 0xf6, 0x7a, 0x51, 0x76, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x47, 0x0d, 0xa9, 0x75, 0x60, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/take/service.pb.go b/x/orders/transactions/take/service.pb.go index 1d535be1d..1c25a3033 100644 --- a/x/orders/transactions/take/service.pb.go +++ b/x/orders/transactions/take/service.pb.go @@ -6,6 +6,7 @@ package take import ( context "context" fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" grpc1 "github.com/cosmos/gogoproto/grpc" proto "github.com/cosmos/gogoproto/proto" _ "google.golang.org/genproto/googleapis/api/annotations" @@ -31,30 +32,30 @@ func init() { } var fileDescriptor_bef3612b3af5a204 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0xc0, 0xf1, 0x26, 0x2f, 0x74, 0x08, 0xef, 0xd4, 0x97, 0x77, 0xc9, 0xfb, 0x92, 0xa1, 0x1f, - 0xe0, 0x0e, 0xda, 0x41, 0x3c, 0x5c, 0x5a, 0x07, 0x75, 0x08, 0x2d, 0x9a, 0x21, 0x48, 0x40, 0x9e, - 0x26, 0x0f, 0x31, 0x34, 0xc9, 0x95, 0xdc, 0x55, 0x3a, 0xfb, 0x09, 0x04, 0xbf, 0x81, 0x6e, 0xfa, - 0x45, 0xc4, 0xa9, 0xe0, 0xe2, 0x28, 0xa9, 0x93, 0xbb, 0xbb, 0xa4, 0x17, 0xf1, 0x3a, 0xde, 0x7a, - 0xe1, 0xf7, 0xe4, 0xff, 0x5c, 0xe2, 0x1c, 0x8c, 0x84, 0x40, 0xe9, 0x43, 0x29, 0x73, 0xa4, 0x05, - 0x4f, 0x96, 0x39, 0x0a, 0xba, 0xa2, 0xbc, 0x4a, 0xb0, 0x12, 0x54, 0x56, 0x50, 0x0a, 0x88, 0x65, - 0xc6, 0x4b, 0x41, 0x25, 0xcc, 0x91, 0x0a, 0xac, 0xae, 0xb2, 0x18, 0xc9, 0xa2, 0xe2, 0x92, 0xf7, - 0x88, 0xa6, 0x49, 0xab, 0xc9, 0x8a, 0x28, 0x4d, 0x74, 0x4d, 0x1a, 0xed, 0xfe, 0x4f, 0x39, 0x4f, - 0x73, 0xa4, 0xb0, 0xc8, 0x28, 0x94, 0x25, 0x97, 0xa0, 0x1e, 0x6e, 0xa7, 0xb9, 0xa6, 0x2d, 0x05, - 0x0a, 0x01, 0x69, 0xdb, 0xe2, 0x9e, 0x18, 0x6a, 0xed, 0xe4, 0xa2, 0x42, 0xb1, 0xe0, 0xa5, 0x68, - 0x47, 0x0d, 0x1e, 0x2d, 0xe7, 0x97, 0x2f, 0xd2, 0xde, 0xbd, 0xe5, 0x74, 0x8f, 0xa1, 0x4c, 0x72, - 0xec, 0xed, 0x19, 0xae, 0x4a, 0x7c, 0x15, 0xe7, 0x1e, 0x9a, 0xc2, 0xe0, 0xe7, 0xe4, 0xb4, 0xcd, - 0xea, 0xff, 0xbb, 0x7e, 0x79, 0xbf, 0xb5, 0xff, 0xf6, 0xff, 0xd0, 0x42, 0xed, 0xf7, 0xbd, 0x15, - 0xcc, 0x71, 0xfc, 0x69, 0x3f, 0xd5, 0x9e, 0xb5, 0xae, 0x3d, 0xeb, 0xad, 0xf6, 0xac, 0x9b, 0x8d, - 0xd7, 0x59, 0x6f, 0xbc, 0xce, 0xeb, 0xc6, 0xeb, 0x38, 0x83, 0x98, 0x17, 0x86, 0xef, 0x1f, 0xff, - 0x3e, 0x53, 0x9f, 0x78, 0xda, 0x5c, 0xc5, 0xd4, 0x3a, 0xdf, 0x4f, 0x33, 0x79, 0xb9, 0x9c, 0x91, - 0x98, 0x17, 0xd4, 0xec, 0x8a, 0xef, 0xec, 0xee, 0xc8, 0x0f, 0x27, 0x41, 0xf0, 0x60, 0xef, 0x44, - 0xf8, 0x6d, 0x44, 0x48, 0x26, 0x2a, 0x22, 0xd0, 0x23, 0x02, 0x98, 0xe3, 0xf3, 0x0e, 0x88, 0x5a, - 0x10, 0x85, 0x91, 0x02, 0x91, 0x0e, 0xa2, 0x06, 0xd4, 0x36, 0x33, 0x03, 0xd1, 0xd1, 0x74, 0xec, - 0xa3, 0x84, 0x04, 0x24, 0x7c, 0xd8, 0x43, 0x0d, 0x33, 0xd6, 0x6a, 0xc6, 0x42, 0xc6, 0x94, 0x67, - 0x4c, 0x1f, 0xc0, 0x58, 0x33, 0x61, 0xd6, 0xdd, 0xfe, 0x2c, 0xc3, 0xaf, 0x00, 0x00, 0x00, 0xff, - 0xff, 0xa1, 0xd4, 0x58, 0xc6, 0x43, 0x03, 0x00, 0x00, + // 364 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xeb, 0x40, + 0x1c, 0xc0, 0xf1, 0x24, 0x8f, 0xd7, 0x21, 0xbc, 0xa9, 0xcb, 0x83, 0xf0, 0xc8, 0xf0, 0x46, 0x87, + 0x3b, 0x6c, 0x07, 0xf1, 0x70, 0x69, 0x1d, 0xd4, 0x21, 0xb4, 0x68, 0x86, 0x20, 0x01, 0xb9, 0x26, + 0x47, 0x0c, 0x4d, 0xee, 0x4a, 0x7e, 0xd7, 0xd2, 0xd1, 0xd1, 0xd1, 0xcd, 0xdd, 0xd1, 0xc9, 0x3f, + 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xee, 0xee, 0x12, 0xef, 0xc0, 0xeb, 0x78, 0x53, 0xe0, + 0xc2, 0xe7, 0x97, 0x6f, 0x7e, 0x89, 0x7f, 0x34, 0x02, 0x60, 0x32, 0xa2, 0x5c, 0x56, 0x0c, 0xd7, + 0x22, 0x5f, 0x56, 0x0c, 0xf0, 0x1a, 0x8b, 0x26, 0x67, 0x0d, 0x60, 0xd9, 0x50, 0x0e, 0x34, 0x93, + 0xa5, 0xe0, 0x80, 0x25, 0x9d, 0x33, 0x0c, 0xac, 0x59, 0x95, 0x19, 0x43, 0x8b, 0x46, 0x48, 0xd1, + 0x47, 0x86, 0x46, 0x5a, 0xa3, 0x35, 0x52, 0x1a, 0x99, 0x1a, 0x75, 0x3a, 0xf8, 0x9b, 0x09, 0xa8, + 0x05, 0xe0, 0x1a, 0x0a, 0xbc, 0xda, 0xef, 0x2e, 0x6a, 0x50, 0xf0, 0xaf, 0x10, 0xa2, 0xa8, 0x18, + 0xa6, 0x8b, 0x12, 0x53, 0xce, 0x85, 0xa4, 0x4a, 0xa9, 0xbb, 0xb6, 0x91, 0x35, 0x03, 0xa0, 0x85, + 0x8e, 0x0c, 0xce, 0x2c, 0xb5, 0x71, 0x72, 0xd5, 0x30, 0x58, 0x08, 0x0e, 0x7a, 0xd4, 0xe0, 0xde, + 0xf5, 0x7f, 0x45, 0x50, 0xf4, 0x6f, 0x5d, 0xbf, 0x77, 0x4a, 0x79, 0x5e, 0xb1, 0xfe, 0x81, 0xe5, + 0x0e, 0x50, 0xa4, 0xe2, 0x82, 0x63, 0x5b, 0x18, 0xff, 0x9c, 0x9c, 0xeb, 0xac, 0xff, 0x4e, 0xf0, + 0xfb, 0xe6, 0xfd, 0x69, 0xcf, 0x1d, 0x7f, 0x7a, 0xcf, 0x6d, 0xe8, 0x6e, 0xda, 0xd0, 0x7d, 0x6b, + 0x43, 0xf7, 0x6e, 0x1b, 0x3a, 0x9b, 0x6d, 0xe8, 0xbc, 0x6e, 0x43, 0xc7, 0x1f, 0x64, 0xa2, 0xb6, + 0x7c, 0xd6, 0xf8, 0xcf, 0x85, 0xfa, 0xce, 0xd3, 0xee, 0xb5, 0xa7, 0xee, 0xe5, 0x61, 0x51, 0xca, + 0xeb, 0xe5, 0x0c, 0x65, 0xa2, 0xc6, 0x76, 0xeb, 0x7c, 0xf0, 0x7a, 0xa3, 0x28, 0x99, 0xc4, 0xf1, + 0xa3, 0xb7, 0x13, 0x11, 0xe9, 0x88, 0x04, 0x4d, 0x54, 0x44, 0x6c, 0x46, 0xc4, 0x74, 0xce, 0x5e, + 0x76, 0x40, 0xaa, 0x41, 0x9a, 0xa4, 0x0a, 0xa4, 0x26, 0x48, 0x3b, 0xd0, 0x7a, 0xc4, 0x0e, 0xa4, + 0x27, 0xd3, 0x71, 0xc4, 0x24, 0xcd, 0xa9, 0xa4, 0x1f, 0xde, 0xd0, 0xc0, 0x84, 0x68, 0x4d, 0x48, + 0x42, 0x88, 0xf2, 0x84, 0x98, 0x03, 0x08, 0xe9, 0x26, 0xcc, 0x7a, 0xdf, 0x3f, 0xc6, 0xf0, 0x2b, + 0x00, 0x00, 0xff, 0xff, 0xd6, 0x20, 0x59, 0x49, 0x48, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. From 0ea7f7a0a237cf1535eabef28f19cb9c80f5d647 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 23 Jul 2024 10:52:37 +0530 Subject: [PATCH 07/64] chore: code cleanup Signed-off-by: Deepanshu Tripathi --- helpers/base/module.go | 33 --------------------------------- 1 file changed, 33 deletions(-) diff --git a/helpers/base/module.go b/helpers/base/module.go index 30c0642ff..940726d0f 100644 --- a/helpers/base/module.go +++ b/helpers/base/module.go @@ -153,39 +153,6 @@ func (module module) RegisterInvariants(invariantRegistry sdkTypes.InvariantRegi func (module module) QuerierRoute() string { return module.name } - -// func (module module) Route() sdkTypes.Route { -// return sdkTypes.NewRoute(module.Name(), func(context sdkTypes.Context, msg sdkTypes.Msg) (*sdkTypes.Result, error) { -// if module.transactions == nil { -// panic(fmt.Errorf("transactions for module %s not initialized", module.Name())) -// } -// -// if message, ok := msg.(helpers.Message); ok { -// if transaction := module.transactions.GetTransaction(message.Type()); transaction != nil { -// return transaction.HandleMessage(sdkTypes.WrapSDKContext(context.WithEventManager(sdkTypes.NewEventManager())), message) -// } -// } -// return nil, fmt.Errorf("message type %T is not supported by module %s", msg, module.Name()) -// }) -// } -// -// func (module module) LegacyQuerierHandler(_ *sdkCodec.LegacyAmino) sdkTypes.Querier { -// return func(context sdkTypes.Context, path []string, requestQuery abciTypes.RequestQuery) ([]byte, error) { -// if module.queries == nil { -// panic(fmt.Errorf("queries for module %s not initialized", module.Name())) -// } -// -// if query := module.queries.GetQuery(path[0]); query != nil { -// return query.HandleQuery(sdkTypes.WrapSDKContext(context), requestQuery) -// } -// -// if path[0] == "parameters" { -// return CodecPrototype().MarshalJSON(module.parameterManager.Fetch(sdkTypes.WrapSDKContext(context)).Get()) -// } -// -// return nil, fmt.Errorf("unknown query path, %v for module %v", path[0], module.Name()) -// } -// } func (module module) RegisterServices(configurator sdkModuleTypes.Configurator) { for _, query := range module.queries.Get() { query.RegisterService(configurator) From 3b5a29ee0d225805c91a9ccd9702d6781a819d78 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 17:55:09 +0530 Subject: [PATCH 08/64] refactor(baseReq): retiring sdkTypes.BaseReq in favor of common_transaction_request Signed-off-by: Deepanshu Tripathi --- utilities/rest/baseReq.go | 48 ------- utilities/rest/common_transaction_request.go | 144 +++++++++++++++++++ 2 files changed, 144 insertions(+), 48 deletions(-) delete mode 100644 utilities/rest/baseReq.go create mode 100644 utilities/rest/common_transaction_request.go diff --git a/utilities/rest/baseReq.go b/utilities/rest/baseReq.go deleted file mode 100644 index d499a6d6a..000000000 --- a/utilities/rest/baseReq.go +++ /dev/null @@ -1,48 +0,0 @@ -package rest - -import ( - "github.com/cosmos/cosmos-sdk/types" - "net/http" -) - -type BaseReq struct { - From string `json:"from"` - Memo string `json:"memo"` - TimeoutHeight uint64 `json:"timeout_height"` - AccountNumber uint64 `json:"account_number"` - Sequence uint64 `json:"sequence"` - ChainID string `json:"chain_id"` - Gas string `json:"gas"` - Fees types.Coins `json:"fees"` - GasPrices types.DecCoins `json:"gas_prices"` - Simulate bool `json:"simulate"` - GasAdjustment string `json:"gas_adjustment"` -} - -func (BaseReq) Validate() error { - return nil -} - -func (BaseReq) Sanitize() BaseReq { - return BaseReq{} -} - -func (BaseReq) ValidateBasic(w http.ResponseWriter) bool { - return false -} - -func NewBaseReq(from, memo, chainID, gas, gasAdjustment string, timeoutHeight, accountNumber, sequence uint64, fees types.Coins, gasPrices types.DecCoins, simulate bool) BaseReq { - return BaseReq{ - From: from, - Memo: memo, - TimeoutHeight: timeoutHeight, - AccountNumber: accountNumber, - Sequence: sequence, - ChainID: chainID, - Gas: gas, - Fees: fees, - GasPrices: gasPrices, - Simulate: simulate, - GasAdjustment: gasAdjustment, - } -} diff --git a/utilities/rest/common_transaction_request.go b/utilities/rest/common_transaction_request.go new file mode 100644 index 000000000..176874430 --- /dev/null +++ b/utilities/rest/common_transaction_request.go @@ -0,0 +1,144 @@ +package rest + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/client" + sdkTypes "github.com/cosmos/cosmos-sdk/types" + "net/http" + "strings" +) + +type CommonTransactionRequest interface { + GetFrom() string + SetFrom(string) CommonTransactionRequest + GetChainID() string + SetChainID(string) CommonTransactionRequest + GetFees() sdkTypes.Coins + IsSimulated() bool + GetGasPrices() sdkTypes.DecCoins + GetTimeoutHeight() uint64 + GetSequence() uint64 + GetMemo() string + GetGas() string + GetGasAdjustment() string + GetAccountNumber() uint64 + SetAccountNumber(uint64) CommonTransactionRequest + Validate() error + Sanitize() CommonTransactionRequest + ValidateBasic(responseWriter http.ResponseWriter) bool +} + +type commonTransactionRequest struct { + From string `json:"from"` + Memo string `json:"memo"` + TimeoutHeight uint64 `json:"timeout_height"` + AccountNumber uint64 `json:"account_number"` + Sequence uint64 `json:"sequence"` + ChainID string `json:"chain_id"` + Gas string `json:"gas"` + Fees sdkTypes.Coins `json:"fees"` + GasPrices sdkTypes.DecCoins `json:"gas_prices"` + Simulate bool `json:"simulate"` + GasAdjustment string `json:"gas_adjustment"` +} + +var _ CommonTransactionRequest = commonTransactionRequest{} + +func (commonTransactionRequest commonTransactionRequest) SetFrom(from string) CommonTransactionRequest { + commonTransactionRequest.From = from + return commonTransactionRequest +} +func (commonTransactionRequest commonTransactionRequest) SetAccountNumber(accountNumber uint64) CommonTransactionRequest { + commonTransactionRequest.AccountNumber = accountNumber + return commonTransactionRequest +} +func (commonTransactionRequest commonTransactionRequest) GetAccountNumber() uint64 { + return commonTransactionRequest.AccountNumber +} +func (commonTransactionRequest commonTransactionRequest) GetGas() string { + return commonTransactionRequest.Gas +} +func (commonTransactionRequest commonTransactionRequest) GetGasAdjustment() string { + return commonTransactionRequest.GasAdjustment +} +func (commonTransactionRequest commonTransactionRequest) GetMemo() string { + return commonTransactionRequest.Memo +} +func (commonTransactionRequest commonTransactionRequest) GetSequence() uint64 { + return commonTransactionRequest.Sequence +} +func (commonTransactionRequest commonTransactionRequest) GetTimeoutHeight() uint64 { + return commonTransactionRequest.TimeoutHeight +} +func (commonTransactionRequest commonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { + return commonTransactionRequest.GasPrices +} +func (commonTransactionRequest commonTransactionRequest) IsSimulated() bool { + return commonTransactionRequest.Simulate +} +func (commonTransactionRequest commonTransactionRequest) GetFrom() string { + return commonTransactionRequest.From +} +func (commonTransactionRequest commonTransactionRequest) GetChainID() string { + return commonTransactionRequest.ChainID +} +func (commonTransactionRequest commonTransactionRequest) SetChainID(chainIDString string) CommonTransactionRequest { + commonTransactionRequest.ChainID = chainIDString + return commonTransactionRequest +} +func (commonTransactionRequest commonTransactionRequest) GetFees() sdkTypes.Coins { + return commonTransactionRequest.Fees +} +func (commonTransactionRequest commonTransactionRequest) Validate() error { + if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { + return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) + } + + if !commonTransactionRequest.Simulate { + if len(commonTransactionRequest.ChainID) == 0 { + return fmt.Errorf("chain-id required but not specified") + } + if !commonTransactionRequest.Fees.IsZero() && !commonTransactionRequest.GasPrices.IsZero() { + return fmt.Errorf("cannot provide both fees and gas prices") + } + if !commonTransactionRequest.Fees.IsValid() && !commonTransactionRequest.GasPrices.IsValid() { + } + return fmt.Errorf("invalid fees or gas prices provided") + } + + return nil +} +func (commonTransactionRequest commonTransactionRequest) Sanitize() CommonTransactionRequest { + return NewCommonTransactionRequest(commonTransactionRequest.From, commonTransactionRequest.Memo, commonTransactionRequest.ChainID, commonTransactionRequest.Gas, commonTransactionRequest.GasAdjustment, commonTransactionRequest.AccountNumber, commonTransactionRequest.TimeoutHeight, commonTransactionRequest.Sequence, commonTransactionRequest.Fees, commonTransactionRequest.GasPrices, commonTransactionRequest.Simulate) +} +func (commonTransactionRequest commonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { + if err := commonTransactionRequest.Validate(); err != nil { + WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return false + } + + return true +} + +func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees sdkTypes.Coins, gasPrices sdkTypes.DecCoins, simulate bool) CommonTransactionRequest { + return commonTransactionRequest{ + From: strings.TrimSpace(from), + Memo: strings.TrimSpace(memo), + ChainID: strings.TrimSpace(chainID), + Fees: fees, + GasPrices: gasPrices, + Gas: strings.TrimSpace(gas), + GasAdjustment: strings.TrimSpace(gasAdjustment), + AccountNumber: accountNumber, + Sequence: sequence, + TimeoutHeight: timeOutHeight, + Simulate: simulate, + } +} +func PrototypeCommonTransactionRequest() CommonTransactionRequest { + return commonTransactionRequest{} +} + +func NewCommonTransactionRequestFromContext(context client.Context) CommonTransactionRequest { + return NewCommonTransactionRequest(context.From, "", context.ChainID, "", "", uint64(context.Height), 0, 0, sdkTypes.Coins{}, sdkTypes.DecCoins{}, context.Simulate) +} From 3768a439ff90d4489e360692103043b6ad65bbb6 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 17:58:58 +0530 Subject: [PATCH 09/64] refactor: readBaserRew Signed-off-by: Deepanshu Tripathi --- helpers/base/cli_command.go | 9 ++------- helpers/cli_command.go | 3 ++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/helpers/base/cli_command.go b/helpers/base/cli_command.go index 948421a6a..73643bd42 100644 --- a/helpers/base/cli_command.go +++ b/helpers/base/cli_command.go @@ -6,7 +6,6 @@ package base import ( "fmt" "github.com/AssetMantle/modules/utilities/rest" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -85,12 +84,8 @@ func (cliCommand cliCommand) ReadString(cliFlag helpers.CLIFlag) string { panic(fmt.Errorf("uregistered flag %v type %T", cliFlag.GetName(), cliFlag.GetValue())) } -func (cliCommand cliCommand) ReadBaseReq(context client.Context) rest.BaseReq { - return rest.BaseReq{ - From: context.GetFromAddress().String(), - ChainID: context.ChainID, - Simulate: context.Simulate, - } +func (cliCommand cliCommand) ReadCommonTransactionRequest(context client.Context) rest.CommonTransactionRequest { + return rest.NewCommonTransactionRequestFromContext(context) } func (cliCommand cliCommand) CreateCommand(runE func(command *cobra.Command, args []string) error) *cobra.Command { command := &cobra.Command{ diff --git a/helpers/cli_command.go b/helpers/cli_command.go index 9d1d01d6d..43b05cbaa 100644 --- a/helpers/cli_command.go +++ b/helpers/cli_command.go @@ -15,7 +15,8 @@ type CLICommand interface { ReadInt(CLIFlag) int ReadBool(CLIFlag) bool ReadString(CLIFlag) string - ReadBaseReq(client.Context) rest.BaseReq + //TODO see if it can be replaced with NewCommonTransactionRequestFromContext + ReadCommonTransactionRequest(client.Context) rest.CommonTransactionRequest CreateCommand(func(command *cobra.Command, args []string) error) *cobra.Command } From be938420321bea3daf7d723e1959a0f9ea8b9036 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 17:59:55 +0530 Subject: [PATCH 10/64] refactor: making Kafka state constructor private Signed-off-by: Deepanshu Tripathi --- utilities/rest/queuing/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/rest/queuing/init.go b/utilities/rest/queuing/init.go index c09a4e5bb..8a7fea575 100644 --- a/utilities/rest/queuing/init.go +++ b/utilities/rest/queuing/init.go @@ -10,7 +10,7 @@ import ( ) func InitializeKafka(nodeList []string, context client.Context) { - KafkaState = *NewKafkaState(nodeList) + KafkaState = *newKafkaState(nodeList) if KafkaState.IsEnabled { go func() { for { From ae21781d656e5060e63e0492b7da1260ead4c75b Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 18:00:04 +0530 Subject: [PATCH 11/64] refactor: making Kafka state constructor private Signed-off-by: Deepanshu Tripathi --- utilities/rest/queuing/kafka_consumer_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/utilities/rest/queuing/kafka_consumer_test.go b/utilities/rest/queuing/kafka_consumer_test.go index 3beb216a5..0c9d733fe 100644 --- a/utilities/rest/queuing/kafka_consumer_test.go +++ b/utilities/rest/queuing/kafka_consumer_test.go @@ -16,7 +16,7 @@ func TestKafkaTopicConsumer(t *testing.T) { testConsumers := []string{"testConsumers"} require.Panics(t, func() { - testKafkaState := NewKafkaState(testConsumers) + testKafkaState := newKafkaState(testConsumers) partitionConsumer := testKafkaState.Consumers["Topic"] var kafkaStore kafkaMsg From 540f92d5ebcd105b52bf94006edc6ad3ff187c9e Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 18:00:37 +0530 Subject: [PATCH 12/64] refactor: making Kafka constructors private Signed-off-by: Deepanshu Tripathi --- utilities/rest/queuing/kafka_types.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/rest/queuing/kafka_types.go b/utilities/rest/queuing/kafka_types.go index 783b85283..497ae7293 100755 --- a/utilities/rest/queuing/kafka_types.go +++ b/utilities/rest/queuing/kafka_types.go @@ -23,8 +23,8 @@ type kafkaMsg struct { KafkaCliCtx kafkaCliCtx `json:"kafkaCliCtx"` } -// NewKafkaMsgFromRest : makes a msg to send to kafka queue -func NewKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, baseRequest rest.BaseReq, context client.Context) kafkaMsg { +// newKafkaMsgFromRest : makes a msg to send to kafka queue +func newKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, baseRestRequest rest.CommonTransactionRequest, context client.Context) kafkaMsg { kafkaCtx := kafkaCliCtx{ OutputFormat: context.OutputFormat, ChainID: context.ChainID, @@ -99,8 +99,8 @@ type kafkaState struct { IsEnabled bool } -// NewKafkaState : returns a kafka state -func NewKafkaState(nodeList []string) *kafkaState { +// newKafkaState : returns a kafka state +func newKafkaState(nodeList []string) *kafkaState { kafkaDB, _ := dbm.NewGoLevelDB("KafkaDB", defaultCLIHome) admin := kafkaAdmin(nodeList) producer := newProducer(nodeList) From cc8232e75d9008037ec8a2466c38b22e0d50ccc6 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 18:41:51 +0530 Subject: [PATCH 13/64] feat(moduleManager): defining RegisterRESTRoutes method Signed-off-by: Deepanshu Tripathi --- helpers/base/module_manager.go | 8 ++++++++ helpers/module.go | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/helpers/base/module_manager.go b/helpers/base/module_manager.go index 8079a18a3..3edb819ff 100644 --- a/helpers/base/module_manager.go +++ b/helpers/base/module_manager.go @@ -9,6 +9,7 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" ) @@ -78,6 +79,13 @@ func (moduleManager moduleManager) GetBasicManager() sdkModuleTypes.BasicManager func (moduleManager moduleManager) ExportGenesisForModules(context sdkTypes.Context, jsonCodec sdkCodec.JSONCodec, moduleNames []string) map[string]json.RawMessage { return moduleManager.getModuleManager().ExportGenesisForModules(context, jsonCodec, moduleNames) } +func (moduleManager moduleManager) RegisterRESTRoutes(context client.Context, router *mux.Router) { + for _, basicModule := range moduleManager.basicModules { + if module, ok := basicModule.(helpers.Module); ok { + module.RegisterRESTRoutes(context, router) + } + } +} func (moduleManager moduleManager) RegisterGRPCGatewayRoutes(context client.Context, serverMux *runtime.ServeMux) { for _, basicModule := range moduleManager.basicModules { basicModule.RegisterGRPCGatewayRoutes(context, serverMux) diff --git a/helpers/module.go b/helpers/module.go index c04acc4e1..ccc779c83 100644 --- a/helpers/module.go +++ b/helpers/module.go @@ -5,7 +5,9 @@ package helpers import ( "encoding/json" + "github.com/cosmos/cosmos-sdk/client" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "github.com/gorilla/mux" storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" @@ -32,4 +34,6 @@ type Module interface { Initialize(*storeTypes.KVStoreKey, paramsTypes.Subspace, ...interface{}) Module GetTransactions() Transactions + + RegisterRESTRoutes(client.Context, *mux.Router) } From c4a22af51703ef6b5f9191565148adfb548face1 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 18:42:21 +0530 Subject: [PATCH 14/64] feat(moduleManager): defining RegisterRESTRoutes method Signed-off-by: Deepanshu Tripathi --- helpers/module_manager.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/helpers/module_manager.go b/helpers/module_manager.go index b1a74e51b..42273c77a 100644 --- a/helpers/module_manager.go +++ b/helpers/module_manager.go @@ -8,6 +8,7 @@ import ( sdkCodecTypes "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" ) @@ -24,6 +25,8 @@ type ModuleManager interface { RegisterServices(module.Configurator) RegisterGRPCGatewayRoutes(client.Context, *runtime.ServeMux) + RegisterRESTRoutes(client.Context, *mux.Router) + RegisterInvariants(sdkTypes.InvariantRegistry) RegisterInterfaces(sdkCodecTypes.InterfaceRegistry) RegisterLegacyAminoCodec(*codec.LegacyAmino) From 5415e44fbf23af2c483da6e864778a2e849ba482 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 18:43:16 +0530 Subject: [PATCH 15/64] refactor(utilities): removing unused baseReq field and getter Signed-off-by: Deepanshu Tripathi --- utilities/rest/id_getters/docs/request.go | 36 ++++++++++------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/utilities/rest/id_getters/docs/request.go b/utilities/rest/id_getters/docs/request.go index e4f1d875a..6bdd3e1de 100644 --- a/utilities/rest/id_getters/docs/request.go +++ b/utilities/rest/id_getters/docs/request.go @@ -5,26 +5,24 @@ package docs import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/utilities/rest" ) type request struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID" valid:"optional"` - ImmutableMetaProperties string `json:"immutableMetaProperties" valid:"optional"` - ImmutableProperties string `json:"immutableProperties" valid:"optional"` - MutableMetaProperties string `json:"mutableMetaProperties" valid:"optional"` - MutableProperties string `json:"mutableProperties" valid:"optional"` - ClassificationID string `json:"classificationID" valid:"optional"` - MakerAssetID string `json:"makerAssetID" valid:"optional"` - TakerAssetID string `json:"takerAssetID" valid:"optional"` - MakerSplit string `json:"makerSplit" valid:"optional"` - TakerSplit string `json:"takerSplit" valid:"optional"` - ExpiresIn string `json:"expiresIn" valid:"optional"` - Height string `json:"height" valid:"optional"` - TakerID string `json:"takerID" valid:"optional"` - Name string `json:"name" valid:"optional"` - Coins string `json:"coins" valid:"optional"` + FromID string `json:"fromID" valid:"optional"` + ImmutableMetaProperties string `json:"immutableMetaProperties" valid:"optional"` + ImmutableProperties string `json:"immutableProperties" valid:"optional"` + MutableMetaProperties string `json:"mutableMetaProperties" valid:"optional"` + MutableProperties string `json:"mutableProperties" valid:"optional"` + ClassificationID string `json:"classificationID" valid:"optional"` + MakerAssetID string `json:"makerAssetID" valid:"optional"` + TakerAssetID string `json:"takerAssetID" valid:"optional"` + MakerSplit string `json:"makerSplit" valid:"optional"` + TakerSplit string `json:"takerSplit" valid:"optional"` + ExpiresIn string `json:"expiresIn" valid:"optional"` + Height string `json:"height" valid:"optional"` + TakerID string `json:"takerID" valid:"optional"` + Name string `json:"name" valid:"optional"` + Coins string `json:"coins" valid:"optional"` } var _ helpers.Request = &request{} @@ -33,10 +31,6 @@ func (request request) Validate() error { return nil } -func (request request) GetBaseReq() rest.BaseReq { - return request.BaseReq -} - func Prototype() helpers.Request { return request{} } From d15259086423c7123b97b761089832675672fb5f Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Fri, 26 Jul 2024 19:11:34 +0530 Subject: [PATCH 16/64] refactor: baseReq to commonTransactionRequest Signed-off-by: Deepanshu Tripathi --- helpers/base/cli_command_test.go | 10 +- helpers/base/transaction.go | 8 +- helpers/transaction_request.go | 3 +- utilities/rest/queuing/broadcast.go | 30 +- utilities/rest/queuing/kafka_types.go | 18 +- utilities/rest/queuing/sign_and_broadcast.go | 28 +- .../transactions/burn/transaction_request.go | 23 +- .../burn/transaction_request_test.go | 102 ++--- .../define/transaction_request.go | 35 +- .../define/transaction_request_test.go | 186 ++++----- .../deputize/transaction_request.go | 55 ++- .../deputize/transaction_request_test.go | 316 +++++++-------- .../transactions/mint/transaction_request.go | 43 +-- .../mint/transaction_request_test.go | 238 ++++++------ .../mutate/transaction_request.go | 31 +- .../mutate/transaction_request_test.go | 154 ++++---- .../renumerate/transaction_request.go | 23 +- .../renumerate/transaction_request_test.go | 102 ++--- .../revoke/transaction_request.go | 27 +- .../revoke/transaction_request_test.go | 128 +++--- .../transactions/send/transaction_request.go | 31 +- .../send/transaction_request_test.go | 164 ++++---- .../unwrap/transaction_request.go | 23 +- .../unwrap/transaction_request_test.go | 126 +++--- .../transactions/wrap/transaction_request.go | 23 +- .../wrap/transaction_request_test.go | 126 +++--- .../define/transaction_request.go | 35 +- .../define/transaction_request_test.go | 196 +++++----- .../deputize/transaction_request.go | 51 ++- .../deputize/transaction_request_test.go | 283 +++++++------- .../transactions/issue/transaction_request.go | 39 +- .../issue/transaction_request_test.go | 248 ++++++------ .../transactions/name/transaction_request.go | 19 +- .../name/transaction_request_test.go | 94 ++--- .../provision/transaction_request.go | 23 +- .../provision/transaction_request_test.go | 120 +++--- .../transactions/quash/transaction_request.go | 23 +- .../quash/transaction_request_test.go | 120 +++--- .../revoke/transaction_request.go | 27 +- .../revoke/transaction_request_test.go | 146 +++---- .../unprovision/transaction_request.go | 23 +- .../unprovision/transaction_request_test.go | 120 +++--- .../update/transaction_request.go | 31 +- .../update/transaction_request_test.go | 176 ++++----- .../reveal/transaction_request.go | 19 +- .../reveal/transaction_request_test.go | 16 +- .../cancel/transaction_request.go | 23 +- .../cancel/transaction_request_test.go | 124 +++--- .../define/transaction_request.go | 35 +- .../define/transaction_request_test.go | 182 ++++----- .../deputize/transaction_request.go | 51 ++- .../deputize/transaction_request_test.go | 286 +++++++------- .../transactions/get/transaction_request.go | 23 +- .../get/transaction_request_test.go | 102 ++--- .../immediate/transaction_request.go | 63 ++- .../immediate/transaction_request_test.go | 364 +++++++++--------- .../transactions/make/transaction_request.go | 63 ++- .../make/transaction_request_test.go | 364 +++++++++--------- .../modify/transaction_request.go | 43 +-- .../modify/transaction_request_test.go | 246 ++++++------ .../transactions/put/transaction_request.go | 39 +- .../put/transaction_request_test.go | 138 +++---- .../revoke/transaction_request.go | 27 +- .../revoke/transaction_request_test.go | 134 +++---- .../transactions/take/transaction_request.go | 27 +- .../take/transaction_request_test.go | 138 +++---- 66 files changed, 3151 insertions(+), 3183 deletions(-) diff --git a/helpers/base/cli_command_test.go b/helpers/base/cli_command_test.go index 8c4180ae7..5c7006e45 100644 --- a/helpers/base/cli_command_test.go +++ b/helpers/base/cli_command_test.go @@ -103,11 +103,11 @@ func Test_cliCommand_ReadBaseReq(t *testing.T) { name string fields fields args args - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{"", "", "", testCliFlagList}, args{client.Context{ChainID: "chainID"}}, rest.BaseReq{ChainID: "chainID"}}, - {"-ve for nil", fields{"", "", "", nil}, args{client.Context{ChainID: ""}}, rest.BaseReq{ChainID: ""}}, + {"+ve", fields{"", "", "", testCliFlagList}, args{client.Context{ChainID: "chainID"}}, rest.PrototypeCommonTransactionRequest()}, + {"-ve for nil", fields{"", "", "", nil}, args{client.Context{ChainID: ""}}, rest.PrototypeCommonTransactionRequest()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -117,8 +117,8 @@ func Test_cliCommand_ReadBaseReq(t *testing.T) { long: tt.fields.long, cliFlagList: tt.fields.cliFlagList, } - if got := cliCommand.ReadBaseReq(tt.args.context); !reflect.DeepEqual(got, tt.want) { - t.Errorf("ReadBaseReq() = %v, want %v", got, tt.want) + if got := cliCommand.ReadCommonTransactionRequest(tt.args.context); !reflect.DeepEqual(got, tt.want) { + t.Errorf("ReadCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } diff --git a/helpers/base/transaction.go b/helpers/base/transaction.go index 607f93f1d..d7e842f78 100644 --- a/helpers/base/transaction.go +++ b/helpers/base/transaction.go @@ -87,9 +87,9 @@ func (transaction transaction) RESTRequestHandler(context client.Context) http.H return } - baseReq := transactionRequest.GetBaseReq().Sanitize() - if !baseReq.ValidateBasic(responseWriter) { - rest.CheckBadRequestError(responseWriter, fmt.Errorf("invalid base request")) + commonTransactionRequest := transactionRequest.GetCommonTransactionRequest().Sanitize() + if !commonTransactionRequest.ValidateBasic(responseWriter) { + rest.CheckBadRequestError(responseWriter, fmt.Errorf("invalid base request ")) } msg, err := transactionRequest.MakeMsg() @@ -98,7 +98,7 @@ func (transaction transaction) RESTRequestHandler(context client.Context) http.H return } - if rest.CheckInternalServerError(responseWriter, queuing.QueueOrBroadcastTransaction(context.WithOutput(responseWriter), baseReq, msg)) { + if rest.CheckInternalServerError(responseWriter, queuing.QueueOrBroadcastTransaction(context.WithOutput(responseWriter), commonTransactionRequest, msg)) { return } } diff --git a/helpers/transaction_request.go b/helpers/transaction_request.go index b89d993bb..3e9ff4ff0 100644 --- a/helpers/transaction_request.go +++ b/helpers/transaction_request.go @@ -6,14 +6,13 @@ package helpers import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" ) type TransactionRequest interface { - GetBaseReq() rest.BaseReq + GetCommonTransactionRequest() rest.CommonTransactionRequest FromCLI(CLICommand, client.Context) (TransactionRequest, error) FromJSON(json.RawMessage) (TransactionRequest, error) diff --git a/utilities/rest/queuing/broadcast.go b/utilities/rest/queuing/broadcast.go index a25211bac..cba5faee1 100644 --- a/utilities/rest/queuing/broadcast.go +++ b/utilities/rest/queuing/broadcast.go @@ -13,16 +13,16 @@ import ( "github.com/AssetMantle/modules/utilities/random" ) -func QueueOrBroadcastTransaction(context client.Context, baseReq rest.BaseReq, msg sdkTypes.Msg) (err error) { - fromAddress, fromName, _, err := client.GetFromFields(context, context.Keyring, baseReq.From) +func QueueOrBroadcastTransaction(context client.Context, commonTransactionRequest rest.CommonTransactionRequest, msg sdkTypes.Msg) (err error) { + fromAddress, fromName, _, err := client.GetFromFields(context, context.Keyring, commonTransactionRequest.GetFrom()) if err != nil { return err } - context = context.WithFromAddress(fromAddress).WithFromName(fromName).WithSkipConfirmation(true).WithGenerateOnly(baseReq.Simulate) + context = context.WithFromAddress(fromAddress).WithFromName(fromName).WithSkipConfirmation(true).WithGenerateOnly(commonTransactionRequest.IsSimulated()) if KafkaState.IsEnabled { - if err = context.PrintBytes(SendToKafka(NewKafkaMsgFromRest(msg, TicketID(random.GenerateUniqueIdentifier(reflect.TypeOf(msg).String())), baseReq, context), context.LegacyAmino)); err != nil { + if err = context.PrintBytes(SendToKafka(newKafkaMsgFromRest(msg, TicketID(random.GenerateUniqueIdentifier(reflect.TypeOf(msg).String())), commonTransactionRequest, context), context.LegacyAmino)); err != nil { return err } else { return nil @@ -30,30 +30,30 @@ func QueueOrBroadcastTransaction(context client.Context, baseReq rest.BaseReq, m } gasAdjustment := flags.DefaultGasAdjustment - if len(baseReq.GasAdjustment) != 0 { - if gasAdjustment, err = strconv.ParseFloat(baseReq.GasAdjustment, 64); err != nil { + if len(commonTransactionRequest.GetGasAdjustment()) != 0 { + if gasAdjustment, err = strconv.ParseFloat(commonTransactionRequest.GetGasAdjustment(), 64); err != nil { return err } } - gasSetting, err := flags.ParseGasSetting(baseReq.Gas) + gasSetting, err := flags.ParseGasSetting(commonTransactionRequest.GetGas()) if err != nil { return err } transactionFactory := tx.Factory{}. - WithFees(baseReq.Fees.String()). - WithGasPrices(baseReq.GasPrices.String()). - WithAccountNumber(baseReq.AccountNumber). + WithFees(commonTransactionRequest.GetFees().String()). + WithGasPrices(commonTransactionRequest.GetGasPrices().String()). + WithAccountNumber(commonTransactionRequest.GetAccountNumber()). WithAccountRetriever(context.AccountRetriever). - WithSequence(baseReq.Sequence). + WithSequence(commonTransactionRequest.GetSequence()). WithGas(gasSetting.Gas). WithGasAdjustment(gasAdjustment). - WithMemo(baseReq.Memo). - WithChainID(baseReq.ChainID). - WithSimulateAndExecute(gasSetting.Simulate || baseReq.Simulate). + WithMemo(commonTransactionRequest.GetMemo()). + WithChainID(commonTransactionRequest.GetChainID()). + WithSimulateAndExecute(gasSetting.Simulate || commonTransactionRequest.IsSimulated()). WithTxConfig(context.TxConfig). - WithTimeoutHeight(baseReq.TimeoutHeight). + WithTimeoutHeight(commonTransactionRequest.GetTimeoutHeight()). WithKeybase(context.Keyring) if context.GenerateOnly { diff --git a/utilities/rest/queuing/kafka_types.go b/utilities/rest/queuing/kafka_types.go index 497ae7293..d3f67ab4f 100755 --- a/utilities/rest/queuing/kafka_types.go +++ b/utilities/rest/queuing/kafka_types.go @@ -17,14 +17,14 @@ type TicketID string // kafkaMsg : is a store that can be stored in kafka queues type kafkaMsg struct { - Msg sdk.Msg `json:"msg"` - TicketID TicketID `json:"TicketID"` - BaseRequest rest.BaseReq `json:"base_req"` - KafkaCliCtx kafkaCliCtx `json:"kafkaCliCtx"` + Msg sdk.Msg `json:"msg"` + TicketID TicketID `json:"TicketID"` + CommonTransactionRequest rest.CommonTransactionRequest `json:"commonTransactionRequest"` + KafkaCliCtx kafkaCliCtx } // newKafkaMsgFromRest : makes a msg to send to kafka queue -func newKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, baseRestRequest rest.CommonTransactionRequest, context client.Context) kafkaMsg { +func newKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, commonTransactionRequest rest.CommonTransactionRequest, context client.Context) kafkaMsg { kafkaCtx := kafkaCliCtx{ OutputFormat: context.OutputFormat, ChainID: context.ChainID, @@ -43,10 +43,10 @@ func newKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, baseRestRequest rest.Co // TODO return pointer return kafkaMsg{ - Msg: msg, - TicketID: ticketID, - BaseRequest: baseRequest, - KafkaCliCtx: kafkaCtx, + Msg: msg, + TicketID: ticketID, + CommonTransactionRequest: commonTransactionRequest, + KafkaCliCtx: kafkaCtx, } } diff --git a/utilities/rest/queuing/sign_and_broadcast.go b/utilities/rest/queuing/sign_and_broadcast.go index d458911db..ae515c4cc 100755 --- a/utilities/rest/queuing/sign_and_broadcast.go +++ b/utilities/rest/queuing/sign_and_broadcast.go @@ -28,12 +28,12 @@ func signAndBroadcastMultiple(kafkaMsgList []kafkaMsg, context client.Context) ( for i, kafkaMsg := range kafkaMsgList { context := cliCtxFromKafkaMsg(kafkaMsg, context) - gasAdj, err := parseGasAdjustment(kafkaMsg.BaseRequest.GasAdjustment) + gasAdj, err := parseGasAdjustment(kafkaMsg.CommonTransactionRequest.GetGasAdjustment()) if err != nil { return nil, err } - gasSetting, err := flags.ParseGasSetting(kafkaMsg.BaseRequest.Gas) + gasSetting, err := flags.ParseGasSetting(kafkaMsg.CommonTransactionRequest.GetGas()) if err != nil { return nil, err } @@ -48,12 +48,12 @@ func signAndBroadcastMultiple(kafkaMsgList []kafkaMsg, context client.Context) ( return nil, err } - kafkaMsg.BaseRequest.AccountNumber = accountNumber + kafkaMsg.CommonTransactionRequest = kafkaMsg.CommonTransactionRequest.SetAccountNumber(accountNumber) var count = uint64(0) for j := 0; j < i; j++ { - if accountNumber == kafkaMsgList[j].BaseRequest.AccountNumber { + if accountNumber == kafkaMsgList[j].CommonTransactionRequest.GetAccountNumber() { count++ } } @@ -61,20 +61,20 @@ func signAndBroadcastMultiple(kafkaMsgList []kafkaMsg, context client.Context) ( sequence += count txFactory := tx.Factory{}. - WithAccountNumber(kafkaMsg.BaseRequest.AccountNumber). - WithSequence(kafkaMsg.BaseRequest.Sequence). + WithAccountNumber(kafkaMsg.CommonTransactionRequest.GetAccountNumber()). + WithSequence(kafkaMsg.CommonTransactionRequest.GetSequence()). WithGas(gasSetting.Gas). WithGasAdjustment(gasAdj). - WithMemo(kafkaMsg.BaseRequest.Memo). - WithChainID(kafkaMsg.BaseRequest.ChainID). - WithSimulateAndExecute(kafkaMsg.BaseRequest.Simulate). + WithMemo(kafkaMsg.CommonTransactionRequest.GetMemo()). + WithChainID(kafkaMsg.CommonTransactionRequest.GetChainID()). + WithSimulateAndExecute(kafkaMsg.CommonTransactionRequest.IsSimulated()). WithTxConfig(context.TxConfig). - WithTimeoutHeight(kafkaMsg.BaseRequest.TimeoutHeight). - WithFees(kafkaMsg.BaseRequest.Fees.String()). - WithGasPrices(kafkaMsg.BaseRequest.GasPrices.String()). + WithTimeoutHeight(kafkaMsg.CommonTransactionRequest.GetTimeoutHeight()). + WithFees(kafkaMsg.CommonTransactionRequest.GetFees().String()). + WithGasPrices(kafkaMsg.CommonTransactionRequest.GetGasPrices().String()). WithKeybase(keyBase) - if kafkaMsg.BaseRequest.Simulate || gasSetting.Simulate { + if kafkaMsg.CommonTransactionRequest.IsSimulated() || gasSetting.Simulate { if gasAdj < 0 { return nil, errors.New("Error invalid gas adjustment") } @@ -87,7 +87,7 @@ func signAndBroadcastMultiple(kafkaMsgList []kafkaMsg, context client.Context) ( txFactory = txFactory.WithGas(adjusted) - if kafkaMsg.BaseRequest.Simulate { + if kafkaMsg.CommonTransactionRequest.IsSimulated() { val, _ := simulationResponse(context.LegacyAmino, txFactory.Gas()) return val, nil } diff --git a/x/assets/transactions/burn/transaction_request.go b/x/assets/transactions/burn/transaction_request.go index 15084779b..4d40dbcd0 100644 --- a/x/assets/transactions/burn/transaction_request.go +++ b/x/assets/transactions/burn/transaction_request.go @@ -6,7 +6,6 @@ package burn import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - AssetID string `json:"assetID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + AssetID string `json:"assetID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.AssetID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, assetID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, assetID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - AssetID: assetID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + AssetID: assetID, } } diff --git a/x/assets/transactions/burn/transaction_request_test.go b/x/assets/transactions/burn/transaction_request_test.go index 440a2f03a..bcd511e0a 100644 --- a/x/assets/transactions/burn/transaction_request_test.go +++ b/x/assets/transactions/burn/transaction_request_test.go @@ -23,25 +23,25 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - assetID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + assetID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, transactionRequest{testBaseRequest, fromID.AsString(), testAssetID.AsString()}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, transactionRequest{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.assetID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.assetID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -70,9 +70,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.AssetID.GetName(), testAssetID.AsString()) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } type args struct { cliCommand helpers.CLICommand @@ -85,14 +85,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{BaseReq: testBaseRequest, FromID: fromID.AsString(), AssetID: testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(testBaseRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: fromID.AsString(), AssetID: testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -108,9 +108,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } type args struct { rawMessage json.RawMessage @@ -122,14 +122,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID.(*baseIDs.IdentityID), testAssetID.(*baseIDs.AssetID)}))}, newTransactionRequest(testBaseRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID.(*baseIDs.IdentityID), testAssetID.(*baseIDs.AssetID)}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -145,26 +145,26 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -172,9 +172,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } tests := []struct { name string @@ -182,14 +182,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, NewMessage(fromAccAddress, fromID, testAssetID), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, NewMessage(fromAccAddress, fromID, testAssetID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -205,9 +205,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } type args struct { legacyAmino *codec.LegacyAmino @@ -217,14 +217,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -233,24 +233,24 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, false}, // {"+ve", fields{}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/define/transaction_request.go b/x/assets/transactions/define/transaction_request.go index d80521ed5..ae89d13b0 100644 --- a/x/assets/transactions/define/transaction_request.go +++ b/x/assets/transactions/define/transaction_request.go @@ -6,7 +6,6 @@ package define import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,12 +19,12 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -51,7 +50,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), @@ -66,11 +65,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -118,13 +117,13 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/assets/transactions/define/transaction_request_test.go b/x/assets/transactions/define/transaction_request_test.go index 495748c18..0c76b2ffe 100644 --- a/x/assets/transactions/define/transaction_request_test.go +++ b/x/assets/transactions/define/transaction_request_test.go @@ -7,13 +7,13 @@ import ( "encoding/json" "fmt" "github.com/AssetMantle/modules/utilities/rest" - "reflect" - "testing" - baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" + "reflect" + "testing" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" @@ -26,7 +26,7 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() immutableMetaPropertiesString = "testImmutableMeta1:S|immutableMeta" immutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testImmutableMeta1"), baseData.NewStringData("immutableMeta"))) immutablePropertiesString = "testImmutable1:S|immutable" @@ -39,23 +39,23 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -87,12 +87,12 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -105,17 +105,17 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -131,12 +131,12 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -148,17 +148,17 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -174,32 +174,32 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -207,12 +207,12 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -220,17 +220,17 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, fromID, immutableMetaProperties1, immutableProperties1.ScrubData(), mutableMetaProperties1, mutableProperties1.ScrubData()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, fromID, immutableMetaProperties1, immutableProperties1.ScrubData(), mutableMetaProperties1, mutableProperties1.ScrubData()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -246,12 +246,12 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -261,17 +261,17 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -280,29 +280,29 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/deputize/transaction_request.go b/x/assets/transactions/deputize/transaction_request.go index 8a6c6172f..0b3408bd4 100644 --- a/x/assets/transactions/deputize/transaction_request.go +++ b/x/assets/transactions/deputize/transaction_request.go @@ -6,7 +6,6 @@ package deputize import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,17 +19,17 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - MaintainedProperties string `json:"maintainedProperties"` - CanMintAsset bool `json:"canMintAsset"` - CanRenumerateAsset bool `json:"canRenumerateAsset"` - CanBurnAsset bool `json:"canBurnAsset"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + MaintainedProperties string `json:"maintainedProperties"` + CanMintAsset bool `json:"canMintAsset"` + CanRenumerateAsset bool `json:"canRenumerateAsset"` + CanBurnAsset bool `json:"canBurnAsset"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -56,7 +55,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -76,11 +75,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -126,18 +125,18 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string, maintainedProperties string, canMintAsset bool, canRenumerateAsset bool, canBurnAsset bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canMintAsset bool, canRenumerateAsset bool, canBurnAsset bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, - MaintainedProperties: maintainedProperties, - CanMintAsset: canMintAsset, - CanRenumerateAsset: canRenumerateAsset, - CanBurnAsset: canBurnAsset, - CanAddMaintainer: canAddMaintainer, - CanRemoveMaintainer: canRemoveMaintainer, - CanMutateMaintainer: canMutateMaintainer, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, + MaintainedProperties: maintainedProperties, + CanMintAsset: canMintAsset, + CanRenumerateAsset: canRenumerateAsset, + CanBurnAsset: canBurnAsset, + CanAddMaintainer: canAddMaintainer, + CanRemoveMaintainer: canRemoveMaintainer, + CanMutateMaintainer: canMutateMaintainer, } } diff --git a/x/assets/transactions/deputize/transaction_request_test.go b/x/assets/transactions/deputize/transaction_request_test.go index a1187081d..b2db289f1 100644 --- a/x/assets/transactions/deputize/transaction_request_test.go +++ b/x/assets/transactions/deputize/transaction_request_test.go @@ -7,13 +7,13 @@ import ( "encoding/json" "fmt" "github.com/AssetMantle/modules/utilities/rest" - "reflect" - "testing" - baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" + "reflect" + "testing" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -26,35 +26,35 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() mutableMetaPropertiesString = "testMutableMeta1:S|mutableMeta" mutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testMutableMeta1"), baseData.NewStringData("mutableMeta"))) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string - maintainedProperties string - canMintAsset bool - canBurnAsset bool - canRenumerateAsset bool - canAddMaintainer bool - canRemoveMaintainer bool - canMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string + maintainedProperties string + canMintAsset bool + canBurnAsset bool + canRenumerateAsset bool + canAddMaintainer bool + canRemoveMaintainer bool + canMutateMaintainer bool } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.maintainedProperties, tt.args.canMintAsset, tt.args.canBurnAsset, tt.args.canRenumerateAsset, tt.args.canAddMaintainer, tt.args.canRemoveMaintainer, tt.args.canMutateMaintainer); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.maintainedProperties, tt.args.canMintAsset, tt.args.canBurnAsset, tt.args.canRenumerateAsset, tt.args.canAddMaintainer, tt.args.canRemoveMaintainer, tt.args.canMutateMaintainer); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -91,17 +91,17 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.CanRemoveMaintainer.GetName(), true) viper.Set(constants.CanMutateMaintainer.GetName(), true) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMintAsset bool + CanBurnAsset bool + CanRenumerateAsset bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } type args struct { cliCommand helpers.CLICommand @@ -114,22 +114,22 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), mutableMetaPropertiesString, true, true, true, true, true, true}, false}, + {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), mutableMetaPropertiesString, true, true, true, true, true, true}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMintAsset: tt.fields.CanMintAsset, + CanBurnAsset: tt.fields.CanBurnAsset, + CanRenumerateAsset: tt.fields.CanRenumerateAsset, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -145,17 +145,17 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMintAsset bool + CanBurnAsset bool + CanRenumerateAsset bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } type args struct { rawMessage json.RawMessage @@ -167,22 +167,22 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}))}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}))}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMintAsset: tt.fields.CanMintAsset, + CanBurnAsset: tt.fields.CanBurnAsset, + CanRenumerateAsset: tt.fields.CanRenumerateAsset, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -198,42 +198,42 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMintAsset bool + CanBurnAsset bool + CanRenumerateAsset bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMintAsset: tt.fields.CanMintAsset, + CanBurnAsset: tt.fields.CanBurnAsset, + CanRenumerateAsset: tt.fields.CanRenumerateAsset, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -241,17 +241,17 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMintAsset bool + CanBurnAsset bool + CanRenumerateAsset bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } tests := []struct { name string @@ -259,22 +259,22 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), mutableMetaPropertiesString, true, true, true, true, true, true}, NewMessage(fromAccAddress, fromID, fromID, classificationID, mutableMetaProperties1, true, true, true, true, true, true), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), mutableMetaPropertiesString, true, true, true, true, true, true}, NewMessage(fromAccAddress, fromID, fromID, classificationID, mutableMetaProperties1, true, true, true, true, true, true), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMintAsset: tt.fields.CanMintAsset, + CanBurnAsset: tt.fields.CanBurnAsset, + CanRenumerateAsset: tt.fields.CanRenumerateAsset, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -290,17 +290,17 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMintAsset bool + CanBurnAsset bool + CanRenumerateAsset bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } type args struct { legacyAmino *codec.LegacyAmino @@ -310,22 +310,22 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMintAsset: tt.fields.CanMintAsset, + CanBurnAsset: tt.fields.CanBurnAsset, + CanRenumerateAsset: tt.fields.CanRenumerateAsset, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -334,17 +334,17 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMintAsset bool + CanBurnAsset bool + CanRenumerateAsset bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } tests := []struct { name string @@ -352,22 +352,22 @@ func Test_transactionRequest_Validate(t *testing.T) { wantErr bool }{ {"+ve with nil", fields{}, true}, - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMintAsset: tt.fields.CanMintAsset, + CanBurnAsset: tt.fields.CanBurnAsset, + CanRenumerateAsset: tt.fields.CanRenumerateAsset, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/mint/transaction_request.go b/x/assets/transactions/mint/transaction_request.go index 0afdb9c80..559cef8e5 100644 --- a/x/assets/transactions/mint/transaction_request.go +++ b/x/assets/transactions/mint/transaction_request.go @@ -6,7 +6,6 @@ package mint import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,14 +19,14 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -53,7 +52,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -70,11 +69,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -134,15 +133,15 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/assets/transactions/mint/transaction_request_test.go b/x/assets/transactions/mint/transaction_request_test.go index d0388e366..9b38d7ac5 100644 --- a/x/assets/transactions/mint/transaction_request_test.go +++ b/x/assets/transactions/mint/transaction_request_test.go @@ -7,13 +7,13 @@ import ( "encoding/json" "fmt" "github.com/AssetMantle/modules/utilities/rest" - "reflect" - "testing" - baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" + "reflect" + "testing" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" @@ -26,7 +26,7 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() immutableMetaPropertiesString = "testImmutableMeta1:S|immutableMeta" immutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testImmutableMeta1"), baseData.NewStringData("immutableMeta"))) immutablePropertiesString = "testImmutable1:S|immutable" @@ -39,25 +39,25 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -91,14 +91,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -111,19 +111,19 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -139,14 +139,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -158,19 +158,19 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -186,36 +186,36 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -223,14 +223,14 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -238,19 +238,19 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, fromID, fromID, classificationID, immutableMetaProperties1, immutableProperties1.ScrubData(), mutableMetaProperties1, mutableProperties1.ScrubData()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, fromID, fromID, classificationID, immutableMetaProperties1, immutableProperties1.ScrubData(), mutableMetaProperties1, mutableProperties1.ScrubData()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -266,14 +266,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -283,19 +283,19 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -304,33 +304,33 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/mutate/transaction_request.go b/x/assets/transactions/mutate/transaction_request.go index 70b006af3..1a8517160 100644 --- a/x/assets/transactions/mutate/transaction_request.go +++ b/x/assets/transactions/mutate/transaction_request.go @@ -6,7 +6,6 @@ package mutate import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,11 +19,11 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - AssetID string `json:"assetID"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + AssetID string `json:"assetID"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -50,7 +49,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.AssetID), cliCommand.ReadString(constants.MutableMetaProperties), @@ -64,11 +63,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -109,12 +108,12 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, assetID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, assetID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - AssetID: assetID, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + AssetID: assetID, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/assets/transactions/mutate/transaction_request_test.go b/x/assets/transactions/mutate/transaction_request_test.go index 27c63f9f4..12bc6c3a2 100644 --- a/x/assets/transactions/mutate/transaction_request_test.go +++ b/x/assets/transactions/mutate/transaction_request_test.go @@ -26,7 +26,7 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() mutableMetaPropertiesString = "testMutableMeta1:S|mutableMeta" mutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testMutableMeta1"), baseData.NewStringData("mutableMeta"))) mutablePropertiesString = "testMutable1:S|mutable" @@ -35,22 +35,22 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - assetID string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + assetID string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.assetID, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.assetID, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -81,11 +81,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -98,16 +98,16 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -123,11 +123,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -139,16 +139,16 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -164,30 +164,30 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -195,11 +195,11 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -207,16 +207,16 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, fromID, testAssetID, mutableMetaProperties1, mutableProperties1.ScrubData()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, fromID, testAssetID, mutableMetaProperties1, mutableProperties1.ScrubData()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -232,11 +232,11 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -246,16 +246,16 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -264,27 +264,27 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/renumerate/transaction_request.go b/x/assets/transactions/renumerate/transaction_request.go index d2fe46442..2c006bb33 100644 --- a/x/assets/transactions/renumerate/transaction_request.go +++ b/x/assets/transactions/renumerate/transaction_request.go @@ -6,7 +6,6 @@ package renumerate import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - AssetID string `json:"assetID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + AssetID string `json:"assetID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.AssetID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, assetID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, assetID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - AssetID: assetID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + AssetID: assetID, } } diff --git a/x/assets/transactions/renumerate/transaction_request_test.go b/x/assets/transactions/renumerate/transaction_request_test.go index 21075e409..986e1d09f 100644 --- a/x/assets/transactions/renumerate/transaction_request_test.go +++ b/x/assets/transactions/renumerate/transaction_request_test.go @@ -22,25 +22,25 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - assetID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + assetID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, transactionRequest{testBaseRequest, fromID.AsString(), testAssetID.AsString()}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, transactionRequest{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.assetID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.assetID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -69,9 +69,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.AssetID.GetName(), testAssetID.AsString()) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } type args struct { cliCommand helpers.CLICommand @@ -84,14 +84,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(testBaseRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -107,9 +107,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } type args struct { rawMessage json.RawMessage @@ -121,14 +121,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID}))}, newTransactionRequest(testBaseRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -144,26 +144,26 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -171,9 +171,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } tests := []struct { name string @@ -181,14 +181,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, NewMessage(fromAccAddress, fromID, testAssetID), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, NewMessage(fromAccAddress, fromID, testAssetID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -204,9 +204,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } type args struct { legacyAmino *codec.LegacyAmino @@ -216,14 +216,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -232,23 +232,23 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - AssetID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + AssetID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), testAssetID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + AssetID: tt.fields.AssetID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/revoke/transaction_request.go b/x/assets/transactions/revoke/transaction_request.go index 7c23b8645..732606a91 100644 --- a/x/assets/transactions/revoke/transaction_request.go +++ b/x/assets/transactions/revoke/transaction_request.go @@ -6,7 +6,6 @@ package revoke import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,10 +18,10 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -48,7 +47,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -61,11 +60,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -99,11 +98,11 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, } } diff --git a/x/assets/transactions/revoke/transaction_request_test.go b/x/assets/transactions/revoke/transaction_request_test.go index 4acf2b848..ea6bc9808 100644 --- a/x/assets/transactions/revoke/transaction_request_test.go +++ b/x/assets/transactions/revoke/transaction_request_test.go @@ -22,26 +22,26 @@ import ( ) var ( - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -71,10 +71,10 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.ToIdentityID.GetName(), fromID.AsString()) viper.Set(constants.ClassificationID.GetName(), classificationID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { cliCommand helpers.CLICommand @@ -87,15 +87,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -111,10 +111,10 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { rawMessage json.RawMessage @@ -126,15 +126,15 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID}))}, newTransactionRequest(testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -150,28 +150,28 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -179,10 +179,10 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string @@ -190,15 +190,15 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, NewMessage(fromAccAddress, fromID, fromID, classificationID), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, NewMessage(fromAccAddress, fromID, fromID, classificationID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -214,10 +214,10 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { legacyAmino *codec.LegacyAmino @@ -227,15 +227,15 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -244,25 +244,25 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/send/transaction_request.go b/x/assets/transactions/send/transaction_request.go index e29953a7b..a4cbd7ef0 100644 --- a/x/assets/transactions/send/transaction_request.go +++ b/x/assets/transactions/send/transaction_request.go @@ -6,7 +6,6 @@ package send import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,11 +18,11 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - AssetID string `json:"assetID"` - Value string `json:"value"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + AssetID string `json:"assetID"` + Value string `json:"value"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -49,7 +48,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.AssetID), @@ -63,11 +62,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -106,12 +105,12 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, assetID string, value string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, assetID string, value string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - AssetID: assetID, - Value: value, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + AssetID: assetID, + Value: value, } } diff --git a/x/assets/transactions/send/transaction_request_test.go b/x/assets/transactions/send/transaction_request_test.go index a13ed9b9f..0ab139e19 100644 --- a/x/assets/transactions/send/transaction_request_test.go +++ b/x/assets/transactions/send/transaction_request_test.go @@ -7,10 +7,10 @@ import ( "encoding/json" "fmt" "github.com/AssetMantle/modules/utilities/rest" + baseIDs "github.com/AssetMantle/schema/ids/base" "reflect" "testing" - baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" @@ -24,30 +24,30 @@ import ( ) var ( - fromAccAddress, _ = types.AccAddressFromBech32(fromAddress.String()) - testBaseRequest = rest.BaseReq{From: fromAddress.String(), ChainID: "test", Fees: types.NewCoins()} - fromID = baseIDs.PrototypeIdentityID().(*baseIDs.IdentityID) - testRate = types.OneInt() + fromAccAddress, _ = types.AccAddressFromBech32(fromAddress.String()) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + fromID = baseIDs.PrototypeIdentityID().(*baseIDs.IdentityID) + testRate = types.OneInt() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - toID string - assetID string - value string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + assetID string + value string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.assetID, tt.args.value); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.assetID, tt.args.value); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -78,11 +78,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.AssetID.GetName(), assetID.AsString()) viper.Set(constants.Value.GetName(), testRate.String()) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - AssetID string - Value string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + AssetID string + Value string } type args struct { cliCommand helpers.CLICommand @@ -95,16 +95,16 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + AssetID: tt.fields.AssetID, + Value: tt.fields.Value, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -119,14 +119,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - AssetID string - Value string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + AssetID string + Value string } type args struct { rawMessage json.RawMessage @@ -138,16 +138,16 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{jsonMessage}, transactionRequest{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{jsonMessage}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + AssetID: tt.fields.AssetID, + Value: tt.fields.Value, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -163,30 +163,30 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - AssetID string - Value string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + AssetID string + Value string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + AssetID: tt.fields.AssetID, + Value: tt.fields.Value, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -194,11 +194,11 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - AssetID string - Value string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + AssetID string + Value string } tests := []struct { name string @@ -206,16 +206,16 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, NewMessage(fromAccAddress, fromID, fromID, assetID, testRate), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, NewMessage(fromAccAddress, fromID, fromID, assetID, testRate), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + AssetID: tt.fields.AssetID, + Value: tt.fields.Value, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -231,11 +231,11 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - AssetID string - Value string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + AssetID string + Value string } type args struct { legacyAmino *sdkCodec.LegacyAmino @@ -245,16 +245,16 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{codec.GetLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{codec.GetLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + AssetID: tt.fields.AssetID, + Value: tt.fields.Value, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -263,27 +263,27 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - AssetID string - Value string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + AssetID string + Value string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + AssetID: tt.fields.AssetID, + Value: tt.fields.Value, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/unwrap/transaction_request.go b/x/assets/transactions/unwrap/transaction_request.go index 2219eb738..6a8ce1e5d 100644 --- a/x/assets/transactions/unwrap/transaction_request.go +++ b/x/assets/transactions/unwrap/transaction_request.go @@ -6,7 +6,6 @@ package unwrap import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - Coins string `json:"coins"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + Coins string `json:"coins"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.Coins), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, coins string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, coins string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - Coins: coins, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + Coins: coins, } } diff --git a/x/assets/transactions/unwrap/transaction_request_test.go b/x/assets/transactions/unwrap/transaction_request_test.go index 968d221fb..195e2637d 100644 --- a/x/assets/transactions/unwrap/transaction_request_test.go +++ b/x/assets/transactions/unwrap/transaction_request_test.go @@ -27,36 +27,36 @@ import ( ) var ( - fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} - immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) - mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) - classificationID = baseIDs.NewClassificationID(immutables, mutables) - fromID = baseIDs.NewIdentityID(classificationID, immutables).(*baseIDs.IdentityID) - coinAsset = baseDocuments.NewCoinAsset("stake") - testRate = types.NewInt(100) - assetID = coinAsset.GetCoinAssetID().(*baseIDs.AssetID) - coin = types.NewCoin(coinAsset.GetDenom(), testRate) - coins = types.NewCoins(coin) + fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" + fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) + mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) + classificationID = baseIDs.NewClassificationID(immutables, mutables) + fromID = baseIDs.NewIdentityID(classificationID, immutables).(*baseIDs.IdentityID) + coinAsset = baseDocuments.NewCoinAsset("stake") + testRate = types.NewInt(100) + assetID = coinAsset.GetCoinAssetID().(*baseIDs.AssetID) + coin = types.NewCoin(coinAsset.GetDenom(), testRate) + coins = types.NewCoins(coin) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + Coins string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), coins.String()}, transactionRequest{testBaseRequest, fromID.AsString(), coins.String()}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), coins.String()}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.Coins); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.Coins); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -86,9 +86,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.AssetID.GetName(), assetID.AsString()) viper.Set(constants.Value.GetName(), testRate.String()) type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } type args struct { cliCommand helpers.CLICommand @@ -101,14 +101,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), coins.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -123,12 +123,12 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, fromID.AsString(), coins.String())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } type args struct { rawMessage json.RawMessage @@ -140,14 +140,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, args{jsonMessage}, newTransactionRequest(testBaseRequest, fromID.AsString(), coins.String()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -163,26 +163,26 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -190,9 +190,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } tests := []struct { name string @@ -200,14 +200,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, NewMessage(fromAccAddress, fromID, coins), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, NewMessage(fromAccAddress, fromID, coins), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -223,9 +223,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } type args struct { legacyAmino *sdkCodec.LegacyAmino @@ -235,14 +235,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, args{codec.GetLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{codec.GetLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -251,23 +251,23 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/assets/transactions/wrap/transaction_request.go b/x/assets/transactions/wrap/transaction_request.go index 921444d11..5d5018711 100644 --- a/x/assets/transactions/wrap/transaction_request.go +++ b/x/assets/transactions/wrap/transaction_request.go @@ -6,7 +6,6 @@ package wrap import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - Coins string `json:"coins"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + Coins string `json:"coins"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.Coins), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyA func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, coins string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, coins string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - Coins: coins, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + Coins: coins, } } diff --git a/x/assets/transactions/wrap/transaction_request_test.go b/x/assets/transactions/wrap/transaction_request_test.go index 40fdedbf9..542d7c9e7 100644 --- a/x/assets/transactions/wrap/transaction_request_test.go +++ b/x/assets/transactions/wrap/transaction_request_test.go @@ -7,15 +7,15 @@ import ( "encoding/json" "fmt" "github.com/AssetMantle/modules/utilities/rest" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" - "reflect" - "testing" - baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" + "reflect" + "testing" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types" @@ -28,32 +28,32 @@ import ( ) var ( - fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} - immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) - mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) - classificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) - fromID = baseIDs.NewIdentityID(classificationID, immutables).(*baseIDs.IdentityID) - coins = types.NewCoins(types.NewCoin("stake", types.NewInt(100))) + fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" + fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) + mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) + classificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) + fromID = baseIDs.NewIdentityID(classificationID, immutables).(*baseIDs.IdentityID) + coins = types.NewCoins(types.NewCoin("stake", types.NewInt(100))) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - coins string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + coins string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, fromID.AsString(), coins.String()}, transactionRequest{testBaseRequest, fromID.AsString(), coins.String()}}, + {"+ve", args{commonTransactionRequest, fromID.AsString(), coins.String()}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.coins); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.coins); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -82,9 +82,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.Coins.GetName(), coins.String()) type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } type args struct { cliCommand helpers.CLICommand @@ -97,14 +97,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{testBaseRequest, fromID.AsString(), coins.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -119,12 +119,12 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, fromID.AsString(), coins.String())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } type args struct { rawMessage json.RawMessage @@ -136,14 +136,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, args{jsonMessage}, newTransactionRequest(testBaseRequest, fromID.AsString(), coins.String()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -159,26 +159,26 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -186,9 +186,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } tests := []struct { name string @@ -196,14 +196,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, NewMessage(fromAccAddress, fromID, coins), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, NewMessage(fromAccAddress, fromID, coins), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -219,9 +219,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } type args struct { legacyAmino *sdkCodec.LegacyAmino @@ -231,14 +231,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, args{codec.GetLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{codec.GetLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -247,23 +247,23 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - Coins string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + Coins string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, fromID.AsString(), coins.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + Coins: tt.fields.Coins, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/define/transaction_request.go b/x/identities/transactions/define/transaction_request.go index 5a9c72509..6c56e8787 100644 --- a/x/identities/transactions/define/transaction_request.go +++ b/x/identities/transactions/define/transaction_request.go @@ -6,7 +6,6 @@ package define import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,12 +19,12 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -51,7 +50,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), @@ -66,12 +65,12 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -118,13 +117,13 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/identities/transactions/define/transaction_request_test.go b/x/identities/transactions/define/transaction_request_test.go index f5def70fd..18d068bc8 100644 --- a/x/identities/transactions/define/transaction_request_test.go +++ b/x/identities/transactions/define/transaction_request_test.go @@ -31,14 +31,14 @@ func Test_newTransactionRequest(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type args struct { - baseReq rest.BaseReq - fromID string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string @@ -46,11 +46,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ - {"+ve", args{testBaseReq, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{BaseReq: testBaseReq, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{CommonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -78,14 +78,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -99,17 +99,17 @@ func Test_transactionRequest_FromCLI(t *testing.T) { wantErr bool }{ - {"+ve", fields{BaseReq: testBaseReq, FromID: "", ImmutableMetaProperties: "", ImmutableProperties: "", MutableMetaProperties: "", MutableProperties: ""}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), cliCommand.ReadString(constants.MutableMetaProperties), cliCommand.ReadString(constants.MutableProperties)}, false}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "", ImmutableMetaProperties: "", ImmutableProperties: "", MutableMetaProperties: "", MutableProperties: ""}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), cliCommand.ReadString(constants.MutableMetaProperties), cliCommand.ReadString(constants.MutableProperties)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -129,16 +129,16 @@ func Test_transactionRequest_FromJSON(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} - jsonMessage, _ := json.Marshal(transactionRequest{testBaseReq, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}) + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -150,17 +150,17 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{BaseReq: testBaseReq, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, args{jsonMessage}, transactionRequest{BaseReq: testBaseReq, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, args{jsonMessage}, transactionRequest{CommonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -180,34 +180,34 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{BaseReq: testBaseReq, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, testBaseReq}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -232,17 +232,17 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() testIdentity := baseIDs.NewIdentityID(baseIDs.NewClassificationID(baseQualified.NewImmutables(immutableProperties), baseQualified.NewMutables(mutableProperties)), baseQualified.NewImmutables(immutableProperties)) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -250,18 +250,18 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{BaseReq: testBaseReq, FromID: testIdentity.AsString(), ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, NewMessage(fromAccAddress, testIdentity, baseLists.NewPropertyList(immutableMetaProperties), immutableProperties.ScrubData(), baseLists.NewPropertyList(mutableMetaProperties), mutableProperties.ScrubData()), false}, - {"-ve wrong Identity", fields{BaseReq: testBaseReq, FromID: "WrongIdentity", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, nil, true}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: testIdentity.AsString(), ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, NewMessage(fromAccAddress, testIdentity, baseLists.NewPropertyList(immutableMetaProperties), immutableProperties.ScrubData(), baseLists.NewPropertyList(mutableMetaProperties), mutableProperties.ScrubData()), false}, + {"-ve wrong Identity", fields{commonTransactionRequest: commonTransactionRequest, FromID: "WrongIdentity", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, nil, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -281,14 +281,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -298,17 +298,17 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{BaseReq: testBaseReq, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -321,31 +321,31 @@ func Test_transactionRequest_Validate(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{BaseReq: testBaseReq, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/deputize/transaction_request.go b/x/identities/transactions/deputize/transaction_request.go index ff7ecb4b5..791b040e0 100644 --- a/x/identities/transactions/deputize/transaction_request.go +++ b/x/identities/transactions/deputize/transaction_request.go @@ -6,7 +6,6 @@ package deputize import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,16 +19,16 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - MaintainedProperties string `json:"maintainedProperties"` - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + MaintainedProperties string `json:"maintainedProperties"` + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -55,7 +54,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -74,11 +73,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -122,17 +121,17 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string, maintainedProperties string, canIssueIdentity bool, canQuashIdentity bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canIssueIdentity bool, canQuashIdentity bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, - MaintainedProperties: maintainedProperties, - CanIssueIdentity: canIssueIdentity, - CanQuashIdentity: canQuashIdentity, - CanAddMaintainer: canAddMaintainer, - CanRemoveMaintainer: canRemoveMaintainer, - CanMutateMaintainer: canMutateMaintainer, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, + MaintainedProperties: maintainedProperties, + CanIssueIdentity: canIssueIdentity, + CanQuashIdentity: canQuashIdentity, + CanAddMaintainer: canAddMaintainer, + CanRemoveMaintainer: canRemoveMaintainer, + CanMutateMaintainer: canMutateMaintainer, } } diff --git a/x/identities/transactions/deputize/transaction_request_test.go b/x/identities/transactions/deputize/transaction_request_test.go index 4bde34e4b..ccd5837dd 100644 --- a/x/identities/transactions/deputize/transaction_request_test.go +++ b/x/identities/transactions/deputize/transaction_request_test.go @@ -22,29 +22,29 @@ func Test_newTransactionRequest(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress).SetFrom(fromAddress) type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string - maintainedProperties string - CanIssueIdentity bool - CanQuashIdentity bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string + maintainedProperties string + CanIssueIdentity bool + CanQuashIdentity bool + CanAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, transactionRequest{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}}, + {"+ve", args{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, transactionRequest{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.maintainedProperties, tt.args.CanIssueIdentity, tt.args.CanQuashIdentity, tt.args.CanAddMaintainer, tt.args.CanRemoveMaintainer, tt.args.CanMutateMaintainer); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.maintainedProperties, tt.args.CanIssueIdentity, tt.args.CanQuashIdentity, tt.args.CanAddMaintainer, tt.args.CanRemoveMaintainer, tt.args.CanMutateMaintainer); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -71,16 +71,16 @@ func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID, constants.MaintainedProperties, constants.CanMintAsset, constants.CanBurnAsset, constants.CanRenumerateAsset, constants.CanAddMaintainer, constants.CanRemoveMaintainer, constants.CanMutateMaintainer}) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } type args struct { cliCommand helpers.CLICommand @@ -94,19 +94,20 @@ func Test_transactionRequest_FromCLI(t *testing.T) { wantErr bool }{ {"+ve", - fields{BaseReq: rest.BaseReq{From: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).GetFromAddress().String(), ChainID: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).ChainID, Simulate: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).Simulate}, FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, + fields{commonTransactionRequest: rest.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, - transactionRequest{BaseReq: rest.BaseReq{From: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).GetFromAddress().String(), ChainID: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).ChainID, Simulate: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).Simulate}, FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, - false}} + transactionRequest{CommonTransactionRequest: rest.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, + false, + }} for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanIssueIdentity: tt.fields.CanIssueIdentity, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -124,19 +125,19 @@ func Test_transactionRequest_FromJSON(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} - jsonMessage, _ := json.Marshal(newTransactionRequest(testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false)) + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + jsonMessage, _ := json.Marshal(newTransactionRequest(commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false)) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } type args struct { rawMessage json.RawMessage @@ -148,21 +149,21 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, args{jsonMessage}, transactionRequest{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, false}, + {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, args{jsonMessage}, transactionRequest{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanIssueIdentity: tt.fields.CanIssueIdentity, + CanQuashIdentity: tt.fields.CanQuashIdentity, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -180,42 +181,42 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanIssueIdentity: tt.fields.CanIssueIdentity, + CanQuashIdentity: tt.fields.CanQuashIdentity, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -225,18 +226,18 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) - testBaseReq := rest.BaseReq{From: "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c", ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string @@ -244,16 +245,16 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), "maintainedProperty:S|maintainedProperty", false, false, false, false, false}, NewMessage(fromAccAddress, testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false), false}, // TODO: issue==> getting MetaDataError that is not expected + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), "maintainedProperty:S|maintainedProperty", false, false, false, false, false}, NewMessage(fromAccAddress, testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false), false}, // TODO: issue==> getting MetaDataError that is not expected } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -271,18 +272,18 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } type args struct { legacyAmino *codec.LegacyAmino @@ -292,21 +293,21 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanIssueIdentity: tt.fields.CanIssueIdentity, + CanQuashIdentity: tt.fields.CanQuashIdentity, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -317,39 +318,39 @@ func Test_transactionRequest_Validate(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseReq, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, false}, + {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanIssueIdentity: tt.fields.CanIssueIdentity, + CanQuashIdentity: tt.fields.CanQuashIdentity, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/issue/transaction_request.go b/x/identities/transactions/issue/transaction_request.go index 4d9c666d2..a57f94377 100644 --- a/x/identities/transactions/issue/transaction_request.go +++ b/x/identities/transactions/issue/transaction_request.go @@ -6,7 +6,6 @@ package issue import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,13 +19,13 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ClassificationID string `json:"classificationID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ClassificationID string `json:"classificationID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -52,7 +51,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ClassificationID), cliCommand.ReadString(constants.ImmutableMetaProperties), @@ -68,11 +67,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -124,14 +123,14 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ClassificationID: classificationID, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ClassificationID: classificationID, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/identities/transactions/issue/transaction_request_test.go b/x/identities/transactions/issue/transaction_request_test.go index 1700a55ef..11945ca2a 100644 --- a/x/identities/transactions/issue/transaction_request_test.go +++ b/x/identities/transactions/issue/transaction_request_test.go @@ -27,7 +27,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, string, string, lists.PropertyList, lists.PropertyList, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, string, sdkTypes.AccAddress, rest.BaseReq) { +func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, string, string, lists.PropertyList, lists.PropertyList, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, string, sdkTypes.AccAddress, rest.CommonTransactionRequest) { var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.To, constants.ClassificationID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) @@ -61,22 +61,22 @@ func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom toAccAddress, err = sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() - return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, toAddress, toAccAddress, testBaseReq + return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, toAddress, toAccAddress, commonTransactionRequest } func Test_newTransactionRequest(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, testBaseReq := createTestInputForRequest(t) + _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type args struct { - baseReq rest.BaseReq - to string - fromID string - classificationID string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + to string + fromID string + classificationID string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string @@ -84,11 +84,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ - {"+ve", args{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{testBaseReq, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.classificationID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.classificationID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -113,16 +113,16 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - _, cliCommand, context, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, testBaseReq := createTestInputForRequest(t) + _, cliCommand, context, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + To string + FromID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -135,18 +135,18 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ClassificationID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), cliCommand.ReadString(constants.MutableMetaProperties), cliCommand.ReadString(constants.MutableProperties)}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ClassificationID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), cliCommand.ReadString(constants.MutableMetaProperties), cliCommand.ReadString(constants.MutableProperties)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -161,20 +161,20 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, testBaseReq := createTestInputForRequest(t) - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseReq, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) + _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.Equal(t, nil, err) - jsonMessage1, err := json.Marshal(newTransactionRequest(testBaseReq, "", "", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) + jsonMessage1, err := json.Marshal(newTransactionRequest(commonTransactionRequest, "", "", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.Equal(t, nil, err) type fields struct { - BaseReq rest.BaseReq - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + To string + FromID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -187,19 +187,19 @@ func Test_transactionRequest_FromJSON(t *testing.T) { wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{testBaseReq, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, - {"+ve", fields{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage1}, transactionRequest{testBaseReq, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage1}, transactionRequest{commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -214,58 +214,58 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, testBaseReq := createTestInputForRequest(t) + _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + To string + FromID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties, _, fromAccAddress, toAddress, _, testBaseReq := createTestInputForRequest(t) + _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties, _, fromAccAddress, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) type fields struct { - BaseReq rest.BaseReq - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + To string + FromID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -273,18 +273,18 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, "9UNIA3_tulK2vRE0nSmsHKNzhDxoCBHI4z8XXfLO1FM=", "9UNIA3_tulK2vRE0nSmsHKNzhDxoCBHI4z8XXfLO1FM=", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties), false}, // TODO: issue==> getting MetaDataError that is not expected + {"+ve", fields{commonTransactionRequest, toAddress, "9UNIA3_tulK2vRE0nSmsHKNzhDxoCBHI4z8XXfLO1FM=", "9UNIA3_tulK2vRE0nSmsHKNzhDxoCBHI4z8XXfLO1FM=", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties), false}, // TODO: issue==> getting MetaDataError that is not expected } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -299,16 +299,16 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, testBaseReq := createTestInputForRequest(t) + _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + To string + FromID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -318,18 +318,18 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -337,38 +337,38 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, testBaseReq := createTestInputForRequest(t) - testBaseReq1 := rest.BaseReq{} + _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) + commonTransactionRequest1 := rest.PrototypeCommonTransactionRequest() type fields struct { - BaseReq rest.BaseReq - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + To string + FromID string + ClassificationID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, - {"+ve", fields{testBaseReq1, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest1, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, {"-ve", fields{ClassificationID: ""}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/name/transaction_request.go b/x/identities/transactions/name/transaction_request.go index 90768136e..c42000801 100644 --- a/x/identities/transactions/name/transaction_request.go +++ b/x/identities/transactions/name/transaction_request.go @@ -6,7 +6,6 @@ package name import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" @@ -18,8 +17,8 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - Name string `json:"name"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + Name string `json:"name"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -45,7 +44,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.Name), ), nil } @@ -56,11 +55,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -76,9 +75,9 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, name string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, name string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - Name: name, + CommonTransactionRequest: commonTransactionRequest, + Name: name, } } diff --git a/x/identities/transactions/name/transaction_request_test.go b/x/identities/transactions/name/transaction_request_test.go index 6ad6176e5..290ea6154 100644 --- a/x/identities/transactions/name/transaction_request_test.go +++ b/x/identities/transactions/name/transaction_request_test.go @@ -21,7 +21,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, sdkTypes.AccAddress, rest.BaseReq) { +func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, sdkTypes.AccAddress, rest.CommonTransactionRequest) { var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.Name}) @@ -30,27 +30,27 @@ func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() - return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), fromAddress, fromAccAddress, testBaseReq + return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), fromAddress, fromAccAddress, commonTransactionRequest } func Test_newTransactionRequest(t *testing.T) { - _, _, _, _, _, testBaseReq := CreateTestInputForRequest(t) + _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type args struct { - baseReq rest.BaseReq - nubID string + commonTransactionRequest rest.CommonTransactionRequest + nubID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseReq, "nubID"}, transactionRequest{testBaseReq, "nubID"}}, + {"+ve", args{commonTransactionRequest, "nubID"}, transactionRequest{commonTransactionRequest, "nubID"}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.nubID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.nubID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -74,11 +74,11 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - _, cliCommand, context, _, _, testBaseReq := CreateTestInputForRequest(t) + _, cliCommand, context, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - NubID string + commonTransactionRequest rest.CommonTransactionRequest + NubID string } type args struct { cliCommand helpers.CLICommand @@ -91,13 +91,13 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, "nubID"}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(context), cliCommand.ReadString(constants.Name)}, false}, + {"+ve", fields{commonTransactionRequest, "nubID"}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.Name)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - Name: tt.fields.NubID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + Name: tt.fields.NubID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -112,11 +112,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - _, _, _, _, fromAccAddress, testBaseReq := CreateTestInputForRequest(t) + _, _, _, _, fromAccAddress, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - NubID string + commonTransactionRequest rest.CommonTransactionRequest + NubID string } type args struct { rawMessage json.RawMessage @@ -128,13 +128,13 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, "nubID"}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), baseIDs.NewStringID("nubID").(*baseIDs.StringID)}))}, transactionRequest{testBaseReq, "nubID"}, false}, + {"+ve", fields{commonTransactionRequest, "nubID"}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), baseIDs.NewStringID("nubID").(*baseIDs.StringID)}))}, transactionRequest{commonTransactionRequest, "nubID"}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - Name: tt.fields.NubID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + Name: tt.fields.NubID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -149,38 +149,38 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - _, _, _, _, _, testBaseReq := CreateTestInputForRequest(t) + _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - NubID string + commonTransactionRequest rest.CommonTransactionRequest + NubID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, "nubID"}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, "nubID"}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - Name: tt.fields.NubID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + Name: tt.fields.NubID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - _, _, _, _, fromAccAddress, testBaseReq := CreateTestInputForRequest(t) + _, _, _, _, fromAccAddress, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - NubID string + commonTransactionRequest rest.CommonTransactionRequest + NubID string } tests := []struct { name string @@ -188,13 +188,13 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseReq, "nubID"}, &Message{fromAccAddress.String(), baseIDs.NewStringID("nubID").(*baseIDs.StringID)}, false}, + {"+ve", fields{commonTransactionRequest, "nubID"}, &Message{fromAccAddress.String(), baseIDs.NewStringID("nubID").(*baseIDs.StringID)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - Name: tt.fields.NubID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + Name: tt.fields.NubID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -209,11 +209,11 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - _, _, _, _, _, testBaseReq := CreateTestInputForRequest(t) + _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - NubID string + commonTransactionRequest rest.CommonTransactionRequest + NubID string } type args struct { legacyAmino *codec.LegacyAmino @@ -223,13 +223,13 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseReq, "nubID"}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, "nubID"}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - Name: tt.fields.NubID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + Name: tt.fields.NubID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -237,24 +237,24 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - _, _, _, _, _, testBaseReq := CreateTestInputForRequest(t) + _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - BaseReq rest.BaseReq - NubID string + commonTransactionRequest rest.CommonTransactionRequest + NubID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseReq, "nubID"}, false}, + {"+ve", fields{commonTransactionRequest, "nubID"}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - Name: tt.fields.NubID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + Name: tt.fields.NubID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/provision/transaction_request.go b/x/identities/transactions/provision/transaction_request.go index 9312b98fa..2fdf2cbc5 100644 --- a/x/identities/transactions/provision/transaction_request.go +++ b/x/identities/transactions/provision/transaction_request.go @@ -6,7 +6,6 @@ package provision import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - To string `json:"to"` - IdentityID string `json:"identityID"` + CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` + To string `json:"to"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.To), cliCommand.ReadString(constants.IdentityID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, to string, identityID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, to string, identityID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - To: to, - IdentityID: identityID, + CommonTransactionRequest: commonTransactionRequest, + To: to, + IdentityID: identityID, } } diff --git a/x/identities/transactions/provision/transaction_request_test.go b/x/identities/transactions/provision/transaction_request_test.go index ae4f54191..bbbd5b612 100644 --- a/x/identities/transactions/provision/transaction_request_test.go +++ b/x/identities/transactions/provision/transaction_request_test.go @@ -25,23 +25,23 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (rest.BaseReq, string, *baseIDs.IdentityID) { +func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *baseIDs.IdentityID) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" - return testBaseReq, testToAddress, testFromID.(*baseIDs.IdentityID) + return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID) } func Test_newTransactionRequest(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type args struct { - baseReq rest.BaseReq - to string - identityID string + commonTransactionRequest rest.CommonTransactionRequest + to string + identityID string } tests := []struct { name string @@ -49,11 +49,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ {"+ve with nil", args{}, transactionRequest{}}, - {"+ve", args{testBaseReq, testToAddress, testFromID.AsString()}, transactionRequest{testBaseReq, testToAddress, testFromID.AsString()}}, + {"+ve", args{commonTransactionRequest, testToAddress, testFromID.AsString()}, transactionRequest{commonTransactionRequest, testToAddress, testFromID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.to, tt.args.identityID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.to, tt.args.identityID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -79,11 +79,11 @@ func Test_requestPrototype(t *testing.T) { func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.To, constants.IdentityID}) - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } type args struct { cliCommand helpers.CLICommand @@ -96,14 +96,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, args{cliCommand: cliCommand, context: client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.To), cliCommand.ReadString(constants.IdentityID)}, false}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{cliCommand: cliCommand, context: client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.To), cliCommand.ReadString(constants.IdentityID)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -118,11 +118,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } type args struct { rawMessage json.RawMessage @@ -134,14 +134,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{sdkTypes.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), sdkTypes.AccAddress(testToAddress).String(), testFromID}))}, transactionRequest{testBaseReq, testToAddress, testFromID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{sdkTypes.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), sdkTypes.AccAddress(testToAddress).String(), testFromID}))}, transactionRequest{commonTransactionRequest, testToAddress, testFromID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -156,44 +156,44 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) toAccAddress, err := sdkTypes.AccAddressFromBech32(testToAddress) require.Nil(t, err) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } tests := []struct { name string @@ -201,14 +201,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, &Message{fromAccAddress.String(), toAccAddress.String(), testFromID}, false}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, &Message{fromAccAddress.String(), toAccAddress.String(), testFromID}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -223,11 +223,11 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } type args struct { legacyAmino *codec.LegacyAmino @@ -238,14 +238,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { args args }{ {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -253,11 +253,11 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } tests := []struct { name string @@ -265,14 +265,14 @@ func Test_transactionRequest_Validate(t *testing.T) { wantErr bool }{ {"+ve with nil", fields{}, true}, - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/quash/transaction_request.go b/x/identities/transactions/quash/transaction_request.go index cd9f490dd..a84902d13 100644 --- a/x/identities/transactions/quash/transaction_request.go +++ b/x/identities/transactions/quash/transaction_request.go @@ -6,7 +6,6 @@ package quash import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - IdentityID string `json:"identityID"` + CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` + FromID string `json:"fromID"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.IdentityID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, identityID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, identityID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - IdentityID: identityID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + IdentityID: identityID, } } diff --git a/x/identities/transactions/quash/transaction_request_test.go b/x/identities/transactions/quash/transaction_request_test.go index a5e5f094e..04a847fcb 100644 --- a/x/identities/transactions/quash/transaction_request_test.go +++ b/x/identities/transactions/quash/transaction_request_test.go @@ -25,23 +25,23 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (rest.BaseReq, string, *baseIDs.IdentityID) { +func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *baseIDs.IdentityID) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" - return testBaseReq, testToAddress, testFromID.(*baseIDs.IdentityID) + return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID) } func Test_newTransactionRequest(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type args struct { - baseReq rest.BaseReq - fromID string - identityID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + identityID string } tests := []struct { name string @@ -49,11 +49,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ {"+ve with nil", args{}, transactionRequest{}}, - {"+ve", args{testBaseReq, testToAddress, testFromID.AsString()}, transactionRequest{testBaseReq, testToAddress, testFromID.AsString()}}, + {"+ve", args{commonTransactionRequest, testToAddress, testFromID.AsString()}, transactionRequest{commonTransactionRequest, testToAddress, testFromID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.identityID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.identityID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -79,11 +79,11 @@ func Test_requestPrototype(t *testing.T) { func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.IdentityID}) - testBaseReq, _, testFromID := createTestInput(t) + commonTransactionRequest, _, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string } type args struct { cliCommand helpers.CLICommand @@ -96,14 +96,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testFromID.AsString()}, args{cliCommand: cliCommand, context: client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.IdentityID)}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString()}, args{cliCommand: cliCommand, context: client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.IdentityID)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -118,11 +118,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string } type args struct { rawMessage json.RawMessage @@ -134,14 +134,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{types.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), testFromID, testFromID}))}, transactionRequest{testBaseReq, testToAddress, testFromID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{types.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), testFromID, testFromID}))}, transactionRequest{commonTransactionRequest, testToAddress, testFromID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -156,42 +156,42 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - testBaseReq, _, testFromID := createTestInput(t) + commonTransactionRequest, _, testFromID := createTestInput(t) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, err := types.AccAddressFromBech32(fromAddress) require.Nil(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string } tests := []struct { name string @@ -199,14 +199,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want helpers.Message wantErr bool }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testFromID.AsString()}, &Message{fromAccAddress.String(), testFromID, testFromID}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString()}, &Message{fromAccAddress.String(), testFromID, testFromID}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -221,11 +221,11 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string } type args struct { legacyAmino *codec.LegacyAmino @@ -236,14 +236,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { args args }{ {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -251,11 +251,11 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - testBaseReq, testToAddress, testFromID := createTestInput(t) + commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string } tests := []struct { name string @@ -263,14 +263,14 @@ func Test_transactionRequest_Validate(t *testing.T) { wantErr bool }{ {"+ve with nil", fields{}, true}, - {"+ve", fields{testBaseReq, testToAddress, testFromID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/revoke/transaction_request.go b/x/identities/transactions/revoke/transaction_request.go index 390655ff7..abb085a1e 100644 --- a/x/identities/transactions/revoke/transaction_request.go +++ b/x/identities/transactions/revoke/transaction_request.go @@ -6,7 +6,6 @@ package revoke import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,10 +18,10 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -48,7 +47,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -61,11 +60,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -97,11 +96,11 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, } } diff --git a/x/identities/transactions/revoke/transaction_request_test.go b/x/identities/transactions/revoke/transaction_request_test.go index 1384288f1..9e34ea8be 100644 --- a/x/identities/transactions/revoke/transaction_request_test.go +++ b/x/identities/transactions/revoke/transaction_request_test.go @@ -26,25 +26,25 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (rest.BaseReq, string, *baseIDs.IdentityID, *baseIDs.IdentityID, *baseIDs.ClassificationID) { +func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *baseIDs.IdentityID, *baseIDs.IdentityID, *baseIDs.ClassificationID) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) testToID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" - return testBaseReq, testToAddress, testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID) + return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID) } func Test_newTransactionRequest(t *testing.T) { - testBaseReq, _, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string } tests := []struct { name string @@ -52,11 +52,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ {"+ve with nil", args{}, transactionRequest{}}, - {"+ve", args{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, transactionRequest{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -82,12 +82,12 @@ func Test_requestPrototype(t *testing.T) { func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID}) - testBaseReq, _, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { cliCommand helpers.CLICommand @@ -100,15 +100,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID)}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -123,14 +123,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - testBaseReq, fromAddress, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, fromAddress, testFromID, testToID, testClassificationID := createTestInput(t) fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { rawMessage json.RawMessage @@ -142,15 +142,15 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), testFromID, testToID, testClassificationID}))}, transactionRequest{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), testFromID, testToID, testClassificationID}))}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -165,44 +165,44 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - testBaseReq, _, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - testBaseReq, fromAccAddress, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, fromAccAddress, testFromID, testToID, testClassificationID := createTestInput(t) testFromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAccAddress) require.Nil(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string @@ -211,15 +211,15 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { wantErr bool }{ // TODO: Type & Data same but Not matching - {"+ve", fields{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, &Message{testFromAccAddress.String(), testFromID, testToID, testClassificationID}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, &Message{testFromAccAddress.String(), testFromID, testToID, testClassificationID}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -234,12 +234,12 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - testBaseReq, _, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { legacyAmino *codec.LegacyAmino @@ -250,15 +250,15 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { args args }{ {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -266,12 +266,12 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - testBaseReq, _, testFromID, testToID, testClassificationID := createTestInput(t) + commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string @@ -279,15 +279,15 @@ func Test_transactionRequest_Validate(t *testing.T) { wantErr bool }{ {"+ve with nil", fields{}, true}, - {"+ve", fields{testBaseReq, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/unprovision/transaction_request.go b/x/identities/transactions/unprovision/transaction_request.go index 55969e685..3cb706f2a 100644 --- a/x/identities/transactions/unprovision/transaction_request.go +++ b/x/identities/transactions/unprovision/transaction_request.go @@ -6,7 +6,6 @@ package unprovision import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - To string `json:"to"` - IdentityID string `json:"identityID"` + CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` + To string `json:"to"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.To), cliCommand.ReadString(constants.IdentityID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, to string, identityID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, to string, identityID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - To: to, - IdentityID: identityID, + CommonTransactionRequest: commonTransactionRequest, + To: to, + IdentityID: identityID, } } diff --git a/x/identities/transactions/unprovision/transaction_request_test.go b/x/identities/transactions/unprovision/transaction_request_test.go index f4f508ff3..0531f4c6c 100644 --- a/x/identities/transactions/unprovision/transaction_request_test.go +++ b/x/identities/transactions/unprovision/transaction_request_test.go @@ -25,7 +25,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.AccAddress, types.Msg, rest.BaseReq) { +func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.AccAddress, types.Msg, rest.CommonTransactionRequest) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) @@ -39,19 +39,19 @@ func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.Acc toAccAddress, err := types.AccAddressFromBech32(toAddress) require.Nil(t, err) - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() testMessage := NewMessage(fromAccAddress, toAccAddress, testIdentityID) - return testIdentityID.(*baseIDs.IdentityID), toAddress, toAccAddress, testMessage, testBaseReq + return testIdentityID.(*baseIDs.IdentityID), toAddress, toAccAddress, testMessage, commonTransactionRequest } func Test_newTransactionRequest(t *testing.T) { - testIdentityID, toAddress, _, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type args struct { - baseReq rest.BaseReq - to string - identityID string + commonTransactionRequest rest.CommonTransactionRequest + to string + identityID string } tests := []struct { name string @@ -59,11 +59,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ {"+ve wit nil", args{}, transactionRequest{}}, - {"+ve", args{testBaseReq, toAddress, testIdentityID.AsString()}, transactionRequest{testBaseReq, toAddress, testIdentityID.AsString()}}, + {"+ve", args{commonTransactionRequest, toAddress, testIdentityID.AsString()}, transactionRequest{commonTransactionRequest, toAddress, testIdentityID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.to, tt.args.identityID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.to, tt.args.identityID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -89,11 +89,11 @@ func Test_requestPrototype(t *testing.T) { func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.To, constants.IdentityID}) - testIdentityID, toAddress, _, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } type args struct { cliCommand helpers.CLICommand @@ -106,14 +106,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, testIdentityID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadBaseReq(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.To), cliCommand.ReadString(constants.IdentityID)}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{cliCommand.ReadCommonTransactionRequest(client.Context{}.WithCodec(baseHelpers.CodecPrototype())), cliCommand.ReadString(constants.To), cliCommand.ReadString(constants.IdentityID)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -128,11 +128,11 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - testIdentityID, toAddress, toAccAddress, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, toAccAddress, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } type args struct { rawMessage json.RawMessage @@ -144,14 +144,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, testIdentityID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{types.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), toAccAddress.String(), testIdentityID}))}, transactionRequest{testBaseReq, toAddress, testIdentityID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{types.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), toAccAddress.String(), testIdentityID}))}, transactionRequest{commonTransactionRequest, toAddress, testIdentityID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -166,42 +166,42 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - testIdentityID, toAddress, _, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseReq, toAddress, testIdentityID.AsString()}, testBaseReq}, + {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - testIdentityID, toAddress, toAccAddress, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, toAccAddress, _, commonTransactionRequest := createInputForMessage(t) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, err := types.AccAddressFromBech32(fromAddress) require.Nil(t, err) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } tests := []struct { name string @@ -209,14 +209,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseReq, toAddress, testIdentityID.AsString()}, &Message{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, &Message{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -231,11 +231,11 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - testIdentityID, toAddress, _, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } type args struct { legacyAmino *codec.LegacyAmino @@ -246,14 +246,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { args args }{ {"+ve wit nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{testBaseReq, toAddress, testIdentityID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -261,11 +261,11 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - testIdentityID, toAddress, _, _, testBaseReq := createInputForMessage(t) + testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - BaseReq rest.BaseReq - To string - IdentityID string + commonTransactionRequest rest.CommonTransactionRequest + To string + IdentityID string } tests := []struct { name string @@ -273,14 +273,14 @@ func Test_transactionRequest_Validate(t *testing.T) { wantErr bool }{ {"+ve wit nil", fields{}, true}, - {"+ve", fields{testBaseReq, toAddress, testIdentityID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + To: tt.fields.To, + IdentityID: tt.fields.IdentityID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/identities/transactions/update/transaction_request.go b/x/identities/transactions/update/transaction_request.go index a57755ee3..26812d32b 100644 --- a/x/identities/transactions/update/transaction_request.go +++ b/x/identities/transactions/update/transaction_request.go @@ -6,7 +6,6 @@ package update import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,11 +19,11 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - IdentityID string `json:"identityID"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + IdentityID string `json:"identityID"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -50,7 +49,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.IdentityID), cliCommand.ReadString(constants.MutableMetaProperties), @@ -64,11 +63,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -108,12 +107,12 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, identityID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, identityID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - IdentityID: identityID, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + IdentityID: identityID, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/identities/transactions/update/transaction_request_test.go b/x/identities/transactions/update/transaction_request_test.go index f33507f61..5b5d52cb3 100644 --- a/x/identities/transactions/update/transaction_request_test.go +++ b/x/identities/transactions/update/transaction_request_test.go @@ -26,7 +26,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, rest.BaseReq) { +func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, rest.CommonTransactionRequest) { var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.IdentityID, constants.MutableMetaProperties, constants.MutableProperties}) @@ -42,31 +42,31 @@ func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, clie fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() - return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), mutableMetaPropertiesString, mutablePropertiesString, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, testBaseReq + return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), mutableMetaPropertiesString, mutablePropertiesString, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, commonTransactionRequest } func Test_newTransactionRequest(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, testBaseReq := createTestInput(t) + _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type args struct { - baseReq rest.BaseReq - fromID string - identityID string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + identityID string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}}, {"-ve with nil", args{}, transactionRequest{}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.identityID, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.identityID, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -90,13 +90,13 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - _, cliCommand, context, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, testBaseReq := createTestInput(t) + _, cliCommand, context, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -109,16 +109,16 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand: cliCommand, context: context}, transactionRequest{cliCommand.ReadBaseReq(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.IdentityID), cliCommand.ReadString(constants.MutableMetaProperties), cliCommand.ReadString(constants.MutableProperties)}, false}, + {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand: cliCommand, context: context}, transactionRequest{cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.IdentityID), cliCommand.ReadString(constants.MutableMetaProperties), cliCommand.ReadString(constants.MutableProperties)}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -133,15 +133,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, testBaseReq := createTestInput(t) - jsonMessage, _ := json.Marshal(transactionRequest{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}) + _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) + jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -153,16 +153,16 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -177,51 +177,51 @@ func Test_transactionRequest_FromJSON(t *testing.T) { } func Test_transactionRequest_GetBaseReq(t *testing.T) { - _, _, context, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, testBaseReq := createTestInput(t) + _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{}, rest.BaseReq{From: context.GetFromAddress().String(), ChainID: context.ChainID, Simulate: context.Simulate}}, - {"+ve", fields{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, testBaseReq}, + {"+ve", fields{}, rest.PrototypeCommonTransactionRequest()}, + {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } } func Test_transactionRequest_MakeMsg(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, mutableMetaProperties, mutableProperties, _, fromAccAddress, testBaseReq := createTestInput(t) + _, _, _, mutableMetaPropertiesString, mutablePropertiesString, mutableMetaProperties, mutableProperties, _, fromAccAddress, commonTransactionRequest := createTestInput(t) immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -229,16 +229,16 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseReq, testFromID.AsString(), testFromID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testFromID, mutableMetaProperties, mutableProperties.ScrubData()), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testFromID, mutableMetaProperties, mutableProperties.ScrubData()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -253,14 +253,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } func Test_transactionRequest_RegisterCodec(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, testBaseReq := createTestInput(t) + _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -270,16 +270,16 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -287,31 +287,31 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { } func Test_transactionRequest_Validate(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, testBaseReq := createTestInput(t) + _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - BaseReq rest.BaseReq - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + IdentityID string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseReq, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, false}, {"+ve with nil", fields{}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + IdentityID: tt.fields.IdentityID, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/metas/transactions/reveal/transaction_request.go b/x/metas/transactions/reveal/transaction_request.go index 17cffb0fa..47d2bb814 100644 --- a/x/metas/transactions/reveal/transaction_request.go +++ b/x/metas/transactions/reveal/transaction_request.go @@ -6,7 +6,6 @@ package reveal import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/data/base" "github.com/cosmos/cosmos-sdk/client" @@ -18,8 +17,8 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - Data string `json:"data"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + Data string `json:"data"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -45,7 +44,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.Data), ), nil } @@ -56,11 +55,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -81,9 +80,9 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, data string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, data string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - Data: data, + CommonTransactionRequest: commonTransactionRequest, + Data: data, } } diff --git a/x/metas/transactions/reveal/transaction_request_test.go b/x/metas/transactions/reveal/transaction_request_test.go index 873eb080b..c7c00813e 100644 --- a/x/metas/transactions/reveal/transaction_request_test.go +++ b/x/metas/transactions/reveal/transaction_request_test.go @@ -10,8 +10,6 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/codec" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/helpers" @@ -24,15 +22,15 @@ func Test_Reveal_Request(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" data := "S|newData" - testBaseReq := rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} - testTransactionRequest := newTransactionRequest(testBaseReq, data) + commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + testTransactionRequest := newTransactionRequest(commonTransactionRequest, data) - require.Equal(t, transactionRequest{BaseReq: testBaseReq, Data: data}, testTransactionRequest) + require.Equal(t, transactionRequest{CommonTransactionRequest: commonTransactionRequest, Data: data}, testTransactionRequest) require.Equal(t, nil, testTransactionRequest.Validate()) requestFromCLI, err := transactionRequest{}.FromCLI(cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())) require.Equal(t, nil, err) - require.Equal(t, transactionRequest{BaseReq: rest.BaseReq{From: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).GetFromAddress().String(), ChainID: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).ChainID, Simulate: client.Context{}.WithCodec(baseHelpers.CodecPrototype()).Simulate}, Data: ""}, requestFromCLI) + require.Equal(t, transactionRequest{CommonTransactionRequest: rest.PrototypeCommonTransactionRequest(), Data: ""}, requestFromCLI) jsonMessage, _ := json.Marshal(testTransactionRequest) transactionRequestUnmarshalled, err := transactionRequest{}.FromJSON(jsonMessage) @@ -43,15 +41,15 @@ func Test_Reveal_Request(t *testing.T) { require.Equal(t, nil, randomUnmarshall) require.NotNil(t, err) - require.Equal(t, testBaseReq, testTransactionRequest.GetBaseReq()) + require.Equal(t, commonTransactionRequest, testTransactionRequest.GetCommonTransactionRequest()) require.Nil(t, err) - msg2, err := newTransactionRequest(rest.BaseReq{From: "randomFromAddress", ChainID: "test"}, data).MakeMsg() + msg2, err := newTransactionRequest(rest.PrototypeCommonTransactionRequest(), data).MakeMsg() require.NotNil(t, err) require.Nil(t, msg2) - msg2, err = newTransactionRequest(rest.BaseReq{From: fromAddress, ChainID: "test"}, "randomString").MakeMsg() + msg2, err = newTransactionRequest(rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress), "randomString").MakeMsg() require.NotNil(t, err) require.Nil(t, msg2) diff --git a/x/orders/transactions/cancel/transaction_request.go b/x/orders/transactions/cancel/transaction_request.go index 44e9b20be..187e4116d 100644 --- a/x/orders/transactions/cancel/transaction_request.go +++ b/x/orders/transactions/cancel/transaction_request.go @@ -6,7 +6,6 @@ package cancel import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - OrderID string `json:"orderID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.OrderID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, orderID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, orderID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - OrderID: orderID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + OrderID: orderID, } } diff --git a/x/orders/transactions/cancel/transaction_request_test.go b/x/orders/transactions/cancel/transaction_request_test.go index 29e3cd9f0..8aed74e09 100644 --- a/x/orders/transactions/cancel/transaction_request_test.go +++ b/x/orders/transactions/cancel/transaction_request_test.go @@ -33,30 +33,30 @@ var ( immutables = baseQualified.NewImmutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables = baseQualified.NewMutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) - testClassificationID = baseIDs.NewClassificationID(immutables, mutables) - testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) - testOrderID = baseIDs.NewOrderID(testClassificationID, immutables) - testOrderID1 = baseIDs.PrototypeOrderID() - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + testClassificationID = baseIDs.NewClassificationID(immutables, mutables) + testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) + testOrderID = baseIDs.NewOrderID(testClassificationID, immutables) + testOrderID1 = baseIDs.PrototypeOrderID() + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - orderID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + orderID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString())}, - {"+ve", args{testBaseRequest, testFromID.AsString(), testOrderID1.AsString()}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID1.AsString())}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString())}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString())}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.orderID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.orderID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -85,9 +85,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.FromIdentityID.GetName(), testFromID.AsString()) viper.Set(constants.OrderID.GetName(), testOrderID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } type args struct { cliCommand helpers.CLICommand @@ -100,14 +100,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -122,15 +122,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString())) require.NoError(t, err) - jsonMessage1, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID1.AsString())) + jsonMessage1, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } type args struct { rawMessage json.RawMessage @@ -142,15 +142,15 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, args{jsonMessage}, transactionRequest{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, false}, - {"+ve with nil", fields{testBaseRequest, testFromID.AsString(), testOrderID1.AsString()}, args{jsonMessage1}, transactionRequest{testBaseRequest, testFromID.AsString(), testOrderID1.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{jsonMessage}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, false}, + {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, args{jsonMessage1}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -166,27 +166,27 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, testBaseRequest}, - {"+ve with nil", fields{testBaseRequest, testFromID.AsString(), testOrderID1.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, commonTransactionRequest}, + {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -194,9 +194,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } tests := []struct { name string @@ -204,14 +204,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, NewMessage(fromAccAddress, testFromID, testOrderID), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, NewMessage(fromAccAddress, testFromID, testOrderID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -227,9 +227,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } type args struct { legacyAmino *codec.LegacyAmino @@ -239,15 +239,15 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, - {"+ve with nil", fields{testBaseRequest, testFromID.AsString(), testOrderID1.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -256,24 +256,24 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, false}, - {"+ve with nil", fields{testBaseRequest, testFromID.AsString(), testOrderID1.AsString()}, true}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, false}, + {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, true}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/define/transaction_request.go b/x/orders/transactions/define/transaction_request.go index 06deea476..6d9780888 100644 --- a/x/orders/transactions/define/transaction_request.go +++ b/x/orders/transactions/define/transaction_request.go @@ -6,7 +6,6 @@ package define import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,12 +19,12 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -51,7 +50,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ImmutableMetaProperties), cliCommand.ReadString(constants.ImmutableProperties), @@ -66,11 +65,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -117,13 +116,13 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/orders/transactions/define/transaction_request_test.go b/x/orders/transactions/define/transaction_request_test.go index b0e23032b..8b9607a84 100644 --- a/x/orders/transactions/define/transaction_request_test.go +++ b/x/orders/transactions/define/transaction_request_test.go @@ -45,28 +45,28 @@ var ( mutables = base.NewMutables(mutableProperties) testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, newTransactionRequest(testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -98,12 +98,12 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) viper.Set(constants.FromIdentityID.GetName(), testFromID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -116,17 +116,17 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -141,15 +141,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -161,17 +161,17 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -187,32 +187,32 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -220,12 +220,12 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -233,17 +233,17 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, immutableMetaProperties, immutableProperties.ScrubData(), mutableMetaProperties, mutableProperties.ScrubData()), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, immutableMetaProperties, immutableProperties.ScrubData(), mutableMetaProperties, mutableProperties.ScrubData()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -259,12 +259,12 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -274,17 +274,17 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -293,29 +293,29 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/deputize/transaction_request.go b/x/orders/transactions/deputize/transaction_request.go index e784f4f25..a34e00e92 100644 --- a/x/orders/transactions/deputize/transaction_request.go +++ b/x/orders/transactions/deputize/transaction_request.go @@ -6,7 +6,6 @@ package deputize import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,16 +19,16 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - MaintainedProperties string `json:"maintainedProperties"` - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + MaintainedProperties string `json:"maintainedProperties"` + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -55,7 +54,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -74,11 +73,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -122,17 +121,17 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string, maintainedProperties string, canMakeOrder bool, canCancelOrder bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canMakeOrder bool, canCancelOrder bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, - MaintainedProperties: maintainedProperties, - CanMakeOrder: canMakeOrder, - CanCancelOrder: canCancelOrder, - CanAddMaintainer: canAddMaintainer, - CanRemoveMaintainer: canRemoveMaintainer, - CanMutateMaintainer: canMutateMaintainer, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, + MaintainedProperties: maintainedProperties, + CanMakeOrder: canMakeOrder, + CanCancelOrder: canCancelOrder, + CanAddMaintainer: canAddMaintainer, + CanRemoveMaintainer: canRemoveMaintainer, + CanMutateMaintainer: canMutateMaintainer, } } diff --git a/x/orders/transactions/deputize/transaction_request_test.go b/x/orders/transactions/deputize/transaction_request_test.go index eebcbce60..8874062cf 100644 --- a/x/orders/transactions/deputize/transaction_request_test.go +++ b/x/orders/transactions/deputize/transaction_request_test.go @@ -37,32 +37,32 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) maintainedPropertyString = "maintainedProperty:S|maintainedProperty" maintainedProperties, _ = base.NewPropertyList().FromMetaPropertiesString(maintainedPropertyString) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string - maintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string + maintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true)}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.maintainedProperties, tt.args.CanMakeOrder, tt.args.CanCancelOrder, tt.args.CanAddMaintainer, tt.args.CanRemoveMaintainer, tt.args.CanMutateMaintainer); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID, tt.args.maintainedProperties, tt.args.CanMakeOrder, tt.args.CanCancelOrder, tt.args.CanAddMaintainer, tt.args.CanRemoveMaintainer, tt.args.CanMutateMaintainer); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -99,16 +99,16 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.CanRemoveMaintainer.GetName(), true) viper.Set(constants.CanMutateMaintainer.GetName(), true) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } type args struct { cliCommand helpers.CLICommand @@ -121,21 +121,21 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMakeOrder: tt.fields.CanMakeOrder, + CanCancelOrder: tt.fields.CanCancelOrder, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -150,19 +150,19 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true)) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true)) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } type args struct { rawMessage json.RawMessage @@ -174,21 +174,21 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMakeOrder: tt.fields.CanMakeOrder, + CanCancelOrder: tt.fields.CanCancelOrder, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -204,40 +204,40 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMakeOrder: tt.fields.CanMakeOrder, + CanCancelOrder: tt.fields.CanCancelOrder, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -245,16 +245,16 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string @@ -262,21 +262,21 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, NewMessage(fromAccAddress, testFromID, testFromID, testClassificationID, maintainedProperties, true, true, true, true, true), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, NewMessage(fromAccAddress, testFromID, testFromID, testClassificationID, maintainedProperties, true, true, true, true, true), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMakeOrder: tt.fields.CanMakeOrder, + CanCancelOrder: tt.fields.CanCancelOrder, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -292,16 +292,16 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } type args struct { legacyAmino *codec.LegacyAmino @@ -311,21 +311,21 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMakeOrder: tt.fields.CanMakeOrder, + CanCancelOrder: tt.fields.CanCancelOrder, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -334,37 +334,37 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string + MaintainedProperties string + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, + MaintainedProperties: tt.fields.MaintainedProperties, + CanMakeOrder: tt.fields.CanMakeOrder, + CanCancelOrder: tt.fields.CanCancelOrder, + CanAddMaintainer: tt.fields.CanAddMaintainer, + CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, + CanMutateMaintainer: tt.fields.CanMutateMaintainer, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/get/transaction_request.go b/x/orders/transactions/get/transaction_request.go index 22819021b..3ad8d8edc 100644 --- a/x/orders/transactions/get/transaction_request.go +++ b/x/orders/transactions/get/transaction_request.go @@ -6,7 +6,6 @@ package get import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,9 +18,9 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - OrderID string `json:"orderID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -47,7 +46,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.OrderID), ), nil @@ -59,11 +58,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -90,10 +89,10 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, orderID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, orderID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - OrderID: orderID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + OrderID: orderID, } } diff --git a/x/orders/transactions/get/transaction_request_test.go b/x/orders/transactions/get/transaction_request_test.go index eed070ac8..2dd595f5c 100644 --- a/x/orders/transactions/get/transaction_request_test.go +++ b/x/orders/transactions/get/transaction_request_test.go @@ -33,17 +33,17 @@ var ( immutables = baseQualified.NewImmutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables = baseQualified.NewMutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) - testClassificationID = baseIDs.NewClassificationID(immutables, mutables) - testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} - takerSplit = types.NewInt(60) + testClassificationID = baseIDs.NewClassificationID(immutables, mutables) + testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) + testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + takerSplit = types.NewInt(60) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string orderID string } @@ -52,11 +52,11 @@ func Test_newTransactionRequest(t *testing.T) { args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, transactionRequest{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.orderID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.orderID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -85,8 +85,8 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.FromIdentityID.GetName(), testFromID.AsString()) viper.Set(constants.OrderID.GetName(), testOrderID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string OrderID string } @@ -101,14 +101,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -123,12 +123,12 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } type args struct { rawMessage json.RawMessage @@ -140,14 +140,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -163,27 +163,27 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string OrderID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -191,8 +191,8 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string OrderID string } @@ -202,14 +202,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, NewMessage(fromAccAddress, testFromID, testOrderID), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, NewMessage(fromAccAddress, testFromID, testOrderID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -225,9 +225,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string } type args struct { legacyAmino *codec.LegacyAmino @@ -237,14 +237,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -253,8 +253,8 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string OrderID string } @@ -263,14 +263,14 @@ func Test_transactionRequest_Validate(t *testing.T) { fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/immediate/transaction_request.go b/x/orders/transactions/immediate/transaction_request.go index 49c567dc6..3607a2525 100644 --- a/x/orders/transactions/immediate/transaction_request.go +++ b/x/orders/transactions/immediate/transaction_request.go @@ -6,7 +6,6 @@ package immediate import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -21,19 +20,19 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ClassificationID string `json:"classificationID"` - TakerID string `json:"takerID"` - MakerAssetID string `json:"makerAssetID"` - TakerAssetID string `json:"takerAssetID"` - ExpiresIn int64 `json:"expiresIn"` - MakerSplit string `json:"makerSplit"` - TakerSplit string `json:"takerSplit"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ClassificationID string `json:"classificationID"` + TakerID string `json:"takerID"` + MakerAssetID string `json:"makerAssetID"` + TakerAssetID string `json:"takerAssetID"` + ExpiresIn int64 `json:"expiresIn"` + MakerSplit string `json:"makerSplit"` + TakerSplit string `json:"takerSplit"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -59,7 +58,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ClassificationID), cliCommand.ReadString(constants.TakerID), @@ -81,12 +80,12 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -171,20 +170,20 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ClassificationID: classificationID, - TakerID: takerID, - MakerAssetID: makerAssetID, - TakerAssetID: takerAssetID, - ExpiresIn: expiresIn, - MakerSplit: makerSplit, - TakerSplit: takerSplit, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ClassificationID: classificationID, + TakerID: takerID, + MakerAssetID: makerAssetID, + TakerAssetID: takerAssetID, + ExpiresIn: expiresIn, + MakerSplit: makerSplit, + TakerSplit: takerSplit, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/orders/transactions/immediate/transaction_request_test.go b/x/orders/transactions/immediate/transaction_request_test.go index 8cd725a28..5a7e3d858 100644 --- a/x/orders/transactions/immediate/transaction_request_test.go +++ b/x/orders/transactions/immediate/transaction_request_test.go @@ -44,7 +44,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("MakerAssetID").GetCoinAssetID().(*baseIDs.AssetID) takerAssetID = baseDocuments.NewCoinAsset("TakerAssetId").GetCoinAssetID().(*baseIDs.AssetID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = types.NewInt(60) takerSplit = types.NewInt(60) @@ -52,19 +52,19 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - classificationID string - takerID string - makerAssetID string - takerAssetID string - expiresIn int64 - makerSplit string - takerSplit string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + classificationID string + takerID string + makerAssetID string + takerAssetID string + expiresIn int64 + makerSplit string + takerSplit string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string @@ -72,11 +72,11 @@ func Test_newTransactionRequest(t *testing.T) { want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.classificationID, tt.args.takerID, tt.args.makerAssetID, tt.args.takerAssetID, tt.args.expiresIn, tt.args.makerSplit, tt.args.takerSplit, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.classificationID, tt.args.takerID, tt.args.makerAssetID, tt.args.takerAssetID, tt.args.expiresIn, tt.args.makerSplit, tt.args.takerSplit, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -116,19 +116,19 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -141,24 +141,24 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -173,22 +173,22 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -200,24 +200,24 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -233,46 +233,46 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -280,19 +280,19 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -300,24 +300,24 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, base.NewHeight(60), makerSplit, takerSplit, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, base.NewHeight(60), makerSplit, takerSplit, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -333,19 +333,19 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -355,24 +355,24 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -381,43 +381,43 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/make/transaction_request.go b/x/orders/transactions/make/transaction_request.go index 6fe3bce11..299332ad6 100644 --- a/x/orders/transactions/make/transaction_request.go +++ b/x/orders/transactions/make/transaction_request.go @@ -6,7 +6,6 @@ package make import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -21,19 +20,19 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ClassificationID string `json:"classificationID"` - TakerID string `json:"takerID"` - MakerAssetID string `json:"makerAssetID"` - TakerAssetID string `json:"takerAssetID"` - ExpiresIn int64 `json:"expiresIn"` - MakerSplit string `json:"makerSplit"` - TakerSplit string `json:"takerSplit"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ClassificationID string `json:"classificationID"` + TakerID string `json:"takerID"` + MakerAssetID string `json:"makerAssetID"` + TakerAssetID string `json:"takerAssetID"` + ExpiresIn int64 `json:"expiresIn"` + MakerSplit string `json:"makerSplit"` + TakerSplit string `json:"takerSplit"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -59,7 +58,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ClassificationID), cliCommand.ReadString(constants.TakerID), @@ -81,12 +80,12 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -171,20 +170,20 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ClassificationID: classificationID, - TakerID: takerID, - MakerAssetID: makerAssetID, - TakerAssetID: takerAssetID, - ExpiresIn: expiresIn, - MakerSplit: makerSplit, - TakerSplit: takerSplit, - ImmutableMetaProperties: immutableMetaProperties, - ImmutableProperties: immutableProperties, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ClassificationID: classificationID, + TakerID: takerID, + MakerAssetID: makerAssetID, + TakerAssetID: takerAssetID, + ExpiresIn: expiresIn, + MakerSplit: makerSplit, + TakerSplit: takerSplit, + ImmutableMetaProperties: immutableMetaProperties, + ImmutableProperties: immutableProperties, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/orders/transactions/make/transaction_request_test.go b/x/orders/transactions/make/transaction_request_test.go index 9e0ff5e8c..515e60e6d 100644 --- a/x/orders/transactions/make/transaction_request_test.go +++ b/x/orders/transactions/make/transaction_request_test.go @@ -44,7 +44,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("makerAssetID").GetCoinAssetID() takerAssetID = baseDocuments.NewCoinAsset("takerAssetID").GetCoinAssetID() - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = sdkTypes.NewInt(60) takerSplit = sdkTypes.NewInt(60) @@ -52,30 +52,30 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - classificationID string - takerID string - makerAssetID string - takerAssetID string - expiresIn int64 - makerSplit string - takerSplit string - immutableMetaProperties string - immutableProperties string - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + classificationID string + takerID string + makerAssetID string + takerAssetID string + expiresIn int64 + makerSplit string + takerSplit string + immutableMetaProperties string + immutableProperties string + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.classificationID, tt.args.takerID, tt.args.makerAssetID, tt.args.takerAssetID, tt.args.expiresIn, tt.args.makerSplit, tt.args.takerSplit, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.classificationID, tt.args.takerID, tt.args.makerAssetID, tt.args.takerAssetID, tt.args.expiresIn, tt.args.makerSplit, tt.args.takerSplit, tt.args.immutableMetaProperties, tt.args.immutableProperties, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -114,19 +114,19 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -139,24 +139,24 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -171,22 +171,22 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -198,24 +198,24 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -231,46 +231,46 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -278,19 +278,19 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -298,24 +298,24 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, base.NewHeight(60), makerSplit, takerSplit, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, base.NewHeight(60), makerSplit, takerSplit, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -331,19 +331,19 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -353,24 +353,24 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -379,43 +379,43 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ClassificationID string + TakerID string + MakerAssetID string + TakerAssetID string + ExpiresIn int64 + MakerSplit string + TakerSplit string + ImmutableMetaProperties string + ImmutableProperties string + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ClassificationID: tt.fields.ClassificationID, + TakerID: tt.fields.TakerID, + MakerAssetID: tt.fields.MakerAssetID, + TakerAssetID: tt.fields.TakerAssetID, + ExpiresIn: tt.fields.ExpiresIn, + MakerSplit: tt.fields.MakerSplit, + TakerSplit: tt.fields.TakerSplit, + ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, + ImmutableProperties: tt.fields.ImmutableProperties, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/modify/transaction_request.go b/x/orders/transactions/modify/transaction_request.go index 08e65b30b..6aac3c475 100644 --- a/x/orders/transactions/modify/transaction_request.go +++ b/x/orders/transactions/modify/transaction_request.go @@ -6,7 +6,6 @@ package modify import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -21,14 +20,14 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - OrderID string `json:"orderID"` - TakerSplit string `json:"takerSplit"` - MakerSplit string `json:"makerSplit"` - ExpiresIn int64 `json:"expiresIn"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + OrderID string `json:"orderID"` + TakerSplit string `json:"takerSplit"` + MakerSplit string `json:"makerSplit"` + ExpiresIn int64 `json:"expiresIn"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -54,7 +53,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.OrderID), cliCommand.ReadString(constants.TakerSplit), @@ -71,12 +70,12 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -130,15 +129,15 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, orderID string, takerSplit string, makerSplit string, expiresIn int64, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, orderID string, takerSplit string, makerSplit string, expiresIn int64, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - OrderID: orderID, - TakerSplit: takerSplit, - MakerSplit: makerSplit, - ExpiresIn: expiresIn, - MutableMetaProperties: mutableMetaProperties, - MutableProperties: mutableProperties, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + OrderID: orderID, + TakerSplit: takerSplit, + MakerSplit: makerSplit, + ExpiresIn: expiresIn, + MutableMetaProperties: mutableMetaProperties, + MutableProperties: mutableProperties, } } diff --git a/x/orders/transactions/modify/transaction_request_test.go b/x/orders/transactions/modify/transaction_request_test.go index 54e24dba1..f0dd0a038 100644 --- a/x/orders/transactions/modify/transaction_request_test.go +++ b/x/orders/transactions/modify/transaction_request_test.go @@ -40,36 +40,36 @@ var ( immutables = baseQualified.NewImmutables(immutableProperties) mutables = baseQualified.NewMutables(mutableProperties) - testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) - testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} - expiresIn = int64(60) - makerSplit = types.NewInt(60) - takerSplit = types.NewInt(60) + testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) + testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) + testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + expiresIn = int64(60) + makerSplit = types.NewInt(60) + takerSplit = types.NewInt(60) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - orderID string - takerSplit string - makerSplit string - expiresIn int64 - mutableMetaProperties string - mutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + orderID string + takerSplit string + makerSplit string + expiresIn int64 + mutableMetaProperties string + mutableProperties string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.orderID, tt.args.takerSplit, tt.args.makerSplit, tt.args.expiresIn, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.orderID, tt.args.takerSplit, tt.args.makerSplit, tt.args.expiresIn, tt.args.mutableMetaProperties, tt.args.mutableProperties); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -103,14 +103,14 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string + TakerSplit string + MakerSplit string + ExpiresIn int64 + MutableMetaProperties string + MutableProperties string } type args struct { cliCommand helpers.CLICommand @@ -123,19 +123,19 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, + TakerSplit: tt.fields.TakerSplit, + MakerSplit: tt.fields.MakerSplit, + ExpiresIn: tt.fields.ExpiresIn, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -150,17 +150,17 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString)) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string + TakerSplit string + MakerSplit string + ExpiresIn int64 + MutableMetaProperties string + MutableProperties string } type args struct { rawMessage json.RawMessage @@ -172,19 +172,19 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, + TakerSplit: tt.fields.TakerSplit, + MakerSplit: tt.fields.MakerSplit, + ExpiresIn: tt.fields.ExpiresIn, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -200,36 +200,36 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string + TakerSplit string + MakerSplit string + ExpiresIn int64 + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, + TakerSplit: tt.fields.TakerSplit, + MakerSplit: tt.fields.MakerSplit, + ExpiresIn: tt.fields.ExpiresIn, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -237,14 +237,14 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string + TakerSplit string + MakerSplit string + ExpiresIn int64 + MutableMetaProperties string + MutableProperties string } tests := []struct { name string @@ -252,19 +252,19 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testOrderID, takerSplit, makerSplit, base.NewHeight(60), mutableMetaProperties, mutableProperties), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, NewMessage(fromAccAddress, testFromID, testOrderID, takerSplit, makerSplit, base.NewHeight(60), mutableMetaProperties, mutableProperties), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, + TakerSplit: tt.fields.TakerSplit, + MakerSplit: tt.fields.MakerSplit, + ExpiresIn: tt.fields.ExpiresIn, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -280,14 +280,14 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string + TakerSplit string + MakerSplit string + ExpiresIn int64 + MutableMetaProperties string + MutableProperties string } type args struct { legacyAmino *codec.LegacyAmino @@ -297,19 +297,19 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, + TakerSplit: tt.fields.TakerSplit, + MakerSplit: tt.fields.MakerSplit, + ExpiresIn: tt.fields.ExpiresIn, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -318,33 +318,33 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + OrderID string + TakerSplit string + MakerSplit string + ExpiresIn int64 + MutableMetaProperties string + MutableProperties string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + OrderID: tt.fields.OrderID, + TakerSplit: tt.fields.TakerSplit, + MakerSplit: tt.fields.MakerSplit, + ExpiresIn: tt.fields.ExpiresIn, + MutableMetaProperties: tt.fields.MutableMetaProperties, + MutableProperties: tt.fields.MutableProperties, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/put/transaction_request.go b/x/orders/transactions/put/transaction_request.go index 9c5959d32..61c930cba 100644 --- a/x/orders/transactions/put/transaction_request.go +++ b/x/orders/transactions/put/transaction_request.go @@ -6,7 +6,6 @@ package put import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,13 +19,13 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - MakerAssetID string `json:"makerAssetID"` - TakerAssetID string `json:"takerAssetID"` - MakerSplit string `json:"makerSplit"` - TakerSplit string `json:"takerSplit"` - ExpiryHeight int64 `json:"expiryHeight"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + MakerAssetID string `json:"makerAssetID"` + TakerAssetID string `json:"takerAssetID"` + MakerSplit string `json:"makerSplit"` + TakerSplit string `json:"takerSplit"` + ExpiryHeight int64 `json:"expiryHeight"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -52,7 +51,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.MakerAssetID), cliCommand.ReadString(constants.TakerAssetID), @@ -68,12 +67,12 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -120,14 +119,14 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, makerAssetID string, takerAssetID string, makerSplit, takerSplit string, expiryHeight int64) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, makerAssetID string, takerAssetID string, makerSplit, takerSplit string, expiryHeight int64) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - MakerAssetID: makerAssetID, - TakerAssetID: takerAssetID, - MakerSplit: makerSplit, - TakerSplit: takerSplit, - ExpiryHeight: expiryHeight, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + MakerAssetID: makerAssetID, + TakerAssetID: takerAssetID, + MakerSplit: makerSplit, + TakerSplit: takerSplit, + ExpiryHeight: expiryHeight, } } diff --git a/x/orders/transactions/put/transaction_request_test.go b/x/orders/transactions/put/transaction_request_test.go index 419b14db0..ce59fe70a 100644 --- a/x/orders/transactions/put/transaction_request_test.go +++ b/x/orders/transactions/put/transaction_request_test.go @@ -44,7 +44,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("makerAssetID").GetCoinAssetID().(*baseIDs.AssetID) takerAssetID = baseDocuments.NewCoinAsset("takerAssetID").GetCoinAssetID().(*baseIDs.AssetID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: sdkTypes.NewCoins()} + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() expiryHeight = int64(60) makerSplit = sdkTypes.NewInt(60) takerSplit = sdkTypes.NewInt(60) @@ -52,24 +52,24 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, newTransactionRequest(testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight)}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.BaseReq, tt.args.FromID, tt.args.MakerAssetID, tt.args.TakerAssetID, tt.args.MakerSplit, tt.args.TakerSplit, tt.args.ExpiryHeight); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.FromID, tt.args.MakerAssetID, tt.args.TakerAssetID, tt.args.MakerSplit, tt.args.TakerSplit, tt.args.ExpiryHeight); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -108,13 +108,13 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } type args struct { cliCommand helpers.CLICommand @@ -127,13 +127,13 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -148,16 +148,16 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight)) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight)) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } type args struct { rawMessage json.RawMessage @@ -169,12 +169,12 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - tt.fields.BaseReq, + tt.fields.commonTransactionRequest, tt.fields.FromID, tt.fields.MakerAssetID, tt.fields.TakerAssetID, @@ -196,25 +196,25 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - tt.fields.BaseReq, + tt.fields.commonTransactionRequest, tt.fields.FromID, tt.fields.MakerAssetID, tt.fields.TakerAssetID, @@ -222,8 +222,8 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tt.fields.TakerSplit, tt.fields.ExpiryHeight, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -231,13 +231,13 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } tests := []struct { name string @@ -245,12 +245,12 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want sdkTypes.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, NewMessage(fromAccAddress, testFromID, makerAssetID, takerAssetID, makerSplit, takerSplit, base.NewHeight(60)), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, NewMessage(fromAccAddress, testFromID, makerAssetID, takerAssetID, makerSplit, takerSplit, base.NewHeight(60)), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - tt.fields.BaseReq, + tt.fields.commonTransactionRequest, tt.fields.FromID, tt.fields.MakerAssetID, tt.fields.TakerAssetID, @@ -272,13 +272,13 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } type args struct { legacyAmino *codec.LegacyAmino @@ -288,12 +288,12 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - tt.fields.BaseReq, + tt.fields.commonTransactionRequest, tt.fields.FromID, tt.fields.MakerAssetID, tt.fields.TakerAssetID, @@ -308,25 +308,25 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 + commonTransactionRequest rest.CommonTransactionRequest + FromID string + MakerAssetID string + TakerAssetID string + MakerSplit string + TakerSplit string + ExpiryHeight int64 } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - tt.fields.BaseReq, + tt.fields.commonTransactionRequest, tt.fields.FromID, tt.fields.MakerAssetID, tt.fields.TakerAssetID, diff --git a/x/orders/transactions/revoke/transaction_request.go b/x/orders/transactions/revoke/transaction_request.go index 509d3f989..fc866bd12 100644 --- a/x/orders/transactions/revoke/transaction_request.go +++ b/x/orders/transactions/revoke/transaction_request.go @@ -6,7 +6,6 @@ package revoke import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,10 +18,10 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` + rest.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -48,7 +47,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.ToIdentityID), cliCommand.ReadString(constants.ClassificationID), @@ -61,11 +60,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -99,11 +98,11 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, toID string, classificationID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - ToID: toID, - ClassificationID: classificationID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + ToID: toID, + ClassificationID: classificationID, } } diff --git a/x/orders/transactions/revoke/transaction_request_test.go b/x/orders/transactions/revoke/transaction_request_test.go index 8bca95311..2695fcd22 100644 --- a/x/orders/transactions/revoke/transaction_request_test.go +++ b/x/orders/transactions/revoke/transaction_request_test.go @@ -33,28 +33,28 @@ var ( immutables = baseQualified.NewImmutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables = baseQualified.NewMutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) - testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) - testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} + testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) + testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - toID string - classificationID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + toID string + classificationID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, transactionRequest{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.toID, tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.toID, tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -84,10 +84,10 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.ToIdentityID.GetName(), testFromID.AsString()) viper.Set(constants.ClassificationID.GetName(), testClassificationID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { cliCommand helpers.CLICommand @@ -100,15 +100,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -123,13 +123,13 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { rawMessage json.RawMessage @@ -141,15 +141,15 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -165,28 +165,28 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -194,10 +194,10 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string @@ -205,15 +205,15 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, NewMessage(fromAccAddress, testFromID, testFromID, testClassificationID), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, NewMessage(fromAccAddress, testFromID, testFromID, testClassificationID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -229,10 +229,10 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } type args struct { legacyAmino *codec.LegacyAmino @@ -242,15 +242,15 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -259,25 +259,25 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - ToID string - ClassificationID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + ToID string + ClassificationID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + ToID: tt.fields.ToID, + ClassificationID: tt.fields.ClassificationID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) diff --git a/x/orders/transactions/take/transaction_request.go b/x/orders/transactions/take/transaction_request.go index 13843a7b3..1a536ae1b 100644 --- a/x/orders/transactions/take/transaction_request.go +++ b/x/orders/transactions/take/transaction_request.go @@ -6,7 +6,6 @@ package take import ( "encoding/json" "github.com/AssetMantle/modules/utilities/rest" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,10 +18,10 @@ import ( ) type transactionRequest struct { - BaseReq rest.BaseReq `json:"baseReq"` - FromID string `json:"fromID"` - TakerSplit string `json:"takerSplit"` - OrderID string `json:"orderID"` + CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` + FromID string `json:"fromID"` + TakerSplit string `json:"takerSplit"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -48,7 +47,7 @@ func (transactionRequest transactionRequest) Validate() error { } func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLICommand, context client.Context) (helpers.TransactionRequest, error) { return newTransactionRequest( - cliCommand.ReadBaseReq(context), + cliCommand.ReadCommonTransactionRequest(context), cliCommand.ReadString(constants.FromIdentityID), cliCommand.ReadString(constants.TakerSplit), cliCommand.ReadString(constants.OrderID), @@ -61,11 +60,11 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetBaseReq() rest.BaseReq { - return transactionRequest.BaseReq +func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { + return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { - from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetBaseReq().From) + from, err := sdkTypes.AccAddressFromBech32(transactionRequest.GetCommonTransactionRequest().GetFrom()) if err != nil { return nil, err } @@ -98,11 +97,11 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(baseReq rest.BaseReq, fromID string, takerSplit string, orderID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, takerSplit string, orderID string) helpers.TransactionRequest { return transactionRequest{ - BaseReq: baseReq, - FromID: fromID, - TakerSplit: takerSplit, - OrderID: orderID, + CommonTransactionRequest: commonTransactionRequest, + FromID: fromID, + TakerSplit: takerSplit, + OrderID: orderID, } } diff --git a/x/orders/transactions/take/transaction_request_test.go b/x/orders/transactions/take/transaction_request_test.go index 10d94f932..c1ec0e2d7 100644 --- a/x/orders/transactions/take/transaction_request_test.go +++ b/x/orders/transactions/take/transaction_request_test.go @@ -33,30 +33,30 @@ var ( immutables = baseQualified.NewImmutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables = baseQualified.NewMutables(base.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) - testClassificationID = baseIDs.NewClassificationID(immutables, mutables) - testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - testBaseRequest = rest.BaseReq{From: fromAddress, ChainID: "test", Fees: types.NewCoins()} - takerSplit = types.NewInt(60) + testClassificationID = baseIDs.NewClassificationID(immutables, mutables) + testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) + testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) + commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + takerSplit = types.NewInt(60) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - baseReq rest.BaseReq - fromID string - takerSplit string - orderID string + commonTransactionRequest rest.CommonTransactionRequest + fromID string + takerSplit string + orderID string } tests := []struct { name string args args want helpers.TransactionRequest }{ - {"+ve", args{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, transactionRequest{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}}, + {"+ve", args{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, transactionRequest{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newTransactionRequest(tt.args.baseReq, tt.args.fromID, tt.args.takerSplit, tt.args.orderID); !reflect.DeepEqual(got, tt.want) { + if got := newTransactionRequest(tt.args.commonTransactionRequest, tt.args.fromID, tt.args.takerSplit, tt.args.orderID); !reflect.DeepEqual(got, tt.want) { t.Errorf("newTransactionRequest() = %v, want %v", got, tt.want) } }) @@ -86,10 +86,10 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.TakerSplit.GetName(), takerSplit.String()) viper.Set(constants.OrderID.GetName(), testOrderID.AsString()) type fields struct { - BaseReq rest.BaseReq - FromID string - TakerSplit string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + TakerSplit string + OrderID string } type args struct { cliCommand helpers.CLICommand @@ -102,15 +102,15 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + TakerSplit: tt.fields.TakerSplit, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.FromCLI(tt.args.cliCommand, tt.args.context) if (err != nil) != tt.wantErr { @@ -125,13 +125,13 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString())) + jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString())) require.NoError(t, err) type fields struct { - BaseReq rest.BaseReq - FromID string - TakerSplit string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + TakerSplit string + OrderID string } type args struct { rawMessage json.RawMessage @@ -143,15 +143,15 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{jsonMessage}, newTransactionRequest(testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + TakerSplit: tt.fields.TakerSplit, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.FromJSON(tt.args.rawMessage) if (err != nil) != tt.wantErr { @@ -167,28 +167,28 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - TakerSplit string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + TakerSplit string + OrderID string } tests := []struct { name string fields fields - want rest.BaseReq + want rest.CommonTransactionRequest }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, testBaseRequest}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, commonTransactionRequest}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + TakerSplit: tt.fields.TakerSplit, + OrderID: tt.fields.OrderID, } - if got := transactionRequest.GetBaseReq(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("GetBaseReq() = %v, want %v", got, tt.want) + if got := transactionRequest.GetCommonTransactionRequest(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("GetCommonTransactionRequest() = %v, want %v", got, tt.want) } }) } @@ -196,10 +196,10 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - TakerSplit string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + TakerSplit string + OrderID string } tests := []struct { name string @@ -207,15 +207,15 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { want types.Msg wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, NewMessage(fromAccAddress, testFromID, takerSplit, testOrderID), false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, NewMessage(fromAccAddress, testFromID, takerSplit, testOrderID), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + TakerSplit: tt.fields.TakerSplit, + OrderID: tt.fields.OrderID, } got, err := transactionRequest.MakeMsg() if (err != nil) != tt.wantErr { @@ -231,10 +231,10 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - TakerSplit string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + TakerSplit string + OrderID string } type args struct { legacyAmino *codec.LegacyAmino @@ -244,15 +244,15 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fields fields args args }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { tr := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + TakerSplit: tt.fields.TakerSplit, + OrderID: tt.fields.OrderID, } tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) }) @@ -261,25 +261,25 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - BaseReq rest.BaseReq - FromID string - TakerSplit string - OrderID string + commonTransactionRequest rest.CommonTransactionRequest + FromID string + TakerSplit string + OrderID string } tests := []struct { name string fields fields wantErr bool }{ - {"+ve", fields{testBaseRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, false}, + {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { transactionRequest := transactionRequest{ - BaseReq: tt.fields.BaseReq, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, + CommonTransactionRequest: tt.fields.commonTransactionRequest, + FromID: tt.fields.FromID, + TakerSplit: tt.fields.TakerSplit, + OrderID: tt.fields.OrderID, } if err := transactionRequest.Validate(); (err != nil) != tt.wantErr { t.Errorf("ValidateBasic() error = %v, wantErr %v", err, tt.wantErr) From bdb9bd84e47ed6f195f4074f1f9474fdfe3a64d1 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 29 Jul 2024 19:32:38 +0530 Subject: [PATCH 17/64] refactor: baseReq to commonTransactionRequest Signed-off-by: Deepanshu Tripathi --- helpers/base/cli_command.go | 5 +- helpers/base/cli_command_test.go | 7 +- helpers/cli_command.go | 3 +- helpers/common_transaction_request.go | 26 ++++ helpers/legacy_codec.go | 1 + helpers/transaction_request.go | 3 +- utilities/rest/common_transaction_request.go | 144 ------------------ utilities/rest/queuing/broadcast.go | 4 +- utilities/rest/queuing/kafka_types.go | 10 +- .../transactions/burn/transaction_request.go | 11 +- .../burn/transaction_request_test.go | 27 ++-- .../define/transaction_request.go | 17 +-- .../define/transaction_request_test.go | 27 ++-- .../deputize/transaction_request.go | 27 ++-- .../deputize/transaction_request_test.go | 27 ++-- .../transactions/mint/transaction_request.go | 21 ++- .../mint/transaction_request_test.go | 27 ++-- .../mutate/transaction_request.go | 15 +- .../mutate/transaction_request_test.go | 27 ++-- .../renumerate/transaction_request.go | 11 +- .../renumerate/transaction_request_test.go | 27 ++-- .../revoke/transaction_request.go | 13 +- .../revoke/transaction_request_test.go | 27 ++-- .../transactions/send/transaction_request.go | 15 +- .../send/transaction_request_test.go | 25 ++- .../unwrap/transaction_request.go | 11 +- .../unwrap/transaction_request_test.go | 25 ++- .../transactions/wrap/transaction_request.go | 11 +- .../wrap/transaction_request_test.go | 25 ++- .../define/transaction_request.go | 17 +-- .../define/transaction_request_test.go | 31 ++-- .../deputize/transaction_request.go | 25 ++- .../deputize/transaction_request_test.go | 33 ++-- .../transactions/issue/transaction_request.go | 19 ++- .../issue/transaction_request_test.go | 23 ++- .../transactions/name/transaction_request.go | 11 +- .../name/transaction_request_test.go | 22 ++- .../provision/transaction_request.go | 11 +- .../provision/transaction_request_test.go | 21 ++- .../transactions/quash/transaction_request.go | 11 +- .../quash/transaction_request_test.go | 21 ++- .../revoke/transaction_request.go | 13 +- .../revoke/transaction_request_test.go | 21 ++- .../unprovision/transaction_request.go | 11 +- .../unprovision/transaction_request_test.go | 21 ++- .../update/transaction_request.go | 15 +- .../update/transaction_request_test.go | 23 ++- .../reveal/transaction_request.go | 9 +- .../reveal/transaction_request_test.go | 9 +- .../cancel/transaction_request.go | 11 +- .../cancel/transaction_request_test.go | 19 ++- .../define/transaction_request.go | 17 +-- .../define/transaction_request_test.go | 19 ++- .../deputize/transaction_request.go | 25 ++- .../deputize/transaction_request_test.go | 19 ++- .../transactions/get/transaction_request.go | 11 +- .../get/transaction_request_test.go | 19 ++- .../immediate/transaction_request.go | 31 ++-- .../immediate/transaction_request_test.go | 19 ++- .../transactions/make/transaction_request.go | 31 ++-- .../make/transaction_request_test.go | 19 ++- .../modify/transaction_request.go | 21 ++- .../modify/transaction_request_test.go | 19 ++- .../transactions/put/transaction_request.go | 19 ++- .../put/transaction_request_test.go | 19 ++- .../revoke/transaction_request.go | 13 +- .../revoke/transaction_request_test.go | 19 ++- .../transactions/take/transaction_request.go | 13 +- .../take/transaction_request_test.go | 19 ++- 69 files changed, 593 insertions(+), 775 deletions(-) create mode 100644 helpers/common_transaction_request.go delete mode 100644 utilities/rest/common_transaction_request.go diff --git a/helpers/base/cli_command.go b/helpers/base/cli_command.go index 73643bd42..064e17029 100644 --- a/helpers/base/cli_command.go +++ b/helpers/base/cli_command.go @@ -5,7 +5,6 @@ package base import ( "fmt" - "github.com/AssetMantle/modules/utilities/rest" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" @@ -84,8 +83,8 @@ func (cliCommand cliCommand) ReadString(cliFlag helpers.CLIFlag) string { panic(fmt.Errorf("uregistered flag %v type %T", cliFlag.GetName(), cliFlag.GetValue())) } -func (cliCommand cliCommand) ReadCommonTransactionRequest(context client.Context) rest.CommonTransactionRequest { - return rest.NewCommonTransactionRequestFromContext(context) +func (cliCommand cliCommand) ReadCommonTransactionRequest(context client.Context) helpers.CommonTransactionRequest { + return NewCommonTransactionRequestFromContext(context) } func (cliCommand cliCommand) CreateCommand(runE func(command *cobra.Command, args []string) error) *cobra.Command { command := &cobra.Command{ diff --git a/helpers/base/cli_command_test.go b/helpers/base/cli_command_test.go index 5c7006e45..1b453eaf8 100644 --- a/helpers/base/cli_command_test.go +++ b/helpers/base/cli_command_test.go @@ -4,7 +4,6 @@ package base import ( - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -103,11 +102,11 @@ func Test_cliCommand_ReadBaseReq(t *testing.T) { name string fields fields args args - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ - {"+ve", fields{"", "", "", testCliFlagList}, args{client.Context{ChainID: "chainID"}}, rest.PrototypeCommonTransactionRequest()}, - {"-ve for nil", fields{"", "", "", nil}, args{client.Context{ChainID: ""}}, rest.PrototypeCommonTransactionRequest()}, + {"+ve", fields{"", "", "", testCliFlagList}, args{client.Context{ChainID: "chainID"}}, PrototypeCommonTransactionRequest()}, + {"-ve for nil", fields{"", "", "", nil}, args{client.Context{ChainID: ""}}, PrototypeCommonTransactionRequest()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/helpers/cli_command.go b/helpers/cli_command.go index 43b05cbaa..812121fd9 100644 --- a/helpers/cli_command.go +++ b/helpers/cli_command.go @@ -4,7 +4,6 @@ package helpers import ( - "github.com/AssetMantle/modules/utilities/rest" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/cobra" @@ -16,7 +15,7 @@ type CLICommand interface { ReadBool(CLIFlag) bool ReadString(CLIFlag) string //TODO see if it can be replaced with NewCommonTransactionRequestFromContext - ReadCommonTransactionRequest(client.Context) rest.CommonTransactionRequest + ReadCommonTransactionRequest(client.Context) CommonTransactionRequest CreateCommand(func(command *cobra.Command, args []string) error) *cobra.Command } diff --git a/helpers/common_transaction_request.go b/helpers/common_transaction_request.go new file mode 100644 index 000000000..9f867c39b --- /dev/null +++ b/helpers/common_transaction_request.go @@ -0,0 +1,26 @@ +package helpers + +import ( + sdkTypes "github.com/cosmos/cosmos-sdk/types" + "net/http" +) + +type CommonTransactionRequest interface { + GetFrom() string + SetFrom(string) CommonTransactionRequest + GetChainID() string + SetChainID(string) CommonTransactionRequest + GetFees() sdkTypes.Coins + IsSimulated() bool + GetGasPrices() sdkTypes.DecCoins + GetTimeoutHeight() uint64 + GetSequence() uint64 + GetMemo() string + GetGas() string + GetGasAdjustment() string + GetAccountNumber() uint64 + SetAccountNumber(uint64) CommonTransactionRequest + Validate() error + Sanitize() CommonTransactionRequest + ValidateBasic(responseWriter http.ResponseWriter) bool +} diff --git a/helpers/legacy_codec.go b/helpers/legacy_codec.go index 9f9a52933..4d631d72f 100644 --- a/helpers/legacy_codec.go +++ b/helpers/legacy_codec.go @@ -8,6 +8,7 @@ func RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { legacyAmino.RegisterInterface((*Mappable)(nil), nil) legacyAmino.RegisterInterface((*QueryResponse)(nil), nil) legacyAmino.RegisterInterface((*QueryRequest)(nil), nil) + legacyAmino.RegisterInterface((*CommonTransactionRequest)(nil), nil) legacyAmino.RegisterInterface((*TransactionRequest)(nil), nil) legacyAmino.RegisterInterface((*Request)(nil), nil) legacyAmino.RegisterInterface((*Error)(nil), nil) diff --git a/helpers/transaction_request.go b/helpers/transaction_request.go index 3e9ff4ff0..2e1fba270 100644 --- a/helpers/transaction_request.go +++ b/helpers/transaction_request.go @@ -5,14 +5,13 @@ package helpers import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" ) type TransactionRequest interface { - GetCommonTransactionRequest() rest.CommonTransactionRequest + GetCommonTransactionRequest() CommonTransactionRequest FromCLI(CLICommand, client.Context) (TransactionRequest, error) FromJSON(json.RawMessage) (TransactionRequest, error) diff --git a/utilities/rest/common_transaction_request.go b/utilities/rest/common_transaction_request.go deleted file mode 100644 index 176874430..000000000 --- a/utilities/rest/common_transaction_request.go +++ /dev/null @@ -1,144 +0,0 @@ -package rest - -import ( - "fmt" - "github.com/cosmos/cosmos-sdk/client" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "net/http" - "strings" -) - -type CommonTransactionRequest interface { - GetFrom() string - SetFrom(string) CommonTransactionRequest - GetChainID() string - SetChainID(string) CommonTransactionRequest - GetFees() sdkTypes.Coins - IsSimulated() bool - GetGasPrices() sdkTypes.DecCoins - GetTimeoutHeight() uint64 - GetSequence() uint64 - GetMemo() string - GetGas() string - GetGasAdjustment() string - GetAccountNumber() uint64 - SetAccountNumber(uint64) CommonTransactionRequest - Validate() error - Sanitize() CommonTransactionRequest - ValidateBasic(responseWriter http.ResponseWriter) bool -} - -type commonTransactionRequest struct { - From string `json:"from"` - Memo string `json:"memo"` - TimeoutHeight uint64 `json:"timeout_height"` - AccountNumber uint64 `json:"account_number"` - Sequence uint64 `json:"sequence"` - ChainID string `json:"chain_id"` - Gas string `json:"gas"` - Fees sdkTypes.Coins `json:"fees"` - GasPrices sdkTypes.DecCoins `json:"gas_prices"` - Simulate bool `json:"simulate"` - GasAdjustment string `json:"gas_adjustment"` -} - -var _ CommonTransactionRequest = commonTransactionRequest{} - -func (commonTransactionRequest commonTransactionRequest) SetFrom(from string) CommonTransactionRequest { - commonTransactionRequest.From = from - return commonTransactionRequest -} -func (commonTransactionRequest commonTransactionRequest) SetAccountNumber(accountNumber uint64) CommonTransactionRequest { - commonTransactionRequest.AccountNumber = accountNumber - return commonTransactionRequest -} -func (commonTransactionRequest commonTransactionRequest) GetAccountNumber() uint64 { - return commonTransactionRequest.AccountNumber -} -func (commonTransactionRequest commonTransactionRequest) GetGas() string { - return commonTransactionRequest.Gas -} -func (commonTransactionRequest commonTransactionRequest) GetGasAdjustment() string { - return commonTransactionRequest.GasAdjustment -} -func (commonTransactionRequest commonTransactionRequest) GetMemo() string { - return commonTransactionRequest.Memo -} -func (commonTransactionRequest commonTransactionRequest) GetSequence() uint64 { - return commonTransactionRequest.Sequence -} -func (commonTransactionRequest commonTransactionRequest) GetTimeoutHeight() uint64 { - return commonTransactionRequest.TimeoutHeight -} -func (commonTransactionRequest commonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { - return commonTransactionRequest.GasPrices -} -func (commonTransactionRequest commonTransactionRequest) IsSimulated() bool { - return commonTransactionRequest.Simulate -} -func (commonTransactionRequest commonTransactionRequest) GetFrom() string { - return commonTransactionRequest.From -} -func (commonTransactionRequest commonTransactionRequest) GetChainID() string { - return commonTransactionRequest.ChainID -} -func (commonTransactionRequest commonTransactionRequest) SetChainID(chainIDString string) CommonTransactionRequest { - commonTransactionRequest.ChainID = chainIDString - return commonTransactionRequest -} -func (commonTransactionRequest commonTransactionRequest) GetFees() sdkTypes.Coins { - return commonTransactionRequest.Fees -} -func (commonTransactionRequest commonTransactionRequest) Validate() error { - if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { - return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) - } - - if !commonTransactionRequest.Simulate { - if len(commonTransactionRequest.ChainID) == 0 { - return fmt.Errorf("chain-id required but not specified") - } - if !commonTransactionRequest.Fees.IsZero() && !commonTransactionRequest.GasPrices.IsZero() { - return fmt.Errorf("cannot provide both fees and gas prices") - } - if !commonTransactionRequest.Fees.IsValid() && !commonTransactionRequest.GasPrices.IsValid() { - } - return fmt.Errorf("invalid fees or gas prices provided") - } - - return nil -} -func (commonTransactionRequest commonTransactionRequest) Sanitize() CommonTransactionRequest { - return NewCommonTransactionRequest(commonTransactionRequest.From, commonTransactionRequest.Memo, commonTransactionRequest.ChainID, commonTransactionRequest.Gas, commonTransactionRequest.GasAdjustment, commonTransactionRequest.AccountNumber, commonTransactionRequest.TimeoutHeight, commonTransactionRequest.Sequence, commonTransactionRequest.Fees, commonTransactionRequest.GasPrices, commonTransactionRequest.Simulate) -} -func (commonTransactionRequest commonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { - if err := commonTransactionRequest.Validate(); err != nil { - WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) - return false - } - - return true -} - -func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees sdkTypes.Coins, gasPrices sdkTypes.DecCoins, simulate bool) CommonTransactionRequest { - return commonTransactionRequest{ - From: strings.TrimSpace(from), - Memo: strings.TrimSpace(memo), - ChainID: strings.TrimSpace(chainID), - Fees: fees, - GasPrices: gasPrices, - Gas: strings.TrimSpace(gas), - GasAdjustment: strings.TrimSpace(gasAdjustment), - AccountNumber: accountNumber, - Sequence: sequence, - TimeoutHeight: timeOutHeight, - Simulate: simulate, - } -} -func PrototypeCommonTransactionRequest() CommonTransactionRequest { - return commonTransactionRequest{} -} - -func NewCommonTransactionRequestFromContext(context client.Context) CommonTransactionRequest { - return NewCommonTransactionRequest(context.From, "", context.ChainID, "", "", uint64(context.Height), 0, 0, sdkTypes.Coins{}, sdkTypes.DecCoins{}, context.Simulate) -} diff --git a/utilities/rest/queuing/broadcast.go b/utilities/rest/queuing/broadcast.go index cba5faee1..da9b0dea2 100644 --- a/utilities/rest/queuing/broadcast.go +++ b/utilities/rest/queuing/broadcast.go @@ -1,7 +1,7 @@ package queuing import ( - "github.com/AssetMantle/modules/utilities/rest" + "github.com/AssetMantle/modules/helpers" "reflect" "strconv" @@ -13,7 +13,7 @@ import ( "github.com/AssetMantle/modules/utilities/random" ) -func QueueOrBroadcastTransaction(context client.Context, commonTransactionRequest rest.CommonTransactionRequest, msg sdkTypes.Msg) (err error) { +func QueueOrBroadcastTransaction(context client.Context, commonTransactionRequest helpers.CommonTransactionRequest, msg sdkTypes.Msg) (err error) { fromAddress, fromName, _, err := client.GetFromFields(context, context.Keyring, commonTransactionRequest.GetFrom()) if err != nil { return err diff --git a/utilities/rest/queuing/kafka_types.go b/utilities/rest/queuing/kafka_types.go index d3f67ab4f..4ee39d424 100755 --- a/utilities/rest/queuing/kafka_types.go +++ b/utilities/rest/queuing/kafka_types.go @@ -4,7 +4,7 @@ package queuing import ( - "github.com/AssetMantle/modules/utilities/rest" + "github.com/AssetMantle/modules/helpers" "github.com/Shopify/sarama" "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" @@ -17,14 +17,14 @@ type TicketID string // kafkaMsg : is a store that can be stored in kafka queues type kafkaMsg struct { - Msg sdk.Msg `json:"msg"` - TicketID TicketID `json:"TicketID"` - CommonTransactionRequest rest.CommonTransactionRequest `json:"commonTransactionRequest"` + Msg sdk.Msg `json:"msg"` + TicketID TicketID `json:"TicketID"` + CommonTransactionRequest helpers.CommonTransactionRequest `json:"commonTransactionRequest"` KafkaCliCtx kafkaCliCtx } // newKafkaMsgFromRest : makes a msg to send to kafka queue -func newKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, commonTransactionRequest rest.CommonTransactionRequest, context client.Context) kafkaMsg { +func newKafkaMsgFromRest(msg sdk.Msg, ticketID TicketID, commonTransactionRequest helpers.CommonTransactionRequest, context client.Context) kafkaMsg { kafkaCtx := kafkaCliCtx{ OutputFormat: context.OutputFormat, ChainID: context.ChainID, diff --git a/x/assets/transactions/burn/transaction_request.go b/x/assets/transactions/burn/transaction_request.go index 4d40dbcd0..40687cbc9 100644 --- a/x/assets/transactions/burn/transaction_request.go +++ b/x/assets/transactions/burn/transaction_request.go @@ -5,7 +5,6 @@ package burn import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - AssetID string `json:"assetID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + AssetID string `json:"assetID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, assetID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, assetID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/burn/transaction_request_test.go b/x/assets/transactions/burn/transaction_request_test.go index bcd511e0a..2d089c677 100644 --- a/x/assets/transactions/burn/transaction_request_test.go +++ b/x/assets/transactions/burn/transaction_request_test.go @@ -6,7 +6,6 @@ package burn import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -18,17 +17,17 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string assetID string } @@ -65,12 +64,12 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID}) viper.Set(constants.AssetID.GetName(), testAssetID.AsString()) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -85,7 +84,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: fromID.AsString(), AssetID: testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: fromID.AsString(), AssetID: testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -108,7 +107,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -122,7 +121,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID.(*baseIDs.IdentityID), testAssetID.(*baseIDs.AssetID)}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID.(*baseIDs.IdentityID), testAssetID.(*baseIDs.AssetID)}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -145,14 +144,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, commonTransactionRequest}, } @@ -172,7 +171,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -205,7 +204,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -233,7 +232,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } diff --git a/x/assets/transactions/define/transaction_request.go b/x/assets/transactions/define/transaction_request.go index ae89d13b0..1e260b9cf 100644 --- a/x/assets/transactions/define/transaction_request.go +++ b/x/assets/transactions/define/transaction_request.go @@ -5,7 +5,6 @@ package define import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,12 +18,12 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -65,7 +64,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -117,7 +116,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/define/transaction_request_test.go b/x/assets/transactions/define/transaction_request_test.go index 0c76b2ffe..5e6d8dab7 100644 --- a/x/assets/transactions/define/transaction_request_test.go +++ b/x/assets/transactions/define/transaction_request_test.go @@ -6,7 +6,6 @@ package define import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" @@ -21,12 +20,12 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() immutableMetaPropertiesString = "testImmutableMeta1:S|immutableMeta" immutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testImmutableMeta1"), baseData.NewStringData("immutableMeta"))) immutablePropertiesString = "testImmutable1:S|immutable" @@ -39,7 +38,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string immutableMetaProperties string immutableProperties string @@ -79,7 +78,7 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) viper.Set(constants.ImmutableMetaProperties.GetName(), immutableMetaPropertiesString) viper.Set(constants.ImmutableProperties.GetName(), immutablePropertiesString) @@ -87,7 +86,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -105,7 +104,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -131,7 +130,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -148,7 +147,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -174,7 +173,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -184,7 +183,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -207,7 +206,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -246,7 +245,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -280,7 +279,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string diff --git a/x/assets/transactions/deputize/transaction_request.go b/x/assets/transactions/deputize/transaction_request.go index 0b3408bd4..b88696ab4 100644 --- a/x/assets/transactions/deputize/transaction_request.go +++ b/x/assets/transactions/deputize/transaction_request.go @@ -5,7 +5,6 @@ package deputize import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,17 +18,17 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - MaintainedProperties string `json:"maintainedProperties"` - CanMintAsset bool `json:"canMintAsset"` - CanRenumerateAsset bool `json:"canRenumerateAsset"` - CanBurnAsset bool `json:"canBurnAsset"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + MaintainedProperties string `json:"maintainedProperties"` + CanMintAsset bool `json:"canMintAsset"` + CanRenumerateAsset bool `json:"canRenumerateAsset"` + CanBurnAsset bool `json:"canBurnAsset"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -75,7 +74,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -125,7 +124,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canMintAsset bool, canRenumerateAsset bool, canBurnAsset bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canMintAsset bool, canRenumerateAsset bool, canBurnAsset bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/deputize/transaction_request_test.go b/x/assets/transactions/deputize/transaction_request_test.go index b2db289f1..141b432fe 100644 --- a/x/assets/transactions/deputize/transaction_request_test.go +++ b/x/assets/transactions/deputize/transaction_request_test.go @@ -6,7 +6,6 @@ package deputize import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" @@ -21,19 +20,19 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() mutableMetaPropertiesString = "testMutableMeta1:S|mutableMeta" mutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testMutableMeta1"), baseData.NewStringData("mutableMeta"))) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -78,7 +77,7 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.ToIdentityID, constants.FromIdentityID, constants.ClassificationID, constants.MaintainedProperties, constants.CanMintAsset, constants.CanBurnAsset, constants.CanRenumerateAsset, constants.CanAddMaintainer, constants.CanRemoveMaintainer, constants.CanMutateMaintainer}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.ToIdentityID, constants.FromIdentityID, constants.ClassificationID, constants.MaintainedProperties, constants.CanMintAsset, constants.CanBurnAsset, constants.CanRenumerateAsset, constants.CanAddMaintainer, constants.CanRemoveMaintainer, constants.CanMutateMaintainer}) viper.Set(constants.ToIdentityID.GetName(), fromID.AsString()) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) @@ -91,7 +90,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.CanRemoveMaintainer.GetName(), true) viper.Set(constants.CanMutateMaintainer.GetName(), true) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -114,7 +113,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), mutableMetaPropertiesString, true, true, true, true, true, true}, false}, + {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), mutableMetaPropertiesString, true, true, true, true, true, true}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -145,7 +144,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -167,7 +166,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}))}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}))}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -198,7 +197,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -213,7 +212,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, commonTransactionRequest}, } @@ -241,7 +240,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -290,7 +289,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -334,7 +333,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/assets/transactions/mint/transaction_request.go b/x/assets/transactions/mint/transaction_request.go index 559cef8e5..e251a03a1 100644 --- a/x/assets/transactions/mint/transaction_request.go +++ b/x/assets/transactions/mint/transaction_request.go @@ -5,7 +5,6 @@ package mint import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,14 +18,14 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -69,7 +68,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -133,7 +132,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/mint/transaction_request_test.go b/x/assets/transactions/mint/transaction_request_test.go index 9b38d7ac5..37483177a 100644 --- a/x/assets/transactions/mint/transaction_request_test.go +++ b/x/assets/transactions/mint/transaction_request_test.go @@ -6,7 +6,6 @@ package mint import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" @@ -21,12 +20,12 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() immutableMetaPropertiesString = "testImmutableMeta1:S|immutableMeta" immutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testImmutableMeta1"), baseData.NewStringData("immutableMeta"))) immutablePropertiesString = "testImmutable1:S|immutable" @@ -39,7 +38,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -81,7 +80,7 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.ToIdentityID.GetName(), fromID.AsString()) @@ -91,7 +90,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -111,7 +110,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -139,7 +138,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -158,7 +157,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -186,7 +185,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -198,7 +197,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -223,7 +222,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -266,7 +265,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -304,7 +303,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/assets/transactions/mutate/transaction_request.go b/x/assets/transactions/mutate/transaction_request.go index 1a8517160..ac6163386 100644 --- a/x/assets/transactions/mutate/transaction_request.go +++ b/x/assets/transactions/mutate/transaction_request.go @@ -5,7 +5,6 @@ package mutate import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,11 +18,11 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - AssetID string `json:"assetID"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + AssetID string `json:"assetID"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -63,7 +62,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -108,7 +107,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, assetID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, assetID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/mutate/transaction_request_test.go b/x/assets/transactions/mutate/transaction_request_test.go index 12bc6c3a2..07edbaad4 100644 --- a/x/assets/transactions/mutate/transaction_request_test.go +++ b/x/assets/transactions/mutate/transaction_request_test.go @@ -6,7 +6,6 @@ package mutate import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -21,12 +20,12 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() mutableMetaPropertiesString = "testMutableMeta1:S|mutableMeta" mutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testMutableMeta1"), baseData.NewStringData("mutableMeta"))) mutablePropertiesString = "testMutable1:S|mutable" @@ -35,7 +34,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string assetID string mutableMetaProperties string @@ -74,14 +73,14 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID, constants.MutableMetaProperties, constants.MutableProperties}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID, constants.MutableMetaProperties, constants.MutableProperties}) viper.Set(constants.AssetID.GetName(), testAssetID.AsString()) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string MutableMetaProperties string @@ -98,7 +97,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -123,7 +122,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string MutableMetaProperties string @@ -139,7 +138,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -164,7 +163,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string MutableMetaProperties string @@ -173,7 +172,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -195,7 +194,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string MutableMetaProperties string @@ -232,7 +231,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string MutableMetaProperties string @@ -264,7 +263,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string MutableMetaProperties string diff --git a/x/assets/transactions/renumerate/transaction_request.go b/x/assets/transactions/renumerate/transaction_request.go index 2c006bb33..5fc1b75fa 100644 --- a/x/assets/transactions/renumerate/transaction_request.go +++ b/x/assets/transactions/renumerate/transaction_request.go @@ -5,7 +5,6 @@ package renumerate import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - AssetID string `json:"assetID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + AssetID string `json:"assetID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, assetID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, assetID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/renumerate/transaction_request_test.go b/x/assets/transactions/renumerate/transaction_request_test.go index 986e1d09f..051313f6f 100644 --- a/x/assets/transactions/renumerate/transaction_request_test.go +++ b/x/assets/transactions/renumerate/transaction_request_test.go @@ -6,7 +6,6 @@ package renumerate import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -17,17 +16,17 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string assetID string } @@ -64,12 +63,12 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID}) viper.Set(constants.AssetID.GetName(), testAssetID.AsString()) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -84,7 +83,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -107,7 +106,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -121,7 +120,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{types.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -144,14 +143,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, commonTransactionRequest}, } @@ -171,7 +170,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -204,7 +203,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } @@ -232,7 +231,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string AssetID string } diff --git a/x/assets/transactions/revoke/transaction_request.go b/x/assets/transactions/revoke/transaction_request.go index 732606a91..930b98575 100644 --- a/x/assets/transactions/revoke/transaction_request.go +++ b/x/assets/transactions/revoke/transaction_request.go @@ -5,7 +5,6 @@ package revoke import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,10 +17,10 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -60,7 +59,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -98,7 +97,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/revoke/transaction_request_test.go b/x/assets/transactions/revoke/transaction_request_test.go index ea6bc9808..1c8604ad7 100644 --- a/x/assets/transactions/revoke/transaction_request_test.go +++ b/x/assets/transactions/revoke/transaction_request_test.go @@ -6,7 +6,6 @@ package revoke import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -17,17 +16,17 @@ import ( "github.com/spf13/viper" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -65,13 +64,13 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID}) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.ToIdentityID.GetName(), fromID.AsString()) viper.Set(constants.ClassificationID.GetName(), classificationID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -87,7 +86,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -111,7 +110,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -126,7 +125,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{sdkTypes.MustSortJSON(base.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -150,7 +149,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -158,7 +157,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, commonTransactionRequest}, } @@ -179,7 +178,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -214,7 +213,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -244,7 +243,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/assets/transactions/send/transaction_request.go b/x/assets/transactions/send/transaction_request.go index a4cbd7ef0..91f7b580d 100644 --- a/x/assets/transactions/send/transaction_request.go +++ b/x/assets/transactions/send/transaction_request.go @@ -5,7 +5,6 @@ package send import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,11 +17,11 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - AssetID string `json:"assetID"` - Value string `json:"value"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + AssetID string `json:"assetID"` + Value string `json:"value"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -62,7 +61,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -105,7 +104,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, assetID string, value string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, assetID string, value string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/send/transaction_request_test.go b/x/assets/transactions/send/transaction_request_test.go index 0ab139e19..02036837e 100644 --- a/x/assets/transactions/send/transaction_request_test.go +++ b/x/assets/transactions/send/transaction_request_test.go @@ -6,7 +6,6 @@ package send import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" baseIDs "github.com/AssetMantle/schema/ids/base" "reflect" "testing" @@ -19,20 +18,20 @@ import ( "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( fromAccAddress, _ = types.AccAddressFromBech32(fromAddress.String()) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() fromID = baseIDs.PrototypeIdentityID().(*baseIDs.IdentityID) testRate = types.OneInt() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string assetID string @@ -71,14 +70,14 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.ToIdentityID, constants.FromIdentityID, constants.AssetID, constants.Value}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.ToIdentityID, constants.FromIdentityID, constants.AssetID, constants.Value}) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.ToIdentityID.GetName(), fromID.AsString()) viper.Set(constants.AssetID.GetName(), assetID.AsString()) viper.Set(constants.Value.GetName(), testRate.String()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string AssetID string @@ -95,7 +94,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -122,7 +121,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String())) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string AssetID string @@ -163,7 +162,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string AssetID string @@ -172,7 +171,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, commonTransactionRequest}, } @@ -194,7 +193,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string AssetID string @@ -231,7 +230,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string AssetID string @@ -263,7 +262,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string AssetID string diff --git a/x/assets/transactions/unwrap/transaction_request.go b/x/assets/transactions/unwrap/transaction_request.go index 6a8ce1e5d..233be8e58 100644 --- a/x/assets/transactions/unwrap/transaction_request.go +++ b/x/assets/transactions/unwrap/transaction_request.go @@ -5,7 +5,6 @@ package unwrap import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - Coins string `json:"coins"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + Coins string `json:"coins"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, coins string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, coins string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/unwrap/transaction_request_test.go b/x/assets/transactions/unwrap/transaction_request_test.go index 195e2637d..1021f14f7 100644 --- a/x/assets/transactions/unwrap/transaction_request_test.go +++ b/x/assets/transactions/unwrap/transaction_request_test.go @@ -7,9 +7,8 @@ import ( "encoding/json" "fmt" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/rest" baseData "github.com/AssetMantle/schema/data/base" baseDocuments "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -29,7 +28,7 @@ import ( var ( fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) classificationID = baseIDs.NewClassificationID(immutables, mutables) @@ -43,7 +42,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string Coins string } @@ -80,13 +79,13 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID, constants.Value}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID, constants.FromIdentityID, constants.Value}) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.AssetID.GetName(), assetID.AsString()) viper.Set(constants.Value.GetName(), testRate.String()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -101,7 +100,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -126,7 +125,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String())) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -163,14 +162,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, commonTransactionRequest}, } @@ -190,7 +189,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -223,7 +222,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -251,7 +250,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } diff --git a/x/assets/transactions/wrap/transaction_request.go b/x/assets/transactions/wrap/transaction_request.go index 5d5018711..e061ac56d 100644 --- a/x/assets/transactions/wrap/transaction_request.go +++ b/x/assets/transactions/wrap/transaction_request.go @@ -5,7 +5,6 @@ package wrap import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - Coins string `json:"coins"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + Coins string `json:"coins"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyA func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, coins string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, coins string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/assets/transactions/wrap/transaction_request_test.go b/x/assets/transactions/wrap/transaction_request_test.go index 542d7c9e7..12aad2d5c 100644 --- a/x/assets/transactions/wrap/transaction_request_test.go +++ b/x/assets/transactions/wrap/transaction_request_test.go @@ -6,7 +6,6 @@ package wrap import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" @@ -23,14 +22,14 @@ import ( "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) var ( fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) classificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) @@ -40,7 +39,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string coins string } @@ -77,12 +76,12 @@ func Test_requestPrototype(t *testing.T) { } func Test_transactionRequest_FromCLI(t *testing.T) { - cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.Coins, constants.FromIdentityID}) + cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.Coins, constants.FromIdentityID}) viper.Set(constants.FromIdentityID.GetName(), fromID.AsString()) viper.Set(constants.Coins.GetName(), coins.String()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -97,7 +96,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { want helpers.TransactionRequest wantErr bool }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(base.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, transactionRequest{commonTransactionRequest, fromID.AsString(), coins.String()}, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -122,7 +121,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String())) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -159,14 +158,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, commonTransactionRequest}, } @@ -186,7 +185,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -219,7 +218,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } @@ -247,7 +246,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string Coins string } diff --git a/x/identities/transactions/define/transaction_request.go b/x/identities/transactions/define/transaction_request.go index 6c56e8787..fbd18ab39 100644 --- a/x/identities/transactions/define/transaction_request.go +++ b/x/identities/transactions/define/transaction_request.go @@ -5,7 +5,6 @@ package define import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,12 +18,12 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -65,7 +64,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } @@ -117,7 +116,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/identities/transactions/define/transaction_request_test.go b/x/identities/transactions/define/transaction_request_test.go index 18d068bc8..7e904beaf 100644 --- a/x/identities/transactions/define/transaction_request_test.go +++ b/x/identities/transactions/define/transaction_request_test.go @@ -5,7 +5,6 @@ package define import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -31,9 +30,9 @@ func Test_newTransactionRequest(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string immutableMetaProperties string immutableProperties string @@ -78,9 +77,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -129,11 +128,11 @@ func Test_transactionRequest_FromJSON(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -180,9 +179,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -192,7 +191,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, commonTransactionRequest}, } @@ -232,12 +231,12 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() testIdentity := baseIDs.NewIdentityID(baseIDs.NewClassificationID(baseQualified.NewImmutables(immutableProperties), baseQualified.NewMutables(mutableProperties)), baseQualified.NewImmutables(immutableProperties)) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -281,9 +280,9 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -321,9 +320,9 @@ func Test_transactionRequest_Validate(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string diff --git a/x/identities/transactions/deputize/transaction_request.go b/x/identities/transactions/deputize/transaction_request.go index 791b040e0..e3c7f09d3 100644 --- a/x/identities/transactions/deputize/transaction_request.go +++ b/x/identities/transactions/deputize/transaction_request.go @@ -5,7 +5,6 @@ package deputize import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,16 +18,16 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - MaintainedProperties string `json:"maintainedProperties"` - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + MaintainedProperties string `json:"maintainedProperties"` + CanIssueIdentity bool `json:"canIssueIdentity"` + CanQuashIdentity bool `json:"canQuashIdentity"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -73,7 +72,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -121,7 +120,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canIssueIdentity bool, canQuashIdentity bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canIssueIdentity bool, canQuashIdentity bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/identities/transactions/deputize/transaction_request_test.go b/x/identities/transactions/deputize/transaction_request_test.go index ccd5837dd..f2b0bf687 100644 --- a/x/identities/transactions/deputize/transaction_request_test.go +++ b/x/identities/transactions/deputize/transaction_request_test.go @@ -5,7 +5,6 @@ package deputize import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -22,9 +21,9 @@ func Test_newTransactionRequest(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress).SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress).SetFrom(fromAddress) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -71,7 +70,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ToIdentityID, constants.ClassificationID, constants.MaintainedProperties, constants.CanMintAsset, constants.CanBurnAsset, constants.CanRenumerateAsset, constants.CanAddMaintainer, constants.CanRemoveMaintainer, constants.CanMutateMaintainer}) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -94,9 +93,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { wantErr bool }{ {"+ve", - fields{commonTransactionRequest: rest.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, + fields{commonTransactionRequest: baseHelpers.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, - transactionRequest{CommonTransactionRequest: rest.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, + transactionRequest{CommonTransactionRequest: baseHelpers.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, false, }} for _, tt := range tests { @@ -125,10 +124,10 @@ func Test_transactionRequest_FromJSON(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) jsonMessage, _ := json.Marshal(newTransactionRequest(commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false)) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -181,9 +180,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -197,7 +196,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, commonTransactionRequest}, } @@ -226,9 +225,9 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -272,9 +271,9 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -318,9 +317,9 @@ func Test_transactionRequest_Validate(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/identities/transactions/issue/transaction_request.go b/x/identities/transactions/issue/transaction_request.go index a57f94377..991d958e2 100644 --- a/x/identities/transactions/issue/transaction_request.go +++ b/x/identities/transactions/issue/transaction_request.go @@ -5,7 +5,6 @@ package issue import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,13 +18,13 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ClassificationID string `json:"classificationID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ClassificationID string `json:"classificationID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -67,7 +66,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -123,7 +122,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, classificationID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/identities/transactions/issue/transaction_request_test.go b/x/identities/transactions/issue/transaction_request_test.go index 11945ca2a..ecc9b4a04 100644 --- a/x/identities/transactions/issue/transaction_request_test.go +++ b/x/identities/transactions/issue/transaction_request_test.go @@ -6,7 +6,6 @@ package issue import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -27,7 +26,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, string, string, lists.PropertyList, lists.PropertyList, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, string, sdkTypes.AccAddress, rest.CommonTransactionRequest) { +func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, string, string, lists.PropertyList, lists.PropertyList, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, string, sdkTypes.AccAddress, helpers.CommonTransactionRequest) { var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.To, constants.ClassificationID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) @@ -61,7 +60,7 @@ func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom toAccAddress, err = sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, toAddress, toAccAddress, commonTransactionRequest } @@ -69,7 +68,7 @@ func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom func Test_newTransactionRequest(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest to string fromID string classificationID string @@ -115,7 +114,7 @@ func Test_requestPrototype(t *testing.T) { func Test_transactionRequest_FromCLI(t *testing.T) { _, cliCommand, context, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string FromID string ClassificationID string @@ -167,7 +166,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage1, err := json.Marshal(newTransactionRequest(commonTransactionRequest, "", "", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.Equal(t, nil, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string FromID string ClassificationID string @@ -216,7 +215,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string FromID string ClassificationID string @@ -228,7 +227,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, @@ -258,7 +257,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string FromID string ClassificationID string @@ -301,7 +300,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string FromID string ClassificationID string @@ -338,10 +337,10 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) - commonTransactionRequest1 := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest1 := baseHelpers.PrototypeCommonTransactionRequest() type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string FromID string ClassificationID string diff --git a/x/identities/transactions/name/transaction_request.go b/x/identities/transactions/name/transaction_request.go index c42000801..368124b6c 100644 --- a/x/identities/transactions/name/transaction_request.go +++ b/x/identities/transactions/name/transaction_request.go @@ -5,7 +5,6 @@ package name import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" @@ -17,8 +16,8 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - Name string `json:"name"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + Name string `json:"name"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -29,7 +28,7 @@ var _ helpers.TransactionRequest = (*transactionRequest)(nil) // @Accept text/plain // @Produce json // @Tags Identities -// @Param body transactionRequest true "A transaction to name a base identity." +// @Param body transactionRequest true "A transaction to name a baseHelpers identity." // @Success 200 {object} transactionResponse "Message for a successful response." // @Failure default {object} transactionResponse "Message for an unexpected error response." // @Router /identities/name [post] @@ -55,7 +54,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -75,7 +74,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, name string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, name string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, Name: name, diff --git a/x/identities/transactions/name/transaction_request_test.go b/x/identities/transactions/name/transaction_request_test.go index 290ea6154..39c5fbf45 100644 --- a/x/identities/transactions/name/transaction_request_test.go +++ b/x/identities/transactions/name/transaction_request_test.go @@ -5,7 +5,6 @@ package name import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -21,7 +20,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, sdkTypes.AccAddress, rest.CommonTransactionRequest) { +func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, sdkTypes.AccAddress, helpers.CommonTransactionRequest) { var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.Name}) @@ -30,15 +29,14 @@ func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), fromAddress, fromAccAddress, commonTransactionRequest } - func Test_newTransactionRequest(t *testing.T) { _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest nubID string } tests := []struct { @@ -77,7 +75,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { _, cliCommand, context, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest NubID string } type args struct { @@ -115,7 +113,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { _, _, _, _, fromAccAddress, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest NubID string } type args struct { @@ -152,13 +150,13 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest NubID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, "nubID"}, commonTransactionRequest}, } @@ -179,7 +177,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { _, _, _, _, fromAccAddress, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest NubID string } tests := []struct { @@ -212,7 +210,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest NubID string } type args struct { @@ -240,7 +238,7 @@ func Test_transactionRequest_Validate(t *testing.T) { _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest NubID string } tests := []struct { diff --git a/x/identities/transactions/provision/transaction_request.go b/x/identities/transactions/provision/transaction_request.go index 2fdf2cbc5..d36e12e25 100644 --- a/x/identities/transactions/provision/transaction_request.go +++ b/x/identities/transactions/provision/transaction_request.go @@ -5,7 +5,6 @@ package provision import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` - To string `json:"to"` - IdentityID string `json:"identityID"` + CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` + To string `json:"to"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, to string, identityID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, to string, identityID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, To: to, diff --git a/x/identities/transactions/provision/transaction_request_test.go b/x/identities/transactions/provision/transaction_request_test.go index bbbd5b612..316a6d15c 100644 --- a/x/identities/transactions/provision/transaction_request_test.go +++ b/x/identities/transactions/provision/transaction_request_test.go @@ -5,7 +5,6 @@ package provision import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -25,13 +24,13 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *baseIDs.IdentityID) { +func createTestInput(t *testing.T) (helpers.CommonTransactionRequest, string, *baseIDs.IdentityID) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID) } @@ -39,7 +38,7 @@ func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *base func Test_newTransactionRequest(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest to string identityID string } @@ -81,7 +80,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -120,7 +119,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -158,14 +157,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, commonTransactionRequest}, } @@ -191,7 +190,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { toAccAddress, err := sdkTypes.AccAddressFromBech32(testToAddress) require.Nil(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -225,7 +224,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -255,7 +254,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } diff --git a/x/identities/transactions/quash/transaction_request.go b/x/identities/transactions/quash/transaction_request.go index a84902d13..e86e442b0 100644 --- a/x/identities/transactions/quash/transaction_request.go +++ b/x/identities/transactions/quash/transaction_request.go @@ -5,7 +5,6 @@ package quash import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` - FromID string `json:"fromID"` - IdentityID string `json:"identityID"` + CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` + FromID string `json:"fromID"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, identityID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, identityID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/identities/transactions/quash/transaction_request_test.go b/x/identities/transactions/quash/transaction_request_test.go index 04a847fcb..95dd923a8 100644 --- a/x/identities/transactions/quash/transaction_request_test.go +++ b/x/identities/transactions/quash/transaction_request_test.go @@ -5,7 +5,6 @@ package quash import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -25,13 +24,13 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *baseIDs.IdentityID) { +func createTestInput(t *testing.T) (helpers.CommonTransactionRequest, string, *baseIDs.IdentityID) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID) } @@ -39,7 +38,7 @@ func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *base func Test_newTransactionRequest(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string identityID string } @@ -81,7 +80,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { commonTransactionRequest, _, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string } @@ -120,7 +119,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string } @@ -158,14 +157,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, commonTransactionRequest}, } @@ -189,7 +188,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { fromAccAddress, err := types.AccAddressFromBech32(fromAddress) require.Nil(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string } @@ -223,7 +222,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string } @@ -253,7 +252,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string } diff --git a/x/identities/transactions/revoke/transaction_request.go b/x/identities/transactions/revoke/transaction_request.go index abb085a1e..01953c715 100644 --- a/x/identities/transactions/revoke/transaction_request.go +++ b/x/identities/transactions/revoke/transaction_request.go @@ -5,7 +5,6 @@ package revoke import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,10 +17,10 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -60,7 +59,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -96,7 +95,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/identities/transactions/revoke/transaction_request_test.go b/x/identities/transactions/revoke/transaction_request_test.go index 9e34ea8be..57d3de46c 100644 --- a/x/identities/transactions/revoke/transaction_request_test.go +++ b/x/identities/transactions/revoke/transaction_request_test.go @@ -6,7 +6,6 @@ package revoke import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -26,14 +25,14 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *baseIDs.IdentityID, *baseIDs.IdentityID, *baseIDs.ClassificationID) { +func createTestInput(t *testing.T) (helpers.CommonTransactionRequest, string, *baseIDs.IdentityID, *baseIDs.IdentityID, *baseIDs.ClassificationID) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) testToID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID) } @@ -41,7 +40,7 @@ func createTestInput(t *testing.T) (rest.CommonTransactionRequest, string, *base func Test_newTransactionRequest(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -84,7 +83,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -127,7 +126,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -167,7 +166,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -175,7 +174,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, commonTransactionRequest}, } @@ -199,7 +198,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { testFromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAccAddress) require.Nil(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -236,7 +235,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -268,7 +267,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/identities/transactions/unprovision/transaction_request.go b/x/identities/transactions/unprovision/transaction_request.go index 3cb706f2a..85a44747e 100644 --- a/x/identities/transactions/unprovision/transaction_request.go +++ b/x/identities/transactions/unprovision/transaction_request.go @@ -5,7 +5,6 @@ package unprovision import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` - To string `json:"to"` - IdentityID string `json:"identityID"` + CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` + To string `json:"to"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, to string, identityID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, to string, identityID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, To: to, diff --git a/x/identities/transactions/unprovision/transaction_request_test.go b/x/identities/transactions/unprovision/transaction_request_test.go index 0531f4c6c..031f44430 100644 --- a/x/identities/transactions/unprovision/transaction_request_test.go +++ b/x/identities/transactions/unprovision/transaction_request_test.go @@ -5,7 +5,6 @@ package unprovision import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -25,7 +24,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.AccAddress, types.Msg, rest.CommonTransactionRequest) { +func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.AccAddress, types.Msg, helpers.CommonTransactionRequest) { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID2"), baseData.NewStringData("Data2")))) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("Data1")))) testClassificationID := baseIDs.NewClassificationID(immutables, mutables) @@ -39,7 +38,7 @@ func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.Acc toAccAddress, err := types.AccAddressFromBech32(toAddress) require.Nil(t, err) - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() testMessage := NewMessage(fromAccAddress, toAccAddress, testIdentityID) @@ -49,7 +48,7 @@ func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.Acc func Test_newTransactionRequest(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest to string identityID string } @@ -91,7 +90,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -130,7 +129,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { func Test_transactionRequest_FromJSON(t *testing.T) { testIdentityID, toAddress, toAccAddress, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -168,14 +167,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, commonTransactionRequest}, } @@ -199,7 +198,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { fromAccAddress, err := types.AccAddressFromBech32(fromAddress) require.Nil(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -233,7 +232,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } @@ -263,7 +262,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest To string IdentityID string } diff --git a/x/identities/transactions/update/transaction_request.go b/x/identities/transactions/update/transaction_request.go index 26812d32b..359c542f5 100644 --- a/x/identities/transactions/update/transaction_request.go +++ b/x/identities/transactions/update/transaction_request.go @@ -5,7 +5,6 @@ package update import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,11 +18,11 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - IdentityID string `json:"identityID"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + IdentityID string `json:"identityID"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -63,7 +62,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -107,7 +106,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, identityID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, identityID string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/identities/transactions/update/transaction_request_test.go b/x/identities/transactions/update/transaction_request_test.go index 5b5d52cb3..e4b79304c 100644 --- a/x/identities/transactions/update/transaction_request_test.go +++ b/x/identities/transactions/update/transaction_request_test.go @@ -5,7 +5,6 @@ package update import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -26,7 +25,7 @@ import ( "github.com/AssetMantle/modules/helpers/constants" ) -func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, rest.CommonTransactionRequest) { +func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, client.Context, string, string, lists.PropertyList, lists.PropertyList, string, sdkTypes.AccAddress, helpers.CommonTransactionRequest) { var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.IdentityID, constants.MutableMetaProperties, constants.MutableProperties}) @@ -42,7 +41,7 @@ func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, clie fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), mutableMetaPropertiesString, mutablePropertiesString, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, commonTransactionRequest } @@ -50,7 +49,7 @@ func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, clie func Test_newTransactionRequest(t *testing.T) { _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string identityID string mutableMetaProperties string @@ -92,7 +91,7 @@ func Test_requestPrototype(t *testing.T) { func Test_transactionRequest_FromCLI(t *testing.T) { _, cliCommand, context, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string MutableMetaProperties string @@ -137,7 +136,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string MutableMetaProperties string @@ -180,7 +179,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string MutableMetaProperties string @@ -189,9 +188,9 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ - {"+ve", fields{}, rest.PrototypeCommonTransactionRequest()}, + {"+ve", fields{}, baseHelpers.PrototypeCommonTransactionRequest()}, {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { @@ -217,7 +216,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string MutableMetaProperties string @@ -256,7 +255,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string MutableMetaProperties string @@ -290,7 +289,7 @@ func Test_transactionRequest_Validate(t *testing.T) { _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string IdentityID string MutableMetaProperties string diff --git a/x/metas/transactions/reveal/transaction_request.go b/x/metas/transactions/reveal/transaction_request.go index 47d2bb814..84cb17226 100644 --- a/x/metas/transactions/reveal/transaction_request.go +++ b/x/metas/transactions/reveal/transaction_request.go @@ -5,7 +5,6 @@ package reveal import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/data/base" "github.com/cosmos/cosmos-sdk/client" @@ -17,8 +16,8 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - Data string `json:"data"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + Data string `json:"data"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -55,7 +54,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -80,7 +79,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, data string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, data string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, Data: data, diff --git a/x/metas/transactions/reveal/transaction_request_test.go b/x/metas/transactions/reveal/transaction_request_test.go index c7c00813e..ce706330a 100644 --- a/x/metas/transactions/reveal/transaction_request_test.go +++ b/x/metas/transactions/reveal/transaction_request_test.go @@ -5,7 +5,6 @@ package reveal import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" "github.com/cosmos/cosmos-sdk/client" "testing" @@ -22,7 +21,7 @@ func Test_Reveal_Request(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" data := "S|newData" - commonTransactionRequest := rest.PrototypeCommonTransactionRequest() + commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() testTransactionRequest := newTransactionRequest(commonTransactionRequest, data) require.Equal(t, transactionRequest{CommonTransactionRequest: commonTransactionRequest, Data: data}, testTransactionRequest) @@ -30,7 +29,7 @@ func Test_Reveal_Request(t *testing.T) { requestFromCLI, err := transactionRequest{}.FromCLI(cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())) require.Equal(t, nil, err) - require.Equal(t, transactionRequest{CommonTransactionRequest: rest.PrototypeCommonTransactionRequest(), Data: ""}, requestFromCLI) + require.Equal(t, transactionRequest{CommonTransactionRequest: baseHelpers.PrototypeCommonTransactionRequest(), Data: ""}, requestFromCLI) jsonMessage, _ := json.Marshal(testTransactionRequest) transactionRequestUnmarshalled, err := transactionRequest{}.FromJSON(jsonMessage) @@ -45,11 +44,11 @@ func Test_Reveal_Request(t *testing.T) { require.Nil(t, err) - msg2, err := newTransactionRequest(rest.PrototypeCommonTransactionRequest(), data).MakeMsg() + msg2, err := newTransactionRequest(baseHelpers.PrototypeCommonTransactionRequest(), data).MakeMsg() require.NotNil(t, err) require.Nil(t, msg2) - msg2, err = newTransactionRequest(rest.PrototypeCommonTransactionRequest().SetFrom(fromAddress), "randomString").MakeMsg() + msg2, err = newTransactionRequest(baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress), "randomString").MakeMsg() require.NotNil(t, err) require.Nil(t, msg2) diff --git a/x/orders/transactions/cancel/transaction_request.go b/x/orders/transactions/cancel/transaction_request.go index 187e4116d..cd969b8f7 100644 --- a/x/orders/transactions/cancel/transaction_request.go +++ b/x/orders/transactions/cancel/transaction_request.go @@ -5,7 +5,6 @@ package cancel import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - OrderID string `json:"orderID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, orderID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, orderID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/cancel/transaction_request_test.go b/x/orders/transactions/cancel/transaction_request_test.go index 8aed74e09..7f1eb7ed8 100644 --- a/x/orders/transactions/cancel/transaction_request_test.go +++ b/x/orders/transactions/cancel/transaction_request_test.go @@ -6,7 +6,6 @@ package cancel import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -37,12 +36,12 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables) testOrderID1 = baseIDs.PrototypeOrderID() - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string orderID string } @@ -85,7 +84,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.FromIdentityID.GetName(), testFromID.AsString()) viper.Set(constants.OrderID.GetName(), testOrderID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } @@ -128,7 +127,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } @@ -166,14 +165,14 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, commonTransactionRequest}, {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, commonTransactionRequest}, @@ -194,7 +193,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } @@ -227,7 +226,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } @@ -256,7 +255,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } diff --git a/x/orders/transactions/define/transaction_request.go b/x/orders/transactions/define/transaction_request.go index 6d9780888..57f132472 100644 --- a/x/orders/transactions/define/transaction_request.go +++ b/x/orders/transactions/define/transaction_request.go @@ -5,7 +5,6 @@ package define import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,12 +18,12 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -65,7 +64,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -116,7 +115,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/define/transaction_request_test.go b/x/orders/transactions/define/transaction_request_test.go index 8b9607a84..fb003cccd 100644 --- a/x/orders/transactions/define/transaction_request_test.go +++ b/x/orders/transactions/define/transaction_request_test.go @@ -6,7 +6,6 @@ package define import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -45,12 +44,12 @@ var ( mutables = base.NewMutables(mutableProperties) testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string immutableMetaProperties string immutableProperties string @@ -98,7 +97,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) viper.Set(constants.FromIdentityID.GetName(), testFromID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -144,7 +143,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -187,7 +186,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -197,7 +196,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -220,7 +219,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -259,7 +258,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string @@ -293,7 +292,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ImmutableMetaProperties string ImmutableProperties string diff --git a/x/orders/transactions/deputize/transaction_request.go b/x/orders/transactions/deputize/transaction_request.go index a34e00e92..1abb28a13 100644 --- a/x/orders/transactions/deputize/transaction_request.go +++ b/x/orders/transactions/deputize/transaction_request.go @@ -5,7 +5,6 @@ package deputize import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,16 +18,16 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` - MaintainedProperties string `json:"maintainedProperties"` - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` + MaintainedProperties string `json:"maintainedProperties"` + CanMakeOrder bool `json:"canMakeOrder"` + CanCancelOrder bool `json:"canCancelOrder"` + CanAddMaintainer bool `json:"canAddMaintainer"` + CanRemoveMaintainer bool `json:"canRemoveMaintainer"` + CanMutateMaintainer bool `json:"canMutateMaintainer"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -73,7 +72,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -121,7 +120,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canMakeOrder bool, canCancelOrder bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string, maintainedProperties string, canMakeOrder bool, canCancelOrder bool, canAddMaintainer bool, canRemoveMaintainer bool, canMutateMaintainer bool) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/deputize/transaction_request_test.go b/x/orders/transactions/deputize/transaction_request_test.go index 8874062cf..55411df88 100644 --- a/x/orders/transactions/deputize/transaction_request_test.go +++ b/x/orders/transactions/deputize/transaction_request_test.go @@ -6,7 +6,6 @@ package deputize import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -37,12 +36,12 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) maintainedPropertyString = "maintainedProperty:S|maintainedProperty" maintainedProperties, _ = base.NewPropertyList().FromMetaPropertiesString(maintainedPropertyString) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -99,7 +98,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.CanRemoveMaintainer.GetName(), true) viper.Set(constants.CanMutateMaintainer.GetName(), true) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -153,7 +152,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true)) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -204,7 +203,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -218,7 +217,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, commonTransactionRequest}, } @@ -245,7 +244,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -292,7 +291,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -334,7 +333,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/orders/transactions/get/transaction_request.go b/x/orders/transactions/get/transaction_request.go index 3ad8d8edc..f6aeba30e 100644 --- a/x/orders/transactions/get/transaction_request.go +++ b/x/orders/transactions/get/transaction_request.go @@ -5,7 +5,6 @@ package get import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,9 +17,9 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - OrderID string `json:"orderID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -58,7 +57,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -89,7 +88,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, orderID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, orderID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/get/transaction_request_test.go b/x/orders/transactions/get/transaction_request_test.go index 2dd595f5c..a2f9e20a4 100644 --- a/x/orders/transactions/get/transaction_request_test.go +++ b/x/orders/transactions/get/transaction_request_test.go @@ -6,7 +6,6 @@ package get import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -36,13 +35,13 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() takerSplit = types.NewInt(60) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string orderID string @@ -85,7 +84,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.FromIdentityID.GetName(), testFromID.AsString()) viper.Set(constants.OrderID.GetName(), testOrderID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string @@ -126,7 +125,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString())) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } @@ -163,7 +162,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string @@ -171,7 +170,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, commonTransactionRequest}, } @@ -191,7 +190,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string @@ -225,7 +224,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string } @@ -253,7 +252,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string diff --git a/x/orders/transactions/immediate/transaction_request.go b/x/orders/transactions/immediate/transaction_request.go index 3607a2525..2ab6af629 100644 --- a/x/orders/transactions/immediate/transaction_request.go +++ b/x/orders/transactions/immediate/transaction_request.go @@ -5,7 +5,6 @@ package immediate import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,19 +19,19 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ClassificationID string `json:"classificationID"` - TakerID string `json:"takerID"` - MakerAssetID string `json:"makerAssetID"` - TakerAssetID string `json:"takerAssetID"` - ExpiresIn int64 `json:"expiresIn"` - MakerSplit string `json:"makerSplit"` - TakerSplit string `json:"takerSplit"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ClassificationID string `json:"classificationID"` + TakerID string `json:"takerID"` + MakerAssetID string `json:"makerAssetID"` + TakerAssetID string `json:"takerAssetID"` + ExpiresIn int64 `json:"expiresIn"` + MakerSplit string `json:"makerSplit"` + TakerSplit string `json:"takerSplit"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -80,7 +79,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } @@ -170,7 +169,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/immediate/transaction_request_test.go b/x/orders/transactions/immediate/transaction_request_test.go index 5a7e3d858..432122b34 100644 --- a/x/orders/transactions/immediate/transaction_request_test.go +++ b/x/orders/transactions/immediate/transaction_request_test.go @@ -6,7 +6,6 @@ package immediate import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -44,7 +43,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("MakerAssetID").GetCoinAssetID().(*baseIDs.AssetID) takerAssetID = baseDocuments.NewCoinAsset("TakerAssetId").GetCoinAssetID().(*baseIDs.AssetID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = types.NewInt(60) takerSplit = types.NewInt(60) @@ -52,7 +51,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string classificationID string takerID string @@ -116,7 +115,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -176,7 +175,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -233,7 +232,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -250,7 +249,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -280,7 +279,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -333,7 +332,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -381,7 +380,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string diff --git a/x/orders/transactions/make/transaction_request.go b/x/orders/transactions/make/transaction_request.go index 299332ad6..4f3d66757 100644 --- a/x/orders/transactions/make/transaction_request.go +++ b/x/orders/transactions/make/transaction_request.go @@ -5,7 +5,6 @@ package make import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,19 +19,19 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ClassificationID string `json:"classificationID"` - TakerID string `json:"takerID"` - MakerAssetID string `json:"makerAssetID"` - TakerAssetID string `json:"takerAssetID"` - ExpiresIn int64 `json:"expiresIn"` - MakerSplit string `json:"makerSplit"` - TakerSplit string `json:"takerSplit"` - ImmutableMetaProperties string `json:"immutableMetaProperties"` - ImmutableProperties string `json:"immutableProperties"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ClassificationID string `json:"classificationID"` + TakerID string `json:"takerID"` + MakerAssetID string `json:"makerAssetID"` + TakerAssetID string `json:"takerAssetID"` + ExpiresIn int64 `json:"expiresIn"` + MakerSplit string `json:"makerSplit"` + TakerSplit string `json:"takerSplit"` + ImmutableMetaProperties string `json:"immutableMetaProperties"` + ImmutableProperties string `json:"immutableProperties"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -80,7 +79,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } @@ -170,7 +169,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, classificationID string, takerID string, makerAssetID string, takerAssetID string, expiresIn int64, makerSplit, takerSplit string, immutableMetaProperties string, immutableProperties string, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/make/transaction_request_test.go b/x/orders/transactions/make/transaction_request_test.go index 515e60e6d..8e38afd2c 100644 --- a/x/orders/transactions/make/transaction_request_test.go +++ b/x/orders/transactions/make/transaction_request_test.go @@ -6,7 +6,6 @@ package make import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -44,7 +43,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("makerAssetID").GetCoinAssetID() takerAssetID = baseDocuments.NewCoinAsset("takerAssetID").GetCoinAssetID() - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = sdkTypes.NewInt(60) takerSplit = sdkTypes.NewInt(60) @@ -52,7 +51,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string classificationID string takerID string @@ -114,7 +113,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -174,7 +173,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -231,7 +230,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -248,7 +247,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -278,7 +277,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -331,7 +330,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string @@ -379,7 +378,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ClassificationID string TakerID string diff --git a/x/orders/transactions/modify/transaction_request.go b/x/orders/transactions/modify/transaction_request.go index 6aac3c475..0435796d6 100644 --- a/x/orders/transactions/modify/transaction_request.go +++ b/x/orders/transactions/modify/transaction_request.go @@ -5,7 +5,6 @@ package modify import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -20,14 +19,14 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - OrderID string `json:"orderID"` - TakerSplit string `json:"takerSplit"` - MakerSplit string `json:"makerSplit"` - ExpiresIn int64 `json:"expiresIn"` - MutableMetaProperties string `json:"mutableMetaProperties"` - MutableProperties string `json:"mutableProperties"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + OrderID string `json:"orderID"` + TakerSplit string `json:"takerSplit"` + MakerSplit string `json:"makerSplit"` + ExpiresIn int64 `json:"expiresIn"` + MutableMetaProperties string `json:"mutableMetaProperties"` + MutableProperties string `json:"mutableProperties"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -70,7 +69,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } @@ -129,7 +128,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, orderID string, takerSplit string, makerSplit string, expiresIn int64, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, orderID string, takerSplit string, makerSplit string, expiresIn int64, mutableMetaProperties string, mutableProperties string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/modify/transaction_request_test.go b/x/orders/transactions/modify/transaction_request_test.go index f0dd0a038..062bdd34b 100644 --- a/x/orders/transactions/modify/transaction_request_test.go +++ b/x/orders/transactions/modify/transaction_request_test.go @@ -6,7 +6,6 @@ package modify import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -43,7 +42,7 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = types.NewInt(60) takerSplit = types.NewInt(60) @@ -51,7 +50,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string orderID string takerSplit string @@ -103,7 +102,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string TakerSplit string @@ -153,7 +152,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString)) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string TakerSplit string @@ -200,7 +199,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string TakerSplit string @@ -212,7 +211,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } @@ -237,7 +236,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string TakerSplit string @@ -280,7 +279,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string TakerSplit string @@ -318,7 +317,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string OrderID string TakerSplit string diff --git a/x/orders/transactions/put/transaction_request.go b/x/orders/transactions/put/transaction_request.go index 61c930cba..9e104eb49 100644 --- a/x/orders/transactions/put/transaction_request.go +++ b/x/orders/transactions/put/transaction_request.go @@ -5,7 +5,6 @@ package put import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -19,13 +18,13 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - MakerAssetID string `json:"makerAssetID"` - TakerAssetID string `json:"takerAssetID"` - MakerSplit string `json:"makerSplit"` - TakerSplit string `json:"takerSplit"` - ExpiryHeight int64 `json:"expiryHeight"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + MakerAssetID string `json:"makerAssetID"` + TakerAssetID string `json:"takerAssetID"` + MakerSplit string `json:"makerSplit"` + TakerSplit string `json:"takerSplit"` + ExpiryHeight int64 `json:"expiryHeight"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -67,7 +66,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } @@ -119,7 +118,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, makerAssetID string, takerAssetID string, makerSplit, takerSplit string, expiryHeight int64) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, makerAssetID string, takerAssetID string, makerSplit, takerSplit string, expiryHeight int64) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/put/transaction_request_test.go b/x/orders/transactions/put/transaction_request_test.go index ce59fe70a..4961654bc 100644 --- a/x/orders/transactions/put/transaction_request_test.go +++ b/x/orders/transactions/put/transaction_request_test.go @@ -6,7 +6,6 @@ package put import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -44,7 +43,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("makerAssetID").GetCoinAssetID().(*baseIDs.AssetID) takerAssetID = baseDocuments.NewCoinAsset("takerAssetID").GetCoinAssetID().(*baseIDs.AssetID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() expiryHeight = int64(60) makerSplit = sdkTypes.NewInt(60) takerSplit = sdkTypes.NewInt(60) @@ -52,7 +51,7 @@ var ( func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string @@ -108,7 +107,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.MutableMetaProperties.GetName(), mutableMetaPropertiesString) viper.Set(constants.MutableProperties.GetName(), mutablePropertiesString) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string @@ -151,7 +150,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight)) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string @@ -196,7 +195,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string @@ -207,7 +206,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, commonTransactionRequest}, } @@ -231,7 +230,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string @@ -272,7 +271,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string @@ -308,7 +307,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string MakerAssetID string TakerAssetID string diff --git a/x/orders/transactions/revoke/transaction_request.go b/x/orders/transactions/revoke/transaction_request.go index fc866bd12..569ff20bc 100644 --- a/x/orders/transactions/revoke/transaction_request.go +++ b/x/orders/transactions/revoke/transaction_request.go @@ -5,7 +5,6 @@ package revoke import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,10 +17,10 @@ import ( ) type transactionRequest struct { - rest.CommonTransactionRequest `json:"commonTransactionRequest"` - FromID string `json:"fromID"` - ToID string `json:"toID"` - ClassificationID string `json:"classificationID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + ToID string `json:"toID"` + ClassificationID string `json:"classificationID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -60,7 +59,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -98,7 +97,7 @@ func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, toID string, classificationID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/revoke/transaction_request_test.go b/x/orders/transactions/revoke/transaction_request_test.go index 2695fcd22..d82673c5a 100644 --- a/x/orders/transactions/revoke/transaction_request_test.go +++ b/x/orders/transactions/revoke/transaction_request_test.go @@ -6,7 +6,6 @@ package revoke import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -35,12 +34,12 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string toID string classificationID string @@ -84,7 +83,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.ToIdentityID.GetName(), testFromID.AsString()) viper.Set(constants.ClassificationID.GetName(), testClassificationID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -126,7 +125,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString())) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -165,7 +164,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -173,7 +172,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, commonTransactionRequest}, } @@ -194,7 +193,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -229,7 +228,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string @@ -259,7 +258,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string ToID string ClassificationID string diff --git a/x/orders/transactions/take/transaction_request.go b/x/orders/transactions/take/transaction_request.go index 1a536ae1b..112c450fc 100644 --- a/x/orders/transactions/take/transaction_request.go +++ b/x/orders/transactions/take/transaction_request.go @@ -5,7 +5,6 @@ package take import ( "encoding/json" - "github.com/AssetMantle/modules/utilities/rest" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,10 +17,10 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest rest.CommonTransactionRequest `json:"CommonTransactionRequest"` - FromID string `json:"fromID"` - TakerSplit string `json:"takerSplit"` - OrderID string `json:"orderID"` + CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` + FromID string `json:"fromID"` + TakerSplit string `json:"takerSplit"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) @@ -60,7 +59,7 @@ func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage return transactionRequest, nil } -func (transactionRequest transactionRequest) GetCommonTransactionRequest() rest.CommonTransactionRequest { +func (transactionRequest transactionRequest) GetCommonTransactionRequest() helpers.CommonTransactionRequest { return transactionRequest.CommonTransactionRequest } func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { @@ -97,7 +96,7 @@ func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmin func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } -func newTransactionRequest(commonTransactionRequest rest.CommonTransactionRequest, fromID string, takerSplit string, orderID string) helpers.TransactionRequest { +func newTransactionRequest(commonTransactionRequest helpers.CommonTransactionRequest, fromID string, takerSplit string, orderID string) helpers.TransactionRequest { return transactionRequest{ CommonTransactionRequest: commonTransactionRequest, FromID: fromID, diff --git a/x/orders/transactions/take/transaction_request_test.go b/x/orders/transactions/take/transaction_request_test.go index c1ec0e2d7..6acd81cf4 100644 --- a/x/orders/transactions/take/transaction_request_test.go +++ b/x/orders/transactions/take/transaction_request_test.go @@ -6,7 +6,6 @@ package take import ( "encoding/json" "fmt" - "github.com/AssetMantle/modules/utilities/rest" "reflect" "testing" @@ -36,13 +35,13 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - commonTransactionRequest = rest.PrototypeCommonTransactionRequest() + commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() takerSplit = types.NewInt(60) ) func Test_newTransactionRequest(t *testing.T) { type args struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest fromID string takerSplit string orderID string @@ -86,7 +85,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { viper.Set(constants.TakerSplit.GetName(), takerSplit.String()) viper.Set(constants.OrderID.GetName(), testOrderID.AsString()) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string TakerSplit string OrderID string @@ -128,7 +127,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString())) require.NoError(t, err) type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string TakerSplit string OrderID string @@ -167,7 +166,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string TakerSplit string OrderID string @@ -175,7 +174,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { tests := []struct { name string fields fields - want rest.CommonTransactionRequest + want helpers.CommonTransactionRequest }{ {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, commonTransactionRequest}, } @@ -196,7 +195,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { func Test_transactionRequest_MakeMsg(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string TakerSplit string OrderID string @@ -231,7 +230,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { func Test_transactionRequest_RegisterCodec(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string TakerSplit string OrderID string @@ -261,7 +260,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { type fields struct { - commonTransactionRequest rest.CommonTransactionRequest + commonTransactionRequest helpers.CommonTransactionRequest FromID string TakerSplit string OrderID string From 99bc7b481f60c2df687407a46020e65644505e56 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 29 Jul 2024 20:09:09 +0530 Subject: [PATCH 18/64] code cleanup Signed-off-by: Deepanshu Tripathi --- utilities/client/methods.go | 11 ----------- utilities/rest/methods.go | 6 +----- 2 files changed, 1 insertion(+), 16 deletions(-) delete mode 100644 utilities/client/methods.go diff --git a/utilities/client/methods.go b/utilities/client/methods.go deleted file mode 100644 index df9a77641..000000000 --- a/utilities/client/methods.go +++ /dev/null @@ -1,11 +0,0 @@ -package clientUtils - -import ( - "github.com/cosmos/cosmos-sdk/client" - "net/http" -) - -func ParseQueryHeightOrReturnBadRequest(responseWriter http.ResponseWriter, clientContext client.Context, request *http.Request) (client.Context, bool) { - // TODO correct - return clientContext, true -} diff --git a/utilities/rest/methods.go b/utilities/rest/methods.go index ebf1bd466..9cab141cb 100644 --- a/utilities/rest/methods.go +++ b/utilities/rest/methods.go @@ -2,7 +2,6 @@ package rest import ( "encoding/json" - clientUtils "github.com/AssetMantle/modules/utilities/client" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" "io" @@ -41,10 +40,7 @@ func CheckBadRequestError(responseWriter http.ResponseWriter, err error) bool { } func ParseQueryHeightOrReturnBadRequest(responseWriter http.ResponseWriter, clientContext client.Context, request *http.Request) (client.Context, bool) { - clientContext, ok := clientUtils.ParseQueryHeightOrReturnBadRequest(responseWriter, clientContext, request) - if !ok { - return clientContext, false - } + // TODO correct return clientContext, true } From eca760861feee5ba27cbffc47dc2bdcc37344e20 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 29 Jul 2024 20:10:30 +0530 Subject: [PATCH 19/64] feat: defining common transaction request and registering codec Signed-off-by: Deepanshu Tripathi --- helpers/{legacy_codec.go => amino_codec.go} | 0 ...gacy_codec_test.go => amino_codec_test.go} | 0 helpers/base/amino_codec.go | 10 ++ helpers/base/codec.go | 1 + helpers/base/common_transaction_request.go | 126 ++++++++++++++++++ 5 files changed, 137 insertions(+) rename helpers/{legacy_codec.go => amino_codec.go} (100%) rename helpers/{legacy_codec_test.go => amino_codec_test.go} (100%) create mode 100644 helpers/base/amino_codec.go create mode 100644 helpers/base/common_transaction_request.go diff --git a/helpers/legacy_codec.go b/helpers/amino_codec.go similarity index 100% rename from helpers/legacy_codec.go rename to helpers/amino_codec.go diff --git a/helpers/legacy_codec_test.go b/helpers/amino_codec_test.go similarity index 100% rename from helpers/legacy_codec_test.go rename to helpers/amino_codec_test.go diff --git a/helpers/base/amino_codec.go b/helpers/base/amino_codec.go new file mode 100644 index 000000000..95eafccdb --- /dev/null +++ b/helpers/base/amino_codec.go @@ -0,0 +1,10 @@ +package base + +import ( + "github.com/AssetMantle/schema/codec/utilities" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" +) + +func RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { + utilities.RegisterModuleConcrete(legacyAmino, commonTransactionRequest{}) +} diff --git a/helpers/base/codec.go b/helpers/base/codec.go index 1bf24e46c..a77b7b14a 100644 --- a/helpers/base/codec.go +++ b/helpers/base/codec.go @@ -34,6 +34,7 @@ func (codec codec) Initialize(moduleManager helpers.ModuleManager) helpers.Codec std.RegisterLegacyAminoCodec(codec.legacyAmino) std.RegisterInterfaces(codec.interfaceRegistry) helpers.RegisterLegacyAminoCodec(codec.legacyAmino) + RegisterLegacyAminoCodec(codec.legacyAmino) schemaCodec.RegisterLegacyAminoCodec(codec.legacyAmino) docs.RegisterLegacyAminoCodec(codec.legacyAmino) moduleManager.RegisterLegacyAminoCodec(codec.legacyAmino) diff --git a/helpers/base/common_transaction_request.go b/helpers/base/common_transaction_request.go new file mode 100644 index 000000000..ab909f496 --- /dev/null +++ b/helpers/base/common_transaction_request.go @@ -0,0 +1,126 @@ +package base + +import ( + "fmt" + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/utilities/rest" + "github.com/cosmos/cosmos-sdk/client" + sdkTypes "github.com/cosmos/cosmos-sdk/types" + "net/http" + "strings" +) + +type commonTransactionRequest struct { + From string `json:"from"` + Memo string `json:"memo"` + TimeoutHeight uint64 `json:"timeout_height"` + AccountNumber uint64 `json:"account_number"` + Sequence uint64 `json:"sequence"` + ChainID string `json:"chain_id"` + Gas string `json:"gas"` + Fees sdkTypes.Coins `json:"fees"` + GasPrices sdkTypes.DecCoins `json:"gas_prices"` + Simulate bool `json:"simulate"` + GasAdjustment string `json:"gas_adjustment"` +} + +var _ helpers.CommonTransactionRequest = commonTransactionRequest{} + +func (commonTransactionRequest commonTransactionRequest) SetFrom(from string) helpers.CommonTransactionRequest { + commonTransactionRequest.From = from + return commonTransactionRequest +} +func (commonTransactionRequest commonTransactionRequest) SetAccountNumber(accountNumber uint64) helpers.CommonTransactionRequest { + commonTransactionRequest.AccountNumber = accountNumber + return commonTransactionRequest +} +func (commonTransactionRequest commonTransactionRequest) GetAccountNumber() uint64 { + return commonTransactionRequest.AccountNumber +} +func (commonTransactionRequest commonTransactionRequest) GetGas() string { + return commonTransactionRequest.Gas +} +func (commonTransactionRequest commonTransactionRequest) GetGasAdjustment() string { + return commonTransactionRequest.GasAdjustment +} +func (commonTransactionRequest commonTransactionRequest) GetMemo() string { + return commonTransactionRequest.Memo +} +func (commonTransactionRequest commonTransactionRequest) GetSequence() uint64 { + return commonTransactionRequest.Sequence +} +func (commonTransactionRequest commonTransactionRequest) GetTimeoutHeight() uint64 { + return commonTransactionRequest.TimeoutHeight +} +func (commonTransactionRequest commonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { + return commonTransactionRequest.GasPrices +} +func (commonTransactionRequest commonTransactionRequest) IsSimulated() bool { + return commonTransactionRequest.Simulate +} +func (commonTransactionRequest commonTransactionRequest) GetFrom() string { + return commonTransactionRequest.From +} +func (commonTransactionRequest commonTransactionRequest) GetChainID() string { + return commonTransactionRequest.ChainID +} +func (commonTransactionRequest commonTransactionRequest) SetChainID(chainIDString string) helpers.CommonTransactionRequest { + commonTransactionRequest.ChainID = chainIDString + return commonTransactionRequest +} +func (commonTransactionRequest commonTransactionRequest) GetFees() sdkTypes.Coins { + return commonTransactionRequest.Fees +} +func (commonTransactionRequest commonTransactionRequest) Validate() error { + if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { + return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) + } + + if !commonTransactionRequest.Simulate { + if len(commonTransactionRequest.ChainID) == 0 { + return fmt.Errorf("chain-id required but not specified") + } + if !commonTransactionRequest.Fees.IsZero() && !commonTransactionRequest.GasPrices.IsZero() { + return fmt.Errorf("cannot provide both fees and gas prices") + } + if !commonTransactionRequest.Fees.IsValid() && !commonTransactionRequest.GasPrices.IsValid() { + return fmt.Errorf("invalid fees or gas prices provided") + } + } + + return nil +} +func (commonTransactionRequest commonTransactionRequest) Sanitize() helpers.CommonTransactionRequest { + return NewCommonTransactionRequest(commonTransactionRequest.From, commonTransactionRequest.Memo, commonTransactionRequest.ChainID, commonTransactionRequest.Gas, commonTransactionRequest.GasAdjustment, commonTransactionRequest.AccountNumber, commonTransactionRequest.TimeoutHeight, commonTransactionRequest.Sequence, commonTransactionRequest.Fees, commonTransactionRequest.GasPrices, commonTransactionRequest.Simulate) +} +func (commonTransactionRequest commonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { + if err := commonTransactionRequest.Validate(); err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return false + } + + return true +} + +func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees sdkTypes.Coins, gasPrices sdkTypes.DecCoins, simulate bool) helpers.CommonTransactionRequest { + return commonTransactionRequest{ + From: strings.TrimSpace(from), + Memo: strings.TrimSpace(memo), + ChainID: strings.TrimSpace(chainID), + Fees: fees, + GasPrices: gasPrices, + Gas: strings.TrimSpace(gas), + GasAdjustment: strings.TrimSpace(gasAdjustment), + AccountNumber: accountNumber, + Sequence: sequence, + TimeoutHeight: timeOutHeight, + Simulate: simulate, + } +} +func PrototypeCommonTransactionRequest() helpers.CommonTransactionRequest { + return &commonTransactionRequest{} +} + +func NewCommonTransactionRequestFromContext(context client.Context) helpers.CommonTransactionRequest { + return NewCommonTransactionRequest(context.From, "", context.ChainID, "", "", uint64(context.Height), 0, 0, sdkTypes.Coins{}, sdkTypes.DecCoins{}, context.Simulate) +} From 913a4f01d892066dc5af1e09f1250fe69d72f968 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 13 Aug 2024 15:03:18 +0530 Subject: [PATCH 20/64] code cleanup Signed-off-by: Deepanshu Tripathi --- .../transactions/provision/transaction_request.go | 6 +++--- x/identities/transactions/quash/transaction_request.go | 6 +++--- .../transactions/unprovision/transaction_request.go | 6 +++--- x/orders/transactions/take/transaction_request.go | 8 ++++---- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/x/identities/transactions/provision/transaction_request.go b/x/identities/transactions/provision/transaction_request.go index d36e12e25..b5e7f0eee 100644 --- a/x/identities/transactions/provision/transaction_request.go +++ b/x/identities/transactions/provision/transaction_request.go @@ -17,9 +17,9 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` - To string `json:"to"` - IdentityID string `json:"identityID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + To string `json:"to"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) diff --git a/x/identities/transactions/quash/transaction_request.go b/x/identities/transactions/quash/transaction_request.go index e86e442b0..5e4345791 100644 --- a/x/identities/transactions/quash/transaction_request.go +++ b/x/identities/transactions/quash/transaction_request.go @@ -17,9 +17,9 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` - FromID string `json:"fromID"` - IdentityID string `json:"identityID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) diff --git a/x/identities/transactions/unprovision/transaction_request.go b/x/identities/transactions/unprovision/transaction_request.go index 85a44747e..8edcfa140 100644 --- a/x/identities/transactions/unprovision/transaction_request.go +++ b/x/identities/transactions/unprovision/transaction_request.go @@ -17,9 +17,9 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` - To string `json:"to"` - IdentityID string `json:"identityID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + To string `json:"to"` + IdentityID string `json:"identityID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) diff --git a/x/orders/transactions/take/transaction_request.go b/x/orders/transactions/take/transaction_request.go index 112c450fc..37f97a91d 100644 --- a/x/orders/transactions/take/transaction_request.go +++ b/x/orders/transactions/take/transaction_request.go @@ -17,10 +17,10 @@ import ( ) type transactionRequest struct { - CommonTransactionRequest helpers.CommonTransactionRequest `json:"CommonTransactionRequest"` - FromID string `json:"fromID"` - TakerSplit string `json:"takerSplit"` - OrderID string `json:"orderID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + FromID string `json:"fromID"` + TakerSplit string `json:"takerSplit"` + OrderID string `json:"orderID"` } var _ helpers.TransactionRequest = (*transactionRequest)(nil) From 9824a4b706d1ffb1eeea4012c0c0b2c081029cae Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 13 Aug 2024 15:04:23 +0530 Subject: [PATCH 21/64] minor fix Signed-off-by: Deepanshu Tripathi --- x/classifications/record/record.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/x/classifications/record/record.go b/x/classifications/record/record.go index 68f59c1fb..3d7719e53 100644 --- a/x/classifications/record/record.go +++ b/x/classifications/record/record.go @@ -36,7 +36,7 @@ func (record *Record) Read(kvStore sdkTypes.KVStore) helpers.Record { if record.GetKey() == nil || len(record.GetKey().GeneratePrefixedStoreKeyBytes()) == 0 { return Prototype() } - Bytes := kvStore.Get(record.GetKey().GenerateStoreKeyBytes()) + Bytes := kvStore.Get(record.GetKey().GeneratePrefixedStoreKeyBytes()) if Bytes == nil { return Prototype() } @@ -51,7 +51,7 @@ func (record *Record) Write(kvStore sdkTypes.KVStore) helpers.Record { return record } func (record *Record) Delete(kvStore sdkTypes.KVStore) { - kvStore.Delete(record.GetKey().GenerateStoreKeyBytes()) + kvStore.Delete(record.GetKey().GeneratePrefixedStoreKeyBytes()) } func RecordsFromInterface(records []helpers.Record) []*Record { From 1cdb772cdeb709d902e77f301985355848ab5452 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 13 Aug 2024 15:05:02 +0530 Subject: [PATCH 22/64] minor fix Signed-off-by: Deepanshu Tripathi --- utilities/rest/queuing/kafka_types.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/utilities/rest/queuing/kafka_types.go b/utilities/rest/queuing/kafka_types.go index 4ee39d424..cb0796edf 100755 --- a/utilities/rest/queuing/kafka_types.go +++ b/utilities/rest/queuing/kafka_types.go @@ -17,10 +17,10 @@ type TicketID string // kafkaMsg : is a store that can be stored in kafka queues type kafkaMsg struct { - Msg sdk.Msg `json:"msg"` - TicketID TicketID `json:"TicketID"` - CommonTransactionRequest helpers.CommonTransactionRequest `json:"commonTransactionRequest"` - KafkaCliCtx kafkaCliCtx + sdk.Msg `json:"msg"` + TicketID `json:"TicketID"` + helpers.CommonTransactionRequest `json:"commonTransactionRequest"` + KafkaCliCtx kafkaCliCtx } // newKafkaMsgFromRest : makes a msg to send to kafka queue From 3222efd1e943fe057b62e6d2a7f4847a28f0c656 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 19 Aug 2024 21:30:33 +0530 Subject: [PATCH 23/64] feat(query): adding custom handling logic Signed-off-by: Deepanshu Tripathi --- helpers/base/query.go | 26 +++++-------------- x/assets/queries/asset/query.go | 3 +++ x/assets/queries/assets/query.go | 3 +++ .../queries/classification/query.go | 3 +++ .../queries/classifications/query.go | 3 +++ x/identities/queries/identities/query.go | 3 +++ x/identities/queries/identity/query.go | 3 +++ x/maintainers/queries/maintainer/query.go | 3 +++ x/maintainers/queries/maintainers/query.go | 3 +++ x/metas/queries/meta/query.go | 3 +++ x/metas/queries/metas/query.go | 3 +++ x/orders/queries/order/query.go | 3 +++ x/orders/queries/orders/query.go | 3 +++ x/splits/queries/balances/query.go | 3 +++ x/splits/queries/split/query.go | 3 +++ x/splits/queries/splits/query.go | 3 +++ x/splits/queries/supply/query.go | 3 +++ 17 files changed, 54 insertions(+), 20 deletions(-) diff --git a/helpers/base/query.go b/helpers/base/query.go index 4c2b0614d..fbaf658dc 100644 --- a/helpers/base/query.go +++ b/helpers/base/query.go @@ -30,6 +30,7 @@ type query struct { keeperPrototype func() helpers.QueryKeeper serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper) grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error + queryHandler func(client.Context, helpers.QueryRequest) (helpers.QueryResponse, error) } var _ helpers.Query = (*query)(nil) @@ -52,23 +53,17 @@ func (query query) Command() *cobra.Command { if err != nil { return err } - queryRequest, err := query.requestPrototype().FromCLI(query.cliCommand, clientContext) if err != nil { return err } - responseBytes, _, err := query.query(queryRequest, clientContext) - if err != nil { - return err - } - - response, err := query.responsePrototype().Decode(responseBytes) + queryResponse, err := query.queryHandler(clientContext, queryRequest) if err != nil { return err } - return clientContext.PrintProto(response) + return clientContext.PrintProto(queryResponse) } return query.cliCommand.CreateCommand(runE) @@ -104,13 +99,12 @@ func (query query) RESTQueryHandler(context client.Context) http.HandlerFunc { rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) } - response, height, err := query.query(queryRequest, clientContext) + response, err := query.queryHandler(clientContext, queryRequest) if err != nil { rest.WriteErrorResponse(responseWriter, http.StatusInternalServerError, err.Error()) return } - clientContext = clientContext.WithHeight(height) rest.PostProcessResponse(responseWriter, clientContext, response) } } @@ -119,16 +113,7 @@ func (query query) Initialize(mapper helpers.Mapper, parameterManager helpers.Pa return query } -func (query query) query(queryRequest helpers.QueryRequest, context client.Context) ([]byte, int64, error) { - bytes, err := queryRequest.Encode() - if err != nil { - return nil, 0, err - } - - return context.QueryWithData("custom"+"/"+query.moduleName+"/"+query.name, bytes) -} - -func NewQuery(name string, short string, long string, moduleName string, requestPrototype func() helpers.QueryRequest, responsePrototype func() helpers.QueryResponse, keeperPrototype func() helpers.QueryKeeper, serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper), grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error, flagList ...helpers.CLIFlag) helpers.Query { +func NewQuery(name string, short string, long string, moduleName string, requestPrototype func() helpers.QueryRequest, responsePrototype func() helpers.QueryResponse, keeperPrototype func() helpers.QueryKeeper, serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper), grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error, queryHandler func(client.Context, helpers.QueryRequest) (helpers.QueryResponse, error), flagList ...helpers.CLIFlag) helpers.Query { return query{ name: name, cliCommand: NewCLICommand(name, short, long, flagList), @@ -138,5 +123,6 @@ func NewQuery(name string, short string, long string, moduleName string, request keeperPrototype: keeperPrototype, serviceRegistrar: serviceRegistrar, grpcGatewayRegistrar: grpcGatewayRegistrar, + queryHandler: queryHandler, } } diff --git a/x/assets/queries/asset/query.go b/x/assets/queries/asset/query.go index 3f65928b2..36362c59d 100644 --- a/x/assets/queries/asset/query.go +++ b/x/assets/queries/asset/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.AssetID, ) diff --git a/x/assets/queries/assets/query.go b/x/assets/queries/assets/query.go index caf0f1971..632d34515 100644 --- a/x/assets/queries/assets/query.go +++ b/x/assets/queries/assets/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.AssetID, helperConstants.Limit, diff --git a/x/classifications/queries/classification/query.go b/x/classifications/queries/classification/query.go index 3e9a23870..06c593495 100644 --- a/x/classifications/queries/classification/query.go +++ b/x/classifications/queries/classification/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.ClassificationID, ) diff --git a/x/classifications/queries/classifications/query.go b/x/classifications/queries/classifications/query.go index 1e4be0a02..42bfc5bcf 100644 --- a/x/classifications/queries/classifications/query.go +++ b/x/classifications/queries/classifications/query.go @@ -35,6 +35,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.ClassificationID, helperConstants.Limit, diff --git a/x/identities/queries/identities/query.go b/x/identities/queries/identities/query.go index 052a6253a..5445fadb0 100644 --- a/x/identities/queries/identities/query.go +++ b/x/identities/queries/identities/query.go @@ -32,6 +32,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.IdentityID, helperConstants.Limit, diff --git a/x/identities/queries/identity/query.go b/x/identities/queries/identity/query.go index 2831fffeb..592a565ef 100644 --- a/x/identities/queries/identity/query.go +++ b/x/identities/queries/identity/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.IdentityID, ) diff --git a/x/maintainers/queries/maintainer/query.go b/x/maintainers/queries/maintainer/query.go index b225b5b78..df8de3d2e 100644 --- a/x/maintainers/queries/maintainer/query.go +++ b/x/maintainers/queries/maintainer/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.MaintainerID, ) diff --git a/x/maintainers/queries/maintainers/query.go b/x/maintainers/queries/maintainers/query.go index 9210f7f0c..1e3017809 100644 --- a/x/maintainers/queries/maintainers/query.go +++ b/x/maintainers/queries/maintainers/query.go @@ -35,6 +35,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.MaintainerID, helperConstants.Limit, diff --git a/x/metas/queries/meta/query.go b/x/metas/queries/meta/query.go index dfa1773de..e2c59eee4 100644 --- a/x/metas/queries/meta/query.go +++ b/x/metas/queries/meta/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.DataID, ) diff --git a/x/metas/queries/metas/query.go b/x/metas/queries/metas/query.go index 7f9385935..b3ced8977 100644 --- a/x/metas/queries/metas/query.go +++ b/x/metas/queries/metas/query.go @@ -35,6 +35,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.DataID, helperConstants.Limit, diff --git a/x/orders/queries/order/query.go b/x/orders/queries/order/query.go index a68662056..73f567b7f 100644 --- a/x/orders/queries/order/query.go +++ b/x/orders/queries/order/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.OrderID, ) diff --git a/x/orders/queries/orders/query.go b/x/orders/queries/orders/query.go index f0ab5c94f..370feca35 100644 --- a/x/orders/queries/orders/query.go +++ b/x/orders/queries/orders/query.go @@ -35,6 +35,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.OrderID, helperConstants.Limit, diff --git a/x/splits/queries/balances/query.go b/x/splits/queries/balances/query.go index a07a12273..59fa62df4 100644 --- a/x/splits/queries/balances/query.go +++ b/x/splits/queries/balances/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.IdentityID, helperConstants.SplitID, diff --git a/x/splits/queries/split/query.go b/x/splits/queries/split/query.go index 7911c45c0..aa0462905 100644 --- a/x/splits/queries/split/query.go +++ b/x/splits/queries/split/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.SplitID, ) diff --git a/x/splits/queries/splits/query.go b/x/splits/queries/splits/query.go index b3736cb10..2cb6f9b9b 100644 --- a/x/splits/queries/splits/query.go +++ b/x/splits/queries/splits/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.SplitID, helperConstants.Limit, diff --git a/x/splits/queries/supply/query.go b/x/splits/queries/supply/query.go index 3f99e21b7..08cd6dc47 100644 --- a/x/splits/queries/supply/query.go +++ b/x/splits/queries/supply/query.go @@ -36,6 +36,9 @@ var Query = baseHelpers.NewQuery( func(clientContext client.Context, serveMux *runtime.ServeMux) error { return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) }, + func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { + return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) + }, helperConstants.AssetID, ) From 5535619c23b68a43b5af07d31c7354c2350c48f3 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 19 Aug 2024 21:32:21 +0530 Subject: [PATCH 24/64] refactor(moduleManager): making Set methods pure Signed-off-by: Deepanshu Tripathi --- helpers/base/module_manager.go | 62 +++++++++++++++++++++++++--------- helpers/module_manager.go | 7 ++-- 2 files changed, 50 insertions(+), 19 deletions(-) diff --git a/helpers/base/module_manager.go b/helpers/base/module_manager.go index 3edb819ff..ee4a4f816 100644 --- a/helpers/base/module_manager.go +++ b/helpers/base/module_manager.go @@ -17,6 +17,7 @@ import ( type moduleManager struct { basicModules []helpers.BasicModule orderInitGenesis []string + orderExportGenesis []string orderBeginBlockers []string orderEndBlockers []string } @@ -38,46 +39,59 @@ func (moduleManager moduleManager) AddQueryCommands(rootQueryCmd *cobra.Command) } } func (moduleManager moduleManager) InitGenesis(context sdkTypes.Context, jsonCodec sdkCodec.JSONCodec, genesisData map[string]json.RawMessage) abciTypes.ResponseInitChain { - return moduleManager.getModuleManager().InitGenesis(context, jsonCodec, genesisData) + return moduleManager.getManager().InitGenesis(context, jsonCodec, genesisData) } func (moduleManager moduleManager) GetVersionMap() sdkModuleTypes.VersionMap { - return moduleManager.getModuleManager().GetVersionMap() + return moduleManager.getManager().GetVersionMap() } func (moduleManager moduleManager) RegisterServices(configurator sdkModuleTypes.Configurator) { - moduleManager.getModuleManager().RegisterServices(configurator) + moduleManager.getManager().RegisterServices(configurator) } -func (moduleManager moduleManager) SetOrderBeginBlockers(moduleName ...string) { - sdkModuleManager := moduleManager.getModuleManager() +func (moduleManager moduleManager) SetOrderBeginBlockers(moduleName ...string) helpers.ModuleManager { + sdkModuleManager := moduleManager.getManager() sdkModuleManager.SetOrderBeginBlockers(moduleName...) moduleManager.orderBeginBlockers = sdkModuleManager.OrderBeginBlockers + + return moduleManager } -func (moduleManager moduleManager) SetOrderEndBlockers(moduleName ...string) { - sdkModuleManager := moduleManager.getModuleManager() +func (moduleManager moduleManager) SetOrderEndBlockers(moduleName ...string) helpers.ModuleManager { + sdkModuleManager := moduleManager.getManager() sdkModuleManager.SetOrderEndBlockers(moduleName...) moduleManager.orderEndBlockers = sdkModuleManager.OrderEndBlockers + + return moduleManager } -func (moduleManager moduleManager) SetOrderInitGenesis(moduleName ...string) { - sdkModuleManager := moduleManager.getModuleManager() +func (moduleManager moduleManager) SetOrderInitGenesis(moduleName ...string) helpers.ModuleManager { + sdkModuleManager := moduleManager.getManager() sdkModuleManager.SetOrderInitGenesis(moduleName...) moduleManager.orderInitGenesis = sdkModuleManager.OrderInitGenesis + + return moduleManager +} +func (moduleManager moduleManager) SetOrderExportGenesis(moduleName ...string) helpers.ModuleManager { + sdkModuleManager := moduleManager.getManager() + sdkModuleManager.SetOrderExportGenesis(moduleName...) + moduleManager.orderExportGenesis = sdkModuleManager.OrderExportGenesis + + return moduleManager } func (moduleManager moduleManager) BeginBlock(context sdkTypes.Context, requestBeginBlock abciTypes.RequestBeginBlock) abciTypes.ResponseBeginBlock { - return moduleManager.getModuleManager().BeginBlock(context, requestBeginBlock) + return moduleManager.getManager().BeginBlock(context, requestBeginBlock) } func (moduleManager moduleManager) EndBlock(context sdkTypes.Context, requestEndBlock abciTypes.RequestEndBlock) abciTypes.ResponseEndBlock { - return moduleManager.getModuleManager().EndBlock(context, requestEndBlock) + return moduleManager.getManager().EndBlock(context, requestEndBlock) } func (moduleManager moduleManager) RunMigrations(context sdkTypes.Context, configurator sdkModuleTypes.Configurator, versionMap sdkModuleTypes.VersionMap) (sdkModuleTypes.VersionMap, error) { - return moduleManager.getModuleManager().RunMigrations(context, configurator, versionMap) + return moduleManager.getManager().RunMigrations(context, configurator, versionMap) } func (moduleManager moduleManager) RegisterInvariants(invariantRegistry sdkTypes.InvariantRegistry) { - moduleManager.getModuleManager().RegisterInvariants(invariantRegistry) + moduleManager.getManager().RegisterInvariants(invariantRegistry) } func (moduleManager moduleManager) GetBasicManager() sdkModuleTypes.BasicManager { return sdkModuleTypes.NewBasicManager(moduleManager.getAppModulesBasic()...) } func (moduleManager moduleManager) ExportGenesisForModules(context sdkTypes.Context, jsonCodec sdkCodec.JSONCodec, moduleNames []string) map[string]json.RawMessage { - return moduleManager.getModuleManager().ExportGenesisForModules(context, jsonCodec, moduleNames) + return moduleManager.getManager().ExportGenesisForModules(context, jsonCodec, moduleNames) } func (moduleManager moduleManager) RegisterRESTRoutes(context client.Context, router *mux.Router) { for _, basicModule := range moduleManager.basicModules { @@ -101,12 +115,28 @@ func (moduleManager moduleManager) RegisterInterfaces(interfaceRegistry types.In basicModule.RegisterInterfaces(interfaceRegistry) } } -func (moduleManager moduleManager) getModuleManager() *sdkModuleTypes.Manager { +func (moduleManager moduleManager) getManager() *sdkModuleTypes.Manager { appModules := make([]sdkModuleTypes.AppModule, len(moduleManager.basicModules)) for i, basicModule := range moduleManager.basicModules { appModules[i] = basicModule } - return sdkModuleTypes.NewManager(appModules...) + + manager := sdkModuleTypes.NewManager(appModules...) + + if len(moduleManager.orderInitGenesis) > 0 { + manager.SetOrderInitGenesis(moduleManager.orderInitGenesis...) + } + if len(moduleManager.orderExportGenesis) > 0 { + manager.SetOrderExportGenesis(moduleManager.orderExportGenesis...) + } + if len(moduleManager.orderBeginBlockers) > 0 { + manager.SetOrderBeginBlockers(moduleManager.orderBeginBlockers...) + } + if len(moduleManager.orderEndBlockers) > 0 { + manager.SetOrderEndBlockers(moduleManager.orderEndBlockers...) + } + + return manager } func (moduleManager moduleManager) getAppModulesBasic() []sdkModuleTypes.AppModuleBasic { appModules := make([]sdkModuleTypes.AppModuleBasic, len(moduleManager.basicModules)) diff --git a/helpers/module_manager.go b/helpers/module_manager.go index 42273c77a..4dff1f940 100644 --- a/helpers/module_manager.go +++ b/helpers/module_manager.go @@ -31,9 +31,10 @@ type ModuleManager interface { RegisterInterfaces(sdkCodecTypes.InterfaceRegistry) RegisterLegacyAminoCodec(*codec.LegacyAmino) - SetOrderBeginBlockers(...string) - SetOrderEndBlockers(...string) - SetOrderInitGenesis(...string) + SetOrderBeginBlockers(...string) ModuleManager + SetOrderEndBlockers(...string) ModuleManager + SetOrderInitGenesis(...string) ModuleManager + SetOrderExportGenesis(...string) ModuleManager BeginBlock(sdkTypes.Context, abciTypes.RequestBeginBlock) abciTypes.ResponseBeginBlock EndBlock(sdkTypes.Context, abciTypes.RequestEndBlock) abciTypes.ResponseEndBlock From 20c49dd431f644f2dfa95f3066bf4fb6824dabb6 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 19 Aug 2024 21:32:55 +0530 Subject: [PATCH 25/64] refactor(upgrade): empty keys not allowed anymore Signed-off-by: Deepanshu Tripathi --- x/assets/key/key.go | 2 +- x/classifications/key/key.go | 2 +- x/identities/key/key.go | 2 +- x/maintainers/key/key.go | 2 +- x/orders/key/key.go | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/x/assets/key/key.go b/x/assets/key/key.go index 74a4eb974..342b5e521 100644 --- a/x/assets/key/key.go +++ b/x/assets/key/key.go @@ -22,7 +22,7 @@ func (key *Key) ValidateBasic() error { return nil } func (key *Key) GenerateStorePrefixBytes() []byte { - return []byte{} + return []byte{0x0} } func (key *Key) GenerateStoreKeyBytes() []byte { return key.AssetID.Bytes() diff --git a/x/classifications/key/key.go b/x/classifications/key/key.go index db8b63f8a..4c4057727 100644 --- a/x/classifications/key/key.go +++ b/x/classifications/key/key.go @@ -22,7 +22,7 @@ func (key *Key) ValidateBasic() error { return nil } func (key *Key) GenerateStorePrefixBytes() []byte { - return []byte{} + return []byte{0x0} } func (key *Key) GenerateStoreKeyBytes() []byte { return key.ClassificationID.Bytes() diff --git a/x/identities/key/key.go b/x/identities/key/key.go index 45ecb2c01..72af92b3c 100644 --- a/x/identities/key/key.go +++ b/x/identities/key/key.go @@ -22,7 +22,7 @@ func (key *Key) ValidateBasic() error { return nil } func (key *Key) GenerateStorePrefixBytes() []byte { - return []byte{} + return []byte{0x0} } func (key *Key) GenerateStoreKeyBytes() []byte { return key.IdentityID.Bytes() diff --git a/x/maintainers/key/key.go b/x/maintainers/key/key.go index dbbc1676c..5ed70d63b 100644 --- a/x/maintainers/key/key.go +++ b/x/maintainers/key/key.go @@ -22,7 +22,7 @@ func (key *Key) ValidateBasic() error { return nil } func (key *Key) GenerateStorePrefixBytes() []byte { - return []byte{} + return []byte{0x0} } func (key *Key) GenerateStoreKeyBytes() []byte { return key.MaintainerID.Bytes() diff --git a/x/orders/key/key.go b/x/orders/key/key.go index 63544a956..c978f88da 100644 --- a/x/orders/key/key.go +++ b/x/orders/key/key.go @@ -22,7 +22,7 @@ func (key *Key) ValidateBasic() error { return nil } func (key *Key) GenerateStorePrefixBytes() []byte { - return []byte{} + return []byte{0x0} } func (key *Key) GenerateStoreKeyBytes() []byte { return key.OrderID.Bytes() From 3419b8111a0e22cc00c3307bea5d11c181668d9c Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 19 Aug 2024 21:49:47 +0530 Subject: [PATCH 26/64] retiring: proto gateway Signed-off-by: Deepanshu Tripathi --- .../x/assets/queries/asset/service.proto | 5 +- .../x/assets/queries/assets/service.proto | 5 +- .../x/assets/transactions/burn/service.proto | 1 - .../assets/transactions/define/service.proto | 1 - .../transactions/deputize/service.proto | 1 - .../x/assets/transactions/mint/service.proto | 1 - .../assets/transactions/mutate/service.proto | 1 - .../transactions/renumerate/service.proto | 1 - .../assets/transactions/revoke/service.proto | 1 - .../x/assets/transactions/send/service.proto | 1 - .../assets/transactions/unwrap/service.proto | 1 - .../x/assets/transactions/wrap/service.proto | 1 - .../queries/classification/service.proto | 5 +- .../queries/classifications/service.proto | 5 +- .../queries/identities/service.proto | 5 +- .../identities/queries/identity/service.proto | 5 +- .../transactions/define/service.proto | 1 - .../transactions/deputize/service.proto | 1 - .../transactions/issue/service.proto | 1 - .../transactions/name/service.proto | 1 - .../transactions/provision/service.proto | 1 - .../transactions/quash/service.proto | 1 - .../transactions/revoke/service.proto | 1 - .../transactions/unprovision/service.proto | 1 - .../transactions/update/service.proto | 1 - .../queries/maintainer/service.proto | 5 +- .../queries/maintainers/service.proto | 5 +- .../x/metas/queries/meta/service.proto | 5 +- .../x/metas/queries/metas/service.proto | 5 +- .../x/metas/transactions/reveal/service.proto | 1 - .../x/orders/queries/order/service.proto | 5 +- .../x/orders/queries/orders/service.proto | 5 +- .../orders/transactions/cancel/service.proto | 1 - .../orders/transactions/define/service.proto | 1 - .../transactions/deputize/service.proto | 1 - .../x/orders/transactions/get/service.proto | 1 - .../transactions/immediate/service.proto | 1 - .../x/orders/transactions/make/service.proto | 1 - .../orders/transactions/modify/service.proto | 1 - .../x/orders/transactions/put/service.proto | 1 - .../orders/transactions/revoke/service.proto | 1 - .../x/orders/transactions/take/service.proto | 1 - .../x/splits/queries/balances/service.proto | 5 +- .../x/splits/queries/split/service.proto | 5 +- .../x/splits/queries/splits/service.proto | 5 +- .../x/splits/queries/supply/service.proto | 5 +- proto/buf.gen.yaml | 3 - x/assets/queries/asset/service.pb.go | 46 +++-- x/assets/queries/asset/service.pb.gw.go | 171 ------------------ x/assets/queries/assets/service.pb.go | 46 +++-- x/assets/queries/assets/service.pb.gw.go | 171 ------------------ x/assets/transactions/burn/service.pb.go | 48 +++-- x/assets/transactions/burn/service.pb.gw.go | 171 ------------------ x/assets/transactions/define/service.pb.go | 48 +++-- x/assets/transactions/define/service.pb.gw.go | 171 ------------------ x/assets/transactions/deputize/service.pb.go | 48 +++-- .../transactions/deputize/service.pb.gw.go | 171 ------------------ x/assets/transactions/mint/service.pb.go | 48 +++-- x/assets/transactions/mint/service.pb.gw.go | 171 ------------------ x/assets/transactions/mutate/service.pb.go | 48 +++-- x/assets/transactions/mutate/service.pb.gw.go | 171 ------------------ .../transactions/renumerate/service.pb.go | 50 +++-- .../transactions/renumerate/service.pb.gw.go | 171 ------------------ x/assets/transactions/revoke/service.pb.go | 48 +++-- x/assets/transactions/revoke/service.pb.gw.go | 171 ------------------ x/assets/transactions/send/service.pb.go | 48 +++-- x/assets/transactions/send/service.pb.gw.go | 171 ------------------ x/assets/transactions/unwrap/service.pb.go | 48 +++-- x/assets/transactions/unwrap/service.pb.gw.go | 171 ------------------ x/assets/transactions/wrap/service.pb.go | 48 +++-- x/assets/transactions/wrap/service.pb.gw.go | 171 ------------------ .../queries/classification/service.pb.go | 47 +++-- .../queries/classification/service.pb.gw.go | 171 ------------------ .../queries/classifications/service.pb.go | 47 +++-- .../queries/classifications/service.pb.gw.go | 171 ------------------ x/identities/queries/identities/service.pb.go | 46 +++-- .../queries/identities/service.pb.gw.go | 171 ------------------ x/identities/queries/identity/service.pb.go | 48 +++-- .../queries/identity/service.pb.gw.go | 171 ------------------ .../transactions/define/service.pb.go | 50 +++-- .../transactions/define/service.pb.gw.go | 171 ------------------ .../transactions/deputize/service.pb.go | 50 +++-- .../transactions/deputize/service.pb.gw.go | 171 ------------------ x/identities/transactions/issue/service.pb.go | 48 +++-- .../transactions/issue/service.pb.gw.go | 171 ------------------ x/identities/transactions/name/service.pb.go | 50 +++-- .../transactions/name/service.pb.gw.go | 171 ------------------ .../transactions/provision/service.pb.go | 50 +++-- .../transactions/provision/service.pb.gw.go | 171 ------------------ x/identities/transactions/quash/service.pb.go | 50 +++-- .../transactions/quash/service.pb.gw.go | 171 ------------------ .../transactions/revoke/service.pb.go | 50 +++-- .../transactions/revoke/service.pb.gw.go | 171 ------------------ .../transactions/unprovision/service.pb.go | 50 +++-- .../transactions/unprovision/service.pb.gw.go | 171 ------------------ .../transactions/update/service.pb.go | 50 +++-- .../transactions/update/service.pb.gw.go | 171 ------------------ .../queries/maintainer/service.pb.go | 47 +++-- .../queries/maintainer/service.pb.gw.go | 171 ------------------ .../queries/maintainers/service.pb.go | 46 +++-- .../queries/maintainers/service.pb.gw.go | 171 ------------------ x/metas/queries/meta/service.pb.go | 46 +++-- x/metas/queries/meta/service.pb.gw.go | 171 ------------------ x/metas/queries/metas/service.pb.go | 46 +++-- x/metas/queries/metas/service.pb.gw.go | 171 ------------------ x/metas/transactions/reveal/service.pb.go | 48 +++-- x/metas/transactions/reveal/service.pb.gw.go | 171 ------------------ x/orders/queries/order/service.pb.go | 46 +++-- x/orders/queries/order/service.pb.gw.go | 171 ------------------ x/orders/queries/orders/service.pb.go | 46 +++-- x/orders/queries/orders/service.pb.gw.go | 171 ------------------ x/orders/transactions/cancel/service.pb.go | 49 +++-- x/orders/transactions/cancel/service.pb.gw.go | 171 ------------------ x/orders/transactions/define/service.pb.go | 48 +++-- x/orders/transactions/define/service.pb.gw.go | 171 ------------------ x/orders/transactions/deputize/service.pb.go | 50 +++-- .../transactions/deputize/service.pb.gw.go | 171 ------------------ x/orders/transactions/get/service.pb.go | 49 +++-- x/orders/transactions/get/service.pb.gw.go | 171 ------------------ x/orders/transactions/immediate/service.pb.go | 50 +++-- .../transactions/immediate/service.pb.gw.go | 171 ------------------ x/orders/transactions/make/service.pb.go | 48 +++-- x/orders/transactions/make/service.pb.gw.go | 171 ------------------ x/orders/transactions/modify/service.pb.go | 50 +++-- x/orders/transactions/modify/service.pb.gw.go | 171 ------------------ x/orders/transactions/put/service.pb.go | 49 +++-- x/orders/transactions/put/service.pb.gw.go | 171 ------------------ x/orders/transactions/revoke/service.pb.go | 48 +++-- x/orders/transactions/revoke/service.pb.gw.go | 171 ------------------ x/orders/transactions/take/service.pb.go | 48 +++-- x/orders/transactions/take/service.pb.gw.go | 171 ------------------ x/splits/queries/balances/service.pb.go | 47 +++-- x/splits/queries/balances/service.pb.gw.go | 171 ------------------ x/splits/queries/split/service.pb.go | 46 +++-- x/splits/queries/split/service.pb.gw.go | 171 ------------------ x/splits/queries/splits/service.pb.go | 46 +++-- x/splits/queries/splits/service.pb.gw.go | 171 ------------------ x/splits/queries/supply/service.pb.go | 46 +++-- x/splits/queries/supply/service.pb.gw.go | 171 ------------------ 139 files changed, 1059 insertions(+), 9129 deletions(-) delete mode 100644 x/assets/queries/asset/service.pb.gw.go delete mode 100644 x/assets/queries/assets/service.pb.gw.go delete mode 100644 x/assets/transactions/burn/service.pb.gw.go delete mode 100644 x/assets/transactions/define/service.pb.gw.go delete mode 100644 x/assets/transactions/deputize/service.pb.gw.go delete mode 100644 x/assets/transactions/mint/service.pb.gw.go delete mode 100644 x/assets/transactions/mutate/service.pb.gw.go delete mode 100644 x/assets/transactions/renumerate/service.pb.gw.go delete mode 100644 x/assets/transactions/revoke/service.pb.gw.go delete mode 100644 x/assets/transactions/send/service.pb.gw.go delete mode 100644 x/assets/transactions/unwrap/service.pb.gw.go delete mode 100644 x/assets/transactions/wrap/service.pb.gw.go delete mode 100644 x/classifications/queries/classification/service.pb.gw.go delete mode 100644 x/classifications/queries/classifications/service.pb.gw.go delete mode 100644 x/identities/queries/identities/service.pb.gw.go delete mode 100644 x/identities/queries/identity/service.pb.gw.go delete mode 100644 x/identities/transactions/define/service.pb.gw.go delete mode 100644 x/identities/transactions/deputize/service.pb.gw.go delete mode 100644 x/identities/transactions/issue/service.pb.gw.go delete mode 100644 x/identities/transactions/name/service.pb.gw.go delete mode 100644 x/identities/transactions/provision/service.pb.gw.go delete mode 100644 x/identities/transactions/quash/service.pb.gw.go delete mode 100644 x/identities/transactions/revoke/service.pb.gw.go delete mode 100644 x/identities/transactions/unprovision/service.pb.gw.go delete mode 100644 x/identities/transactions/update/service.pb.gw.go delete mode 100644 x/maintainers/queries/maintainer/service.pb.gw.go delete mode 100644 x/maintainers/queries/maintainers/service.pb.gw.go delete mode 100644 x/metas/queries/meta/service.pb.gw.go delete mode 100644 x/metas/queries/metas/service.pb.gw.go delete mode 100644 x/metas/transactions/reveal/service.pb.gw.go delete mode 100644 x/orders/queries/order/service.pb.gw.go delete mode 100644 x/orders/queries/orders/service.pb.gw.go delete mode 100644 x/orders/transactions/cancel/service.pb.gw.go delete mode 100644 x/orders/transactions/define/service.pb.gw.go delete mode 100644 x/orders/transactions/deputize/service.pb.gw.go delete mode 100644 x/orders/transactions/get/service.pb.gw.go delete mode 100644 x/orders/transactions/immediate/service.pb.gw.go delete mode 100644 x/orders/transactions/make/service.pb.gw.go delete mode 100644 x/orders/transactions/modify/service.pb.gw.go delete mode 100644 x/orders/transactions/put/service.pb.gw.go delete mode 100644 x/orders/transactions/revoke/service.pb.gw.go delete mode 100644 x/orders/transactions/take/service.pb.gw.go delete mode 100644 x/splits/queries/balances/service.pb.gw.go delete mode 100644 x/splits/queries/split/service.pb.gw.go delete mode 100644 x/splits/queries/splits/service.pb.gw.go delete mode 100644 x/splits/queries/supply/service.pb.gw.go diff --git a/proto/AssetMantle/modules/x/assets/queries/asset/service.proto b/proto/AssetMantle/modules/x/assets/queries/asset/service.proto index 239878561..1c6134223 100644 --- a/proto/AssetMantle/modules/x/assets/queries/asset/service.proto +++ b/proto/AssetMantle/modules/x/assets/queries/asset/service.proto @@ -3,10 +3,7 @@ package AssetMantle.modules.x.assets.queries.asset; import "AssetMantle/modules/x/assets/queries/asset/query_request.proto"; import "AssetMantle/modules/x/assets/queries/asset/query_response.proto"; -import "google/api/annotations.proto"; service Query { - rpc Handle(QueryRequest) returns (QueryResponse) { - option (google.api.http).get = "/mantle/assets/v1beta1/asset"; - } + rpc Handle(QueryRequest) returns (QueryResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/queries/assets/service.proto b/proto/AssetMantle/modules/x/assets/queries/assets/service.proto index d938521c5..ca10b3a1b 100644 --- a/proto/AssetMantle/modules/x/assets/queries/assets/service.proto +++ b/proto/AssetMantle/modules/x/assets/queries/assets/service.proto @@ -3,10 +3,7 @@ package AssetMantle.modules.x.assets.queries.assets; import "AssetMantle/modules/x/assets/queries/assets/query_request.proto"; import "AssetMantle/modules/x/assets/queries/assets/query_response.proto"; -import "google/api/annotations.proto"; service Query { - rpc Handle(QueryRequest) returns (QueryResponse) { - option (google.api.http).get = "/mantle/assets/v1beta1/assets"; - } + rpc Handle(QueryRequest) returns (QueryResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto b/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto index b6f5a8a59..3c577f254 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/burn/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.burn; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/burn/message.proto"; import "AssetMantle/modules/x/assets/transactions/burn/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/define/service.proto b/proto/AssetMantle/modules/x/assets/transactions/define/service.proto index 3e0ce4eae..c4451e45a 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/define/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/define/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.define; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/define/message.proto"; import "AssetMantle/modules/x/assets/transactions/define/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto b/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto index 3ef897f93..826158b5e 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/deputize/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.deputize; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/deputize/message.proto"; import "AssetMantle/modules/x/assets/transactions/deputize/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto b/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto index b6e304168..21ed2e29d 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/mint/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.mint; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/mint/message.proto"; import "AssetMantle/modules/x/assets/transactions/mint/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto b/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto index 3a718058b..4fad3ecf1 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/mutate/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.mutate; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/mutate/message.proto"; import "AssetMantle/modules/x/assets/transactions/mutate/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto b/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto index 2f79d12b7..f6e20a4c4 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/renumerate/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.renumerate; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/renumerate/message.proto"; import "AssetMantle/modules/x/assets/transactions/renumerate/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto b/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto index f78620c70..dec63d2ab 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/revoke/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.revoke; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/revoke/message.proto"; import "AssetMantle/modules/x/assets/transactions/revoke/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/send/service.proto b/proto/AssetMantle/modules/x/assets/transactions/send/service.proto index b7e84c3ad..629dcfe73 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/send/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/send/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.send; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/send/message.proto"; import "AssetMantle/modules/x/assets/transactions/send/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto b/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto index 5028e690b..e275b7cbd 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/unwrap/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.unwrap; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/unwrap/message.proto"; import "AssetMantle/modules/x/assets/transactions/unwrap/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto b/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto index d02bc49b0..4f77245dd 100644 --- a/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto +++ b/proto/AssetMantle/modules/x/assets/transactions/wrap/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.assets.transactions.wrap; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/assets/transactions/wrap/message.proto"; import "AssetMantle/modules/x/assets/transactions/wrap/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/classifications/queries/classification/service.proto b/proto/AssetMantle/modules/x/classifications/queries/classification/service.proto index 8a238c240..4d467bc7c 100644 --- a/proto/AssetMantle/modules/x/classifications/queries/classification/service.proto +++ b/proto/AssetMantle/modules/x/classifications/queries/classification/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.classifications.queries.classification; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/classifications/queries/classification/query_request.proto"; import "AssetMantle/modules/x/classifications/queries/classification/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/classifications/v1beta1/classification"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/classifications/queries/classifications/service.proto b/proto/AssetMantle/modules/x/classifications/queries/classifications/service.proto index 0329b8690..7e34a2296 100644 --- a/proto/AssetMantle/modules/x/classifications/queries/classifications/service.proto +++ b/proto/AssetMantle/modules/x/classifications/queries/classifications/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.classifications.queries.classifications; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/classifications/queries/classifications/query_request.proto"; import "AssetMantle/modules/x/classifications/queries/classifications/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/classifications/v1beta1/classifications"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/queries/identities/service.proto b/proto/AssetMantle/modules/x/identities/queries/identities/service.proto index 72db49f08..ceada9af9 100644 --- a/proto/AssetMantle/modules/x/identities/queries/identities/service.proto +++ b/proto/AssetMantle/modules/x/identities/queries/identities/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.queries.identities; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/queries/identities/query_request.proto"; import "AssetMantle/modules/x/identities/queries/identities/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/identities/v1beta1/identities"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/queries/identity/service.proto b/proto/AssetMantle/modules/x/identities/queries/identity/service.proto index 749f61cc7..09ba89f05 100644 --- a/proto/AssetMantle/modules/x/identities/queries/identity/service.proto +++ b/proto/AssetMantle/modules/x/identities/queries/identity/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.queries.identity; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/queries/identity/query_request.proto"; import "AssetMantle/modules/x/identities/queries/identity/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/identities/v1beta1/identity"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/transactions/define/service.proto b/proto/AssetMantle/modules/x/identities/transactions/define/service.proto index dc09c7529..cffe58b4e 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/define/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/define/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.define; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/define/message.proto"; import "AssetMantle/modules/x/identities/transactions/define/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto b/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto index e75791c7f..1a7ac609d 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/deputize/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.deputize; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/deputize/message.proto"; import "AssetMantle/modules/x/identities/transactions/deputize/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto b/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto index 028f73bfb..19c03a5ba 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/issue/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.issue; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/issue/message.proto"; import "AssetMantle/modules/x/identities/transactions/issue/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/name/service.proto b/proto/AssetMantle/modules/x/identities/transactions/name/service.proto index 486530078..460258171 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/name/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/name/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.name; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/name/message.proto"; import "AssetMantle/modules/x/identities/transactions/name/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto b/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto index bf3bac97c..7bb67cd3f 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/provision/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.provision; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/provision/message.proto"; import "AssetMantle/modules/x/identities/transactions/provision/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto b/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto index a7e3428f5..2b8e21a1d 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/quash/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.quash; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/quash/message.proto"; import "AssetMantle/modules/x/identities/transactions/quash/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto b/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto index 1cfc20f9d..9352660a2 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/revoke/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.revoke; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/revoke/message.proto"; import "AssetMantle/modules/x/identities/transactions/revoke/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto b/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto index e530b5b4a..8fd6cabed 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/unprovision/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.unprovision; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/unprovision/message.proto"; import "AssetMantle/modules/x/identities/transactions/unprovision/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/identities/transactions/update/service.proto b/proto/AssetMantle/modules/x/identities/transactions/update/service.proto index 26ab816fe..eaf99f299 100644 --- a/proto/AssetMantle/modules/x/identities/transactions/update/service.proto +++ b/proto/AssetMantle/modules/x/identities/transactions/update/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.identities.transactions.update; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/identities/transactions/update/message.proto"; import "AssetMantle/modules/x/identities/transactions/update/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/maintainers/queries/maintainer/service.proto b/proto/AssetMantle/modules/x/maintainers/queries/maintainer/service.proto index da7a1008c..6a9ac73e4 100644 --- a/proto/AssetMantle/modules/x/maintainers/queries/maintainer/service.proto +++ b/proto/AssetMantle/modules/x/maintainers/queries/maintainer/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.maintainers.queries.maintainer; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/maintainers/queries/maintainer/query_request.proto"; import "AssetMantle/modules/x/maintainers/queries/maintainer/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/maintainers/v1beta1/maintainer"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/maintainers/queries/maintainers/service.proto b/proto/AssetMantle/modules/x/maintainers/queries/maintainers/service.proto index 360adac4f..994f9bb06 100644 --- a/proto/AssetMantle/modules/x/maintainers/queries/maintainers/service.proto +++ b/proto/AssetMantle/modules/x/maintainers/queries/maintainers/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.maintainers.queries.maintainers; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/maintainers/queries/maintainers/query_request.proto"; import "AssetMantle/modules/x/maintainers/queries/maintainers/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/maintainers/v1beta1/maintainers"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/metas/queries/meta/service.proto b/proto/AssetMantle/modules/x/metas/queries/meta/service.proto index 4bc2f8f40..a3a8c4d27 100644 --- a/proto/AssetMantle/modules/x/metas/queries/meta/service.proto +++ b/proto/AssetMantle/modules/x/metas/queries/meta/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.metas.queries.meta; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/metas/queries/meta/query_request.proto"; import "AssetMantle/modules/x/metas/queries/meta/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/metas/v1beta1/meta"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/metas/queries/metas/service.proto b/proto/AssetMantle/modules/x/metas/queries/metas/service.proto index 544d75f41..d9851760e 100644 --- a/proto/AssetMantle/modules/x/metas/queries/metas/service.proto +++ b/proto/AssetMantle/modules/x/metas/queries/metas/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.metas.queries.metas; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/metas/queries/metas/query_request.proto"; import "AssetMantle/modules/x/metas/queries/metas/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/metas/v1beta1/metas"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto b/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto index 5f220ea47..e026bae20 100644 --- a/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto +++ b/proto/AssetMantle/modules/x/metas/transactions/reveal/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.metas.transactions.reveal; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/metas/transactions/reveal/message.proto"; import "AssetMantle/modules/x/metas/transactions/reveal/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/queries/order/service.proto b/proto/AssetMantle/modules/x/orders/queries/order/service.proto index 18183b5a3..662c0c26e 100644 --- a/proto/AssetMantle/modules/x/orders/queries/order/service.proto +++ b/proto/AssetMantle/modules/x/orders/queries/order/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.queries.order; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/queries/order/query_request.proto"; import "AssetMantle/modules/x/orders/queries/order/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/orders/v1beta1/order"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/queries/orders/service.proto b/proto/AssetMantle/modules/x/orders/queries/orders/service.proto index a82842e35..7cebcf4fe 100644 --- a/proto/AssetMantle/modules/x/orders/queries/orders/service.proto +++ b/proto/AssetMantle/modules/x/orders/queries/orders/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.queries.orders; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/queries/orders/query_request.proto"; import "AssetMantle/modules/x/orders/queries/orders/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns (QueryResponse) { - option (google.api.http).get = "/mantle/orders/v1beta1/orders"; - } + rpc Handle(QueryRequest) returns (QueryResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto b/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto index 44b5d9f17..390ce7596 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/cancel/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.cancel; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/cancel/message.proto"; import "AssetMantle/modules/x/orders/transactions/cancel/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/define/service.proto b/proto/AssetMantle/modules/x/orders/transactions/define/service.proto index 4b0fd8197..2774f0ca9 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/define/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/define/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.define; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/define/message.proto"; import "AssetMantle/modules/x/orders/transactions/define/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto b/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto index c1a988763..9bf1dda32 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/deputize/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.deputize; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/deputize/message.proto"; import "AssetMantle/modules/x/orders/transactions/deputize/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/get/service.proto b/proto/AssetMantle/modules/x/orders/transactions/get/service.proto index 155a640df..fbf128450 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/get/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/get/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.get; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/get/message.proto"; import "AssetMantle/modules/x/orders/transactions/get/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto b/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto index ab585f884..72b37dd49 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/immediate/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.immediate; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/immediate/message.proto"; import "AssetMantle/modules/x/orders/transactions/immediate/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/make/service.proto b/proto/AssetMantle/modules/x/orders/transactions/make/service.proto index 3de650727..f39070024 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/make/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/make/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.make; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/make/message.proto"; import "AssetMantle/modules/x/orders/transactions/make/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto b/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto index ce68877ee..420ee675b 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/modify/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.modify; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/modify/message.proto"; import "AssetMantle/modules/x/orders/transactions/modify/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/put/service.proto b/proto/AssetMantle/modules/x/orders/transactions/put/service.proto index 3119d20eb..3cf3c903f 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/put/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/put/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.put; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/put/message.proto"; import "AssetMantle/modules/x/orders/transactions/put/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto b/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto index aac94ddb4..34975693e 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/revoke/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.revoke; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/revoke/message.proto"; import "AssetMantle/modules/x/orders/transactions/revoke/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/orders/transactions/take/service.proto b/proto/AssetMantle/modules/x/orders/transactions/take/service.proto index e5e5b4ce1..dc331fb62 100644 --- a/proto/AssetMantle/modules/x/orders/transactions/take/service.proto +++ b/proto/AssetMantle/modules/x/orders/transactions/take/service.proto @@ -2,7 +2,6 @@ syntax = "proto3"; package AssetMantle.modules.x.orders.transactions.take; import "cosmos/msg/v1/msg.proto"; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/orders/transactions/take/message.proto"; import "AssetMantle/modules/x/orders/transactions/take/transaction_response.proto"; diff --git a/proto/AssetMantle/modules/x/splits/queries/balances/service.proto b/proto/AssetMantle/modules/x/splits/queries/balances/service.proto index b7448f05c..d291e3a17 100644 --- a/proto/AssetMantle/modules/x/splits/queries/balances/service.proto +++ b/proto/AssetMantle/modules/x/splits/queries/balances/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.splits.queries.balances; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/splits/queries/balances/query_request.proto"; import "AssetMantle/modules/x/splits/queries/balances/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns (QueryResponse) { - option (google.api.http).get = "/mantle/splits/v1beta1/balances"; - } + rpc Handle(QueryRequest) returns (QueryResponse) {} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/splits/queries/split/service.proto b/proto/AssetMantle/modules/x/splits/queries/split/service.proto index 28271df3e..81dace100 100644 --- a/proto/AssetMantle/modules/x/splits/queries/split/service.proto +++ b/proto/AssetMantle/modules/x/splits/queries/split/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.splits.queries.split; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/splits/queries/split/query_request.proto"; import "AssetMantle/modules/x/splits/queries/split/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/splits/v1beta1/split"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/splits/queries/splits/service.proto b/proto/AssetMantle/modules/x/splits/queries/splits/service.proto index 9aaaa2214..f83783247 100644 --- a/proto/AssetMantle/modules/x/splits/queries/splits/service.proto +++ b/proto/AssetMantle/modules/x/splits/queries/splits/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.splits.queries.splits; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/splits/queries/splits/query_request.proto"; import "AssetMantle/modules/x/splits/queries/splits/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns(QueryResponse){ - option (google.api.http).get = "/mantle/splits/v1beta1/splits"; - } + rpc Handle(QueryRequest) returns(QueryResponse){} } \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/splits/queries/supply/service.proto b/proto/AssetMantle/modules/x/splits/queries/supply/service.proto index 5c380a324..3be634ede 100644 --- a/proto/AssetMantle/modules/x/splits/queries/supply/service.proto +++ b/proto/AssetMantle/modules/x/splits/queries/supply/service.proto @@ -1,12 +1,9 @@ syntax = "proto3"; package AssetMantle.modules.x.splits.queries.supply; -import "google/api/annotations.proto"; import "AssetMantle/modules/x/splits/queries/supply/query_request.proto"; import "AssetMantle/modules/x/splits/queries/supply/query_response.proto"; service Query { - rpc Handle(QueryRequest) returns (QueryResponse) { - option (google.api.http).get = "/mantle/splits/v1beta1/supply"; - } + rpc Handle(QueryRequest) returns (QueryResponse) {} } \ No newline at end of file diff --git a/proto/buf.gen.yaml b/proto/buf.gen.yaml index 8e18d867c..810df92a7 100644 --- a/proto/buf.gen.yaml +++ b/proto/buf.gen.yaml @@ -13,6 +13,3 @@ plugins: - name: gocosmos out: ../ opt: plugins=grpc - - name: grpc-gateway - out: ../ - opt: allow_colon_final_segments=true diff --git a/x/assets/queries/asset/service.pb.go b/x/assets/queries/asset/service.pb.go index c1c94f135..c08f6476c 100644 --- a/x/assets/queries/asset/service.pb.go +++ b/x/assets/queries/asset/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_a9cb246b41332473 = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0x86, 0x9b, 0x80, 0x1d, 0x82, 0x53, 0xc6, 0x50, 0x6e, 0x10, 0x27, 0x87, 0x3b, 0xaa, 0x28, - 0xf5, 0x06, 0x25, 0x5d, 0x74, 0x09, 0xb4, 0xba, 0x04, 0x09, 0xc8, 0xb5, 0xfd, 0xa8, 0x81, 0x34, - 0xd7, 0xe6, 0x2e, 0xa5, 0xae, 0xfe, 0x02, 0xc1, 0x7f, 0xa0, 0x9b, 0xe0, 0xff, 0x10, 0xa7, 0x82, - 0x8b, 0x8b, 0x20, 0xa9, 0x93, 0xbf, 0x42, 0x92, 0xef, 0x86, 0x76, 0x6b, 0x3b, 0xbe, 0x97, 0xf7, - 0xc9, 0xfb, 0xbd, 0x77, 0x9f, 0xd3, 0xf2, 0x95, 0x02, 0x1d, 0x88, 0x54, 0x27, 0xc0, 0x46, 0x72, - 0x90, 0x27, 0xa0, 0xd8, 0x8c, 0x89, 0xf2, 0x54, 0xb1, 0x49, 0x0e, 0x59, 0x0c, 0x0a, 0x25, 0x53, - 0x90, 0x4d, 0xe3, 0x3e, 0xd0, 0x71, 0x26, 0xb5, 0x74, 0x0f, 0x96, 0x48, 0x6a, 0x48, 0x3a, 0xa3, - 0x48, 0x52, 0x43, 0xa2, 0xf4, 0xce, 0x36, 0x48, 0x29, 0xd5, 0xfd, 0x6d, 0x06, 0x93, 0x1c, 0x94, - 0xc6, 0x2c, 0xef, 0x7c, 0x0b, 0x5e, 0x8d, 0x65, 0xaa, 0xcc, 0xb0, 0x5e, 0x63, 0x28, 0xe5, 0x30, - 0x01, 0x26, 0xc6, 0x31, 0x13, 0x69, 0x2a, 0xb5, 0xd0, 0xb1, 0x4c, 0x15, 0x7e, 0x3d, 0x7c, 0xb3, - 0x9c, 0x9d, 0x6e, 0x89, 0xb9, 0x2f, 0x96, 0x53, 0xbf, 0x14, 0xe9, 0x20, 0x01, 0xb7, 0x45, 0xd7, - 0x2f, 0x48, 0x2b, 0xfa, 0x0a, 0x67, 0xf6, 0x4e, 0xb7, 0x20, 0x71, 0xda, 0xbd, 0xfd, 0x87, 0xcf, - 0xdf, 0x27, 0x9b, 0xb8, 0x0d, 0x36, 0xc2, 0xb2, 0xa6, 0xe2, 0xb4, 0xd9, 0x03, 0x2d, 0x9a, 0x28, - 0xdb, 0xdf, 0xf6, 0x7b, 0x41, 0xac, 0x79, 0x41, 0xac, 0x9f, 0x82, 0x58, 0x8f, 0x0b, 0x52, 0x9b, - 0x2f, 0x48, 0xed, 0x6b, 0x41, 0x6a, 0x0e, 0xed, 0xcb, 0xd1, 0x06, 0xf1, 0xed, 0xdd, 0x6b, 0x7c, - 0xd4, 0x4e, 0x79, 0x11, 0x1d, 0xeb, 0xe6, 0x78, 0x18, 0xeb, 0xbb, 0xbc, 0x57, 0xfe, 0x86, 0xad, - 0x7f, 0xe9, 0xcf, 0x76, 0xdd, 0x0f, 0x42, 0xbf, 0xeb, 0xbf, 0xda, 0x2b, 0x6b, 0x11, 0x98, 0xf0, - 0x10, 0x47, 0x52, 0x55, 0xdb, 0x32, 0xbc, 0x92, 0x1f, 0x2b, 0xe6, 0xc8, 0x98, 0xa3, 0x30, 0x42, - 0x73, 0x64, 0xcc, 0x28, 0x0b, 0xfb, 0x64, 0x7d, 0x73, 0x74, 0xd1, 0x69, 0x07, 0xa0, 0xc5, 0x40, - 0x68, 0xf1, 0x67, 0x2f, 0x17, 0xe1, 0xdc, 0x90, 0x9c, 0x87, 0x9c, 0x23, 0xcb, 0xb9, 0x81, 0xcd, - 0x41, 0xaf, 0x5e, 0xad, 0xc5, 0xd1, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6c, 0x4f, 0x87, 0x0e, - 0x1d, 0x03, 0x00, 0x00, + // 308 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x70, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x4f, 0x04, 0x89, 0x16, 0xeb, 0x17, 0x96, 0xa6, 0x16, 0x65, 0xa6, 0x16, 0x43, 0xb8, + 0xfa, 0xc5, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0x5a, + 0x48, 0x3a, 0xf5, 0xa0, 0x3a, 0xf5, 0x2a, 0xf4, 0x20, 0x3a, 0xf5, 0xa0, 0x3a, 0x21, 0x5c, 0x29, + 0x3b, 0x12, 0x6c, 0x01, 0xf1, 0x2a, 0xe3, 0x8b, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x20, 0x76, + 0x49, 0xd9, 0x93, 0xa1, 0xbf, 0xb8, 0x20, 0x3f, 0xaf, 0x18, 0xea, 0x58, 0xa3, 0x0e, 0x46, 0x2e, + 0xd6, 0x40, 0x90, 0x84, 0x50, 0x3d, 0x17, 0x9b, 0x47, 0x62, 0x5e, 0x4a, 0x4e, 0xaa, 0x90, 0x85, + 0x1e, 0xf1, 0x3e, 0xd0, 0x03, 0x6b, 0x0e, 0x82, 0x38, 0x4a, 0xca, 0x92, 0x0c, 0x9d, 0x10, 0xe7, + 0x28, 0x31, 0x38, 0xdd, 0x65, 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, 0x06, 0x2e, + 0xbd, 0xe4, 0xfc, 0x5c, 0x12, 0x8c, 0x76, 0xe2, 0x09, 0x86, 0xc4, 0x48, 0x00, 0xc8, 0x8f, 0x01, + 0x8c, 0x51, 0xa6, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x20, 0x63, 0xf4, 0x89, 0x0f, 0xb1, 0x45, + 0x4c, 0x6c, 0x8e, 0xbe, 0x11, 0x8e, 0x81, 0x8e, 0xab, 0x98, 0x50, 0xe2, 0xd4, 0x17, 0x6a, 0x79, + 0x04, 0xc4, 0x49, 0xc5, 0x60, 0x9f, 0x80, 0x2c, 0x07, 0x73, 0x4f, 0xa1, 0x28, 0x8e, 0x81, 0x2a, + 0x8e, 0x89, 0x88, 0x81, 0x28, 0x8e, 0x81, 0x2a, 0x86, 0x70, 0x1f, 0x31, 0x99, 0x11, 0xaf, 0x38, + 0xc6, 0x3d, 0xc0, 0xc9, 0x37, 0xb5, 0x24, 0x31, 0x25, 0xb1, 0x24, 0xf1, 0x15, 0x13, 0xb2, 0x47, + 0xac, 0xac, 0xa0, 0x3a, 0xad, 0xac, 0x22, 0xac, 0xac, 0x20, 0x7a, 0xad, 0xac, 0xa0, 0x9a, 0xa1, + 0x02, 0x49, 0x6c, 0xe0, 0x18, 0x37, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x7b, 0x74, 0x5c, 0xec, + 0xda, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/queries/asset/service.pb.gw.go b/x/assets/queries/asset/service.pb.gw.go deleted file mode 100644 index c2a0630cd..000000000 --- a/x/assets/queries/asset/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/queries/asset/service.proto - -/* -Package asset is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package asset - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "assets", "v1beta1", "asset"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/queries/assets/service.pb.go b/x/assets/queries/assets/service.pb.go index 1b0dbe0d2..79e4091f3 100644 --- a/x/assets/queries/assets/service.pb.go +++ b/x/assets/queries/assets/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_c8b1b0efe74062b4 = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0x86, 0x9b, 0x80, 0x1d, 0x82, 0x53, 0xc6, 0xa0, 0x11, 0x04, 0x27, 0xe1, 0xce, 0x2a, 0x28, - 0xbd, 0x45, 0xd3, 0x45, 0x97, 0x40, 0xab, 0x4b, 0x90, 0x80, 0x5c, 0xdb, 0x8f, 0x1a, 0x48, 0x72, - 0x6d, 0xee, 0x52, 0xea, 0xea, 0x2f, 0x10, 0xfc, 0x07, 0x0e, 0x0e, 0x4e, 0xfe, 0x0c, 0x71, 0x2a, - 0xb8, 0x38, 0x4a, 0xe2, 0xe4, 0xaf, 0x90, 0xf4, 0xbe, 0x42, 0x3b, 0xa6, 0xe3, 0x7b, 0xf7, 0x3e, - 0xf9, 0xde, 0xf7, 0xf2, 0x59, 0x6d, 0x4f, 0x4a, 0x50, 0x3e, 0x4f, 0x55, 0x0c, 0x34, 0x11, 0xc3, - 0x3c, 0x06, 0x49, 0x67, 0x94, 0x57, 0xa7, 0x92, 0x4e, 0x72, 0xc8, 0x22, 0x90, 0x4b, 0x29, 0x21, - 0x9b, 0x46, 0x03, 0x20, 0xe3, 0x4c, 0x28, 0x61, 0x1f, 0xae, 0xa0, 0x04, 0x51, 0x32, 0x23, 0xda, - 0x4b, 0x10, 0x45, 0xe9, 0x9c, 0xd7, 0x99, 0x53, 0xc9, 0x87, 0xbb, 0x0c, 0x26, 0x39, 0x48, 0xa5, - 0xa7, 0x39, 0x17, 0x9b, 0x7c, 0x40, 0x8e, 0x45, 0x2a, 0x31, 0xaf, 0xb3, 0x33, 0x12, 0x62, 0x14, - 0x03, 0xe5, 0xe3, 0x88, 0xf2, 0x34, 0x15, 0x8a, 0xab, 0x48, 0xa4, 0x52, 0xdf, 0x1e, 0xbf, 0x1b, - 0xd6, 0x56, 0xaf, 0xc2, 0xec, 0x57, 0xc3, 0x6a, 0x5e, 0xf1, 0x74, 0x18, 0x83, 0xdd, 0x26, 0x35, - 0x3a, 0x92, 0x05, 0x7e, 0xad, 0x53, 0x3b, 0x6c, 0x13, 0x54, 0xe7, 0xdd, 0x3f, 0x78, 0xfc, 0xfa, - 0x7d, 0x36, 0xf7, 0xec, 0x5d, 0x9a, 0xe8, 0xbe, 0x58, 0x6b, 0xda, 0xea, 0x83, 0xe2, 0x2d, 0x94, - 0x9d, 0xd2, 0xfc, 0x28, 0x5c, 0x63, 0x5e, 0xb8, 0xc6, 0x4f, 0xe1, 0x1a, 0x4f, 0xa5, 0xdb, 0x98, - 0x97, 0x6e, 0xe3, 0xbb, 0x74, 0x1b, 0x16, 0x1d, 0x88, 0xa4, 0x4e, 0x80, 0xce, 0xf6, 0x8d, 0xfe, - 0xb7, 0xdd, 0xea, 0x31, 0xba, 0xc6, 0xed, 0xe9, 0x28, 0x52, 0xf7, 0x79, 0x9f, 0x0c, 0x44, 0x42, - 0x6b, 0xbc, 0xfc, 0x8b, 0xd9, 0xf4, 0xfc, 0xc0, 0xeb, 0x79, 0x6f, 0xe6, 0xda, 0x7a, 0xf8, 0x38, - 0x3e, 0xd0, 0xa1, 0x74, 0xe1, 0x6a, 0xbc, 0x96, 0x9f, 0x6b, 0xee, 0x10, 0xdd, 0x61, 0x10, 0xea, - 0xeb, 0x10, 0xdd, 0x28, 0x0b, 0xf3, 0xac, 0x86, 0x3b, 0xbc, 0xec, 0x76, 0x7c, 0x50, 0x7c, 0xc8, - 0x15, 0xff, 0x33, 0x8f, 0x56, 0x48, 0xc6, 0x10, 0x65, 0x2c, 0x60, 0x4c, 0xbb, 0x19, 0x43, 0x7a, - 0x79, 0xd0, 0x6f, 0x2e, 0xf6, 0xe3, 0xe4, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x56, 0x5a, 0xf8, 0x16, - 0x2a, 0x03, 0x00, 0x00, + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x74, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x4f, 0x04, 0x89, 0x16, 0xeb, 0x17, 0x96, 0xa6, 0x16, 0x65, 0xa6, 0x16, 0xc3, 0xb8, + 0xc5, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 0x7a, 0x05, 0x45, 0xf9, 0x25, 0xf9, 0x42, 0xda, 0x48, + 0x5a, 0xf5, 0xa0, 0x5a, 0xf5, 0x2a, 0xf4, 0x20, 0x6a, 0xf5, 0xa0, 0x5a, 0xa1, 0x5c, 0x29, 0x7b, + 0x52, 0xec, 0x01, 0x71, 0x2b, 0xe3, 0x8b, 0x52, 0x0b, 0x4b, 0x53, 0x8b, 0x4b, 0x20, 0xb6, 0x49, + 0x39, 0x90, 0x63, 0x40, 0x71, 0x41, 0x7e, 0x5e, 0x31, 0xd4, 0xbd, 0x46, 0xdd, 0x8c, 0x5c, 0xac, + 0x81, 0x20, 0x09, 0xa1, 0x46, 0x46, 0x2e, 0x36, 0x8f, 0xc4, 0xbc, 0x94, 0x9c, 0x54, 0x21, 0x4b, + 0x3d, 0x12, 0x7c, 0xa1, 0x07, 0xd6, 0x1e, 0x04, 0x71, 0x97, 0x94, 0x15, 0x39, 0x5a, 0x21, 0x2e, + 0x52, 0x62, 0x70, 0x7a, 0xcc, 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, 0x5c, + 0xfa, 0xc9, 0xf9, 0xb9, 0xa4, 0x98, 0xed, 0xc4, 0x13, 0x0c, 0x89, 0x98, 0x00, 0x90, 0x3f, 0x03, + 0x18, 0xa3, 0xcc, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x49, 0x08, + 0xb6, 0x45, 0x4c, 0x6c, 0x8e, 0xbe, 0x11, 0x8e, 0x81, 0x8e, 0xab, 0x98, 0x50, 0xe2, 0xd6, 0x17, + 0x6a, 0x7d, 0x04, 0xc4, 0x51, 0x10, 0xbf, 0x80, 0xac, 0x87, 0x70, 0x4f, 0xa1, 0xa8, 0x8e, 0x81, + 0xaa, 0x8e, 0x89, 0x88, 0x81, 0x48, 0xc7, 0x40, 0x55, 0x43, 0xb9, 0x8f, 0x98, 0xcc, 0x49, 0x50, + 0x1d, 0xe3, 0x1e, 0xe0, 0xe4, 0x9b, 0x5a, 0x92, 0x98, 0x92, 0x58, 0x92, 0xf8, 0x8a, 0xc9, 0x00, + 0x49, 0xa7, 0x95, 0x15, 0x54, 0xab, 0x95, 0x55, 0x84, 0x95, 0x15, 0x44, 0xb5, 0x95, 0x15, 0x54, + 0x37, 0x4c, 0x20, 0x89, 0x0d, 0x1c, 0xf5, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x20, + 0x71, 0x6d, 0xe7, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/queries/assets/service.pb.gw.go b/x/assets/queries/assets/service.pb.gw.go deleted file mode 100644 index fcf7054d6..000000000 --- a/x/assets/queries/assets/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/queries/assets/service.proto - -/* -Package assets is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package assets - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "assets", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/burn/service.pb.go b/x/assets/transactions/burn/service.pb.go index 58345f45c..8cf1c4d83 100644 --- a/x/assets/transactions/burn/service.pb.go +++ b/x/assets/transactions/burn/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_64d6f26faf8cce14 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xeb, 0x40, - 0x1c, 0x07, 0xf0, 0x5c, 0x1e, 0xaf, 0x43, 0x78, 0x53, 0x97, 0x07, 0xe1, 0x91, 0xe1, 0x8d, 0x0e, - 0x77, 0xd8, 0x0e, 0xe2, 0xe1, 0xd2, 0x38, 0xa8, 0x43, 0xa0, 0x68, 0x87, 0x20, 0x01, 0xb9, 0xa6, - 0x47, 0x0c, 0x24, 0x77, 0x25, 0xbf, 0x4b, 0xe9, 0xe8, 0xe8, 0xe8, 0xe6, 0xee, 0xe8, 0xe4, 0x9f, - 0x21, 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x77, 0x77, 0x89, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, - 0x0b, 0x9f, 0x6f, 0xbe, 0xf7, 0xcb, 0x05, 0x47, 0x13, 0x00, 0xae, 0x12, 0x26, 0x54, 0xc5, 0x49, - 0x2d, 0x17, 0x6d, 0xc5, 0x81, 0xac, 0x09, 0xeb, 0xa7, 0x40, 0x54, 0xc3, 0x04, 0xb0, 0x5c, 0x95, - 0x52, 0x00, 0x99, 0xb7, 0x8d, 0x20, 0xc0, 0x9b, 0x55, 0x99, 0x73, 0xbc, 0x6c, 0xa4, 0x92, 0x43, - 0x6c, 0x69, 0x6c, 0x34, 0x5e, 0x63, 0xad, 0xb1, 0xad, 0x71, 0xaf, 0xc3, 0xbf, 0xb9, 0x84, 0x5a, - 0x02, 0xa9, 0xa1, 0x20, 0xab, 0xfd, 0xfe, 0xa1, 0x83, 0xc2, 0x7f, 0x85, 0x94, 0x45, 0xc5, 0x09, - 0x5b, 0x96, 0x84, 0x09, 0x21, 0x15, 0xd3, 0x4a, 0xbf, 0x75, 0x2d, 0x59, 0x73, 0x00, 0x56, 0x98, - 0x92, 0xe1, 0x99, 0xa3, 0xb6, 0x26, 0x57, 0x0d, 0x87, 0xa5, 0x14, 0x60, 0xa2, 0x46, 0xf7, 0x28, - 0xf8, 0x95, 0x40, 0x31, 0xbc, 0x45, 0xc1, 0xe0, 0x94, 0x89, 0x45, 0xc5, 0x87, 0x07, 0x8e, 0x3b, - 0xc0, 0x89, 0x2e, 0x17, 0x1e, 0xbb, 0xc2, 0xd9, 0xcf, 0xe4, 0xdc, 0xd4, 0xfa, 0xef, 0x85, 0xbf, - 0x6f, 0xde, 0x9f, 0xf6, 0x50, 0xfc, 0xe9, 0x3f, 0x77, 0x11, 0xda, 0x74, 0x11, 0x7a, 0xeb, 0x22, - 0x74, 0xb7, 0x8d, 0xbc, 0xcd, 0x36, 0xf2, 0x5e, 0xb7, 0x91, 0x17, 0x8c, 0x72, 0x59, 0x3b, 0x7e, - 0x2b, 0xfe, 0x73, 0xa1, 0xff, 0xf3, 0xb4, 0x3f, 0xf6, 0x14, 0x5d, 0x1e, 0x16, 0xa5, 0xba, 0x6e, - 0xe7, 0x38, 0x97, 0x35, 0x71, 0x5b, 0xe7, 0x83, 0x3f, 0x98, 0x24, 0xe9, 0x64, 0x16, 0x3f, 0xfa, - 0x3b, 0x25, 0x12, 0x53, 0x22, 0xd5, 0x53, 0xb0, 0x8f, 0x07, 0x38, 0x6e, 0x1b, 0xf1, 0xb2, 0x03, - 0x32, 0x03, 0xb2, 0x34, 0xd3, 0x20, 0xb3, 0x41, 0xd6, 0x83, 0xce, 0xa7, 0x6e, 0x20, 0x3b, 0x99, - 0xc6, 0x09, 0x57, 0x6c, 0xc1, 0x14, 0xfb, 0xf0, 0xc7, 0x16, 0xa6, 0xd4, 0x68, 0x4a, 0x53, 0xaa, - 0x53, 0x81, 0x52, 0x3b, 0x80, 0xd2, 0x3e, 0x61, 0x3e, 0xf8, 0xbe, 0x18, 0xe3, 0xaf, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x86, 0xb8, 0x68, 0xd7, 0x48, 0x03, 0x00, 0x00, + // 343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xc3, 0x40, + 0x14, 0x06, 0xf0, 0x5c, 0xc4, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x1d, 0xb6, + 0x83, 0x78, 0xb8, 0x34, 0x0e, 0xea, 0x10, 0x28, 0xda, 0x21, 0x48, 0x40, 0xae, 0xe9, 0x11, 0x0b, + 0xcd, 0x5d, 0xc9, 0xbb, 0x94, 0x8e, 0x8e, 0x8e, 0x6e, 0xee, 0x8e, 0x4e, 0xfe, 0x19, 0xe2, 0xd4, + 0xd1, 0x51, 0x92, 0x41, 0x70, 0x77, 0x97, 0x78, 0x07, 0x5e, 0xc7, 0x9b, 0x02, 0x0f, 0x7e, 0x5f, + 0xbe, 0x77, 0x77, 0xc1, 0xe9, 0x08, 0x80, 0xab, 0x84, 0x09, 0xb5, 0xe0, 0xa4, 0x94, 0xb3, 0x7a, + 0xc1, 0x81, 0xac, 0x09, 0xeb, 0xa6, 0x40, 0x54, 0xc5, 0x04, 0xb0, 0x5c, 0xcd, 0xa5, 0x00, 0x32, + 0xad, 0x2b, 0x41, 0x80, 0x57, 0xab, 0x79, 0xce, 0xf1, 0xb2, 0x92, 0x4a, 0xf6, 0xb1, 0xa5, 0xb1, + 0xd1, 0x78, 0x8d, 0xb5, 0xc6, 0xb6, 0xc6, 0x9d, 0x0e, 0xf7, 0x73, 0x09, 0xa5, 0x04, 0x52, 0x42, + 0x41, 0x56, 0x47, 0xdd, 0x47, 0x07, 0x85, 0xae, 0x35, 0x4a, 0x0e, 0xc0, 0x0a, 0x53, 0x23, 0xbc, + 0x74, 0xd4, 0xd6, 0xe4, 0xb6, 0xe2, 0xb0, 0x94, 0x02, 0x4c, 0xd4, 0xe0, 0x09, 0x05, 0x3b, 0x09, + 0x14, 0xfd, 0x07, 0x14, 0xf4, 0x2e, 0x98, 0x98, 0x2d, 0x78, 0xff, 0xd8, 0x71, 0x4b, 0x9c, 0xe8, + 0x72, 0xe1, 0x99, 0x2b, 0x9c, 0xfc, 0x4f, 0xae, 0x4c, 0xad, 0x03, 0x2f, 0xdc, 0xbd, 0xff, 0x7a, + 0x3d, 0x44, 0xf1, 0x8f, 0xff, 0xd6, 0x44, 0x68, 0xd3, 0x44, 0xe8, 0xb3, 0x89, 0xd0, 0x63, 0x1b, + 0x79, 0x9b, 0x36, 0xf2, 0x3e, 0xda, 0xc8, 0x0b, 0x06, 0xb9, 0x2c, 0x1d, 0xff, 0x15, 0xef, 0x5d, + 0xeb, 0x9b, 0x1c, 0x77, 0x6b, 0x8f, 0xd1, 0xcd, 0x49, 0x31, 0x57, 0x77, 0xf5, 0x14, 0xe7, 0xb2, + 0x24, 0x6e, 0xc7, 0xf9, 0xec, 0xf7, 0x46, 0x49, 0x3a, 0x9a, 0xc4, 0x2f, 0xfe, 0x56, 0x89, 0xc4, + 0x94, 0x48, 0xf5, 0x14, 0xec, 0xf5, 0x00, 0xc7, 0x75, 0x25, 0xde, 0xb7, 0x40, 0x66, 0x40, 0x96, + 0x66, 0x1a, 0x64, 0x36, 0xc8, 0x3a, 0xd0, 0xf8, 0xd4, 0x0d, 0x64, 0xe7, 0xe3, 0x38, 0xe1, 0x8a, + 0xcd, 0x98, 0x62, 0xdf, 0xfe, 0xd0, 0xc2, 0x94, 0x1a, 0x4d, 0x69, 0x4a, 0x75, 0x2a, 0x50, 0x6a, + 0x07, 0x50, 0xda, 0x25, 0x4c, 0x7b, 0x7f, 0x0f, 0x63, 0xf8, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x3c, + 0x01, 0xd8, 0xbc, 0x2a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/burn/service.pb.gw.go b/x/assets/transactions/burn/service.pb.gw.go deleted file mode 100644 index 4428f889e..000000000 --- a/x/assets/transactions/burn/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/burn/service.proto - -/* -Package burn is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package burn - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "burn"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/define/service.pb.go b/x/assets/transactions/define/service.pb.go index 48fa1f483..2856d8f6e 100644 --- a/x/assets/transactions/define/service.pb.go +++ b/x/assets/transactions/define/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_1e8e48cb5e3393e4 = []byte{ - // 367 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0x83, 0xa3, 0xc3, - 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x2a, 0x0a, 0x12, 0x28, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, - 0x19, 0x03, 0xc9, 0x5d, 0xc9, 0x73, 0x2d, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, - 0x10, 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, - 0x84, 0xcf, 0x37, 0xdf, 0xbb, 0x3c, 0xfe, 0x71, 0x17, 0x80, 0xc9, 0x88, 0x72, 0x59, 0x32, 0x5c, - 0x89, 0x6c, 0x52, 0x32, 0xc0, 0x33, 0x4c, 0x97, 0x53, 0xc0, 0xb2, 0xa6, 0x1c, 0x68, 0x2a, 0x0b, - 0xc1, 0x01, 0x67, 0xec, 0xa6, 0xe0, 0x0c, 0x03, 0xab, 0xa7, 0x45, 0xca, 0xd0, 0xb8, 0x16, 0x52, - 0x74, 0xb6, 0x0c, 0x8f, 0xb4, 0x47, 0x33, 0xa4, 0x3c, 0x32, 0x3d, 0x52, 0x3e, 0xf8, 0x97, 0x0a, - 0xa8, 0x04, 0xe0, 0x0a, 0x72, 0x3c, 0xdd, 0x5e, 0x3e, 0x54, 0x54, 0xf0, 0x3f, 0x17, 0x22, 0x2f, - 0x19, 0xa6, 0xe3, 0x02, 0x53, 0xce, 0x85, 0xa4, 0xca, 0xa9, 0xb7, 0xf6, 0x45, 0x2b, 0x06, 0x40, - 0x73, 0x5d, 0x34, 0x38, 0xb7, 0xf6, 0xc6, 0xec, 0xba, 0x66, 0x30, 0x16, 0x1c, 0x74, 0xd8, 0xce, - 0x93, 0xeb, 0xb7, 0x22, 0xc8, 0x3b, 0x0f, 0xae, 0xdf, 0x3e, 0xa3, 0x3c, 0x2b, 0x59, 0xe7, 0x00, - 0xd9, 0xde, 0x04, 0x8a, 0x54, 0xc1, 0xe0, 0xc4, 0x9e, 0x0e, 0x7f, 0x67, 0x17, 0xba, 0xda, 0x86, - 0x13, 0xfc, 0xb9, 0xfb, 0x7a, 0xdd, 0x74, 0x7b, 0xf7, 0xad, 0xb7, 0x26, 0x74, 0xe7, 0x4d, 0xe8, - 0x7e, 0x36, 0xa1, 0xfb, 0xb8, 0x08, 0x9d, 0xf9, 0x22, 0x74, 0x3e, 0x16, 0xa1, 0xe3, 0xef, 0xa5, - 0xa2, 0xb2, 0xfe, 0x5a, 0xef, 0xef, 0xa5, 0xfa, 0xe7, 0x83, 0xe5, 0xe1, 0x07, 0xee, 0xd5, 0x61, - 0x5e, 0xc8, 0xdb, 0xc9, 0x08, 0xa5, 0xa2, 0xc2, 0xb6, 0xd7, 0xfa, 0xec, 0xb5, 0xbb, 0x51, 0xdc, - 0x1d, 0xf6, 0x5f, 0xbc, 0xb5, 0xdd, 0x89, 0x74, 0x91, 0x58, 0xd5, 0x03, 0xf3, 0x88, 0x80, 0xfa, - 0x2b, 0xfb, 0xbe, 0x46, 0x12, 0x4d, 0x92, 0x38, 0x51, 0x24, 0x31, 0x49, 0xa2, 0x48, 0xe3, 0x1d, - 0xd9, 0x92, 0xe4, 0x74, 0xd0, 0x8b, 0x98, 0xa4, 0x19, 0x95, 0xf4, 0xdb, 0xdb, 0x37, 0x38, 0x21, - 0xda, 0x13, 0x12, 0x13, 0xa2, 0x12, 0x08, 0x31, 0x23, 0x08, 0x51, 0x19, 0xa3, 0xf6, 0x6a, 0x51, - 0x76, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2e, 0x6e, 0x18, 0xb9, 0x60, 0x03, 0x00, 0x00, + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xca, 0xaf, 0x43, 0xf8, 0x4d, 0x5d, 0x84, 0x0c, 0x19, 0x1c, 0x1d, 0xee, + 0xfc, 0x3b, 0x78, 0x8a, 0xd0, 0x52, 0x51, 0x90, 0x40, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0xce, + 0x18, 0x68, 0x72, 0x25, 0xcf, 0xb5, 0x74, 0xd4, 0xdd, 0xc1, 0xdd, 0xcd, 0xd1, 0xc9, 0x97, 0x21, + 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x5f, 0x85, 0xa4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, 0xc0, + 0xe7, 0x9b, 0xef, 0x93, 0x3c, 0xde, 0x49, 0x17, 0x80, 0xcb, 0x90, 0x95, 0x72, 0xcc, 0x49, 0x21, + 0xd2, 0xe9, 0x98, 0x03, 0x99, 0x13, 0xd6, 0x4c, 0x81, 0xc8, 0x8a, 0x95, 0xc0, 0x12, 0x99, 0x8b, + 0x12, 0x48, 0xca, 0x6f, 0xf3, 0x92, 0x13, 0xe0, 0xd5, 0x2c, 0x4f, 0x38, 0x9e, 0x54, 0x42, 0x8a, + 0xce, 0xb6, 0xe1, 0xb1, 0xf6, 0x78, 0x8e, 0x95, 0xc7, 0xa6, 0xc7, 0xca, 0xfb, 0x1b, 0x89, 0x80, + 0x42, 0x00, 0x29, 0x20, 0x23, 0xb3, 0x9d, 0xe6, 0xa1, 0xa2, 0x7c, 0xfb, 0x2a, 0x05, 0x07, 0x60, + 0x99, 0xae, 0xe2, 0x5f, 0x58, 0x7b, 0x63, 0x76, 0x53, 0x71, 0x98, 0x88, 0x12, 0x74, 0xd8, 0xee, + 0x33, 0xf2, 0x5a, 0x21, 0x64, 0x9d, 0x47, 0xe4, 0xb5, 0xcf, 0x59, 0x99, 0x8e, 0x79, 0xe7, 0x10, + 0xdb, 0xee, 0x8a, 0x43, 0x55, 0xd0, 0x3f, 0xb5, 0xa7, 0xc3, 0xbf, 0xd9, 0xa5, 0xae, 0xb6, 0xe9, + 0xf8, 0xff, 0xee, 0xbf, 0xdf, 0xb6, 0x50, 0xef, 0xa1, 0xf5, 0x5e, 0x07, 0x68, 0x51, 0x07, 0xe8, + 0xab, 0x0e, 0xd0, 0xd3, 0x32, 0x70, 0x16, 0xcb, 0xc0, 0xf9, 0x5c, 0x06, 0x8e, 0xb7, 0x9f, 0x88, + 0xc2, 0xfa, 0x6d, 0xbd, 0xff, 0x57, 0xea, 0xaf, 0x0e, 0x9a, 0xe5, 0x07, 0xe8, 0xfa, 0x28, 0xcb, + 0xe5, 0xdd, 0x74, 0x84, 0x13, 0x51, 0x10, 0xdb, 0xcf, 0xfa, 0xe2, 0xb6, 0xbb, 0x61, 0xd4, 0x1d, + 0xf6, 0x5f, 0xdd, 0xb5, 0xeb, 0x08, 0x75, 0x91, 0x48, 0xd5, 0x03, 0x73, 0x45, 0xc0, 0xfd, 0x95, + 0xfd, 0x58, 0x23, 0xb1, 0x26, 0x71, 0x14, 0x2b, 0x12, 0x9b, 0x24, 0x56, 0xa4, 0x76, 0x8f, 0x6d, + 0x49, 0x7c, 0x36, 0xe8, 0x85, 0x5c, 0xb2, 0x94, 0x49, 0xf6, 0xe3, 0x1e, 0x18, 0x9c, 0x52, 0xed, + 0x29, 0x8d, 0x28, 0x55, 0x09, 0x94, 0x9a, 0x11, 0x94, 0xaa, 0x8c, 0x51, 0x7b, 0x75, 0x28, 0x7b, + 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4e, 0x26, 0xd5, 0x35, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/define/service.pb.gw.go b/x/assets/transactions/define/service.pb.gw.go deleted file mode 100644 index b7be2b06d..000000000 --- a/x/assets/transactions/define/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/define/service.proto - -/* -Package define is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package define - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "define"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/deputize/service.pb.go b/x/assets/transactions/deputize/service.pb.go index 1418e4548..3a8994ef8 100644 --- a/x/assets/transactions/deputize/service.pb.go +++ b/x/assets/transactions/deputize/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_da0b5d193ea2455f = []byte{ - // 372 bytes of a gzipped FileDescriptorProto + // 355 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0xc7, 0x93, 0x94, 0xb7, 0x43, 0x78, 0xa7, 0x2e, 0x2f, 0x84, 0x97, 0x0c, 0x8e, 0x0e, 0x77, - 0x58, 0x41, 0xe1, 0x44, 0xb1, 0xa5, 0x50, 0x97, 0x40, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8e, - 0x18, 0x48, 0xee, 0x42, 0x9e, 0x6b, 0x29, 0x4e, 0x7e, 0x01, 0xa1, 0xdf, 0x40, 0x70, 0x74, 0xf2, - 0x63, 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x4f, 0x21, 0xf5, 0xae, 0x78, 0x1d, 0x9b, 0x29, - 0xf0, 0x84, 0xdf, 0xef, 0xfe, 0xf7, 0xbf, 0xc7, 0x3d, 0xef, 0x01, 0x30, 0x19, 0x50, 0x2e, 0x73, - 0x86, 0x0b, 0x91, 0x4c, 0x73, 0x06, 0x78, 0x8e, 0xe9, 0x7a, 0x0a, 0x58, 0x56, 0x94, 0x03, 0x8d, - 0x65, 0x26, 0x38, 0xe0, 0x84, 0x95, 0x53, 0x99, 0xdd, 0x31, 0x0c, 0xac, 0x9a, 0x65, 0x31, 0x43, - 0x65, 0x25, 0xa4, 0xe8, 0x74, 0x0d, 0x03, 0xd2, 0x06, 0x34, 0x47, 0xca, 0x80, 0x4c, 0x03, 0xda, - 0x18, 0xbc, 0x7f, 0xb1, 0x80, 0x42, 0x00, 0x2e, 0x20, 0xc5, 0xb3, 0x83, 0xf5, 0x47, 0xc9, 0xbc, - 0xff, 0xa9, 0x10, 0x69, 0xce, 0x30, 0x2d, 0x33, 0x4c, 0x39, 0x17, 0x92, 0x2a, 0x52, 0xfd, 0x6d, - 0x12, 0xb6, 0x60, 0x00, 0x34, 0xd5, 0x61, 0xbd, 0xa0, 0x81, 0xc1, 0x98, 0xde, 0x54, 0x0c, 0x4a, - 0xc1, 0x41, 0xeb, 0xba, 0x8f, 0xb6, 0xdb, 0x0a, 0x20, 0xed, 0x2c, 0x6c, 0xb7, 0x7d, 0x41, 0x79, - 0x92, 0xb3, 0xce, 0x09, 0xda, 0xbd, 0x0f, 0x14, 0xa8, 0x90, 0xde, 0xb0, 0x09, 0x3c, 0xfe, 0x9d, - 0x5e, 0xea, 0x78, 0x7b, 0x96, 0xf7, 0xe7, 0xfe, 0xf3, 0x65, 0xdf, 0xee, 0x3f, 0xb4, 0x5e, 0x6b, - 0xdf, 0x5e, 0xd6, 0xbe, 0xfd, 0x51, 0xfb, 0xf6, 0x62, 0xe5, 0x5b, 0xcb, 0x95, 0x6f, 0xbd, 0xaf, - 0x7c, 0xcb, 0x3d, 0x8a, 0x45, 0xd1, 0xe0, 0xbc, 0xfe, 0xdf, 0x2b, 0xf5, 0xfe, 0xa3, 0x75, 0x05, - 0x23, 0xfb, 0xfa, 0x34, 0xcd, 0xe4, 0xed, 0x74, 0x82, 0x62, 0x51, 0xe0, 0xdd, 0xeb, 0x7d, 0x72, - 0xda, 0xbd, 0x20, 0xec, 0x8d, 0x07, 0xcf, 0xce, 0xd6, 0x26, 0x05, 0x3a, 0x4c, 0xa8, 0x22, 0x82, - 0x79, 0x4d, 0x40, 0x03, 0x4d, 0xbf, 0x6d, 0x41, 0x91, 0x86, 0xa2, 0x30, 0x52, 0x50, 0x64, 0x42, - 0xd1, 0x06, 0xaa, 0x9d, 0xb3, 0xdd, 0xa1, 0x68, 0x38, 0xea, 0x07, 0x4c, 0xd2, 0x84, 0x4a, 0xfa, - 0xe5, 0x1c, 0x1b, 0x02, 0x42, 0xb4, 0x81, 0x90, 0x90, 0x10, 0xe5, 0x20, 0xc4, 0x94, 0x10, 0xb2, - 0xb1, 0x4c, 0xda, 0x3f, 0x8b, 0x73, 0xf8, 0x1d, 0x00, 0x00, 0xff, 0xff, 0xfc, 0x57, 0xe6, 0x4e, - 0x78, 0x03, 0x00, 0x00, + 0x18, 0xc7, 0x73, 0x29, 0x6f, 0x87, 0xf0, 0x4e, 0x5d, 0x84, 0x0c, 0x19, 0x1c, 0x1d, 0xee, 0xb0, + 0x82, 0xc2, 0x89, 0x62, 0x4b, 0xa1, 0x2e, 0x07, 0x45, 0x3b, 0x04, 0x09, 0xc8, 0x35, 0x39, 0x62, + 0xa0, 0xc9, 0x95, 0x3c, 0xd7, 0x52, 0x9c, 0xfc, 0x02, 0x42, 0xbf, 0x81, 0xe0, 0xe8, 0xe4, 0xc7, + 0x10, 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x9f, 0x42, 0xea, 0x5d, 0xf1, 0x3a, 0x36, 0x53, 0xe0, + 0x0f, 0xbf, 0x5f, 0xfe, 0xcf, 0x73, 0x8f, 0x77, 0xd1, 0x01, 0x10, 0x8a, 0xf1, 0x42, 0x8d, 0x05, + 0xc9, 0x65, 0x32, 0x1d, 0x0b, 0x20, 0x73, 0xc2, 0xd7, 0x29, 0x10, 0x55, 0xf2, 0x02, 0x78, 0xac, + 0x32, 0x59, 0x00, 0x49, 0xc4, 0x64, 0xaa, 0xb2, 0x7b, 0x41, 0x40, 0x94, 0xb3, 0x2c, 0x16, 0x78, + 0x52, 0x4a, 0x25, 0x5b, 0x6d, 0xcb, 0x80, 0x8d, 0x01, 0xcf, 0xb1, 0x36, 0x60, 0xdb, 0x80, 0x37, + 0x06, 0x7f, 0x2f, 0x96, 0x90, 0x4b, 0x20, 0x39, 0xa4, 0x64, 0x76, 0xb8, 0xfe, 0x68, 0x99, 0x5f, + 0xa7, 0x4e, 0x2e, 0x00, 0x78, 0x6a, 0xea, 0xf8, 0xac, 0x86, 0xc1, 0x4a, 0x6f, 0x4b, 0x01, 0x13, + 0x59, 0x80, 0xd1, 0xb5, 0x9f, 0x90, 0xd7, 0x60, 0x90, 0xb6, 0x16, 0xc8, 0x6b, 0x5e, 0xf2, 0x22, + 0x19, 0x8b, 0xd6, 0x29, 0xde, 0x7d, 0x62, 0xcc, 0x74, 0x49, 0xbf, 0x5f, 0x07, 0x1e, 0xfe, 0xa5, + 0x57, 0xa6, 0xde, 0xbe, 0xe3, 0xff, 0x7b, 0xf8, 0x7a, 0x3d, 0x40, 0xdd, 0xc7, 0xc6, 0x5b, 0x15, + 0xa0, 0x65, 0x15, 0xa0, 0xcf, 0x2a, 0x40, 0x8b, 0x55, 0xe0, 0x2c, 0x57, 0x81, 0xf3, 0xb1, 0x0a, + 0x1c, 0xef, 0x38, 0x96, 0x79, 0x8d, 0xff, 0x75, 0xff, 0x5f, 0xeb, 0x17, 0x1e, 0xac, 0x57, 0x30, + 0x40, 0x37, 0x67, 0x69, 0xa6, 0xee, 0xa6, 0x23, 0x1c, 0xcb, 0x9c, 0xec, 0xbe, 0xde, 0x67, 0xb7, + 0xd9, 0x61, 0x61, 0x67, 0xd8, 0x7b, 0x71, 0xb7, 0x6e, 0x85, 0x99, 0x32, 0xa1, 0xae, 0x08, 0xf6, + 0x98, 0x80, 0x7b, 0x86, 0x7e, 0xdf, 0x82, 0x22, 0x03, 0x45, 0x61, 0xa4, 0xa1, 0xc8, 0x86, 0xa2, + 0x0d, 0x54, 0xb9, 0xe7, 0xbb, 0x43, 0x51, 0x7f, 0xd0, 0x65, 0x42, 0xf1, 0x84, 0x2b, 0xfe, 0xed, + 0x9e, 0x58, 0x02, 0x4a, 0x8d, 0x81, 0xd2, 0x90, 0x52, 0xed, 0xa0, 0xd4, 0x96, 0x50, 0xba, 0xb1, + 0x8c, 0x9a, 0xbf, 0x87, 0x73, 0xf4, 0x13, 0x00, 0x00, 0xff, 0xff, 0xfa, 0x85, 0x92, 0x4c, 0x5a, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/deputize/service.pb.gw.go b/x/assets/transactions/deputize/service.pb.gw.go deleted file mode 100644 index f7c701db4..000000000 --- a/x/assets/transactions/deputize/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/deputize/service.proto - -/* -Package deputize is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package deputize - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "deputize"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/mint/service.pb.go b/x/assets/transactions/mint/service.pb.go index ad55ef26b..fab9c75f8 100644 --- a/x/assets/transactions/mint/service.pb.go +++ b/x/assets/transactions/mint/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_eea46adca244dcb0 = []byte{ - // 362 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xeb, 0x40, - 0x1c, 0x07, 0xf0, 0x24, 0x8f, 0xd7, 0x21, 0xbc, 0xa9, 0xcb, 0x83, 0xf0, 0xc8, 0xf0, 0x46, 0x87, - 0x3b, 0x6c, 0x07, 0xf1, 0x70, 0x69, 0x1d, 0xd4, 0xe1, 0xa0, 0x68, 0x87, 0x20, 0x01, 0xb9, 0xa6, - 0x47, 0x0c, 0xe4, 0xee, 0x4a, 0x7e, 0xd7, 0xd2, 0xd1, 0xd1, 0xd1, 0xcd, 0xdd, 0xd1, 0xc9, 0x3f, - 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xee, 0xee, 0x12, 0xef, 0xc0, 0xeb, 0x78, 0x53, 0xe0, - 0x17, 0x3e, 0xdf, 0x7c, 0xef, 0x97, 0x8b, 0x8f, 0x46, 0x00, 0x5c, 0x53, 0x26, 0x75, 0xcd, 0xb1, - 0x50, 0xf3, 0x65, 0xcd, 0x01, 0xaf, 0x31, 0xeb, 0xa6, 0x80, 0x75, 0xc3, 0x24, 0xb0, 0x42, 0x57, - 0x4a, 0x02, 0x16, 0x95, 0xd4, 0x18, 0x78, 0xb3, 0xaa, 0x0a, 0x8e, 0x16, 0x8d, 0xd2, 0xaa, 0x8f, - 0x1c, 0x8d, 0xac, 0x46, 0x6b, 0x64, 0x34, 0x72, 0x35, 0xea, 0x74, 0xf2, 0xb7, 0x50, 0x20, 0x14, - 0x60, 0x01, 0x25, 0x5e, 0xed, 0x77, 0x0f, 0x13, 0x94, 0xfc, 0x2b, 0x95, 0x2a, 0x6b, 0x8e, 0xd9, - 0xa2, 0xc2, 0x4c, 0x4a, 0xa5, 0x99, 0x51, 0xe6, 0xad, 0x6f, 0x49, 0xc1, 0x01, 0x58, 0x69, 0x4b, - 0x26, 0x67, 0x9e, 0xda, 0x99, 0x5c, 0x35, 0x1c, 0x16, 0x4a, 0x82, 0x8d, 0x1a, 0xdc, 0x87, 0xf1, - 0x2f, 0x0a, 0x65, 0xff, 0x36, 0x8c, 0x7b, 0xa7, 0x4c, 0xce, 0x6b, 0xde, 0x3f, 0xf0, 0xdc, 0x01, - 0xa2, 0xa6, 0x5c, 0x72, 0xec, 0x0b, 0xa7, 0x3f, 0x93, 0x73, 0x5b, 0xeb, 0x7f, 0x90, 0xfc, 0xbe, - 0x79, 0x7f, 0xda, 0x0b, 0xc7, 0x9f, 0xd1, 0x73, 0x9b, 0x86, 0x9b, 0x36, 0x0d, 0xdf, 0xda, 0x34, - 0xbc, 0xdb, 0xa6, 0xc1, 0x66, 0x9b, 0x06, 0xaf, 0xdb, 0x34, 0x88, 0x07, 0x85, 0x12, 0x9e, 0xdf, - 0x1a, 0xff, 0xb9, 0x30, 0xff, 0x79, 0xd2, 0x1d, 0x7b, 0x12, 0x5e, 0x1e, 0x96, 0x95, 0xbe, 0x5e, - 0xce, 0x50, 0xa1, 0x04, 0xf6, 0x5b, 0xe7, 0x43, 0xd4, 0x1b, 0xd1, 0x6c, 0x34, 0xa5, 0x8f, 0xd1, - 0x4e, 0x09, 0x6a, 0x4b, 0x64, 0x66, 0x0a, 0xee, 0xf1, 0x00, 0xd1, 0x4a, 0xea, 0x97, 0x1d, 0x90, - 0x5b, 0x90, 0x67, 0xb9, 0x01, 0xb9, 0x0b, 0xf2, 0x0e, 0xb4, 0x11, 0xf1, 0x03, 0xf9, 0xc9, 0x64, - 0x4c, 0xb9, 0x66, 0x73, 0xa6, 0xd9, 0x47, 0x34, 0x74, 0x30, 0x21, 0x56, 0x13, 0x92, 0x11, 0x93, - 0x0a, 0x84, 0xb8, 0x01, 0x84, 0x74, 0x09, 0xb3, 0xde, 0xf7, 0xc5, 0x18, 0x7e, 0x05, 0x00, 0x00, - 0xff, 0xff, 0xfe, 0x34, 0xc7, 0x2f, 0x48, 0x03, 0x00, 0x00, + // 343 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0x03, 0x31, + 0x14, 0x06, 0xf0, 0xbb, 0x13, 0x3b, 0x1c, 0x4e, 0x5d, 0x84, 0x1b, 0x6e, 0x70, 0x74, 0x48, 0xb0, + 0x1d, 0xc4, 0xe0, 0xd2, 0x3a, 0xa8, 0x43, 0xa0, 0x68, 0x87, 0x43, 0x0e, 0x24, 0xbd, 0x86, 0xf3, + 0xa0, 0x49, 0xca, 0xbd, 0xb4, 0x74, 0x74, 0x74, 0x74, 0x73, 0x77, 0x74, 0xf2, 0xcf, 0x10, 0xa7, + 0x8e, 0x8e, 0x72, 0x1d, 0x04, 0x77, 0x77, 0x39, 0x13, 0x30, 0x1d, 0x33, 0x1d, 0x3c, 0xf8, 0x7d, + 0xf7, 0xbd, 0x24, 0xf1, 0xe9, 0x00, 0x80, 0x6b, 0xca, 0xa4, 0x9e, 0x71, 0x2c, 0xd4, 0x74, 0x31, + 0xe3, 0x80, 0x57, 0x98, 0xb5, 0x53, 0xc0, 0xba, 0x66, 0x12, 0x58, 0xa1, 0x2b, 0x25, 0x01, 0x8b, + 0x4a, 0x6a, 0x0c, 0xbc, 0x5e, 0x56, 0x05, 0x47, 0xf3, 0x5a, 0x69, 0xd5, 0x45, 0x8e, 0x46, 0x56, + 0xa3, 0x15, 0x32, 0x1a, 0xb9, 0x1a, 0xb5, 0x3a, 0xd9, 0x2f, 0x14, 0x08, 0x05, 0x58, 0x40, 0x89, + 0x97, 0x47, 0xed, 0xc7, 0x04, 0x25, 0xbe, 0x35, 0x04, 0x07, 0x60, 0xa5, 0xad, 0x91, 0x5c, 0x7a, + 0x6a, 0x67, 0x72, 0x5b, 0x73, 0x98, 0x2b, 0x09, 0x36, 0xaa, 0xf7, 0x14, 0xc6, 0x3b, 0x14, 0xca, + 0xee, 0x43, 0x18, 0x77, 0x2e, 0x98, 0x9c, 0xce, 0x78, 0xf7, 0xd8, 0x73, 0x4b, 0x44, 0x4d, 0xb9, + 0xe4, 0xcc, 0x17, 0x8e, 0xff, 0x27, 0x57, 0xb6, 0xd6, 0x41, 0x90, 0xec, 0xde, 0x7f, 0xbd, 0x1e, + 0x86, 0xc3, 0x9f, 0xe8, 0xad, 0x49, 0xc3, 0x75, 0x93, 0x86, 0x9f, 0x4d, 0x1a, 0x3e, 0x6e, 0xd2, + 0x60, 0xbd, 0x49, 0x83, 0x8f, 0x4d, 0x1a, 0xc4, 0xbd, 0x42, 0x09, 0xcf, 0x7f, 0x0d, 0xf7, 0xae, + 0xcd, 0x4d, 0x8e, 0xda, 0xb5, 0x47, 0xe1, 0xcd, 0x49, 0x59, 0xe9, 0xbb, 0xc5, 0x04, 0x15, 0x4a, + 0x60, 0xbf, 0xe3, 0x7c, 0x8e, 0x3a, 0x03, 0x9a, 0x0d, 0xc6, 0xf4, 0x25, 0xda, 0x2a, 0x41, 0x6d, + 0x89, 0xcc, 0x4c, 0xc1, 0x5d, 0x0f, 0x10, 0xad, 0xa4, 0x7e, 0xdf, 0x02, 0xb9, 0x05, 0x79, 0x96, + 0x1b, 0x90, 0xbb, 0x20, 0x6f, 0x41, 0x13, 0x11, 0x3f, 0x90, 0x9f, 0x8f, 0x86, 0x94, 0x6b, 0x36, + 0x65, 0x9a, 0x7d, 0x47, 0x7d, 0x07, 0x13, 0x62, 0x35, 0x21, 0x19, 0x31, 0xa9, 0x40, 0x88, 0x1b, + 0x40, 0x48, 0x9b, 0x30, 0xe9, 0xfc, 0x3d, 0x8c, 0xfe, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, + 0x93, 0xb3, 0x7e, 0x2a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/mint/service.pb.gw.go b/x/assets/transactions/mint/service.pb.gw.go deleted file mode 100644 index ea198c498..000000000 --- a/x/assets/transactions/mint/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/mint/service.proto - -/* -Package mint is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package mint - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "mint"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/mutate/service.pb.go b/x/assets/transactions/mutate/service.pb.go index 0ef727630..c60db7f78 100644 --- a/x/assets/transactions/mutate/service.pb.go +++ b/x/assets/transactions/mutate/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_0cec9114e6ce7c03 = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xfb, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xd7, 0x21, 0xfc, 0xa6, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, - 0xfe, 0x1d, 0x3c, 0x45, 0x68, 0x41, 0x14, 0xe4, 0xa0, 0x68, 0x87, 0x20, 0x01, 0xb9, 0xa6, 0x47, - 0x0c, 0x24, 0x77, 0x25, 0xcf, 0xb5, 0x74, 0xd4, 0xdd, 0xc1, 0xdd, 0xcd, 0xd1, 0xc9, 0x97, 0x21, - 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x5f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, 0x84, - 0xcf, 0x37, 0xdf, 0xbb, 0x3c, 0xe1, 0x69, 0x17, 0x80, 0x2b, 0xca, 0x84, 0x2a, 0x39, 0xae, 0xe4, - 0x68, 0x52, 0x72, 0xc0, 0x33, 0xcc, 0x96, 0x53, 0xc0, 0xaa, 0x66, 0x02, 0x58, 0xa6, 0x0a, 0x29, - 0x00, 0x57, 0x13, 0xc5, 0x14, 0xc7, 0xc0, 0xeb, 0x69, 0x91, 0x71, 0x34, 0xae, 0xa5, 0x92, 0x9d, - 0x1d, 0xcb, 0x23, 0xe3, 0xd1, 0x0c, 0x69, 0x8f, 0x6c, 0x8f, 0xb4, 0x8f, 0x36, 0x32, 0x09, 0x95, - 0x04, 0x5c, 0x41, 0x8e, 0xa7, 0xbb, 0xcb, 0x87, 0x8e, 0x8a, 0x36, 0x73, 0x29, 0xf3, 0x92, 0x63, - 0x36, 0x2e, 0x30, 0x13, 0x42, 0x2a, 0xa6, 0x9d, 0x7e, 0xeb, 0x5e, 0xb4, 0xe2, 0x00, 0x2c, 0x37, - 0x45, 0xa3, 0x4b, 0x67, 0x6f, 0xcd, 0x6e, 0x6b, 0x0e, 0x63, 0x29, 0xc0, 0x84, 0xed, 0x3d, 0xfb, - 0x61, 0x8b, 0x42, 0xde, 0x79, 0xf4, 0xc3, 0xf6, 0x05, 0x13, 0xa3, 0x92, 0x77, 0x8e, 0x90, 0xeb, - 0x4d, 0x20, 0xaa, 0x0b, 0x46, 0x67, 0xee, 0x74, 0xf0, 0x37, 0xbb, 0x32, 0xd5, 0xb6, 0xbc, 0xe8, - 0xdf, 0xfd, 0xf7, 0xdb, 0xb6, 0xdf, 0x7b, 0x68, 0xbd, 0x37, 0xb1, 0x3f, 0x6f, 0x62, 0xff, 0xab, - 0x89, 0xfd, 0xa7, 0x45, 0xec, 0xcd, 0x17, 0xb1, 0xf7, 0xb9, 0x88, 0xbd, 0xf0, 0x20, 0x93, 0x95, - 0xf3, 0xd7, 0x7a, 0xff, 0xaf, 0xf5, 0x3f, 0xef, 0x2f, 0x0f, 0xdf, 0xf7, 0x6f, 0x8e, 0xf3, 0x42, - 0xdd, 0x4d, 0x86, 0x28, 0x93, 0x15, 0x76, 0xbd, 0xd6, 0x97, 0xa0, 0xdd, 0xa5, 0x49, 0x77, 0x40, - 0x5f, 0x83, 0xb5, 0xdd, 0xa1, 0xa6, 0x48, 0xa2, 0xeb, 0x81, 0x7d, 0x44, 0x40, 0x74, 0x65, 0x3f, - 0xd6, 0x48, 0x6a, 0x48, 0x9a, 0xa4, 0x9a, 0xa4, 0x36, 0x49, 0x35, 0x69, 0x82, 0x13, 0x57, 0x92, - 0x9e, 0xf7, 0x7b, 0x94, 0x2b, 0x36, 0x62, 0x8a, 0xfd, 0x04, 0x87, 0x16, 0x27, 0xc4, 0x78, 0x42, - 0x12, 0x42, 0x74, 0x02, 0x21, 0x76, 0x04, 0x21, 0x3a, 0x63, 0xd8, 0x5e, 0x2d, 0xca, 0xfe, 0x6f, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xab, 0x85, 0x7f, 0x7c, 0x60, 0x03, 0x00, 0x00, + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x5c, 0x8a, 0x1d, 0x82, 0x53, 0x17, 0x21, 0x43, 0x06, 0x47, 0x87, 0x3b, 0x7f, + 0x0e, 0x9e, 0x22, 0xb4, 0x20, 0x0a, 0x72, 0x50, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0xd3, 0x23, 0x16, + 0x7a, 0xb9, 0x92, 0x77, 0x2d, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, 0x10, 0xa7, + 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, 0xe0, 0xf3, + 0xcd, 0xf7, 0x25, 0x2f, 0x3a, 0x6b, 0x03, 0x08, 0xcd, 0x78, 0xa9, 0x47, 0x82, 0x48, 0x35, 0x98, + 0x8c, 0x04, 0x90, 0x19, 0xe1, 0xcb, 0x29, 0x10, 0x5d, 0xf1, 0x12, 0x78, 0xae, 0x87, 0xaa, 0x04, + 0x22, 0x27, 0x9a, 0x6b, 0x41, 0x40, 0x54, 0xd3, 0x61, 0x2e, 0xf0, 0xb8, 0x52, 0x5a, 0xb5, 0x76, + 0x1d, 0x8f, 0xad, 0xc7, 0x33, 0x6c, 0x3c, 0x76, 0x3d, 0x36, 0x3e, 0xde, 0xca, 0x15, 0x48, 0x05, + 0x44, 0x42, 0x41, 0xa6, 0x7b, 0xcb, 0x87, 0x89, 0x8a, 0xfd, 0xab, 0x48, 0x01, 0xc0, 0x0b, 0x5b, + 0x25, 0xbe, 0xf2, 0xf6, 0xce, 0xec, 0xae, 0x12, 0x30, 0x56, 0x25, 0xd8, 0xb0, 0xfd, 0x17, 0x14, + 0x35, 0x18, 0x14, 0xad, 0x27, 0x14, 0x35, 0x2f, 0x79, 0x39, 0x18, 0x89, 0xd6, 0x31, 0xf6, 0xdd, + 0x15, 0x33, 0x53, 0x30, 0x3e, 0xf7, 0xa7, 0xbd, 0xff, 0xd9, 0xb5, 0xad, 0xb6, 0x1d, 0xc4, 0x1b, + 0x0f, 0x3f, 0xef, 0x3b, 0xa8, 0xf3, 0xd8, 0xf8, 0xa8, 0x13, 0x34, 0xaf, 0x13, 0xf4, 0x5d, 0x27, + 0xe8, 0x79, 0x91, 0x04, 0xf3, 0x45, 0x12, 0x7c, 0x2d, 0x92, 0x20, 0x3a, 0xcc, 0x95, 0xf4, 0x7e, + 0x5b, 0x67, 0xf3, 0xc6, 0xfc, 0xd5, 0xee, 0x72, 0xf9, 0x2e, 0xba, 0x3d, 0x29, 0x86, 0xfa, 0x7e, + 0xd2, 0xc7, 0xb9, 0x92, 0xc4, 0xf7, 0xb3, 0xbe, 0x86, 0xcd, 0x36, 0x4b, 0xdb, 0x3d, 0xf6, 0x16, + 0xae, 0x5d, 0x07, 0xb3, 0x45, 0x52, 0x53, 0x0f, 0xdc, 0x15, 0x01, 0xb3, 0x95, 0xfd, 0x5c, 0x23, + 0x99, 0x25, 0x59, 0x9a, 0x19, 0x92, 0xb9, 0x24, 0x33, 0xa4, 0x0e, 0x4f, 0x7d, 0x49, 0x76, 0xd1, + 0xed, 0x30, 0xa1, 0xf9, 0x80, 0x6b, 0xfe, 0x1b, 0x1e, 0x39, 0x9c, 0x52, 0xeb, 0x29, 0x4d, 0x29, + 0x35, 0x09, 0x94, 0xba, 0x11, 0x94, 0x9a, 0x8c, 0x7e, 0x73, 0x75, 0x28, 0x07, 0x7f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xee, 0x04, 0xf7, 0x63, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/mutate/service.pb.gw.go b/x/assets/transactions/mutate/service.pb.gw.go deleted file mode 100644 index e326df841..000000000 --- a/x/assets/transactions/mutate/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/mutate/service.proto - -/* -Package mutate is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package mutate - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "mutate"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/renumerate/service.pb.go b/x/assets/transactions/renumerate/service.pb.go index b7cfe3de7..53e83bace 100644 --- a/x/assets/transactions/renumerate/service.pb.go +++ b/x/assets/transactions/renumerate/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_88dc66d07d98c2a7 = []byte{ - // 372 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, - 0x1c, 0xc7, 0x93, 0x94, 0xa7, 0x43, 0x78, 0xa6, 0x2e, 0x0f, 0x84, 0x87, 0x0c, 0x8e, 0x0e, 0x77, - 0xf8, 0x67, 0xd0, 0x03, 0xd1, 0x66, 0x51, 0x87, 0x60, 0xa9, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1e, - 0x31, 0x90, 0xdc, 0x95, 0xfc, 0xae, 0xa5, 0xa3, 0x2f, 0xc1, 0xc1, 0xc5, 0x55, 0x37, 0x27, 0x5f, - 0x86, 0x38, 0x75, 0x74, 0x94, 0x74, 0x10, 0x7c, 0x15, 0x52, 0xef, 0x30, 0xd7, 0xf5, 0xa6, 0x83, - 0xdf, 0xf1, 0xf9, 0xdc, 0xf7, 0x7e, 0x7c, 0xfd, 0xa8, 0x0f, 0xc0, 0x64, 0x4c, 0xb9, 0x2c, 0x19, - 0xae, 0xc4, 0x64, 0x56, 0x32, 0xc0, 0x0b, 0x4c, 0xd7, 0x53, 0xc0, 0xb2, 0xa6, 0x1c, 0x68, 0x26, - 0x0b, 0xc1, 0x01, 0xd7, 0x8c, 0xcf, 0x2a, 0x56, 0x53, 0xc9, 0x30, 0xb0, 0x7a, 0x5e, 0x64, 0x0c, - 0x4d, 0x6b, 0x21, 0x45, 0x6f, 0xdf, 0x70, 0x20, 0xed, 0x40, 0x0b, 0xa4, 0x1c, 0xc8, 0x74, 0xa0, - 0xd6, 0x11, 0xfc, 0xcb, 0x04, 0x54, 0x02, 0x70, 0x05, 0x39, 0x9e, 0xef, 0xac, 0x0f, 0xa5, 0x0b, - 0xfe, 0xe7, 0x42, 0xe4, 0x25, 0xc3, 0x74, 0x5a, 0x60, 0xca, 0xb9, 0x90, 0x54, 0xb1, 0xea, 0xd6, - 0x2e, 0x70, 0xc5, 0x00, 0x68, 0xae, 0x03, 0x07, 0x17, 0x56, 0x0e, 0x63, 0x7e, 0x5d, 0x33, 0x98, - 0x0a, 0x0e, 0x5a, 0xb8, 0xfb, 0xe4, 0xfa, 0x9d, 0x18, 0xf2, 0xde, 0xbd, 0xeb, 0x77, 0xcf, 0x28, - 0x9f, 0x94, 0xac, 0x77, 0x84, 0x6c, 0xb6, 0x82, 0x62, 0x15, 0x34, 0x38, 0xb7, 0xc3, 0x47, 0xed, - 0x7c, 0xa8, 0x23, 0x6e, 0x39, 0xc1, 0x9f, 0xdb, 0xcf, 0x97, 0x6d, 0x37, 0x7a, 0xe8, 0xbc, 0x36, - 0xa1, 0xbb, 0x6c, 0x42, 0xf7, 0xa3, 0x09, 0xdd, 0xbb, 0x55, 0xe8, 0x2c, 0x57, 0xa1, 0xf3, 0xbe, - 0x0a, 0x1d, 0xff, 0x20, 0x13, 0x95, 0xd5, 0x8b, 0xd1, 0xdf, 0x4b, 0xd5, 0x85, 0xc1, 0x7a, 0x11, - 0x03, 0xf7, 0xea, 0x38, 0x2f, 0xe4, 0xcd, 0x6c, 0x8c, 0x32, 0x51, 0x61, 0x9b, 0x35, 0x3f, 0x7a, - 0xdd, 0x7e, 0x9c, 0xf4, 0x47, 0xc3, 0x67, 0x6f, 0xa3, 0x57, 0xb1, 0x0e, 0x94, 0xa8, 0x98, 0x60, - 0x7e, 0x15, 0xd0, 0xf0, 0x97, 0x7f, 0xdb, 0xc0, 0x52, 0x8d, 0xa5, 0x49, 0xaa, 0xb0, 0xd4, 0xc4, - 0xd2, 0x16, 0x6b, 0xbc, 0x13, 0x1b, 0x2c, 0x3d, 0x1d, 0x44, 0x31, 0x93, 0x74, 0x42, 0x25, 0xfd, - 0xf2, 0x0e, 0x0d, 0x05, 0x21, 0xda, 0x41, 0x48, 0x42, 0x88, 0xb2, 0x10, 0x62, 0x6a, 0x08, 0x69, - 0x3d, 0xe3, 0xee, 0x4f, 0x91, 0xf6, 0xbe, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe6, 0xd2, 0xfb, 0xc7, - 0x90, 0x03, 0x00, 0x00, + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0xc7, 0x73, 0x29, 0xbf, 0x0e, 0xe1, 0x37, 0x75, 0x11, 0x32, 0x64, 0x70, 0x74, 0xb8, 0xc3, + 0x3f, 0x83, 0x1e, 0x88, 0x36, 0x8b, 0x3a, 0x04, 0x4b, 0xed, 0x10, 0x24, 0x20, 0xd7, 0xf4, 0x88, + 0x85, 0x5e, 0xae, 0xe4, 0xb9, 0x96, 0x8e, 0xbe, 0x04, 0x07, 0x17, 0x57, 0xdd, 0x9c, 0x7c, 0x19, + 0xe2, 0xd4, 0xd1, 0x51, 0xd2, 0x41, 0xf0, 0x55, 0x48, 0xbd, 0xc3, 0x5c, 0xd7, 0x9b, 0x02, 0x5f, + 0xf8, 0x7c, 0xf2, 0x7d, 0x9e, 0x7b, 0x82, 0xb8, 0x0b, 0xc0, 0x55, 0xc2, 0x4a, 0x35, 0xe1, 0x44, + 0xc8, 0xd1, 0x6c, 0xc2, 0x81, 0x2c, 0x08, 0x5b, 0xa7, 0x40, 0x54, 0xc5, 0x4a, 0x60, 0xb9, 0x1a, + 0xcb, 0x12, 0x48, 0xc5, 0xcb, 0x99, 0xe0, 0x15, 0x53, 0x9c, 0x00, 0xaf, 0xe6, 0xe3, 0x9c, 0xe3, + 0x69, 0x25, 0x95, 0xec, 0x1c, 0x58, 0x0e, 0x6c, 0x1c, 0x78, 0x81, 0xb5, 0x03, 0xdb, 0x0e, 0xdc, + 0x38, 0xc2, 0xad, 0x5c, 0x82, 0x90, 0x40, 0x04, 0x14, 0x64, 0xbe, 0xbb, 0xfe, 0x68, 0x5d, 0xe8, + 0x56, 0x49, 0x70, 0x00, 0x56, 0x98, 0x4a, 0xe1, 0xa5, 0x93, 0xc3, 0xca, 0x6f, 0x2a, 0x0e, 0x53, + 0x59, 0x82, 0x11, 0xee, 0x3d, 0xa3, 0xa0, 0x95, 0x40, 0xd1, 0x79, 0x40, 0x41, 0xfb, 0x9c, 0x95, + 0xa3, 0x09, 0xef, 0x1c, 0x63, 0x97, 0xb9, 0x71, 0xa2, 0x8b, 0x86, 0x17, 0x6e, 0xf8, 0xa0, 0xc9, + 0xfb, 0xa6, 0xe2, 0xb6, 0x17, 0xfe, 0xbb, 0xfb, 0x7a, 0xdd, 0x41, 0xf1, 0x63, 0xeb, 0xad, 0x8e, + 0xd0, 0xb2, 0x8e, 0xd0, 0x67, 0x1d, 0xa1, 0xfb, 0x55, 0xe4, 0x2d, 0x57, 0x91, 0xf7, 0xb1, 0x8a, + 0xbc, 0xe0, 0x30, 0x97, 0xc2, 0xe9, 0x8f, 0xf1, 0xff, 0x2b, 0xfd, 0xda, 0xbd, 0xf5, 0x22, 0x7a, + 0xe8, 0xfa, 0xa4, 0x18, 0xab, 0xdb, 0xd9, 0x10, 0xe7, 0x52, 0x10, 0x97, 0x35, 0x3f, 0xf9, 0xed, + 0x6e, 0x92, 0x76, 0x07, 0xfd, 0x17, 0x7f, 0xe3, 0x72, 0x12, 0x53, 0x28, 0xd5, 0x35, 0xc1, 0x1e, + 0x15, 0x70, 0xff, 0x8f, 0x7f, 0xdf, 0xc0, 0x32, 0x83, 0x65, 0x69, 0xa6, 0xb1, 0xcc, 0xc6, 0xb2, + 0x06, 0xab, 0xfd, 0x53, 0x17, 0x2c, 0x3b, 0xeb, 0xc5, 0x09, 0x57, 0x6c, 0xc4, 0x14, 0xfb, 0xf6, + 0x8f, 0x2c, 0x05, 0xa5, 0xc6, 0x41, 0x69, 0x4a, 0xa9, 0xb6, 0x50, 0x6a, 0x6b, 0x28, 0x6d, 0x3c, + 0xc3, 0xf6, 0xef, 0x21, 0xed, 0xff, 0x04, 0x00, 0x00, 0xff, 0xff, 0xff, 0xf4, 0xee, 0xcb, 0x72, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/renumerate/service.pb.gw.go b/x/assets/transactions/renumerate/service.pb.gw.go deleted file mode 100644 index ff7df7666..000000000 --- a/x/assets/transactions/renumerate/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/renumerate/service.proto - -/* -Package renumerate is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package renumerate - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "renumerate"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/revoke/service.pb.go b/x/assets/transactions/revoke/service.pb.go index f965cf45c..425d9583a 100644 --- a/x/assets/transactions/revoke/service.pb.go +++ b/x/assets/transactions/revoke/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_5cc15353cc44c580 = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x6b, 0xe3, 0x30, - 0x18, 0x06, 0x70, 0xcb, 0xe1, 0x32, 0x98, 0x9b, 0xb2, 0x1c, 0x98, 0xc3, 0xc3, 0x8d, 0x37, 0x48, - 0xfd, 0x3b, 0x54, 0x2d, 0x85, 0x04, 0x4a, 0x0b, 0xc5, 0x10, 0xd2, 0x0c, 0xa6, 0x18, 0x8a, 0xe2, - 0x08, 0xd7, 0xd4, 0x96, 0x82, 0x5f, 0x25, 0x64, 0x6c, 0xf7, 0x0e, 0xdd, 0xbb, 0x75, 0xec, 0xd4, - 0x8f, 0x51, 0x3a, 0x65, 0xec, 0x58, 0x9c, 0xa1, 0xd0, 0x4f, 0x51, 0x12, 0x09, 0xaa, 0x8c, 0x9a, - 0x0c, 0xaf, 0xf9, 0x3d, 0x7e, 0x24, 0xbf, 0xc1, 0x71, 0x17, 0x80, 0xab, 0x98, 0x09, 0x55, 0x72, - 0x52, 0xc9, 0xf1, 0xb4, 0xe4, 0x40, 0xe6, 0x84, 0xad, 0xa6, 0x40, 0x54, 0xcd, 0x04, 0xb0, 0x4c, - 0x15, 0x52, 0x00, 0xa9, 0xf9, 0x4c, 0xde, 0x70, 0x02, 0xbc, 0x9e, 0x15, 0x19, 0xc7, 0x93, 0x5a, - 0x2a, 0xd9, 0xd9, 0xb2, 0x3c, 0x36, 0x1e, 0xcf, 0xb1, 0xf6, 0xd8, 0xf6, 0x58, 0xfb, 0xf0, 0x4f, - 0x26, 0xa1, 0x92, 0x40, 0x2a, 0xc8, 0xc9, 0x6c, 0x7b, 0xf5, 0xd0, 0x51, 0xe1, 0xdf, 0x5c, 0xca, - 0xbc, 0xe4, 0x84, 0x4d, 0x0a, 0xc2, 0x84, 0x90, 0x8a, 0x69, 0xa7, 0xdf, 0xba, 0x17, 0xad, 0x38, - 0x00, 0xcb, 0x4d, 0xd1, 0xf0, 0xdc, 0xd9, 0x5b, 0xb3, 0xab, 0x9a, 0xc3, 0x44, 0x0a, 0x30, 0x61, - 0x3b, 0x8f, 0x28, 0x68, 0xc5, 0x90, 0x77, 0xee, 0x51, 0xd0, 0x3e, 0x63, 0x62, 0x5c, 0xf2, 0xce, - 0x01, 0x76, 0xbd, 0x09, 0x1c, 0xeb, 0x82, 0xe1, 0x89, 0x3b, 0x1d, 0xfe, 0xcc, 0x06, 0xa6, 0xda, - 0x3f, 0x2f, 0xfc, 0x75, 0xfb, 0xf9, 0xf2, 0x1f, 0xf5, 0xee, 0x5a, 0xaf, 0x4d, 0x84, 0x16, 0x4d, - 0x84, 0x3e, 0x9a, 0x08, 0x3d, 0x2c, 0x23, 0x6f, 0xb1, 0x8c, 0xbc, 0xf7, 0x65, 0xe4, 0x05, 0x7b, - 0x99, 0xac, 0x9c, 0xbf, 0xd6, 0xfb, 0x7d, 0xa1, 0xff, 0x79, 0x7f, 0x75, 0xf8, 0x3e, 0xba, 0x3c, - 0xcc, 0x0b, 0x75, 0x3d, 0x1d, 0xe1, 0x4c, 0x56, 0xc4, 0xf5, 0x5a, 0x9f, 0xfc, 0x76, 0x37, 0x4e, - 0xba, 0xc3, 0xc1, 0xb3, 0xbf, 0xb1, 0x3b, 0xb1, 0x29, 0x92, 0xe8, 0x7a, 0x60, 0x1f, 0x11, 0xf0, - 0x60, 0x6d, 0xdf, 0x36, 0x48, 0x6a, 0x48, 0x9a, 0xa4, 0x9a, 0xa4, 0x36, 0x49, 0x35, 0x69, 0xfc, - 0x23, 0x57, 0x92, 0x9e, 0xf6, 0x7b, 0x31, 0x57, 0x6c, 0xcc, 0x14, 0xfb, 0xf2, 0xf7, 0x2d, 0x4e, - 0xa9, 0xf1, 0x94, 0x26, 0x94, 0xea, 0x04, 0x4a, 0xed, 0x08, 0x4a, 0x75, 0xc6, 0xa8, 0xbd, 0x5e, - 0x94, 0xdd, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbf, 0x5c, 0x57, 0x15, 0x60, 0x03, 0x00, 0x00, + // 348 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x5c, 0x8a, 0x1d, 0x82, 0x53, 0x17, 0x21, 0x43, 0x06, 0x47, 0x87, 0x3b, 0x7f, + 0x0e, 0x9e, 0x22, 0xb4, 0x20, 0x0a, 0x12, 0x28, 0xb5, 0x43, 0x90, 0x80, 0x5c, 0xd3, 0x23, 0x16, + 0x7b, 0xb9, 0x92, 0x77, 0x2d, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, 0x10, 0xa7, + 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xa4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, 0xe0, 0xf3, + 0xcd, 0xf7, 0x25, 0x2f, 0x38, 0x6b, 0x03, 0x70, 0x15, 0xb3, 0x42, 0x8d, 0x39, 0x11, 0x72, 0x38, + 0x1d, 0x73, 0x20, 0x73, 0xc2, 0xea, 0x29, 0x10, 0x55, 0xb2, 0x02, 0x58, 0xa6, 0x46, 0xb2, 0x00, + 0x52, 0xf2, 0x99, 0xbc, 0xe7, 0x04, 0x78, 0x39, 0x1b, 0x65, 0x1c, 0x4f, 0x4a, 0xa9, 0x64, 0x6b, + 0xd7, 0xf2, 0xd8, 0x78, 0x3c, 0xc7, 0xda, 0x63, 0xdb, 0x63, 0xed, 0xc3, 0xad, 0x4c, 0x82, 0x90, + 0x40, 0x04, 0xe4, 0x64, 0xb6, 0x57, 0x3f, 0x74, 0x54, 0xe8, 0x5e, 0x45, 0x70, 0x00, 0x96, 0x9b, + 0x2a, 0xe1, 0x95, 0xb3, 0xb7, 0x66, 0xb7, 0x25, 0x87, 0x89, 0x2c, 0xc0, 0x84, 0xed, 0xbf, 0xa0, + 0xa0, 0x11, 0x43, 0xde, 0x7a, 0x42, 0x41, 0xf3, 0x92, 0x15, 0xc3, 0x31, 0x6f, 0x1d, 0x63, 0xd7, + 0x5d, 0x71, 0xac, 0x0b, 0x86, 0xe7, 0xee, 0xb4, 0xff, 0x3f, 0xeb, 0x99, 0x6a, 0xdb, 0x5e, 0xb8, + 0xf1, 0xf0, 0xf3, 0xbe, 0x83, 0x3a, 0x8f, 0x8d, 0x8f, 0x2a, 0x42, 0x8b, 0x2a, 0x42, 0xdf, 0x55, + 0x84, 0x9e, 0x97, 0x91, 0xb7, 0x58, 0x46, 0xde, 0xd7, 0x32, 0xf2, 0x82, 0xc3, 0x4c, 0x0a, 0xe7, + 0xb7, 0x75, 0x36, 0xaf, 0xf5, 0x5f, 0xed, 0xd6, 0xcb, 0x77, 0xd1, 0xcd, 0x49, 0x3e, 0x52, 0x77, + 0xd3, 0x01, 0xce, 0xa4, 0x20, 0xae, 0x9f, 0xf5, 0xd5, 0x6f, 0xb6, 0xe3, 0xa4, 0xdd, 0xef, 0xbd, + 0xf9, 0x6b, 0xd7, 0x11, 0x9b, 0x22, 0x89, 0xae, 0x07, 0xf6, 0x8a, 0x80, 0x7b, 0x2b, 0xfb, 0xb9, + 0x46, 0x52, 0x43, 0xd2, 0x24, 0xd5, 0x24, 0xb5, 0x49, 0xaa, 0x49, 0xe5, 0x9f, 0xba, 0x92, 0xf4, + 0xa2, 0xdb, 0x89, 0xb9, 0x62, 0x43, 0xa6, 0xd8, 0xaf, 0x7f, 0x64, 0x71, 0x4a, 0x8d, 0xa7, 0x34, + 0xa1, 0x54, 0x27, 0x50, 0x6a, 0x47, 0x50, 0xaa, 0x33, 0x06, 0xcd, 0xd5, 0xa1, 0x1c, 0xfc, 0x05, + 0x00, 0x00, 0xff, 0xff, 0x4b, 0x04, 0x61, 0x12, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/revoke/service.pb.gw.go b/x/assets/transactions/revoke/service.pb.gw.go deleted file mode 100644 index f0e01b32a..000000000 --- a/x/assets/transactions/revoke/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/revoke/service.proto - -/* -Package revoke is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package revoke - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "revoke"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/send/service.pb.go b/x/assets/transactions/send/service.pb.go index d62b10ddd..abab54e15 100644 --- a/x/assets/transactions/send/service.pb.go +++ b/x/assets/transactions/send/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_95a46fce5d59d239 = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xf3, 0x40, - 0x18, 0x06, 0xf0, 0x5c, 0x3e, 0xbe, 0x0e, 0xe1, 0x9b, 0xba, 0x7c, 0x10, 0x24, 0x83, 0xa3, 0xc3, - 0x1d, 0xb6, 0x83, 0x78, 0xb8, 0xb4, 0x0e, 0xea, 0x10, 0x28, 0xb6, 0x43, 0x90, 0x80, 0x5c, 0x93, - 0x23, 0x06, 0x92, 0xbb, 0x92, 0xf7, 0x5a, 0x3a, 0x3a, 0x3a, 0xba, 0xb9, 0x3b, 0x3a, 0xf9, 0x67, - 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0xdd, 0x5d, 0xe2, 0x1d, 0x78, 0x1d, 0x6f, 0x0a, 0xbc, - 0xe1, 0xf7, 0xe4, 0xb9, 0x37, 0x17, 0x9c, 0x8c, 0x00, 0xb8, 0x8a, 0x99, 0x50, 0x15, 0x27, 0xb5, - 0xcc, 0x97, 0x15, 0x07, 0xb2, 0x26, 0xac, 0x9b, 0x02, 0x51, 0x0d, 0x13, 0xc0, 0x32, 0x55, 0x4a, - 0x01, 0x04, 0xb8, 0xc8, 0x09, 0xf0, 0x66, 0x55, 0x66, 0x1c, 0x2f, 0x1a, 0xa9, 0x64, 0x1f, 0x5b, - 0x1a, 0x1b, 0x8d, 0xd7, 0x58, 0x6b, 0x6c, 0x6b, 0xdc, 0xe9, 0xf0, 0x7f, 0x26, 0xa1, 0x96, 0x40, - 0x6a, 0x28, 0xc8, 0xea, 0xb0, 0x7b, 0xe8, 0xa0, 0x70, 0xaf, 0x90, 0xb2, 0xa8, 0x38, 0x61, 0x8b, - 0x92, 0x30, 0x21, 0xa4, 0x62, 0x5a, 0xe9, 0xb7, 0xae, 0x25, 0x6b, 0x0e, 0xc0, 0x0a, 0x53, 0x32, - 0xbc, 0x70, 0xd4, 0xd6, 0xe4, 0xba, 0xe1, 0xb0, 0x90, 0x02, 0x4c, 0xd4, 0xe0, 0x01, 0x05, 0x7f, - 0x62, 0x28, 0xfa, 0x77, 0x28, 0xe8, 0x9d, 0x33, 0x91, 0x57, 0xbc, 0x7f, 0xe4, 0xb8, 0x03, 0x1c, - 0xeb, 0x72, 0xe1, 0xa9, 0x2b, 0x9c, 0xfd, 0x4e, 0x2e, 0x4d, 0xad, 0x7d, 0x2f, 0xfc, 0x7b, 0xfb, - 0xf1, 0x7c, 0x80, 0xc6, 0x5f, 0xfe, 0x4b, 0x1b, 0xa1, 0x4d, 0x1b, 0xa1, 0xf7, 0x36, 0x42, 0xf7, - 0xdb, 0xc8, 0xdb, 0x6c, 0x23, 0xef, 0x6d, 0x1b, 0x79, 0xc1, 0x20, 0x93, 0xb5, 0xe3, 0xb7, 0xc6, - 0xff, 0xa6, 0xfa, 0x3f, 0x4f, 0xba, 0x63, 0x4f, 0xd0, 0xd5, 0x71, 0x51, 0xaa, 0x9b, 0xe5, 0x1c, - 0x67, 0xb2, 0x26, 0x6e, 0xeb, 0x7c, 0xf4, 0x7b, 0xa3, 0x38, 0x19, 0xcd, 0xa6, 0x4f, 0xfe, 0x4e, - 0x89, 0xd8, 0x94, 0x48, 0xf4, 0x14, 0xec, 0xe3, 0x01, 0x9e, 0x72, 0x91, 0xbf, 0xee, 0x80, 0xd4, - 0x80, 0x34, 0x49, 0x35, 0x48, 0x6d, 0x90, 0x76, 0xa0, 0xf5, 0xa9, 0x1b, 0x48, 0xcf, 0x26, 0xe3, - 0x98, 0x2b, 0x96, 0x33, 0xc5, 0x3e, 0xfd, 0xa1, 0x85, 0x29, 0x35, 0x9a, 0xd2, 0x84, 0xea, 0x54, - 0xa0, 0xd4, 0x0e, 0xa0, 0xb4, 0x4b, 0x98, 0xf7, 0x7e, 0x2e, 0xc6, 0xf0, 0x3b, 0x00, 0x00, 0xff, - 0xff, 0xa5, 0x99, 0xa5, 0xf2, 0x48, 0x03, 0x00, 0x00, + // 344 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0x33, 0x31, + 0x18, 0x06, 0xf0, 0xcb, 0x7d, 0x7c, 0x1d, 0x0e, 0xa7, 0x2e, 0xc2, 0x0d, 0x37, 0x38, 0x3a, 0x24, + 0xd8, 0x0e, 0x62, 0x70, 0x69, 0x1d, 0xd4, 0xe1, 0xa0, 0xd8, 0x0e, 0x87, 0x1c, 0x48, 0x7a, 0x17, + 0xce, 0x42, 0x2f, 0x29, 0xf7, 0xa6, 0xa5, 0xa3, 0xa3, 0xa3, 0x9b, 0xbb, 0xa3, 0x93, 0x7f, 0x86, + 0x38, 0x75, 0x74, 0x94, 0xeb, 0x20, 0xb8, 0xbb, 0x4b, 0x4c, 0xc0, 0x74, 0xcc, 0x74, 0xf0, 0xc2, + 0xef, 0xb9, 0xe7, 0x4d, 0x12, 0x9d, 0x0e, 0x00, 0xb8, 0x4a, 0x99, 0x50, 0x73, 0x4e, 0x6a, 0x59, + 0x2e, 0xe7, 0x1c, 0xc8, 0x9a, 0x30, 0x3d, 0x05, 0xa2, 0x1a, 0x26, 0x80, 0x15, 0x6a, 0x26, 0x05, + 0x10, 0xe0, 0xa2, 0x24, 0xc0, 0x9b, 0xd5, 0xac, 0xe0, 0x78, 0xd1, 0x48, 0x25, 0xbb, 0xd8, 0xd1, + 0xd8, 0x6a, 0xbc, 0xc6, 0x46, 0x63, 0x57, 0x63, 0xad, 0xe3, 0xfd, 0x42, 0x42, 0x2d, 0x81, 0xd4, + 0x50, 0x91, 0xd5, 0x91, 0xfe, 0x98, 0xa0, 0xd8, 0xb7, 0x46, 0xcd, 0x01, 0x58, 0x65, 0x6b, 0xc4, + 0x97, 0x9e, 0xda, 0x99, 0xdc, 0x34, 0x1c, 0x16, 0x52, 0x80, 0x8d, 0xea, 0x3d, 0xa2, 0xe8, 0x5f, + 0x0a, 0x55, 0xf7, 0x1e, 0x45, 0x9d, 0x0b, 0x26, 0xca, 0x39, 0xef, 0x1e, 0x7b, 0x6e, 0x89, 0x53, + 0x53, 0x2e, 0x3e, 0xf3, 0x85, 0x93, 0xbf, 0xc9, 0x95, 0xad, 0x75, 0x10, 0xc4, 0xff, 0xef, 0x3e, + 0x5f, 0x0e, 0xd1, 0xf0, 0x3b, 0x7c, 0x6d, 0x13, 0xb4, 0x69, 0x13, 0xf4, 0xd1, 0x26, 0xe8, 0x61, + 0x9b, 0x04, 0x9b, 0x6d, 0x12, 0xbc, 0x6f, 0x93, 0x20, 0xea, 0x15, 0xb2, 0xf6, 0xfc, 0xd7, 0x70, + 0x6f, 0x6c, 0x6e, 0x72, 0xa4, 0xd7, 0x1e, 0xa1, 0xeb, 0x93, 0x6a, 0xa6, 0x6e, 0x97, 0x53, 0x5c, + 0xc8, 0x9a, 0xf8, 0x1d, 0xe7, 0x53, 0xd8, 0x19, 0xa4, 0xd9, 0x60, 0x32, 0x7e, 0x0e, 0x77, 0x4a, + 0xa4, 0xb6, 0x44, 0x66, 0xa6, 0xe0, 0xae, 0x07, 0x78, 0xcc, 0x45, 0xf9, 0xb6, 0x03, 0x72, 0x0b, + 0xf2, 0x2c, 0x37, 0x20, 0x77, 0x41, 0xae, 0x41, 0x1b, 0x52, 0x3f, 0x90, 0x9f, 0x8f, 0x86, 0x29, + 0x57, 0xac, 0x64, 0x8a, 0x7d, 0x85, 0x7d, 0x07, 0x53, 0x6a, 0x35, 0xa5, 0x19, 0x35, 0xa9, 0x40, + 0xa9, 0x1b, 0x40, 0xa9, 0x4e, 0x98, 0x76, 0x7e, 0x1f, 0x46, 0xff, 0x27, 0x00, 0x00, 0xff, 0xff, + 0x9f, 0x53, 0x86, 0xbd, 0x2a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/send/service.pb.gw.go b/x/assets/transactions/send/service.pb.gw.go deleted file mode 100644 index 856a7b8c2..000000000 --- a/x/assets/transactions/send/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/send/service.proto - -/* -Package send is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package send - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "send"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/unwrap/service.pb.go b/x/assets/transactions/unwrap/service.pb.go index 57d19518d..561715217 100644 --- a/x/assets/transactions/unwrap/service.pb.go +++ b/x/assets/transactions/unwrap/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_590bf0044c41d756 = []byte{ - // 367 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0x83, 0xa3, 0xc3, - 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x09, 0x14, 0x6d, 0x21, 0x48, 0x40, 0xae, 0xe9, - 0x11, 0x03, 0xc9, 0x5d, 0xc8, 0x73, 0xad, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, - 0x10, 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, - 0x84, 0xcf, 0x37, 0xdf, 0xbb, 0x3c, 0xfe, 0x71, 0x17, 0x80, 0xc9, 0x88, 0x72, 0x59, 0x30, 0x5c, - 0x8a, 0xf1, 0xa4, 0x60, 0x80, 0x67, 0x98, 0x2e, 0xa7, 0x80, 0x65, 0x4d, 0x39, 0xd0, 0x54, 0xe6, - 0x82, 0x03, 0x9e, 0xf0, 0xdb, 0x9a, 0x56, 0x18, 0x58, 0x3d, 0xcd, 0x53, 0x86, 0xaa, 0x5a, 0x48, - 0xd1, 0xd9, 0x32, 0x3c, 0xd2, 0x1e, 0xcd, 0x90, 0xf2, 0xc8, 0xf4, 0x48, 0xf9, 0xe0, 0x5f, 0x2a, - 0xa0, 0x14, 0x80, 0x4b, 0xc8, 0xf0, 0x74, 0x7b, 0xf9, 0x50, 0x51, 0xc1, 0xff, 0x4c, 0x88, 0xac, - 0x60, 0x98, 0x56, 0x39, 0xa6, 0x9c, 0x0b, 0x49, 0x95, 0x53, 0x6f, 0xed, 0x8b, 0x96, 0x0c, 0x80, - 0x66, 0xba, 0x68, 0x70, 0x6e, 0xed, 0x8d, 0xd9, 0x75, 0xcd, 0xa0, 0x12, 0x1c, 0x74, 0xd8, 0xce, - 0x93, 0xeb, 0xb7, 0x22, 0xc8, 0x3a, 0x0f, 0xae, 0xdf, 0x3e, 0xa3, 0x7c, 0x5c, 0xb0, 0xce, 0x01, - 0xb2, 0xbd, 0x09, 0x14, 0xa9, 0x82, 0xc1, 0x89, 0x3d, 0x1d, 0xfc, 0xce, 0x2e, 0x74, 0xb5, 0x0d, - 0x27, 0xf8, 0x73, 0xf7, 0xf5, 0xba, 0xe9, 0xf6, 0xee, 0x5b, 0x6f, 0x4d, 0xe8, 0xce, 0x9b, 0xd0, - 0xfd, 0x6c, 0x42, 0xf7, 0x71, 0x11, 0x3a, 0xf3, 0x45, 0xe8, 0x7c, 0x2c, 0x42, 0xc7, 0xdf, 0x4b, - 0x45, 0x69, 0xfd, 0xb5, 0xde, 0xdf, 0x4b, 0xf5, 0xcf, 0xfb, 0xcb, 0xc3, 0xf7, 0xdd, 0xab, 0xc3, - 0x2c, 0x97, 0x37, 0x93, 0x11, 0x4a, 0x45, 0x89, 0x6d, 0xaf, 0xf5, 0xd9, 0x6b, 0x77, 0xa3, 0xb8, - 0x3b, 0x18, 0xbe, 0x78, 0x6b, 0xbb, 0x13, 0xe9, 0x22, 0xb1, 0xaa, 0x07, 0xe6, 0x11, 0x01, 0x0d, - 0x57, 0xf6, 0x7d, 0x8d, 0x24, 0x9a, 0x24, 0x71, 0xa2, 0x48, 0x62, 0x92, 0x44, 0x91, 0xc6, 0x3b, - 0xb2, 0x25, 0xc9, 0x69, 0xbf, 0x17, 0x31, 0x49, 0xc7, 0x54, 0xd2, 0x6f, 0x6f, 0xdf, 0xe0, 0x84, - 0x68, 0x4f, 0x48, 0x4c, 0x88, 0x4a, 0x20, 0xc4, 0x8c, 0x20, 0x44, 0x65, 0x8c, 0xda, 0xab, 0x45, - 0xd9, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0xdb, 0xaf, 0xf4, 0x2c, 0x60, 0x03, 0x00, 0x00, + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xca, 0xaf, 0x43, 0xf8, 0x4d, 0x5d, 0x84, 0x0c, 0x19, 0x1c, 0x1d, 0xee, + 0xfc, 0x3b, 0x78, 0x8a, 0xd0, 0x82, 0x28, 0x48, 0xa0, 0x68, 0x0b, 0x41, 0x02, 0x72, 0x4d, 0x8f, + 0x58, 0x68, 0xee, 0x4a, 0x9e, 0x6b, 0xed, 0xa8, 0xbb, 0x83, 0xbb, 0x9b, 0xa3, 0x93, 0x2f, 0x43, + 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xbe, 0x0a, 0x49, 0xef, 0xc0, 0xeb, 0x78, 0x53, 0xe0, 0x81, + 0xcf, 0x37, 0xdf, 0x27, 0x79, 0x82, 0x93, 0x36, 0x00, 0x57, 0x31, 0x13, 0x6a, 0xcc, 0x49, 0x21, + 0x87, 0xd3, 0x31, 0x07, 0x32, 0x27, 0xac, 0x9e, 0x02, 0x51, 0x25, 0x13, 0xc0, 0x32, 0x35, 0x92, + 0x02, 0xc8, 0x54, 0xdc, 0x95, 0x6c, 0x42, 0x80, 0x97, 0xb3, 0x51, 0xc6, 0xf1, 0xa4, 0x94, 0x4a, + 0xb6, 0xb6, 0x2d, 0x8f, 0x8d, 0xc7, 0x73, 0xac, 0x3d, 0xb6, 0x3d, 0xd6, 0x3e, 0xdc, 0xc8, 0x24, + 0x14, 0x12, 0x48, 0x01, 0x39, 0x99, 0xed, 0xd4, 0x0f, 0x1d, 0x15, 0xba, 0x57, 0x29, 0x38, 0x00, + 0xcb, 0x4d, 0x95, 0xf0, 0xc2, 0xd9, 0x5b, 0xb3, 0x9b, 0x92, 0xc3, 0x44, 0x0a, 0x30, 0x61, 0xbb, + 0xcf, 0x28, 0x68, 0xc4, 0x90, 0xb7, 0x1e, 0x51, 0xd0, 0x3c, 0x67, 0x62, 0x38, 0xe6, 0xad, 0x43, + 0xec, 0xba, 0x2b, 0x8e, 0x75, 0xc1, 0xf0, 0xd4, 0x9d, 0xf6, 0xfe, 0x66, 0x97, 0xa6, 0xda, 0xa6, + 0x17, 0xfe, 0xbb, 0xff, 0x7e, 0xdb, 0x42, 0x9d, 0x87, 0xc6, 0x7b, 0x15, 0xa1, 0x45, 0x15, 0xa1, + 0xaf, 0x2a, 0x42, 0x4f, 0xcb, 0xc8, 0x5b, 0x2c, 0x23, 0xef, 0x73, 0x19, 0x79, 0xc1, 0x7e, 0x26, + 0x0b, 0xe7, 0xb7, 0x75, 0xfe, 0x5f, 0xe9, 0xbf, 0xda, 0xad, 0x97, 0xef, 0xa2, 0xeb, 0xa3, 0x7c, + 0xa4, 0x6e, 0xa7, 0x03, 0x9c, 0xc9, 0x82, 0xb8, 0x7e, 0xd6, 0x17, 0xbf, 0xd9, 0x8e, 0x93, 0x76, + 0xaf, 0xff, 0xea, 0xaf, 0x5d, 0x47, 0x6c, 0x8a, 0x24, 0xba, 0x1e, 0xd8, 0x2b, 0x02, 0xee, 0xaf, + 0xec, 0xc7, 0x1a, 0x49, 0x0d, 0x49, 0x93, 0x54, 0x93, 0xd4, 0x26, 0xa9, 0x26, 0x95, 0x7f, 0xec, + 0x4a, 0xd2, 0xb3, 0x6e, 0x27, 0xe6, 0x8a, 0x0d, 0x99, 0x62, 0x3f, 0xfe, 0x81, 0xc5, 0x29, 0x35, + 0x9e, 0xd2, 0x84, 0x52, 0x9d, 0x40, 0xa9, 0x1d, 0x41, 0xa9, 0xce, 0x18, 0x34, 0x57, 0x87, 0xb2, + 0xf7, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x41, 0xde, 0xa5, 0x08, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/unwrap/service.pb.gw.go b/x/assets/transactions/unwrap/service.pb.gw.go deleted file mode 100644 index e19aada74..000000000 --- a/x/assets/transactions/unwrap/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/unwrap/service.proto - -/* -Package unwrap is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package unwrap - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "unwrap"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/assets/transactions/wrap/service.pb.go b/x/assets/transactions/wrap/service.pb.go index 2ac9145bb..ebee5a55c 100644 --- a/x/assets/transactions/wrap/service.pb.go +++ b/x/assets/transactions/wrap/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_ccaf91d5b35dd610 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xc3, 0x40, - 0x14, 0x06, 0xf0, 0x24, 0x62, 0x87, 0xe0, 0xd4, 0x45, 0x08, 0x92, 0xc1, 0xd1, 0xe1, 0x0e, 0xdb, - 0x41, 0x3c, 0x5c, 0x5a, 0x07, 0x75, 0x08, 0x14, 0x2d, 0x34, 0x48, 0x40, 0x5e, 0xd3, 0x23, 0x06, - 0x92, 0x5c, 0xc8, 0xbb, 0xd6, 0x8e, 0x8e, 0x8e, 0x6e, 0xee, 0x8e, 0x4e, 0xfe, 0x19, 0xe2, 0xd4, - 0xd1, 0x51, 0xd2, 0x41, 0x70, 0x77, 0x97, 0x78, 0x01, 0xaf, 0xe3, 0x4d, 0x81, 0x17, 0x7e, 0x5f, - 0xbe, 0x7b, 0x39, 0xf7, 0x64, 0x80, 0xc8, 0x65, 0x00, 0x85, 0xcc, 0x38, 0xcd, 0xc5, 0x6c, 0x9e, - 0x71, 0xa4, 0x4b, 0x0a, 0xcd, 0x14, 0xa9, 0xac, 0xa0, 0x40, 0x88, 0x65, 0x2a, 0x0a, 0xa4, 0x77, - 0x15, 0x94, 0x14, 0x79, 0xb5, 0x48, 0x63, 0x4e, 0xca, 0x4a, 0x48, 0xd1, 0x25, 0x9a, 0x26, 0xad, - 0x26, 0x4b, 0xa2, 0x34, 0xd1, 0x35, 0x69, 0xb4, 0xb7, 0x1b, 0x0b, 0xcc, 0x05, 0xd2, 0x1c, 0x13, - 0xba, 0x38, 0x6c, 0x1e, 0x2a, 0xc8, 0xdb, 0x4b, 0x84, 0x48, 0x32, 0x4e, 0xa1, 0x4c, 0x29, 0x14, - 0x85, 0x90, 0xa0, 0x94, 0x7a, 0x6b, 0x5a, 0x32, 0xe7, 0x88, 0x90, 0xb4, 0x25, 0xbd, 0x0b, 0x43, - 0xad, 0x4d, 0x6e, 0x2a, 0x8e, 0xa5, 0x28, 0xb0, 0x8d, 0xea, 0x3d, 0xd9, 0xee, 0x56, 0x80, 0x49, - 0xf7, 0xc1, 0x76, 0x3b, 0xe7, 0x50, 0xcc, 0x32, 0xde, 0x3d, 0x32, 0xdc, 0x01, 0x09, 0x54, 0x39, - 0xef, 0xd4, 0x14, 0x8e, 0xff, 0x27, 0x97, 0x6d, 0xad, 0x7d, 0xcb, 0xdb, 0xbe, 0xff, 0x7a, 0x3d, - 0xb0, 0x87, 0x3f, 0xce, 0x5b, 0xed, 0xdb, 0xab, 0xda, 0xb7, 0x3f, 0x6b, 0xdf, 0x7e, 0x5c, 0xfb, - 0xd6, 0x6a, 0xed, 0x5b, 0x1f, 0x6b, 0xdf, 0x72, 0x7b, 0xb1, 0xc8, 0x0d, 0xbf, 0x35, 0xdc, 0xb9, - 0x52, 0xff, 0x79, 0xd4, 0x1c, 0x7b, 0x64, 0x5f, 0x1f, 0x27, 0xa9, 0xbc, 0x9d, 0x4f, 0x49, 0x2c, - 0x72, 0x6a, 0xb6, 0xce, 0x67, 0xa7, 0x33, 0x08, 0xc2, 0xc1, 0x78, 0xf2, 0xe2, 0x6c, 0x94, 0x08, - 0xda, 0x12, 0xa1, 0x9a, 0xa2, 0x7e, 0x3c, 0x24, 0x93, 0x0a, 0xca, 0xf7, 0x0d, 0x10, 0xb5, 0x20, - 0x0a, 0x23, 0x05, 0x22, 0x1d, 0x44, 0x0d, 0xa8, 0x1d, 0x66, 0x06, 0xa2, 0xb3, 0xd1, 0x30, 0xe0, - 0x12, 0x66, 0x20, 0xe1, 0xdb, 0xe9, 0x6b, 0x98, 0xb1, 0x56, 0x33, 0x16, 0x32, 0x95, 0x8a, 0x8c, - 0xe9, 0x01, 0x8c, 0x35, 0x09, 0xd3, 0xce, 0xdf, 0xc5, 0xe8, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, - 0xf1, 0x7f, 0x01, 0xaf, 0x48, 0x03, 0x00, 0x00, + // 346 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xf3, 0x40, + 0x18, 0x06, 0xf0, 0x5c, 0x3e, 0xbe, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x1d, + 0xb6, 0x83, 0x78, 0xb8, 0xb4, 0x0e, 0xea, 0x10, 0x28, 0x5a, 0x68, 0x90, 0x80, 0x5c, 0xd3, 0x23, + 0x16, 0x9a, 0x5c, 0xc8, 0x7b, 0xad, 0x1d, 0x1d, 0x1d, 0xdd, 0xdc, 0x1d, 0x9d, 0xfc, 0x33, 0xc4, + 0xa9, 0xa3, 0xa3, 0x24, 0x83, 0xe0, 0xee, 0x2e, 0xe7, 0x1d, 0x78, 0x1d, 0x6f, 0x0a, 0xbc, 0xf0, + 0x7b, 0xf2, 0xbc, 0x77, 0x17, 0x1c, 0x0f, 0x00, 0xb8, 0x8c, 0x59, 0x29, 0x17, 0x9c, 0x14, 0x62, + 0xb6, 0x5c, 0x70, 0x20, 0x6b, 0xc2, 0xd4, 0x14, 0x88, 0xac, 0x59, 0x09, 0x2c, 0x93, 0x73, 0x51, + 0x02, 0xb9, 0xad, 0x59, 0x45, 0x80, 0xd7, 0xab, 0x79, 0xc6, 0x71, 0x55, 0x0b, 0x29, 0xba, 0xd8, + 0xd2, 0xd8, 0x68, 0xbc, 0xc6, 0x5a, 0x63, 0x5b, 0x63, 0xa5, 0xc3, 0xdd, 0x4c, 0x40, 0x21, 0x80, + 0x14, 0x90, 0x93, 0xd5, 0x81, 0xfa, 0xe8, 0xa0, 0xd0, 0xb5, 0x46, 0xc1, 0x01, 0x58, 0x6e, 0x6a, + 0x84, 0xe7, 0x8e, 0xda, 0x9a, 0x5c, 0xd7, 0x1c, 0x2a, 0x51, 0x82, 0x89, 0xea, 0x3d, 0xa2, 0xe0, + 0x5f, 0x0c, 0x79, 0xf7, 0x1e, 0x05, 0x9d, 0x33, 0x56, 0xce, 0x16, 0xbc, 0x7b, 0xe8, 0xb8, 0x25, + 0x8e, 0x75, 0xb9, 0xf0, 0xc4, 0x15, 0x8e, 0xff, 0x26, 0x17, 0xa6, 0xd6, 0x9e, 0x17, 0xfe, 0xbf, + 0xfb, 0x7c, 0xd9, 0x47, 0xc3, 0x6f, 0xff, 0xb5, 0x89, 0xd0, 0xa6, 0x89, 0xd0, 0x47, 0x13, 0xa1, + 0x87, 0x36, 0xf2, 0x36, 0x6d, 0xe4, 0xbd, 0xb7, 0x91, 0x17, 0xf4, 0x32, 0x51, 0x38, 0xfe, 0x6b, + 0xb8, 0x73, 0xa9, 0x6f, 0x72, 0xa4, 0xd6, 0x1e, 0xa1, 0xab, 0xa3, 0x7c, 0x2e, 0x6f, 0x96, 0x53, + 0x9c, 0x89, 0x82, 0xb8, 0x1d, 0xe7, 0x93, 0xdf, 0x19, 0xc4, 0xc9, 0x60, 0x3c, 0x79, 0xf6, 0xb7, + 0x4a, 0xc4, 0xa6, 0x44, 0xa2, 0xa7, 0x60, 0xaf, 0x07, 0x78, 0x52, 0xb3, 0xea, 0x6d, 0x0b, 0xa4, + 0x06, 0xa4, 0x49, 0xaa, 0x41, 0x6a, 0x83, 0x54, 0x81, 0xc6, 0xa7, 0x6e, 0x20, 0x3d, 0x1d, 0x0d, + 0x63, 0x2e, 0xd9, 0x8c, 0x49, 0xf6, 0xe5, 0xf7, 0x2d, 0x4c, 0xa9, 0xd1, 0x94, 0x26, 0x54, 0xa7, + 0x02, 0xa5, 0x76, 0x00, 0xa5, 0x2a, 0x61, 0xda, 0xf9, 0x7d, 0x18, 0xfd, 0x9f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x9b, 0x20, 0x68, 0x98, 0x2a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/assets/transactions/wrap/service.pb.gw.go b/x/assets/transactions/wrap/service.pb.gw.go deleted file mode 100644 index dd59a9ee2..000000000 --- a/x/assets/transactions/wrap/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/assets/transactions/wrap/service.proto - -/* -Package wrap is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package wrap - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "assets", "wrap"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/classifications/queries/classification/service.pb.go b/x/classifications/queries/classification/service.pb.go index 32255f815..66c3d66dd 100644 --- a/x/classifications/queries/classification/service.pb.go +++ b/x/classifications/queries/classification/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,28 @@ func init() { } var fileDescriptor_e5438836dfa39dff = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0xc7, 0x9b, 0x88, 0x1d, 0x82, 0x53, 0xc6, 0x22, 0x19, 0x7c, 0x80, 0x3b, 0xab, 0xe0, 0x70, - 0x38, 0xd8, 0x76, 0x68, 0xa9, 0x04, 0x12, 0x5d, 0x82, 0x04, 0xe4, 0x9a, 0x7e, 0xd6, 0x83, 0x24, - 0xd7, 0xe6, 0x2e, 0xa5, 0xae, 0x3e, 0x81, 0xe0, 0x1b, 0x38, 0xfa, 0x24, 0xea, 0x54, 0x70, 0xd1, - 0x4d, 0x12, 0x27, 0x9f, 0x42, 0xda, 0xdc, 0xd0, 0xde, 0x9a, 0xae, 0xff, 0x2f, 0xff, 0x1f, 0xbf, - 0x7c, 0xf7, 0x59, 0xc3, 0x8e, 0x10, 0x20, 0x5d, 0x9a, 0xca, 0x18, 0x70, 0xc2, 0xc7, 0x79, 0x0c, - 0x02, 0x2f, 0x70, 0x14, 0x53, 0x21, 0xd8, 0x1d, 0x8b, 0xa8, 0x64, 0x3c, 0x15, 0x78, 0x96, 0x43, - 0xc6, 0x40, 0x68, 0x39, 0x16, 0x90, 0xcd, 0x59, 0x04, 0x68, 0x9a, 0x71, 0xc9, 0xed, 0xf3, 0x0d, - 0x16, 0x52, 0x2c, 0xb4, 0x40, 0x1a, 0x0b, 0x29, 0x96, 0x96, 0xb7, 0x0e, 0x27, 0x9c, 0x4f, 0x62, - 0xc0, 0x74, 0xca, 0x30, 0x4d, 0x53, 0x2e, 0xd5, 0xe7, 0x6b, 0x76, 0xcb, 0xab, 0xe5, 0xb9, 0x8a, - 0x1f, 0x6e, 0x33, 0x98, 0xe5, 0x20, 0xa4, 0x22, 0xfa, 0x3b, 0x21, 0x8a, 0x29, 0x4f, 0x85, 0x5a, - 0xc0, 0x49, 0x69, 0x58, 0xfb, 0xfe, 0x6a, 0x60, 0x7f, 0x1b, 0x56, 0x73, 0x40, 0xd3, 0x71, 0x0c, - 0xf6, 0x10, 0xd5, 0x59, 0x0b, 0x5a, 0xf3, 0xae, 0x2a, 0xf3, 0xd6, 0xe5, 0x4e, 0x58, 0x95, 0xf3, - 0xd1, 0xd9, 0xe3, 0xe7, 0xef, 0xb3, 0x79, 0x6c, 0x23, 0x9c, 0x54, 0x4b, 0xd0, 0x7f, 0x7d, 0xde, - 0x1e, 0x81, 0xa4, 0x6d, 0x2d, 0xef, 0xbe, 0xef, 0xbd, 0x15, 0x8e, 0xb1, 0x2c, 0x1c, 0xe3, 0xa7, - 0x70, 0x8c, 0xa7, 0xd2, 0x69, 0x2c, 0x4b, 0xa7, 0xf1, 0x55, 0x3a, 0x0d, 0xeb, 0x22, 0xe2, 0x49, - 0x2d, 0xc5, 0xee, 0xc1, 0x75, 0x75, 0x52, 0xde, 0x6a, 0xa1, 0x9e, 0x71, 0xd3, 0x9f, 0x30, 0x79, - 0x9f, 0x8f, 0x50, 0xc4, 0x13, 0x5c, 0xe7, 0xc1, 0x5e, 0xcc, 0x66, 0xc7, 0x0d, 0x7a, 0x7e, 0xef, - 0xd5, 0xdc, 0x3a, 0x53, 0x57, 0x09, 0x06, 0xa8, 0xa7, 0x09, 0xfa, 0x4a, 0x70, 0x3b, 0xff, 0xd8, - 0xaa, 0x87, 0xaa, 0x1e, 0x06, 0xa1, 0x56, 0x0f, 0x55, 0x5d, 0xcb, 0x0b, 0x73, 0x50, 0xa7, 0x1e, - 0xf6, 0xbd, 0xae, 0x0b, 0x92, 0x8e, 0xa9, 0xa4, 0x7f, 0x66, 0x67, 0x03, 0x45, 0x88, 0x62, 0x11, - 0x12, 0x10, 0xa2, 0xd1, 0x08, 0x51, 0x38, 0x7d, 0x32, 0x6a, 0xae, 0x0f, 0xf7, 0xf4, 0x3f, 0x00, - 0x00, 0xff, 0xff, 0xbb, 0x34, 0xaa, 0x80, 0x07, 0x04, 0x00, 0x00, + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0xe3, 0x20, 0x3a, 0x44, 0x4c, 0x1d, 0x3b, 0x78, 0xe0, 0x00, 0xb6, 0x04, 0x9b, 0xc5, + 0x40, 0x93, 0xa1, 0x55, 0x51, 0xa4, 0x04, 0x96, 0x08, 0x45, 0x42, 0x6e, 0x62, 0xc0, 0x52, 0x12, + 0xb7, 0xb1, 0x83, 0xca, 0x2d, 0x38, 0x03, 0x6c, 0x48, 0xdc, 0x03, 0x98, 0x3a, 0x32, 0xa2, 0x64, + 0xe3, 0x14, 0x28, 0x8d, 0x87, 0xc6, 0x6b, 0xba, 0xfe, 0xd6, 0xff, 0xe5, 0x7b, 0x2f, 0xcf, 0x59, + 0x4c, 0xa5, 0x64, 0xca, 0xa7, 0x85, 0xca, 0x18, 0xce, 0x45, 0x5a, 0x65, 0x4c, 0xe2, 0x0d, 0x4e, + 0x32, 0x2a, 0x25, 0xbf, 0xe7, 0x09, 0x55, 0x5c, 0x14, 0x12, 0xaf, 0x2b, 0x56, 0x72, 0x26, 0x8d, + 0x1c, 0x4b, 0x56, 0x3e, 0xf1, 0x84, 0xa1, 0x55, 0x29, 0x94, 0x18, 0x5f, 0xec, 0xb1, 0x90, 0x66, + 0xa1, 0x0d, 0x32, 0x58, 0x48, 0xb3, 0x8c, 0x7c, 0x12, 0x0c, 0x32, 0x69, 0xe3, 0xe7, 0xbb, 0x92, + 0xad, 0x2b, 0x26, 0x55, 0xe7, 0x33, 0x09, 0x0f, 0x42, 0x94, 0x2b, 0x51, 0x48, 0x3d, 0xe2, 0xd9, + 0x07, 0x70, 0x8e, 0xc3, 0xf6, 0x61, 0xfc, 0x06, 0x9c, 0xd1, 0x9c, 0x16, 0x69, 0xc6, 0xc6, 0x0b, + 0x34, 0x64, 0x70, 0xb4, 0xe3, 0x5d, 0x77, 0xe6, 0x93, 0xab, 0x83, 0xb0, 0x3a, 0xe7, 0x53, 0xcb, + 0xfd, 0x3a, 0xfa, 0xac, 0x21, 0xd8, 0xd6, 0x10, 0xfc, 0xd6, 0x10, 0xbc, 0x34, 0xd0, 0xda, 0x36, + 0xd0, 0xfa, 0x69, 0xa0, 0xe5, 0x5c, 0x26, 0x22, 0x1f, 0xf4, 0x31, 0xf7, 0xe4, 0xa6, 0xfb, 0xfd, + 0x41, 0xbb, 0x9a, 0x00, 0xdc, 0xce, 0x1e, 0xb8, 0x7a, 0xac, 0x96, 0x28, 0x11, 0x39, 0x1e, 0xb2, + 0xfa, 0x57, 0x7b, 0x34, 0xf5, 0x23, 0x2f, 0xf4, 0xde, 0xed, 0xde, 0x49, 0xf9, 0x5a, 0x30, 0x42, + 0x9e, 0x21, 0x18, 0x6a, 0xc1, 0x7e, 0xfe, 0xdd, 0xab, 0xc7, 0xba, 0x1e, 0x47, 0xb1, 0x51, 0x8f, + 0x75, 0xdd, 0xc8, 0x6b, 0x7b, 0x3e, 0xa4, 0x1e, 0xcf, 0x02, 0xd7, 0x67, 0x8a, 0xa6, 0x54, 0xd1, + 0x3f, 0x7b, 0xba, 0x87, 0x22, 0x44, 0xb3, 0x08, 0x89, 0x08, 0x31, 0x68, 0x84, 0x68, 0x9c, 0xf9, + 0xb2, 0x1c, 0xed, 0x4e, 0xf0, 0xfc, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x70, 0x12, 0x4a, 0x27, 0xb3, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/classifications/queries/classification/service.pb.gw.go b/x/classifications/queries/classification/service.pb.gw.go deleted file mode 100644 index 84980b631..000000000 --- a/x/classifications/queries/classification/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/classifications/queries/classification/service.proto - -/* -Package classification is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package classification - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "classifications", "v1beta1", "classification"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/classifications/queries/classifications/service.pb.go b/x/classifications/queries/classifications/service.pb.go index a6c39f2b0..ca6db69e1 100644 --- a/x/classifications/queries/classifications/service.pb.go +++ b/x/classifications/queries/classifications/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,28 @@ func init() { } var fileDescriptor_52483da8b4452def = []byte{ - // 368 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x92, 0x31, 0x4b, 0xfb, 0x40, - 0x18, 0xc6, 0x9b, 0xfc, 0xf9, 0x77, 0x08, 0x4e, 0x19, 0x8b, 0x64, 0xf0, 0x03, 0xdc, 0x51, 0x1d, - 0x84, 0x03, 0x87, 0xa6, 0x83, 0x95, 0x1a, 0x68, 0xeb, 0x12, 0x24, 0x20, 0xd7, 0xf4, 0xb5, 0x1e, - 0x24, 0xb9, 0x36, 0x77, 0x29, 0x75, 0xf5, 0x13, 0x08, 0x7e, 0x03, 0x47, 0x3f, 0x89, 0xb8, 0x58, - 0x70, 0x71, 0x70, 0x90, 0x54, 0x1c, 0xfc, 0x14, 0x92, 0xe6, 0x86, 0xf6, 0xea, 0x96, 0xae, 0xcf, - 0xfb, 0x3e, 0x3f, 0x9e, 0x7b, 0xee, 0xb5, 0xba, 0x2d, 0x21, 0x40, 0x7a, 0x34, 0x91, 0x11, 0xe0, - 0x98, 0x8f, 0xb2, 0x08, 0x04, 0x9e, 0xe3, 0x30, 0xa2, 0x42, 0xb0, 0x6b, 0x16, 0x52, 0xc9, 0x78, - 0x22, 0xf0, 0x34, 0x83, 0x94, 0x81, 0xd8, 0xd2, 0x05, 0xa4, 0x33, 0x16, 0x02, 0x9a, 0xa4, 0x5c, - 0x72, 0xfb, 0x64, 0x0d, 0x86, 0x14, 0x0c, 0xcd, 0x91, 0x66, 0x42, 0x0a, 0xa6, 0xeb, 0x8d, 0xfd, - 0x31, 0xe7, 0xe3, 0x08, 0x30, 0x9d, 0x30, 0x4c, 0x93, 0x84, 0x4b, 0xb5, 0xbf, 0x82, 0x37, 0xfa, - 0xd5, 0x92, 0x16, 0xfa, 0xed, 0x55, 0x0a, 0xd3, 0x0c, 0x84, 0x54, 0xc8, 0xc1, 0x6e, 0x90, 0x62, - 0xc2, 0x13, 0xa1, 0x3a, 0x38, 0xfc, 0x36, 0xac, 0xff, 0xfd, 0x62, 0x60, 0x7f, 0x18, 0x56, 0xbd, - 0x43, 0x93, 0x51, 0x04, 0x76, 0x17, 0x55, 0x6a, 0x06, 0xad, 0x80, 0x83, 0x32, 0x7b, 0xe3, 0x7c, - 0x37, 0xb0, 0x32, 0xf5, 0xc1, 0xf1, 0xdd, 0xdb, 0xd7, 0x83, 0xd9, 0xb4, 0x31, 0x8e, 0xcb, 0x1e, - 0xf4, 0x57, 0xce, 0x9a, 0x43, 0x90, 0xb4, 0xa9, 0xeb, 0xee, 0xeb, 0xbf, 0xe7, 0xdc, 0x31, 0x16, - 0xb9, 0x63, 0x7c, 0xe6, 0x8e, 0x71, 0xbf, 0x74, 0x6a, 0x8b, 0xa5, 0x53, 0x7b, 0x5f, 0x3a, 0x35, - 0xab, 0x15, 0xf2, 0xb8, 0x5a, 0x48, 0x77, 0xef, 0xa2, 0xbc, 0xac, 0x5e, 0x51, 0x6a, 0xcf, 0xb8, - 0xec, 0x8c, 0x99, 0xbc, 0xc9, 0x86, 0x28, 0xe4, 0x31, 0xae, 0xf4, 0x6b, 0x8f, 0x66, 0xbd, 0xe5, - 0xf9, 0xed, 0x7e, 0xfb, 0xc9, 0xdc, 0x38, 0x57, 0x4f, 0x45, 0xf4, 0x51, 0xfb, 0x8f, 0xbe, 0x8a, - 0x88, 0x9a, 0xfe, 0xb2, 0xe1, 0x0f, 0x94, 0x3f, 0xf0, 0x03, 0x6d, 0x2f, 0x50, 0x7e, 0x5d, 0xcf, - 0xcd, 0xb3, 0x4a, 0xfe, 0xe0, 0xb4, 0xe7, 0x7a, 0x20, 0xe9, 0x88, 0x4a, 0xfa, 0x63, 0xba, 0x6b, - 0x2c, 0x42, 0x14, 0x8c, 0x10, 0x9f, 0x10, 0xcd, 0x46, 0x88, 0xe2, 0x6d, 0x4d, 0x86, 0xf5, 0xd5, - 0x05, 0x1f, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x80, 0xf7, 0xaa, 0x60, 0x14, 0x04, 0x00, 0x00, + // 325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xf2, 0x76, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x4f, 0xce, 0x49, 0x2c, 0x2e, 0xce, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, + 0x2b, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, 0xc6, 0x10, 0x2f, 0x4e, 0x2d, 0x2a, 0xcb, + 0x4c, 0x4e, 0xd5, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xb2, 0x45, 0x32, 0x4c, 0x0f, 0x6a, 0x98, + 0x5e, 0x85, 0x1e, 0x9a, 0x26, 0x3d, 0xa8, 0x61, 0xe8, 0xe2, 0x52, 0x81, 0x94, 0xb9, 0x05, 0x24, + 0x5e, 0x19, 0x5f, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0x02, 0x71, 0x91, 0x54, 0x10, 0x75, 0x8c, + 0x2c, 0x2e, 0xc8, 0xcf, 0x2b, 0x86, 0xfa, 0xd2, 0x68, 0x3d, 0x23, 0x17, 0x6b, 0x20, 0x48, 0x42, + 0x68, 0x29, 0x23, 0x17, 0x9b, 0x47, 0x62, 0x5e, 0x4a, 0x4e, 0xaa, 0x90, 0xb7, 0x1e, 0x45, 0x7e, + 0xd7, 0x03, 0x1b, 0x18, 0x04, 0x71, 0xbb, 0x94, 0x0f, 0x75, 0x0c, 0x83, 0xb8, 0x5a, 0x89, 0xc1, + 0xe9, 0x3c, 0xf3, 0x89, 0x47, 0x72, 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, + 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x70, 0x39, 0x26, 0xe7, + 0xe7, 0x52, 0x66, 0x9b, 0x13, 0x4f, 0x30, 0x24, 0x11, 0x04, 0x80, 0x42, 0x27, 0x80, 0x31, 0xca, + 0x23, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, 0x57, 0x9f, 0xa2, 0xe0, 0x5f, 0xc4, + 0xc4, 0xe6, 0xe8, 0x1b, 0xe1, 0x1c, 0xe8, 0xbc, 0x8a, 0x09, 0x25, 0x65, 0xf9, 0x42, 0x9d, 0x18, + 0xa1, 0xe7, 0x8c, 0xc5, 0xe3, 0x20, 0x27, 0xa2, 0x89, 0x9f, 0x42, 0xd1, 0x1f, 0x03, 0xd5, 0x1f, + 0x13, 0x11, 0x83, 0xa6, 0x2e, 0x06, 0xaa, 0x1f, 0x5d, 0xfc, 0x11, 0x93, 0x27, 0x45, 0xfa, 0x63, + 0xdc, 0x03, 0x9c, 0x7c, 0x53, 0x4b, 0x12, 0x53, 0x12, 0x4b, 0x12, 0x5f, 0x31, 0x39, 0x21, 0x99, + 0x65, 0x65, 0x05, 0x35, 0xcc, 0xca, 0x2a, 0xc2, 0xca, 0x0a, 0x4d, 0x9b, 0x95, 0x15, 0xd4, 0x3c, + 0x0c, 0x99, 0x24, 0x36, 0x70, 0x52, 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x41, 0x61, 0xa4, + 0x8a, 0xbf, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/classifications/queries/classifications/service.pb.gw.go b/x/classifications/queries/classifications/service.pb.gw.go deleted file mode 100644 index 6e07dbca1..000000000 --- a/x/classifications/queries/classifications/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/classifications/queries/classifications/service.proto - -/* -Package classifications is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package classifications - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "classifications", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/queries/identities/service.pb.go b/x/identities/queries/identities/service.pb.go index 96b7f0747..ed64dfbf0 100644 --- a/x/identities/queries/identities/service.pb.go +++ b/x/identities/queries/identities/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_4aeac867eb0910c3 = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xb1, 0x6a, 0xeb, 0x30, - 0x14, 0x86, 0x63, 0x5f, 0x6e, 0x06, 0x73, 0x27, 0x8f, 0xe1, 0xe2, 0xe1, 0xc2, 0xa5, 0x53, 0x25, - 0xd2, 0x0c, 0x2d, 0x1a, 0x5a, 0xec, 0x25, 0xc9, 0x60, 0x48, 0xda, 0xc5, 0x14, 0x43, 0x51, 0xe2, - 0x43, 0x6a, 0xb0, 0xa5, 0xc4, 0x92, 0x43, 0xba, 0xf6, 0x09, 0x0a, 0x79, 0x83, 0x8e, 0x7d, 0x88, - 0xce, 0xa1, 0x53, 0xa0, 0x4b, 0xc7, 0xe2, 0x74, 0xea, 0x53, 0x14, 0xc7, 0x02, 0x2b, 0xab, 0x33, - 0x09, 0x7e, 0x9f, 0xff, 0xe3, 0xff, 0x8f, 0x8f, 0xe5, 0xba, 0x42, 0x80, 0xf4, 0x29, 0x93, 0x09, - 0xe0, 0x94, 0x47, 0x79, 0x02, 0x02, 0xaf, 0x70, 0x1c, 0x01, 0x93, 0xb1, 0x8c, 0x41, 0xe0, 0x45, - 0x0e, 0x59, 0xf9, 0x6a, 0x92, 0x80, 0x6c, 0x19, 0x4f, 0x01, 0xcd, 0x33, 0x2e, 0xb9, 0xdd, 0xd3, - 0x10, 0x48, 0x21, 0xd0, 0x0a, 0xd5, 0xf3, 0x48, 0x21, 0x34, 0xa9, 0xf3, 0x77, 0xc6, 0xf9, 0x2c, - 0x01, 0x4c, 0xe7, 0x31, 0xa6, 0x8c, 0x71, 0x49, 0x65, 0xcc, 0x99, 0xa8, 0x90, 0x9d, 0x7e, 0x93, - 0x54, 0xa5, 0xf4, 0x70, 0x97, 0xc1, 0x22, 0x07, 0x21, 0x15, 0x68, 0x70, 0x0c, 0x48, 0xcc, 0x39, - 0x13, 0xaa, 0xe5, 0xd9, 0xc6, 0xb0, 0x7e, 0x8f, 0xcb, 0x0f, 0xf6, 0xab, 0x61, 0xb5, 0x07, 0x94, - 0x45, 0x09, 0xd8, 0x2e, 0x6a, 0xd0, 0x1d, 0xed, 0x31, 0xd7, 0x55, 0xce, 0x8e, 0x77, 0x0c, 0xa2, - 0x4a, 0xf8, 0xef, 0xf4, 0xf1, 0xfd, 0x6b, 0x6d, 0x9e, 0xd8, 0xff, 0x71, 0x5a, 0x35, 0xd5, 0xca, - 0x2c, 0xbb, 0x13, 0x90, 0xb4, 0xab, 0x49, 0xde, 0xfa, 0xd7, 0xa6, 0x70, 0x8c, 0x6d, 0xe1, 0x18, - 0x9f, 0x85, 0x63, 0x3c, 0xed, 0x9c, 0xd6, 0x76, 0xe7, 0xb4, 0x3e, 0x76, 0x4e, 0xcb, 0x3a, 0x9f, - 0xf2, 0xb4, 0x49, 0x20, 0xef, 0xcf, 0x4d, 0x75, 0x13, 0xa3, 0x72, 0x59, 0x23, 0xe3, 0xf6, 0x72, - 0x16, 0xcb, 0xfb, 0x7c, 0x82, 0xa6, 0x3c, 0xc5, 0x0d, 0xfe, 0xc1, 0xb3, 0xd9, 0x76, 0xfd, 0x60, - 0x38, 0x1e, 0xbe, 0x98, 0x07, 0xe7, 0xe5, 0xab, 0x38, 0x01, 0x1a, 0x1e, 0x2e, 0xa3, 0x7c, 0x6b, - 0xe9, 0xed, 0xc0, 0x15, 0x2a, 0x57, 0x18, 0x84, 0xf5, 0x48, 0xa8, 0x5c, 0x9a, 0x54, 0x98, 0x57, - 0x0d, 0x5c, 0x61, 0x7f, 0xe4, 0xf9, 0x20, 0x69, 0x44, 0x25, 0xfd, 0x36, 0x2f, 0x34, 0x02, 0x21, - 0x0a, 0x41, 0x48, 0x40, 0x48, 0xed, 0x20, 0x44, 0x51, 0x74, 0x71, 0xd2, 0xde, 0xdf, 0x59, 0xef, - 0x27, 0x00, 0x00, 0xff, 0xff, 0x9d, 0x9e, 0xc8, 0x96, 0x92, 0x03, 0x00, 0x00, + // 317 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x74, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4c, 0x49, 0xcd, 0x2b, 0xc9, 0x2c, 0xc9, 0x4c, 0x2d, 0xd6, 0x2f, 0x2c, 0x4d, + 0x2d, 0x02, 0xd1, 0x48, 0x42, 0xc5, 0xa9, 0x45, 0x65, 0x99, 0xc9, 0xa9, 0x7a, 0x05, 0x45, 0xf9, + 0x25, 0xf9, 0x42, 0xc6, 0x48, 0x46, 0xe8, 0x41, 0x8d, 0xd0, 0xab, 0xd0, 0x43, 0xa8, 0xd7, 0x83, + 0x1a, 0x81, 0x24, 0x24, 0xe5, 0x4e, 0x8e, 0xbd, 0x20, 0xa1, 0xca, 0xf8, 0xa2, 0xd4, 0xc2, 0xd2, + 0xd4, 0xe2, 0x12, 0x88, 0xed, 0x52, 0x1e, 0x94, 0x18, 0x54, 0x5c, 0x90, 0x9f, 0x57, 0x0c, 0xf5, + 0x87, 0xd1, 0x6c, 0x46, 0x2e, 0xd6, 0x40, 0x90, 0x84, 0xd0, 0x44, 0x46, 0x2e, 0x36, 0x8f, 0xc4, + 0xbc, 0x94, 0x9c, 0x54, 0x21, 0x47, 0x3d, 0x32, 0x7c, 0xa7, 0x07, 0x36, 0x26, 0x08, 0xe2, 0x4e, + 0x29, 0x27, 0x4a, 0x8c, 0x80, 0xb8, 0x50, 0x89, 0xc1, 0x69, 0x32, 0xf3, 0x89, 0x47, 0x72, 0x8c, + 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, 0x72, + 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x70, 0x99, 0x27, 0xe7, 0xe7, 0x92, 0x63, 0x87, 0x13, 0x4f, 0x30, + 0x24, 0x22, 0x03, 0x40, 0xfe, 0x0f, 0x60, 0x8c, 0xb2, 0x4b, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, + 0x4b, 0xce, 0xcf, 0xd5, 0x27, 0x23, 0x58, 0x17, 0x31, 0xb1, 0x39, 0xfa, 0x46, 0x78, 0x06, 0x7a, + 0xae, 0x62, 0x42, 0x49, 0x13, 0xbe, 0x50, 0xe7, 0x44, 0xe8, 0x79, 0xa2, 0xfa, 0x0f, 0x44, 0x23, + 0x84, 0x4e, 0xa1, 0xe8, 0x8a, 0x81, 0xea, 0x8a, 0x89, 0x88, 0x41, 0x28, 0x89, 0x81, 0xea, 0x42, + 0x12, 0x7a, 0xc4, 0x64, 0x4f, 0x86, 0xae, 0x18, 0xf7, 0x00, 0x27, 0xdf, 0xd4, 0x92, 0xc4, 0x94, + 0xc4, 0x92, 0xc4, 0x57, 0x4c, 0x16, 0x48, 0x26, 0x58, 0x59, 0x41, 0x8d, 0xb0, 0xb2, 0x8a, 0xb0, + 0xb2, 0x42, 0xe8, 0xb0, 0xb2, 0x82, 0x9a, 0x82, 0x2c, 0x98, 0xc4, 0x06, 0x4e, 0x3a, 0xc6, 0x80, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xba, 0x94, 0xaf, 0xd6, 0x47, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/queries/identities/service.pb.gw.go b/x/identities/queries/identities/service.pb.gw.go deleted file mode 100644 index 14859fd46..000000000 --- a/x/identities/queries/identities/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/queries/identities/service.proto - -/* -Package identities is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package identities - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "identities", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/queries/identity/service.pb.go b/x/identities/queries/identity/service.pb.go index 519a7558a..5bc34becc 100644 --- a/x/identities/queries/identity/service.pb.go +++ b/x/identities/queries/identity/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,31 +30,28 @@ func init() { } var fileDescriptor_6e63cefd0e75caab = []byte{ - // 373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, - 0x1c, 0xc7, 0x9b, 0x3c, 0x3c, 0x1d, 0xc2, 0x33, 0x65, 0x2c, 0x0f, 0x19, 0x14, 0x27, 0xe1, 0x8e, - 0x2a, 0x3a, 0x1c, 0x4a, 0x6d, 0xc1, 0x3f, 0x1d, 0x02, 0xad, 0x2e, 0x41, 0x02, 0x72, 0x6d, 0x7e, - 0xd4, 0x40, 0x72, 0xd7, 0xe6, 0x2e, 0xa5, 0x59, 0x5d, 0x5c, 0x05, 0xdf, 0x81, 0xa3, 0xaf, 0xc0, - 0xd9, 0x49, 0x9c, 0x0a, 0x2e, 0x8e, 0x92, 0x3a, 0xf9, 0x2a, 0x24, 0xcd, 0xb5, 0x69, 0xc7, 0x74, - 0x0a, 0x7c, 0xc3, 0xf7, 0xc3, 0xe7, 0x7b, 0xfc, 0x8c, 0x46, 0x53, 0x08, 0x90, 0x36, 0x65, 0x32, - 0x00, 0x1c, 0x72, 0x2f, 0x0e, 0x40, 0xe0, 0x09, 0xf6, 0x3d, 0x60, 0xd2, 0x97, 0x3e, 0x08, 0x3c, - 0x8a, 0x21, 0xca, 0xbe, 0x2a, 0x4a, 0xb0, 0x80, 0x68, 0xec, 0xf7, 0x01, 0x0d, 0x23, 0x2e, 0xb9, - 0x59, 0x5f, 0x01, 0x20, 0x05, 0x40, 0x13, 0x54, 0x00, 0x90, 0x02, 0x2c, 0xa2, 0xa4, 0xf6, 0x7f, - 0xc0, 0xf9, 0x20, 0x00, 0x4c, 0x87, 0x3e, 0xa6, 0x8c, 0x71, 0x49, 0xa5, 0xcf, 0x99, 0xc8, 0x81, - 0xb5, 0xd3, 0xf2, 0x46, 0x59, 0x90, 0xdc, 0x44, 0x30, 0x8a, 0x41, 0x48, 0x85, 0x39, 0xdb, 0x1c, - 0x23, 0x86, 0x9c, 0x09, 0xb5, 0x6f, 0xef, 0x55, 0x33, 0xfe, 0x76, 0xb3, 0x1f, 0xe6, 0x8b, 0x66, - 0x54, 0x2f, 0x28, 0xf3, 0x02, 0x30, 0x1b, 0xa8, 0xf4, 0x6a, 0x34, 0x87, 0x5c, 0xe6, 0x8e, 0xb5, - 0x93, 0xcd, 0x01, 0xb9, 0xdd, 0xd6, 0xee, 0xdd, 0xc7, 0xf7, 0xa3, 0xbe, 0x63, 0x6e, 0xe3, 0x30, - 0xdf, 0xb8, 0xb2, 0x6c, 0x5c, 0xef, 0x81, 0xa4, 0xf5, 0xe5, 0xb2, 0xd6, 0xfd, 0x9f, 0xb7, 0xd4, - 0xd2, 0xa6, 0xa9, 0xa5, 0x7d, 0xa5, 0x96, 0xf6, 0x30, 0xb3, 0x2a, 0xd3, 0x99, 0x55, 0xf9, 0x9c, - 0x59, 0x15, 0xe3, 0xa0, 0xcf, 0xc3, 0xf2, 0x32, 0xad, 0x7f, 0x57, 0xf9, 0x15, 0x74, 0xb2, 0x47, - 0xea, 0x68, 0xd7, 0x47, 0x03, 0x5f, 0xde, 0xc6, 0x3d, 0xd4, 0xe7, 0x21, 0x2e, 0xfd, 0xf2, 0x4f, - 0x7a, 0xb5, 0x69, 0x3b, 0xed, 0x6e, 0xfb, 0x59, 0x5f, 0x3b, 0x27, 0x5b, 0xa9, 0x38, 0xa8, 0x5d, - 0xa8, 0x74, 0x95, 0x8a, 0x8a, 0x92, 0xf7, 0xb5, 0x8e, 0xab, 0x3a, 0xae, 0xe3, 0x16, 0x1d, 0x57, - 0x75, 0x16, 0x51, 0x92, 0xea, 0xc7, 0xa5, 0x3b, 0xee, 0x79, 0xa7, 0x65, 0x83, 0xa4, 0x1e, 0x95, - 0xf4, 0x47, 0x3f, 0x5c, 0xe9, 0x13, 0xa2, 0x00, 0x84, 0x38, 0x84, 0x14, 0x08, 0x42, 0x14, 0x63, - 0x19, 0x26, 0xbd, 0xea, 0xfc, 0xaa, 0xf6, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xa3, 0x52, 0xbc, - 0xd3, 0x78, 0x03, 0x00, 0x00, + // 324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x77, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4c, 0x49, 0xcd, 0x2b, 0xc9, 0x2c, 0xc9, 0x4c, 0x2d, 0xd6, 0x2f, 0x2c, 0x4d, + 0x2d, 0x02, 0xd1, 0x50, 0xa1, 0x4a, 0xfd, 0xe2, 0xd4, 0xa2, 0xb2, 0xcc, 0xe4, 0x54, 0xbd, 0x82, + 0xa2, 0xfc, 0x92, 0x7c, 0x21, 0x43, 0x24, 0x03, 0xf4, 0xa0, 0x06, 0xe8, 0x55, 0xe8, 0x21, 0x0c, + 0xd0, 0x83, 0x1a, 0x00, 0x13, 0xaa, 0x94, 0x72, 0x25, 0xdd, 0x4e, 0x90, 0x40, 0x65, 0x7c, 0x51, + 0x6a, 0x61, 0x69, 0x6a, 0x71, 0x09, 0xc4, 0x66, 0x29, 0x37, 0xf2, 0x8d, 0x29, 0x2e, 0xc8, 0xcf, + 0x2b, 0x86, 0xfa, 0xc0, 0x68, 0x3a, 0x23, 0x17, 0x6b, 0x20, 0x48, 0x42, 0xa8, 0x97, 0x91, 0x8b, + 0xcd, 0x23, 0x31, 0x2f, 0x25, 0x27, 0x55, 0xc8, 0x5e, 0x8f, 0x64, 0x7f, 0xe9, 0x81, 0x0d, 0x09, + 0x82, 0xb8, 0x51, 0xca, 0x81, 0x7c, 0x03, 0x20, 0xae, 0x53, 0x62, 0x70, 0x6a, 0x67, 0x3e, 0xf1, + 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, + 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x06, 0x2e, 0xd3, 0xe4, 0xfc, 0x5c, 0xd2, 0x6d, 0x70, + 0xe2, 0x09, 0x86, 0x44, 0x5e, 0x00, 0xc8, 0xe7, 0x01, 0x8c, 0x51, 0x36, 0xe9, 0x99, 0x25, 0x19, + 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x24, 0x07, 0xe7, 0x22, 0x26, 0x36, 0x47, 0xdf, 0x08, + 0xcf, 0x40, 0xcf, 0x55, 0x4c, 0x28, 0xa9, 0xc0, 0x17, 0xea, 0x94, 0x08, 0x3d, 0x4f, 0x84, 0x53, + 0x02, 0xa1, 0x4e, 0x81, 0x0a, 0x55, 0x9e, 0x42, 0xd1, 0x13, 0x03, 0xd5, 0x13, 0x13, 0x11, 0x83, + 0xd0, 0x13, 0x03, 0xd5, 0x03, 0x13, 0xaa, 0x7c, 0xc4, 0x64, 0x4b, 0xb2, 0x9e, 0x18, 0xf7, 0x00, + 0x27, 0xdf, 0xd4, 0x92, 0xc4, 0x94, 0xc4, 0x92, 0xc4, 0x57, 0x4c, 0x66, 0x48, 0xfa, 0xad, 0xac, + 0xa0, 0x06, 0x58, 0x59, 0x45, 0x58, 0x59, 0x21, 0x8c, 0xb0, 0xb2, 0x82, 0x9a, 0x01, 0x17, 0xac, + 0x4c, 0x62, 0x03, 0x27, 0x15, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x14, 0x08, 0x28, 0xa7, + 0x2f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/queries/identity/service.pb.gw.go b/x/identities/queries/identity/service.pb.gw.go deleted file mode 100644 index faef0f54f..000000000 --- a/x/identities/queries/identity/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/queries/identity/service.proto - -/* -Package identity is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package identity - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "identities", "v1beta1", "identity"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/define/service.pb.go b/x/identities/transactions/define/service.pb.go index 3dcebb375..bcf000ecd 100644 --- a/x/identities/transactions/define/service.pb.go +++ b/x/identities/transactions/define/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_0c544b9b622019f8 = []byte{ - // 374 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, - 0x18, 0xc0, 0x93, 0x94, 0xb7, 0x43, 0x78, 0xa7, 0x2e, 0x2f, 0x84, 0x97, 0x0c, 0xef, 0xf8, 0x0e, - 0x77, 0xf8, 0x67, 0xd0, 0x03, 0xd1, 0x86, 0x82, 0x76, 0x08, 0x16, 0xed, 0x10, 0x24, 0x20, 0xd7, - 0xe4, 0x8c, 0x07, 0xc9, 0x5d, 0xc9, 0x73, 0x2d, 0x1d, 0xfd, 0x08, 0x0e, 0x2e, 0xae, 0xba, 0x39, - 0xf9, 0x31, 0xc4, 0xa9, 0xa3, 0xa3, 0xa4, 0x83, 0xe0, 0xa7, 0x90, 0xf6, 0x02, 0x49, 0xd7, 0x9b, - 0x02, 0x4f, 0xf8, 0xfd, 0xee, 0xc7, 0xc3, 0xe3, 0x06, 0x7d, 0x00, 0xa6, 0x42, 0x2a, 0x54, 0xce, - 0x70, 0x21, 0xd3, 0x59, 0xce, 0x00, 0x2f, 0x30, 0x4f, 0x99, 0x50, 0x5c, 0x71, 0x06, 0x58, 0x95, - 0x54, 0x00, 0x4d, 0x14, 0x97, 0x02, 0x70, 0xca, 0x6e, 0xb8, 0x60, 0x18, 0x58, 0x39, 0xe7, 0x09, - 0x43, 0xd3, 0x52, 0x2a, 0xd9, 0xdb, 0x6f, 0x39, 0x50, 0xed, 0x40, 0x0b, 0xd4, 0x38, 0x50, 0xdb, - 0x81, 0xb4, 0xc3, 0xfb, 0x93, 0x48, 0x28, 0x24, 0xe0, 0x02, 0x32, 0x3c, 0xdf, 0x59, 0x7f, 0xb4, - 0xce, 0xfb, 0x9b, 0x49, 0x99, 0xe5, 0x0c, 0xd3, 0x29, 0xc7, 0x54, 0x08, 0xa9, 0xa8, 0xe6, 0xf4, - 0x5f, 0xb3, 0xe0, 0x82, 0x01, 0xd0, 0xac, 0x0e, 0xf6, 0xce, 0x8d, 0x1c, 0xad, 0xd9, 0x75, 0xc9, - 0x60, 0x2a, 0x05, 0xd4, 0xc2, 0xdd, 0x67, 0xdb, 0xed, 0x84, 0x90, 0xf5, 0x1e, 0x6c, 0xb7, 0x7b, - 0x46, 0x45, 0x9a, 0xb3, 0xde, 0x11, 0x32, 0xd9, 0x0a, 0x0a, 0x75, 0xa8, 0x37, 0x34, 0xc3, 0xc7, - 0xcd, 0xec, 0xa2, 0x4e, 0xfc, 0x67, 0x79, 0xbf, 0xee, 0xbe, 0x5e, 0xff, 0xdb, 0xc1, 0x63, 0xe7, - 0xad, 0xf2, 0xed, 0x65, 0xe5, 0xdb, 0x9f, 0x95, 0x6f, 0xdf, 0xaf, 0x7c, 0x6b, 0xb9, 0xf2, 0xad, - 0x8f, 0x95, 0x6f, 0xb9, 0x07, 0x89, 0x2c, 0x8c, 0x5e, 0x0c, 0x7e, 0x5f, 0xea, 0x5b, 0x18, 0xad, - 0x17, 0x31, 0xb2, 0xaf, 0x8e, 0x33, 0xae, 0x6e, 0x67, 0x13, 0x94, 0xc8, 0x02, 0x9b, 0xac, 0xf9, - 0xc9, 0xe9, 0xf6, 0xc3, 0x68, 0x38, 0x1e, 0xbc, 0x38, 0x5b, 0x77, 0x15, 0xd6, 0x41, 0x11, 0x1a, - 0x36, 0x41, 0xe3, 0x76, 0xd0, 0x60, 0xc3, 0xbf, 0x6f, 0x61, 0x71, 0x8d, 0xc5, 0x51, 0xdc, 0x60, - 0x71, 0x1b, 0x8b, 0x35, 0x56, 0x39, 0x27, 0x26, 0x58, 0x7c, 0x3a, 0x0a, 0x42, 0xa6, 0x68, 0x4a, - 0x15, 0xfd, 0x76, 0x0e, 0x5b, 0x0a, 0x42, 0x6a, 0x07, 0x21, 0x11, 0x21, 0x8d, 0x85, 0x90, 0xb6, - 0x86, 0x10, 0xed, 0x99, 0x74, 0x37, 0x87, 0xb4, 0xf7, 0x13, 0x00, 0x00, 0xff, 0xff, 0xef, 0xef, - 0xc1, 0xb5, 0x90, 0x03, 0x00, 0x00, + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xc3, 0x40, + 0x14, 0xc0, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x86, 0x0c, 0x8e, 0x0e, 0x77, 0xf8, 0x67, + 0xd0, 0x03, 0xd1, 0x86, 0x82, 0x76, 0x08, 0x16, 0xed, 0x10, 0x24, 0x20, 0xd7, 0xe4, 0x8c, 0x81, + 0xe6, 0xae, 0xe4, 0x5d, 0x4b, 0x47, 0x3f, 0x82, 0x83, 0x8b, 0xab, 0x6e, 0x4e, 0x7e, 0x0c, 0x71, + 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x29, 0xa4, 0xcd, 0x41, 0xae, 0xeb, 0x4d, 0x81, 0x07, 0xbf, + 0x5f, 0x7e, 0x79, 0x79, 0x6e, 0xd0, 0x05, 0x60, 0x32, 0xa4, 0x5c, 0x8e, 0x19, 0x2e, 0x44, 0x3a, + 0x1d, 0x33, 0xc0, 0x73, 0x9c, 0xa7, 0x8c, 0xcb, 0x5c, 0xe6, 0x0c, 0xb0, 0x2c, 0x29, 0x07, 0x9a, + 0xc8, 0x5c, 0x70, 0xc0, 0x29, 0xbb, 0xcf, 0x39, 0xc3, 0xc0, 0xca, 0x59, 0x9e, 0x30, 0x34, 0x29, + 0x85, 0x14, 0x9d, 0x23, 0xcd, 0x81, 0x94, 0x03, 0xcd, 0x51, 0xe3, 0x40, 0xba, 0x03, 0xd5, 0x0e, + 0x6f, 0x27, 0x11, 0x50, 0x08, 0xc0, 0x05, 0x64, 0x78, 0xb6, 0xbf, 0x7a, 0xd4, 0x3a, 0xcf, 0x2c, + 0xa9, 0x60, 0x00, 0x34, 0x53, 0x49, 0xde, 0x95, 0x91, 0x43, 0x9b, 0xdd, 0x95, 0x0c, 0x26, 0x82, + 0x83, 0x12, 0x1e, 0xbc, 0xd9, 0x6e, 0x2b, 0x84, 0xac, 0xf3, 0x6c, 0xbb, 0xed, 0x4b, 0xca, 0xd3, + 0x31, 0xeb, 0x9c, 0x22, 0x93, 0xef, 0x46, 0x61, 0x1d, 0xea, 0xf5, 0xcd, 0xf0, 0x61, 0x33, 0xbb, + 0x56, 0x89, 0xbb, 0x96, 0xb7, 0xf5, 0xf8, 0xfb, 0xb1, 0x67, 0x07, 0x2f, 0xad, 0xcf, 0xca, 0xb7, + 0x17, 0x95, 0x6f, 0xff, 0x54, 0xbe, 0xfd, 0xb4, 0xf4, 0xad, 0xc5, 0xd2, 0xb7, 0xbe, 0x97, 0xbe, + 0xe5, 0x1e, 0x27, 0xa2, 0x30, 0x7a, 0x63, 0xb0, 0x7d, 0x53, 0xff, 0xed, 0xc1, 0x6a, 0x11, 0x03, + 0xfb, 0xf6, 0x2c, 0xcb, 0xe5, 0xc3, 0x74, 0x84, 0x12, 0x51, 0x60, 0x93, 0x35, 0xbf, 0x3a, 0xed, + 0x6e, 0x18, 0xf5, 0x87, 0xbd, 0x77, 0x67, 0xe3, 0x72, 0x42, 0x15, 0x14, 0xa1, 0x7e, 0x13, 0x34, + 0xd4, 0x83, 0x7a, 0x6b, 0xfe, 0x6b, 0x03, 0x8b, 0x15, 0x16, 0x47, 0x71, 0x83, 0xc5, 0x3a, 0x16, + 0xd7, 0x58, 0xe5, 0x9c, 0x9b, 0x60, 0xf1, 0xc5, 0x20, 0x08, 0x99, 0xa4, 0x29, 0x95, 0xf4, 0xcf, + 0x39, 0xd1, 0x14, 0x84, 0x28, 0x07, 0x21, 0x11, 0x21, 0x8d, 0x85, 0x10, 0x5d, 0x43, 0x48, 0xed, + 0x19, 0xb5, 0xd7, 0x87, 0x74, 0xf8, 0x1f, 0x00, 0x00, 0xff, 0xff, 0xb8, 0x61, 0x79, 0xb1, 0x72, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/define/service.pb.gw.go b/x/identities/transactions/define/service.pb.gw.go deleted file mode 100644 index 91b32e954..000000000 --- a/x/identities/transactions/define/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/define/service.proto - -/* -Package define is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package define - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "define"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/deputize/service.pb.go b/x/identities/transactions/deputize/service.pb.go index bc71ad9bf..8b5318ead 100644 --- a/x/identities/transactions/deputize/service.pb.go +++ b/x/identities/transactions/deputize/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_c6e0a52473ac78cc = []byte{ - // 373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0x07, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x10, 0x24, 0x83, 0xa3, 0xc3, 0x1d, 0x2a, - 0x38, 0x9c, 0x83, 0x34, 0x14, 0xb4, 0x48, 0xa0, 0x6a, 0x87, 0x20, 0x01, 0xb9, 0x26, 0x47, 0x3c, - 0x48, 0xee, 0x42, 0xde, 0xb5, 0x14, 0x27, 0x3f, 0x82, 0xa3, 0xb3, 0x20, 0x82, 0x93, 0x1f, 0x43, - 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0x7e, 0x0a, 0xa9, 0xb9, 0x92, 0x74, 0xcd, 0x14, 0x78, 0xe1, - 0xff, 0xbb, 0x3f, 0x8f, 0x67, 0x0f, 0xfa, 0x00, 0x4c, 0xf9, 0x54, 0xa8, 0x94, 0xe1, 0x4c, 0xc6, - 0xd3, 0x94, 0x01, 0x9e, 0x63, 0x1e, 0x33, 0xa1, 0xb8, 0xe2, 0x0c, 0xb0, 0x2a, 0xa8, 0x00, 0x1a, - 0x29, 0x2e, 0x05, 0xe0, 0x98, 0xe5, 0x53, 0xc5, 0xef, 0x19, 0x06, 0x56, 0xcc, 0x78, 0xc4, 0x50, - 0x5e, 0x48, 0x25, 0x7b, 0xc7, 0x0d, 0x05, 0x69, 0x05, 0xcd, 0x51, 0xad, 0xa0, 0xa6, 0x82, 0xd6, - 0x8a, 0xb3, 0x13, 0x49, 0xc8, 0x24, 0xe0, 0x0c, 0x12, 0x3c, 0x3b, 0x58, 0x7d, 0x2a, 0xd0, 0xd9, - 0x4d, 0xa4, 0x4c, 0x52, 0x86, 0x69, 0xce, 0x31, 0x15, 0x42, 0x2a, 0x5a, 0x25, 0xab, 0xbf, 0x6d, - 0x4b, 0x67, 0x0c, 0x80, 0x26, 0xba, 0xb4, 0x73, 0xd9, 0x52, 0x69, 0x4c, 0x6f, 0x0b, 0x06, 0xb9, - 0x14, 0xa0, 0xc9, 0xc3, 0x57, 0xd3, 0xee, 0xf8, 0x90, 0xf4, 0x9e, 0x4c, 0xbb, 0x7b, 0x4e, 0x45, - 0x9c, 0xb2, 0xde, 0x29, 0x6a, 0xb7, 0x1b, 0xe4, 0x57, 0x65, 0x9d, 0x8b, 0xb6, 0xc0, 0xb8, 0x9e, - 0x5e, 0xe9, 0x9a, 0x7b, 0x86, 0xb3, 0xf5, 0xf0, 0xf3, 0xbe, 0x6f, 0x7a, 0x2f, 0x9d, 0x8f, 0xd2, - 0x35, 0x17, 0xa5, 0x6b, 0x7e, 0x97, 0xae, 0xf9, 0xb8, 0x74, 0x8d, 0xc5, 0xd2, 0x35, 0xbe, 0x96, - 0xae, 0x61, 0x93, 0x48, 0x66, 0x2d, 0xdf, 0xf4, 0xb6, 0xaf, 0xab, 0xbb, 0x18, 0xad, 0xd6, 0x31, - 0x32, 0x6f, 0xfa, 0x09, 0x57, 0x77, 0xd3, 0x09, 0x8a, 0x64, 0x86, 0xdb, 0xad, 0xfb, 0xd9, 0xea, - 0xf6, 0xfd, 0x60, 0x38, 0x1e, 0xbc, 0x59, 0x1b, 0x57, 0xe6, 0xeb, 0x52, 0x01, 0x1a, 0xd6, 0xa5, - 0xc6, 0xcd, 0x52, 0x03, 0x2d, 0x7c, 0x6e, 0x04, 0x43, 0x1d, 0x0c, 0x83, 0xb0, 0x0e, 0x86, 0xcd, - 0x60, 0xb8, 0x0e, 0x96, 0x96, 0xd7, 0x2e, 0x18, 0x9e, 0x8d, 0x3c, 0x9f, 0x29, 0x1a, 0x53, 0x45, - 0x7f, 0xad, 0x93, 0x06, 0x42, 0x88, 0x56, 0x08, 0x09, 0x08, 0xa9, 0x1d, 0x42, 0x9a, 0x10, 0x21, - 0x6b, 0x69, 0xd2, 0xfd, 0x3f, 0xac, 0xa3, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x79, 0xa7, 0xb1, - 0x9d, 0xa8, 0x03, 0x00, 0x00, + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xca, 0xdb, 0x21, 0xbc, 0x53, 0x17, 0x21, 0x43, 0x06, 0x47, 0x87, 0x3b, + 0x54, 0x70, 0x38, 0x07, 0x69, 0x28, 0x68, 0x91, 0x40, 0xd5, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8e, + 0x78, 0xd0, 0xe4, 0x4a, 0x9e, 0x6b, 0x29, 0x4e, 0x7e, 0x04, 0x47, 0x67, 0x41, 0x04, 0x27, 0x3f, + 0x86, 0x38, 0x75, 0x74, 0x94, 0x74, 0x10, 0xfc, 0x14, 0x52, 0x7b, 0x25, 0xd7, 0xf5, 0xa6, 0xc0, + 0x03, 0xff, 0x5f, 0xfe, 0x79, 0xf2, 0x78, 0xbd, 0x2e, 0x00, 0x57, 0x11, 0x2b, 0xd5, 0x98, 0x93, + 0x42, 0x66, 0xd3, 0x31, 0x07, 0x32, 0x27, 0x22, 0xe3, 0xa5, 0x12, 0x4a, 0x70, 0x20, 0xaa, 0x62, + 0x25, 0xb0, 0x54, 0x09, 0x59, 0x02, 0xc9, 0xf8, 0x64, 0xaa, 0xc4, 0x1d, 0x27, 0xc0, 0xab, 0x99, + 0x48, 0x39, 0x9e, 0x54, 0x52, 0xc9, 0xce, 0x91, 0xa1, 0x60, 0xad, 0xe0, 0x39, 0x6e, 0x14, 0x6c, + 0x2a, 0x78, 0xa3, 0xf8, 0x3b, 0xa9, 0x84, 0x42, 0x02, 0x29, 0x20, 0x27, 0xb3, 0xfd, 0xd5, 0x63, + 0x0d, 0xfa, 0xb6, 0xb5, 0x0a, 0x0e, 0xc0, 0x72, 0x5d, 0xcb, 0xbf, 0xb0, 0x54, 0x8c, 0xe9, 0x4d, + 0xc5, 0x61, 0x22, 0x4b, 0xd0, 0xe4, 0xc1, 0x0b, 0xf2, 0x5a, 0x11, 0xe4, 0x9d, 0x47, 0xe4, 0xb5, + 0xcf, 0x58, 0x99, 0x8d, 0x79, 0xe7, 0x04, 0xdb, 0x7d, 0x3d, 0x8e, 0xd6, 0x65, 0xfd, 0x73, 0x5b, + 0x60, 0xd8, 0x4c, 0x2f, 0x75, 0xcd, 0x5d, 0xc7, 0xff, 0x77, 0xff, 0xfd, 0xb6, 0x87, 0xc2, 0xe7, + 0xd6, 0x7b, 0x1d, 0xa0, 0x45, 0x1d, 0xa0, 0xaf, 0x3a, 0x40, 0x0f, 0xcb, 0xc0, 0x59, 0x2c, 0x03, + 0xe7, 0x73, 0x19, 0x38, 0x1e, 0x4d, 0x65, 0x61, 0xf9, 0xce, 0xf0, 0xff, 0xd5, 0xfa, 0xcf, 0x0f, + 0x56, 0xeb, 0x18, 0xa0, 0xeb, 0x6e, 0x2e, 0xd4, 0xed, 0x74, 0x84, 0x53, 0x59, 0x10, 0xbb, 0x75, + 0x3f, 0xb9, 0xed, 0x6e, 0x14, 0xf7, 0x87, 0xbd, 0x57, 0x77, 0xeb, 0x8e, 0x22, 0x5d, 0x2a, 0xc6, + 0xfd, 0xa6, 0xd4, 0xd0, 0x2c, 0xd5, 0xd3, 0xc2, 0xc7, 0x56, 0x30, 0xd1, 0xc1, 0x24, 0x4e, 0x9a, + 0x60, 0x62, 0x06, 0x93, 0x4d, 0xb0, 0x76, 0x43, 0xbb, 0x60, 0x72, 0x3a, 0x08, 0x23, 0xae, 0x58, + 0xc6, 0x14, 0xfb, 0x71, 0x8f, 0x0d, 0x84, 0x52, 0xad, 0x50, 0x1a, 0x53, 0xda, 0x38, 0x94, 0x9a, + 0x10, 0xa5, 0x1b, 0x69, 0xd4, 0xfe, 0x3b, 0xac, 0xc3, 0xdf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbd, + 0x42, 0x77, 0x7b, 0x8a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/deputize/service.pb.gw.go b/x/identities/transactions/deputize/service.pb.gw.go deleted file mode 100644 index bbeb56616..000000000 --- a/x/identities/transactions/deputize/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/deputize/service.proto - -/* -Package deputize is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package deputize - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "deputize"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/issue/service.pb.go b/x/identities/transactions/issue/service.pb.go index 1dcc5d858..c5939adfb 100644 --- a/x/identities/transactions/issue/service.pb.go +++ b/x/identities/transactions/issue/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_67f6e03c262c4d59 = []byte{ - // 372 bytes of a gzipped FileDescriptorProto + // 355 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x80, 0x93, 0x94, 0xaf, 0x43, 0xf8, 0xa6, 0x2e, 0x1f, 0x84, 0x8f, 0x0c, 0xdf, 0xf8, 0x0d, - 0x77, 0x68, 0x07, 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x86, 0x48, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, - 0x8e, 0x78, 0x90, 0xdc, 0x95, 0xbc, 0xd7, 0xd2, 0xd1, 0x9f, 0x20, 0xfa, 0x0b, 0x74, 0x74, 0xf2, - 0x67, 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x5f, 0x21, 0x4d, 0x02, 0xb9, 0xae, 0x37, 0x05, - 0xde, 0xf0, 0x3c, 0xf7, 0xf0, 0xf2, 0xba, 0xa3, 0x11, 0x00, 0x53, 0x21, 0x15, 0x2a, 0x67, 0xb8, - 0x90, 0xe9, 0x32, 0x67, 0x80, 0xd7, 0x98, 0xa7, 0x4c, 0x28, 0xae, 0x38, 0x03, 0xac, 0x4a, 0x2a, - 0x80, 0x26, 0x8a, 0x4b, 0x01, 0x98, 0x03, 0x2c, 0x19, 0x06, 0x56, 0xae, 0x78, 0xc2, 0xd0, 0xa2, - 0x94, 0x4a, 0x0e, 0x86, 0x9a, 0x02, 0xb5, 0x0a, 0xb4, 0x46, 0x9d, 0x02, 0xe9, 0x0a, 0x54, 0x2b, - 0xbc, 0x3f, 0x89, 0x84, 0x42, 0x02, 0x2e, 0x20, 0xc3, 0xab, 0x83, 0xdd, 0xa7, 0xb1, 0x79, 0x7f, - 0x33, 0x29, 0xb3, 0x9c, 0x61, 0xba, 0xe0, 0x98, 0x0a, 0x21, 0x15, 0x6d, 0xb0, 0xe6, 0xaf, 0x51, - 0x6e, 0xc1, 0x00, 0x68, 0xd6, 0xe6, 0x7a, 0x17, 0x26, 0x0a, 0x6d, 0x74, 0x53, 0x32, 0x58, 0x48, - 0x01, 0xad, 0xef, 0xf0, 0xc9, 0x76, 0x7b, 0x21, 0x64, 0x83, 0x07, 0xdb, 0xed, 0x4f, 0xa8, 0x48, - 0x73, 0x36, 0x38, 0x41, 0x06, 0x2b, 0x41, 0x61, 0x93, 0xe9, 0x4d, 0x8c, 0xe8, 0x59, 0x37, 0xba, - 0x6c, 0x03, 0xff, 0x59, 0xde, 0xaf, 0xbb, 0xaf, 0xd7, 0xff, 0xf6, 0xf8, 0xb1, 0xf7, 0x56, 0xf9, - 0xf6, 0xa6, 0xf2, 0xed, 0xcf, 0xca, 0xb7, 0xef, 0xb7, 0xbe, 0xb5, 0xd9, 0xfa, 0xd6, 0xc7, 0xd6, - 0xb7, 0xdc, 0xa3, 0x44, 0x16, 0x26, 0x0f, 0x8e, 0x7f, 0x5f, 0x35, 0x57, 0x30, 0xdd, 0x6d, 0x61, - 0x6a, 0x5f, 0x9f, 0x66, 0x5c, 0xdd, 0x2e, 0xe7, 0x28, 0x91, 0x05, 0x36, 0x58, 0xf1, 0xb3, 0xd3, - 0x1f, 0x85, 0x51, 0x30, 0x0b, 0x5e, 0x9c, 0xbd, 0x83, 0x0a, 0xdb, 0x9c, 0x08, 0x05, 0x5d, 0xce, - 0x4c, 0xcf, 0x09, 0x76, 0xf8, 0xfb, 0x1e, 0x15, 0xb7, 0x54, 0x1c, 0xc5, 0x1d, 0x15, 0xeb, 0x54, - 0x5c, 0x53, 0x95, 0x73, 0x66, 0x40, 0xc5, 0xe7, 0xd3, 0x71, 0xc8, 0x14, 0x4d, 0xa9, 0xa2, 0xdf, - 0xce, 0xb1, 0x66, 0x20, 0xa4, 0x55, 0x10, 0x12, 0x11, 0xd2, 0x49, 0x08, 0xd1, 0x2d, 0x84, 0xd4, - 0x9a, 0x79, 0xbf, 0x3e, 0xa0, 0xe1, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x31, 0xb9, 0x1d, 0xaf, - 0x84, 0x03, 0x00, 0x00, + 0x18, 0x80, 0x73, 0x29, 0x5f, 0x87, 0xf0, 0x4d, 0x5d, 0x3e, 0xc8, 0x90, 0xe1, 0x1b, 0x1d, 0xee, + 0xd0, 0x0e, 0xca, 0x21, 0x4a, 0xbb, 0xd8, 0x0c, 0x91, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, + 0xf1, 0xa0, 0xc9, 0x95, 0xbc, 0xd7, 0xd2, 0xd1, 0x9f, 0x20, 0xfa, 0x0b, 0x74, 0x74, 0xf2, 0x67, + 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x5f, 0x21, 0x4d, 0x0f, 0x72, 0x5d, 0x6f, 0x0a, 0xbc, + 0xf0, 0x3c, 0x79, 0xf2, 0xe6, 0xf5, 0x06, 0x03, 0x00, 0xae, 0x22, 0x56, 0xaa, 0x19, 0x27, 0x85, + 0xcc, 0x16, 0x33, 0x0e, 0x64, 0x45, 0x44, 0xc6, 0x4b, 0x25, 0x94, 0xe0, 0x40, 0x54, 0xc5, 0x4a, + 0x60, 0xa9, 0x12, 0xb2, 0x04, 0x22, 0x00, 0x16, 0x9c, 0x00, 0xaf, 0x96, 0x22, 0xe5, 0x78, 0x5e, + 0x49, 0x25, 0x7b, 0x7d, 0x43, 0x81, 0xb5, 0x02, 0xaf, 0x70, 0xab, 0xc0, 0xa6, 0x02, 0x37, 0x0a, + 0xff, 0x5f, 0x2a, 0xa1, 0x90, 0x40, 0x0a, 0xc8, 0xc9, 0xf2, 0x70, 0xfb, 0xd8, 0xd9, 0x7c, 0xab, + 0xa0, 0x82, 0x03, 0xb0, 0x5c, 0x07, 0xf9, 0x97, 0x36, 0x0a, 0x63, 0x74, 0x5b, 0x71, 0x98, 0xcb, + 0x12, 0xb4, 0xef, 0xe8, 0x19, 0x79, 0x9d, 0x08, 0xf2, 0xde, 0x23, 0xf2, 0xba, 0x23, 0x56, 0x66, + 0x33, 0xde, 0x3b, 0xc5, 0x16, 0x1f, 0x8d, 0xa3, 0x5d, 0xa6, 0x3f, 0xb2, 0xa2, 0x27, 0xed, 0xe8, + 0x4a, 0x07, 0xfe, 0x77, 0xfc, 0x3f, 0xf7, 0xdf, 0x6f, 0x07, 0x68, 0xf8, 0xd4, 0x79, 0xaf, 0x03, + 0xb4, 0xae, 0x03, 0xf4, 0x55, 0x07, 0xe8, 0x61, 0x13, 0x38, 0xeb, 0x4d, 0xe0, 0x7c, 0x6e, 0x02, + 0xc7, 0x3b, 0x4e, 0x65, 0x61, 0xf3, 0xc2, 0xe1, 0xdf, 0xeb, 0xdd, 0x7f, 0x1e, 0x6f, 0xb7, 0x30, + 0x46, 0x37, 0x67, 0xb9, 0x50, 0x77, 0x8b, 0x29, 0x4e, 0x65, 0x41, 0x2c, 0x56, 0xfc, 0xe2, 0x76, + 0x07, 0x51, 0x1c, 0x4e, 0xc2, 0x57, 0x77, 0xef, 0x64, 0x22, 0x9d, 0x13, 0xe3, 0xb0, 0xcd, 0x99, + 0x98, 0x39, 0xe1, 0x16, 0xff, 0xd8, 0xa3, 0x12, 0x4d, 0x25, 0x71, 0xd2, 0x52, 0x89, 0x49, 0x25, + 0x0d, 0x55, 0xbb, 0xe7, 0x16, 0x54, 0x72, 0x31, 0x1e, 0x46, 0x5c, 0xb1, 0x8c, 0x29, 0xf6, 0xe3, + 0x9e, 0x18, 0x06, 0x4a, 0xb5, 0x82, 0xd2, 0x98, 0xd2, 0x56, 0x42, 0xa9, 0x69, 0xa1, 0xb4, 0xd1, + 0x4c, 0xbb, 0xcd, 0x01, 0xf5, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x85, 0x8c, 0xf6, 0x66, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/issue/service.pb.gw.go b/x/identities/transactions/issue/service.pb.gw.go deleted file mode 100644 index 8dd4ae82d..000000000 --- a/x/identities/transactions/issue/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/issue/service.proto - -/* -Package issue is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package issue - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "issue"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/name/service.pb.go b/x/identities/transactions/name/service.pb.go index 95816ac2a..837c199eb 100644 --- a/x/identities/transactions/name/service.pb.go +++ b/x/identities/transactions/name/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_5f93b42fa6f5fa12 = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x58, 0x41, - 0xe1, 0x44, 0xb1, 0x5d, 0x6a, 0x87, 0x94, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, - 0xbb, 0x2b, 0xf9, 0xaf, 0xa5, 0xa3, 0x2f, 0x20, 0xf4, 0x0d, 0x04, 0x47, 0x27, 0x1f, 0x43, 0x9c, - 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0x3e, 0x85, 0xc4, 0x04, 0x72, 0x1d, 0x9b, 0x29, 0xf0, 0x87, 0xef, - 0xcb, 0xc7, 0x9f, 0xdf, 0xbe, 0xee, 0x01, 0x30, 0xe5, 0x51, 0xa1, 0x52, 0x86, 0xb9, 0x8c, 0xe6, - 0x29, 0x03, 0xbc, 0xc4, 0x49, 0xc4, 0x84, 0x4a, 0x54, 0xc2, 0x00, 0xab, 0x8c, 0x0a, 0xa0, 0xa1, - 0x4a, 0xa4, 0x00, 0x2c, 0x28, 0x67, 0x18, 0x58, 0xb6, 0x48, 0x42, 0x86, 0x66, 0x99, 0x54, 0xb2, - 0xd3, 0xd5, 0x0c, 0xa8, 0x32, 0xa0, 0x25, 0xaa, 0x0d, 0x48, 0x37, 0xa0, 0xc2, 0xe0, 0x1c, 0x84, - 0x12, 0xb8, 0x04, 0xcc, 0x21, 0xc6, 0x8b, 0x93, 0xe2, 0x51, 0xca, 0x9c, 0xc3, 0x58, 0xca, 0x38, - 0x65, 0x98, 0xce, 0x12, 0x4c, 0x85, 0x90, 0x8a, 0x96, 0x54, 0xf9, 0xb6, 0x49, 0x2c, 0x67, 0x00, - 0x34, 0xae, 0x62, 0x1d, 0xaf, 0x81, 0x41, 0x9b, 0x3c, 0x64, 0x0c, 0x66, 0x52, 0x40, 0xa5, 0xeb, - 0xbe, 0x98, 0x76, 0xcb, 0x83, 0xb8, 0xb3, 0x32, 0xed, 0xf6, 0x0d, 0x15, 0x51, 0xca, 0x3a, 0x17, - 0x68, 0xf7, 0x7d, 0x20, 0xaf, 0x8c, 0x74, 0x06, 0x4d, 0xe0, 0x49, 0x3d, 0xb9, 0xad, 0xf2, 0x8e, - 0x0c, 0x67, 0xef, 0xe9, 0xe7, 0xfd, 0xd8, 0xec, 0x3f, 0xb7, 0x3e, 0x72, 0xd7, 0x5c, 0xe7, 0xae, - 0xf9, 0x9d, 0xbb, 0xe6, 0x6a, 0xe3, 0x1a, 0xeb, 0x8d, 0x6b, 0x7c, 0x6d, 0x5c, 0xc3, 0x3e, 0x0b, - 0x25, 0x6f, 0xf0, 0xbd, 0xfe, 0xfe, 0x5d, 0xf9, 0xff, 0xc7, 0xc5, 0x0a, 0xc6, 0xe6, 0xfd, 0x65, - 0x9c, 0xa8, 0xc7, 0xf9, 0x14, 0x85, 0x92, 0xe3, 0xdd, 0xd7, 0xfb, 0x6a, 0xb5, 0x7b, 0x9e, 0x3f, - 0x9c, 0x8c, 0xde, 0xac, 0xad, 0x4b, 0xf2, 0xaa, 0x18, 0x1f, 0x0d, 0xeb, 0x98, 0x89, 0x1e, 0x33, - 0xa2, 0x9c, 0x7d, 0x6e, 0x41, 0x41, 0x05, 0x05, 0x7e, 0x50, 0x43, 0x81, 0x0e, 0x05, 0x05, 0x94, - 0x5b, 0x57, 0xbb, 0x43, 0xc1, 0x60, 0xdc, 0xf7, 0x98, 0xa2, 0x11, 0x55, 0xf4, 0xd7, 0x3a, 0xd7, - 0x04, 0x84, 0x54, 0x06, 0x42, 0x7c, 0x42, 0x6a, 0x07, 0x21, 0xba, 0x84, 0x90, 0xc2, 0x32, 0x6d, - 0xff, 0x1f, 0xce, 0xe9, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x84, 0x47, 0xc6, 0xa9, 0x78, 0x03, - 0x00, 0x00, + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x6a, 0xeb, 0x30, + 0x14, 0x40, 0x6d, 0x87, 0x97, 0xc1, 0xbc, 0x29, 0xcb, 0x03, 0x0f, 0x1e, 0xde, 0xf8, 0x06, 0x89, + 0x97, 0x42, 0x0b, 0x2a, 0x2d, 0x4d, 0x96, 0x34, 0x83, 0x42, 0x68, 0x33, 0x98, 0x62, 0x28, 0x8a, + 0x2d, 0x5c, 0x43, 0x24, 0x05, 0x5f, 0x25, 0x64, 0xec, 0x0f, 0x14, 0xf2, 0x07, 0x85, 0x8e, 0x9d, + 0xfa, 0x19, 0xa5, 0x53, 0xc6, 0x8e, 0xc5, 0x19, 0x0a, 0xfd, 0x8a, 0xe2, 0x46, 0x60, 0x65, 0x8c, + 0x27, 0xc3, 0x85, 0x73, 0x7c, 0x7c, 0x7d, 0xfd, 0x8b, 0x1e, 0x00, 0xd7, 0x94, 0x49, 0x3d, 0xe3, + 0x58, 0xa8, 0x74, 0x31, 0xe3, 0x80, 0x57, 0x38, 0x4f, 0xb9, 0xd4, 0xb9, 0xce, 0x39, 0x60, 0x5d, + 0x30, 0x09, 0x2c, 0xd1, 0xb9, 0x92, 0x80, 0x25, 0x13, 0x1c, 0x03, 0x2f, 0x96, 0x79, 0xc2, 0xd1, + 0xbc, 0x50, 0x5a, 0x75, 0xba, 0x96, 0x01, 0x19, 0x03, 0x5a, 0xa1, 0xda, 0x80, 0x6c, 0x03, 0xaa, + 0x0c, 0xc1, 0x9f, 0x44, 0x81, 0x50, 0x80, 0x05, 0x64, 0x78, 0xf9, 0xbf, 0x7a, 0xec, 0x64, 0x41, + 0x93, 0x1c, 0xc1, 0x01, 0x58, 0x66, 0x72, 0x02, 0xda, 0xc0, 0x60, 0x4d, 0x6e, 0x0b, 0x0e, 0x73, + 0x25, 0xc1, 0xe8, 0xba, 0x8f, 0xae, 0xdf, 0xa2, 0x90, 0x75, 0xd6, 0xae, 0xdf, 0xbe, 0x64, 0x32, + 0x9d, 0xf1, 0xce, 0x29, 0x3a, 0xfc, 0x8b, 0x11, 0xdd, 0x45, 0x06, 0x83, 0x26, 0xf0, 0xa4, 0x9e, + 0x5c, 0x99, 0xbc, 0xbf, 0x4e, 0xf0, 0xeb, 0xfe, 0xf3, 0xe5, 0x9f, 0xdb, 0x7f, 0x68, 0xbd, 0x96, + 0xa1, 0xbb, 0x29, 0x43, 0xf7, 0xa3, 0x0c, 0xdd, 0xf5, 0x36, 0x74, 0x36, 0xdb, 0xd0, 0x79, 0xdf, + 0x86, 0x8e, 0x7f, 0x9c, 0x28, 0xd1, 0xe0, 0x7d, 0xfd, 0xdf, 0xd7, 0xbb, 0x3f, 0x3c, 0xae, 0x56, + 0x30, 0x76, 0x6f, 0xce, 0xb2, 0x5c, 0xdf, 0x2d, 0xa6, 0x28, 0x51, 0x02, 0x1f, 0xbe, 0xde, 0x27, + 0xaf, 0xdd, 0xa3, 0xd1, 0x70, 0x32, 0x7a, 0xf6, 0xf6, 0x6e, 0x85, 0x9a, 0x98, 0x08, 0x0d, 0xeb, + 0x98, 0x89, 0x1d, 0x33, 0x62, 0x82, 0xbf, 0xed, 0x41, 0xb1, 0x81, 0xe2, 0x28, 0xae, 0xa1, 0xd8, + 0x86, 0xe2, 0x0a, 0x2a, 0xbd, 0xf3, 0xc3, 0xa1, 0x78, 0x30, 0xee, 0x53, 0xae, 0x59, 0xca, 0x34, + 0xfb, 0xf2, 0x4e, 0x2c, 0x01, 0x21, 0xc6, 0x40, 0x48, 0x44, 0x48, 0xed, 0x20, 0xc4, 0x96, 0x10, + 0x52, 0x59, 0xa6, 0xed, 0x9f, 0xc3, 0x39, 0xfa, 0x0e, 0x00, 0x00, 0xff, 0xff, 0xcc, 0x2e, 0x2c, + 0xae, 0x5a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/name/service.pb.gw.go b/x/identities/transactions/name/service.pb.gw.go deleted file mode 100644 index 491e155f5..000000000 --- a/x/identities/transactions/name/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/name/service.proto - -/* -Package name is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package name - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "name"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/provision/service.pb.go b/x/identities/transactions/provision/service.pb.go index dd80a3bfe..6831459ed 100644 --- a/x/identities/transactions/provision/service.pb.go +++ b/x/identities/transactions/provision/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_d21f8e25d50e279b = []byte{ - // 378 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x6b, 0xdb, 0x40, - 0x14, 0x07, 0x70, 0x49, 0xa6, 0x1e, 0x44, 0x27, 0x2f, 0x05, 0x51, 0x34, 0x74, 0xec, 0x70, 0x47, - 0xdb, 0xa1, 0x70, 0xed, 0x50, 0xab, 0x84, 0xc4, 0x10, 0x81, 0x70, 0x3c, 0x88, 0x20, 0x08, 0x67, - 0xe9, 0x50, 0x0e, 0xa4, 0x7b, 0x42, 0xef, 0x6c, 0x3c, 0xe6, 0x23, 0x64, 0xce, 0x98, 0x2d, 0xc9, - 0x92, 0x8f, 0x11, 0x32, 0x79, 0xcc, 0x18, 0xe4, 0x21, 0x90, 0x4f, 0x11, 0x1c, 0x2b, 0x92, 0xbc, - 0x6a, 0x3a, 0x78, 0xf0, 0xff, 0xdd, 0x9f, 0xc7, 0xb3, 0x0f, 0xc6, 0x88, 0x42, 0xfb, 0x5c, 0xe9, - 0x4c, 0xd0, 0x1c, 0x92, 0x45, 0x26, 0x90, 0xae, 0xa8, 0x4c, 0x84, 0xd2, 0x52, 0x4b, 0x81, 0x54, - 0x97, 0x5c, 0x21, 0x8f, 0xb5, 0x04, 0x85, 0xb4, 0x28, 0x61, 0x29, 0x51, 0x82, 0xa2, 0x28, 0xca, - 0xa5, 0x8c, 0x05, 0x29, 0x4a, 0xd0, 0x30, 0xfa, 0xdd, 0x61, 0x48, 0xcd, 0x90, 0x15, 0x69, 0x19, - 0xd2, 0x65, 0x48, 0xc3, 0x38, 0x5f, 0x62, 0xc0, 0x1c, 0x90, 0xe6, 0x98, 0xd2, 0xe5, 0x8f, 0xed, - 0xb3, 0x13, 0x9d, 0xaf, 0x29, 0x40, 0x9a, 0x09, 0xca, 0x0b, 0x49, 0xb9, 0x52, 0xa0, 0x79, 0x13, - 0xd5, 0xe0, 0xf4, 0xae, 0x9d, 0x0b, 0x44, 0x9e, 0xd6, 0xb5, 0x9d, 0x69, 0x5f, 0xa6, 0x33, 0x3e, - 0x2b, 0x05, 0x16, 0xa0, 0xb0, 0x36, 0x7f, 0xde, 0x98, 0xf6, 0xc0, 0xc7, 0x74, 0x74, 0x65, 0xda, - 0xc3, 0x23, 0xae, 0x92, 0x4c, 0x8c, 0xfe, 0x91, 0x9e, 0xeb, 0x21, 0xfe, 0xae, 0xae, 0x73, 0xdc, - 0x5b, 0x98, 0xb5, 0xe3, 0x69, 0x5d, 0xf4, 0x9b, 0xe1, 0x7c, 0xba, 0x78, 0xb9, 0xff, 0x6e, 0x7a, - 0x77, 0x83, 0x87, 0xca, 0x35, 0xd7, 0x95, 0x6b, 0x3e, 0x57, 0xae, 0x79, 0xb9, 0x71, 0x8d, 0xf5, - 0xc6, 0x35, 0x9e, 0x36, 0xae, 0x61, 0xff, 0x89, 0x21, 0xef, 0xfb, 0xa9, 0xf7, 0xf9, 0x64, 0x77, - 0x1d, 0xc1, 0x76, 0x23, 0x81, 0x79, 0xea, 0xa5, 0x52, 0x9f, 0x2f, 0xe6, 0x24, 0x86, 0x9c, 0xf6, - 0x5c, 0xf9, 0xb5, 0x35, 0x1c, 0xfb, 0xe1, 0x64, 0x16, 0xdc, 0x5a, 0x7b, 0xc7, 0xe6, 0xd7, 0xb5, - 0x42, 0x32, 0x69, 0x6b, 0xcd, 0xba, 0xb5, 0x82, 0x0f, 0xe2, 0x71, 0x2f, 0x19, 0xd5, 0xc9, 0x28, - 0x8c, 0xda, 0x64, 0xd4, 0x4d, 0x46, 0x4d, 0xb2, 0xb2, 0xfe, 0xf7, 0x4c, 0x46, 0x87, 0x81, 0xe7, - 0x0b, 0xcd, 0x13, 0xae, 0xf9, 0xab, 0xf5, 0xb7, 0xa3, 0x30, 0x56, 0x33, 0x8c, 0x85, 0x8c, 0xb5, - 0x10, 0x63, 0x5d, 0x89, 0xb1, 0x86, 0x9a, 0x0f, 0xdf, 0x0f, 0xec, 0xd7, 0x5b, 0x00, 0x00, 0x00, - 0xff, 0xff, 0x8c, 0xc8, 0x37, 0xaa, 0xb4, 0x03, 0x00, 0x00, + // 357 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x1d, 0xea, + 0x20, 0x9c, 0x0e, 0x36, 0x22, 0x5a, 0x30, 0x10, 0x6a, 0x87, 0x20, 0x01, 0xb9, 0x26, 0x47, 0x3c, + 0x68, 0x72, 0x25, 0xef, 0x5a, 0x3a, 0xfa, 0x11, 0x9c, 0x1d, 0xdd, 0xd4, 0xc5, 0x8f, 0x21, 0x4e, + 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x3f, 0x85, 0xd4, 0x9e, 0xcd, 0x75, 0xbd, 0x29, 0xf0, 0xe0, 0xff, + 0xcb, 0x9f, 0x77, 0xcf, 0x3d, 0xef, 0x02, 0x30, 0x19, 0xd2, 0x52, 0x8e, 0x18, 0x2e, 0x44, 0x36, + 0x19, 0x31, 0xc0, 0x33, 0xcc, 0x33, 0x56, 0x4a, 0x2e, 0x39, 0x03, 0x2c, 0x2b, 0x5a, 0x02, 0x4d, + 0x25, 0x17, 0x25, 0xe0, 0x71, 0x25, 0xa6, 0x1c, 0xb8, 0x28, 0x31, 0xb0, 0x6a, 0xca, 0x53, 0x86, + 0xc6, 0x95, 0x90, 0xa2, 0x73, 0xa4, 0x31, 0x48, 0x31, 0x68, 0x86, 0x1a, 0x06, 0xe9, 0x0c, 0x5a, + 0x33, 0xde, 0x4e, 0x2a, 0xa0, 0x10, 0x80, 0x0b, 0xc8, 0xf1, 0x74, 0x7f, 0xf9, 0x59, 0x89, 0x9e, + 0x71, 0xb1, 0x82, 0x01, 0xd0, 0x5c, 0x15, 0xf3, 0xfa, 0xa6, 0x8c, 0x36, 0xbe, 0xad, 0x18, 0x8c, + 0x45, 0x09, 0xca, 0x3c, 0x78, 0xb6, 0xdd, 0x56, 0x08, 0x79, 0xe7, 0xd1, 0x76, 0xdb, 0x97, 0xb4, + 0xcc, 0x46, 0xac, 0x73, 0x8a, 0x0c, 0x17, 0x80, 0xc2, 0x55, 0x5d, 0xef, 0xca, 0x58, 0x18, 0x34, + 0xe3, 0xbe, 0x2a, 0xba, 0x6b, 0x79, 0x5b, 0xf7, 0xdf, 0x6f, 0x7b, 0x76, 0xf0, 0xda, 0x7a, 0xaf, + 0x7d, 0x7b, 0x5e, 0xfb, 0xf6, 0x57, 0xed, 0xdb, 0x0f, 0x0b, 0xdf, 0x9a, 0x2f, 0x7c, 0xeb, 0x73, + 0xe1, 0x5b, 0xee, 0x71, 0x2a, 0x0a, 0xd3, 0x9f, 0x06, 0xdb, 0xd7, 0xab, 0xf7, 0x8f, 0x96, 0x1b, + 0x89, 0xec, 0x9b, 0x20, 0xe7, 0xf2, 0x6e, 0x32, 0x44, 0xa9, 0x28, 0xb0, 0xe1, 0xca, 0x9f, 0x9c, + 0x76, 0x37, 0x8c, 0x7b, 0x83, 0xe8, 0xc5, 0xd9, 0x38, 0xa7, 0x50, 0xd5, 0x8a, 0x51, 0xaf, 0xa9, + 0x35, 0xd0, 0x6b, 0x45, 0xff, 0xc4, 0xc7, 0x46, 0x32, 0x51, 0xc9, 0x24, 0x4e, 0x9a, 0x64, 0xa2, + 0x27, 0x93, 0x75, 0xb2, 0x76, 0xce, 0x0c, 0x93, 0xc9, 0x45, 0x14, 0x84, 0x4c, 0xd2, 0x8c, 0x4a, + 0xfa, 0xe3, 0x9c, 0x68, 0x0a, 0x21, 0x8a, 0x21, 0x24, 0x26, 0xa4, 0x81, 0x08, 0xd1, 0x25, 0x42, + 0xd6, 0xd4, 0xb0, 0xfd, 0x77, 0x60, 0x87, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x06, 0x2d, 0xbd, + 0xfe, 0x96, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/provision/service.pb.gw.go b/x/identities/transactions/provision/service.pb.gw.go deleted file mode 100644 index b22b0b3af..000000000 --- a/x/identities/transactions/provision/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/provision/service.proto - -/* -Package provision is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package provision - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "provision"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/quash/service.pb.go b/x/identities/transactions/quash/service.pb.go index 51806ba78..53dda44c0 100644 --- a/x/identities/transactions/quash/service.pb.go +++ b/x/identities/transactions/quash/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_8f0ffa14eacab991 = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x80, 0x93, 0x94, 0xaf, 0x43, 0xf8, 0xa6, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x68, - 0x07, 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x87, 0x48, 0xab, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x69, - 0x20, 0xb9, 0xab, 0x79, 0xaf, 0xa5, 0xa3, 0x3f, 0x41, 0xf4, 0x17, 0xe8, 0xe8, 0xe4, 0xcf, 0x10, - 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0xbf, 0x42, 0x9a, 0x04, 0x72, 0x5d, 0x6f, 0x0a, 0xbc, 0xe1, - 0x79, 0xee, 0xe1, 0xe5, 0xb5, 0x7b, 0x3d, 0x00, 0x26, 0x3d, 0xca, 0x65, 0xca, 0x70, 0x26, 0xa2, - 0x45, 0xca, 0x00, 0xaf, 0x70, 0x12, 0x31, 0x2e, 0x13, 0x99, 0x30, 0xc0, 0x32, 0xa7, 0x1c, 0x68, - 0x28, 0x13, 0xc1, 0x01, 0xdf, 0x2f, 0x28, 0xcc, 0x30, 0xb0, 0x7c, 0x99, 0x84, 0x0c, 0xcd, 0x73, - 0x21, 0x45, 0xa7, 0xab, 0x28, 0x50, 0xad, 0x40, 0x2b, 0xd4, 0x28, 0x90, 0xaa, 0x40, 0xa5, 0xc2, - 0xd9, 0x0b, 0x05, 0x64, 0x02, 0x70, 0x06, 0x31, 0x5e, 0x1e, 0x6d, 0x3f, 0x95, 0xcd, 0xd9, 0x8f, - 0x85, 0x88, 0x53, 0x86, 0xe9, 0x3c, 0xc1, 0x94, 0x73, 0x21, 0x69, 0x85, 0x55, 0x7f, 0xb5, 0x72, - 0x33, 0x06, 0x40, 0xe3, 0x3a, 0xd7, 0xb9, 0xd2, 0x51, 0x28, 0xa3, 0xbb, 0x9c, 0xc1, 0x5c, 0x70, - 0xa8, 0x7d, 0xc7, 0x2f, 0xa6, 0xdd, 0xf2, 0x20, 0xee, 0x3c, 0x99, 0x76, 0x7b, 0x40, 0x79, 0x94, - 0xb2, 0xce, 0x19, 0xd2, 0x58, 0x09, 0xf2, 0xaa, 0x4c, 0x67, 0xa0, 0x45, 0x4f, 0x9a, 0xd1, 0x75, - 0x1d, 0x78, 0x60, 0x38, 0xff, 0x1e, 0x7e, 0xde, 0x0f, 0xcd, 0xfe, 0x73, 0xeb, 0xa3, 0x70, 0xcd, - 0x75, 0xe1, 0x9a, 0xdf, 0x85, 0x6b, 0x3e, 0x6e, 0x5c, 0x63, 0xbd, 0x71, 0x8d, 0xaf, 0x8d, 0x6b, - 0xd8, 0x27, 0xa1, 0xc8, 0x74, 0x1e, 0xec, 0xff, 0xbf, 0xa9, 0xae, 0x60, 0xb4, 0xdd, 0xc2, 0xc8, - 0xbc, 0x3d, 0x8f, 0x13, 0x39, 0x5b, 0x4c, 0x51, 0x28, 0x32, 0xac, 0xb1, 0xe2, 0x57, 0xab, 0xdd, - 0xf3, 0xfc, 0xe1, 0x64, 0xfc, 0x66, 0xed, 0x1c, 0x94, 0x57, 0xe7, 0xf8, 0x68, 0xd8, 0xe4, 0x4c, - 0xd4, 0x9c, 0xf1, 0x16, 0xff, 0xdc, 0xa1, 0x82, 0x9a, 0x0a, 0xfc, 0xa0, 0xa1, 0x02, 0x95, 0x0a, - 0x4a, 0xaa, 0xb0, 0x2e, 0x34, 0xa8, 0xe0, 0x72, 0xd4, 0xf7, 0x98, 0xa4, 0x11, 0x95, 0xf4, 0xd7, - 0x3a, 0x55, 0x0c, 0x84, 0xd4, 0x0a, 0x42, 0x7c, 0x42, 0x1a, 0x09, 0x21, 0xaa, 0x85, 0x90, 0x52, - 0x33, 0x6d, 0x97, 0x07, 0xd4, 0xfd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x4c, 0x17, 0x60, 0x84, - 0x03, 0x00, 0x00, + // 354 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0x80, 0x73, 0x29, 0x76, 0x08, 0x4e, 0x5d, 0x84, 0x0c, 0x19, 0x1c, 0x1d, 0xee, 0xd0, 0x0e, + 0xca, 0x21, 0x4a, 0xbb, 0xd8, 0x0e, 0x91, 0x56, 0x3b, 0x04, 0x09, 0xc8, 0x35, 0x39, 0xd2, 0x40, + 0x93, 0xab, 0xf9, 0xaf, 0xa5, 0xa3, 0x8f, 0x20, 0xfa, 0x04, 0x3a, 0x3a, 0xf9, 0x18, 0xe2, 0xd4, + 0xd1, 0x51, 0xd2, 0x41, 0xf0, 0x29, 0xa4, 0xe9, 0x41, 0xae, 0xeb, 0x4d, 0x81, 0x1f, 0xbe, 0x2f, + 0x5f, 0xfe, 0xfc, 0x4e, 0xa7, 0x03, 0xc0, 0xa5, 0xcf, 0x72, 0x39, 0xe5, 0x24, 0x13, 0xf1, 0x7c, + 0xca, 0x81, 0x2c, 0x49, 0x1a, 0xf3, 0x5c, 0xa6, 0x32, 0xe5, 0x40, 0x64, 0xc1, 0x72, 0x60, 0x91, + 0x4c, 0x45, 0x0e, 0xe4, 0x61, 0xce, 0x60, 0x42, 0x80, 0x17, 0x8b, 0x34, 0xe2, 0x78, 0x56, 0x08, + 0x29, 0x5a, 0x6d, 0x4d, 0x81, 0x95, 0x02, 0x2f, 0x71, 0xad, 0xc0, 0xba, 0x02, 0x57, 0x0a, 0xf7, + 0x20, 0x12, 0x90, 0x09, 0x20, 0x19, 0x24, 0x64, 0x71, 0xbc, 0x79, 0x6c, 0x6d, 0xae, 0x51, 0x50, + 0xc6, 0x01, 0x58, 0xa2, 0x82, 0xdc, 0x6b, 0x13, 0x85, 0x36, 0xba, 0x2f, 0x38, 0xcc, 0x44, 0x0e, + 0xca, 0x77, 0xf2, 0x8a, 0x9c, 0x86, 0x0f, 0x49, 0xeb, 0x19, 0x39, 0xcd, 0x1e, 0xcb, 0xe3, 0x29, + 0x6f, 0x9d, 0x63, 0x83, 0x8f, 0xc6, 0xfe, 0x36, 0xd3, 0xed, 0x19, 0xd1, 0xa3, 0x7a, 0x74, 0xa3, + 0x02, 0x0f, 0x2d, 0x77, 0xef, 0xf1, 0xf7, 0xe3, 0x08, 0x75, 0x5f, 0x1a, 0x9f, 0xa5, 0x87, 0x56, + 0xa5, 0x87, 0x7e, 0x4a, 0x0f, 0x3d, 0xad, 0x3d, 0x6b, 0xb5, 0xf6, 0xac, 0xef, 0xb5, 0x67, 0x39, + 0xa7, 0x91, 0xc8, 0x4c, 0x5e, 0xd8, 0xdd, 0xbf, 0xdd, 0xfe, 0xe7, 0xc1, 0x66, 0x0b, 0x03, 0x74, + 0x77, 0x91, 0xa4, 0x72, 0x32, 0x1f, 0xe3, 0x48, 0x64, 0xc4, 0x60, 0xc5, 0x6f, 0x76, 0xb3, 0xe3, + 0x07, 0xfd, 0xd1, 0xf0, 0xdd, 0xde, 0x39, 0x19, 0x5f, 0xe5, 0x04, 0xb8, 0x5f, 0xe7, 0x8c, 0xf4, + 0x9c, 0xe1, 0x06, 0xff, 0xda, 0xa1, 0x42, 0x45, 0x85, 0x41, 0x58, 0x53, 0xa1, 0x4e, 0x85, 0x15, + 0x55, 0xda, 0x97, 0x06, 0x54, 0x78, 0x35, 0xe8, 0xfa, 0x5c, 0xb2, 0x98, 0x49, 0xf6, 0x67, 0x9f, + 0x69, 0x06, 0x4a, 0x95, 0x82, 0xd2, 0x80, 0xd2, 0x5a, 0x42, 0xa9, 0x6e, 0xa1, 0xb4, 0xd2, 0x8c, + 0x9b, 0xd5, 0x01, 0xb5, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x88, 0xf0, 0x37, 0x31, 0x66, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/quash/service.pb.gw.go b/x/identities/transactions/quash/service.pb.gw.go deleted file mode 100644 index 23f0ca11c..000000000 --- a/x/identities/transactions/quash/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/quash/service.proto - -/* -Package quash is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package quash - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "quash"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/revoke/service.pb.go b/x/identities/transactions/revoke/service.pb.go index d68c4a243..611099dbe 100644 --- a/x/identities/transactions/revoke/service.pb.go +++ b/x/identities/transactions/revoke/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_e76110c17ab23cba = []byte{ - // 373 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xf3, 0x40, - 0x18, 0xc0, 0x93, 0x94, 0xb7, 0x43, 0x78, 0xa7, 0x2e, 0x2f, 0x84, 0x97, 0x0c, 0x8e, 0x0e, 0x77, - 0xf8, 0x67, 0xd0, 0x03, 0xd1, 0x66, 0xd1, 0x0e, 0xc1, 0x52, 0x3b, 0x04, 0x09, 0xc8, 0x35, 0x79, - 0x88, 0xc1, 0xe4, 0xae, 0xe4, 0xb9, 0x96, 0x8e, 0x7e, 0x04, 0x07, 0x17, 0x57, 0xdd, 0x9c, 0xfc, - 0x18, 0xe2, 0xd4, 0xd1, 0x51, 0xd2, 0x41, 0xf0, 0x53, 0x48, 0x7b, 0x81, 0xa4, 0x6b, 0xa6, 0xc0, - 0x13, 0x7e, 0xbf, 0xfb, 0xf1, 0xf0, 0xd8, 0x5e, 0x1f, 0x11, 0x94, 0xcf, 0x85, 0xca, 0x80, 0xe6, - 0x32, 0x9e, 0x65, 0x80, 0x74, 0x41, 0xd3, 0x18, 0x84, 0x4a, 0x55, 0x0a, 0x48, 0x55, 0xc1, 0x05, - 0xf2, 0x48, 0xa5, 0x52, 0x20, 0x2d, 0x60, 0x2e, 0xef, 0x80, 0x22, 0x14, 0xf3, 0x34, 0x02, 0x32, - 0x2d, 0xa4, 0x92, 0xbd, 0xc3, 0x86, 0x83, 0x54, 0x0e, 0xb2, 0x20, 0xb5, 0x83, 0x34, 0x1d, 0x44, - 0x3b, 0x9c, 0x7f, 0x91, 0xc4, 0x5c, 0x22, 0xcd, 0x31, 0xa1, 0xf3, 0xbd, 0xf5, 0x47, 0xeb, 0x9c, - 0xff, 0x89, 0x94, 0x49, 0x06, 0x94, 0x4f, 0x53, 0xca, 0x85, 0x90, 0x8a, 0x6b, 0x4e, 0xff, 0x6d, - 0x17, 0x9c, 0x03, 0x22, 0x4f, 0xaa, 0x60, 0xe7, 0xb2, 0x95, 0xa3, 0x31, 0xbb, 0x29, 0x00, 0xa7, - 0x52, 0x60, 0x25, 0xdc, 0x7f, 0x31, 0xed, 0x8e, 0x8f, 0x49, 0xef, 0xd1, 0xb4, 0xbb, 0x17, 0x5c, - 0xc4, 0x19, 0xf4, 0x4e, 0x48, 0x9b, 0xad, 0x10, 0x5f, 0x87, 0x3a, 0x83, 0x76, 0xf8, 0xb8, 0x9e, - 0x8d, 0xaa, 0xc4, 0x1d, 0xc3, 0xf9, 0x73, 0xff, 0xfd, 0xb6, 0x6b, 0x7a, 0x4f, 0x9d, 0xf7, 0xd2, - 0x35, 0x97, 0xa5, 0x6b, 0x7e, 0x95, 0xae, 0xf9, 0xb0, 0x72, 0x8d, 0xe5, 0xca, 0x35, 0x3e, 0x57, - 0xae, 0x61, 0x1f, 0x45, 0x32, 0x6f, 0xf5, 0xa2, 0xf7, 0xf7, 0x4a, 0xdf, 0xc2, 0x70, 0xbd, 0x88, - 0xa1, 0x79, 0x7d, 0x9a, 0xa4, 0xea, 0x76, 0x36, 0x21, 0x91, 0xcc, 0x69, 0x9b, 0x35, 0x3f, 0x5b, - 0xdd, 0xbe, 0x1f, 0x0c, 0xc6, 0xa3, 0x57, 0x6b, 0xeb, 0xae, 0xfc, 0x2a, 0x28, 0x20, 0x83, 0x3a, - 0x68, 0xdc, 0x0c, 0x1a, 0x6d, 0xf8, 0x8f, 0x2d, 0x2c, 0xac, 0xb0, 0x30, 0x08, 0x6b, 0x2c, 0x6c, - 0x62, 0xa1, 0xc6, 0x4a, 0xeb, 0xac, 0x0d, 0x16, 0x9e, 0x0f, 0x3d, 0x1f, 0x14, 0x8f, 0xb9, 0xe2, - 0x3f, 0xd6, 0x71, 0x43, 0xc1, 0x58, 0xe5, 0x60, 0x2c, 0x60, 0xac, 0xb6, 0x30, 0xd6, 0xd4, 0x30, - 0xa6, 0x3d, 0x93, 0xee, 0xe6, 0x90, 0x0e, 0x7e, 0x03, 0x00, 0x00, 0xff, 0xff, 0x61, 0x99, 0x3d, - 0xc5, 0x90, 0x03, 0x00, 0x00, + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0x80, 0x73, 0x29, 0xbf, 0x0e, 0xe1, 0x37, 0x75, 0x11, 0x32, 0x64, 0x70, 0x74, 0xb8, 0xc3, + 0x3f, 0x83, 0x1e, 0x88, 0x36, 0x8b, 0x76, 0x08, 0x96, 0xda, 0x21, 0x48, 0x40, 0xae, 0xc9, 0x11, + 0x83, 0x4d, 0xae, 0xe4, 0xbd, 0x96, 0x8e, 0x7e, 0x04, 0x07, 0x17, 0x57, 0xdd, 0x9c, 0xfc, 0x18, + 0xe2, 0xd4, 0xd1, 0x51, 0x92, 0x41, 0xf0, 0x53, 0x48, 0x9b, 0x83, 0x5c, 0xd7, 0x9b, 0x02, 0x2f, + 0x3c, 0x4f, 0x9e, 0xbc, 0x79, 0x1d, 0xbf, 0x0f, 0xc0, 0x65, 0xc0, 0x0a, 0x39, 0xe5, 0x24, 0x17, + 0xc9, 0x7c, 0xca, 0x81, 0x2c, 0x49, 0x96, 0xf0, 0x42, 0x66, 0x32, 0xe3, 0x40, 0x64, 0xc9, 0x0a, + 0x60, 0xb1, 0xcc, 0x44, 0x01, 0xa4, 0xe4, 0x0b, 0x71, 0xcf, 0x09, 0xf0, 0x72, 0x91, 0xc5, 0x1c, + 0xcf, 0x4a, 0x21, 0x45, 0xef, 0x48, 0x73, 0x60, 0xe5, 0xc0, 0x4b, 0xdc, 0x3a, 0xb0, 0xee, 0xc0, + 0x8d, 0xc3, 0xdd, 0x89, 0x05, 0xe4, 0x02, 0x48, 0x0e, 0x29, 0x59, 0xec, 0xaf, 0x1f, 0x8d, 0xce, + 0x35, 0x4b, 0xca, 0x39, 0x00, 0x4b, 0x55, 0x92, 0x7b, 0x65, 0xe4, 0xd0, 0x66, 0xb7, 0x25, 0x87, + 0x99, 0x28, 0x40, 0x09, 0x0f, 0x5e, 0x91, 0xd3, 0x09, 0x20, 0xed, 0x3d, 0x21, 0xa7, 0x7b, 0xc9, + 0x8a, 0x64, 0xca, 0x7b, 0xa7, 0xd8, 0xe4, 0xbb, 0x71, 0xd0, 0x84, 0xba, 0x03, 0x33, 0x7c, 0xdc, + 0xce, 0x46, 0x2a, 0x71, 0xd7, 0x72, 0xff, 0x3d, 0xfc, 0xbc, 0xef, 0x21, 0xff, 0xb9, 0xf3, 0x51, + 0x79, 0x68, 0x55, 0x79, 0xe8, 0xbb, 0xf2, 0xd0, 0x63, 0xed, 0x59, 0xab, 0xda, 0xb3, 0xbe, 0x6a, + 0xcf, 0x72, 0x8e, 0x63, 0x91, 0x1b, 0xbd, 0xd1, 0xff, 0x7f, 0xdd, 0xfc, 0xed, 0xe1, 0x7a, 0x11, + 0x43, 0x74, 0x73, 0x96, 0x66, 0xf2, 0x6e, 0x3e, 0xc1, 0xb1, 0xc8, 0x89, 0xc9, 0x9a, 0x5f, 0xec, + 0x6e, 0x3f, 0x08, 0x07, 0xe3, 0xd1, 0x9b, 0xbd, 0x75, 0x39, 0x81, 0x0a, 0x0a, 0xf1, 0xa0, 0x0d, + 0x1a, 0xeb, 0x41, 0xa3, 0x0d, 0xff, 0xb9, 0x85, 0x45, 0x0a, 0x8b, 0xc2, 0xa8, 0xc5, 0x22, 0x1d, + 0x8b, 0x1a, 0xac, 0xb2, 0xcf, 0x4d, 0xb0, 0xe8, 0x62, 0xe8, 0x07, 0x5c, 0xb2, 0x84, 0x49, 0xf6, + 0x6b, 0x9f, 0x68, 0x0a, 0x4a, 0x95, 0x83, 0xd2, 0x90, 0xd2, 0xd6, 0x42, 0xa9, 0xae, 0xa1, 0xb4, + 0xf1, 0x4c, 0xba, 0x9b, 0x43, 0x3a, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x34, 0x96, 0x21, 0xc8, + 0x72, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/revoke/service.pb.gw.go b/x/identities/transactions/revoke/service.pb.gw.go deleted file mode 100644 index 719cb6b46..000000000 --- a/x/identities/transactions/revoke/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/revoke/service.proto - -/* -Package revoke is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package revoke - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "revoke"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/unprovision/service.pb.go b/x/identities/transactions/unprovision/service.pb.go index 58e653dc2..37020c1e8 100644 --- a/x/identities/transactions/unprovision/service.pb.go +++ b/x/identities/transactions/unprovision/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_cb37a005e91ee120 = []byte{ - // 379 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd2, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0xc3, 0x3b, 0xbe, - 0xc3, 0x1d, 0xea, 0xe4, 0x81, 0x42, 0x83, 0x52, 0x3b, 0x44, 0x8a, 0xa6, 0x10, 0x24, 0x20, 0xd7, - 0xe4, 0x88, 0x07, 0xc9, 0x5d, 0xc8, 0x73, 0x2d, 0x1d, 0xfd, 0x08, 0x7e, 0x02, 0x07, 0x47, 0x41, - 0x70, 0xf3, 0x2b, 0x88, 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x4f, 0x21, 0x35, 0x81, 0x5c, 0xd7, - 0x74, 0xba, 0xe1, 0xe1, 0xff, 0xbb, 0x3f, 0x0f, 0x8f, 0x3d, 0x1a, 0x02, 0x30, 0xe5, 0x53, 0xa1, - 0x32, 0x86, 0x73, 0x99, 0xcc, 0x33, 0x06, 0x78, 0x89, 0x79, 0xc2, 0x84, 0xe2, 0x8a, 0x33, 0xc0, - 0xaa, 0xa4, 0x02, 0x68, 0xac, 0xb8, 0x14, 0x80, 0xe7, 0xa2, 0x28, 0xe5, 0x82, 0x03, 0x97, 0x02, - 0x03, 0x2b, 0x17, 0x3c, 0x66, 0xa8, 0x28, 0xa5, 0x92, 0x83, 0x43, 0x0d, 0x42, 0x0d, 0x84, 0x96, - 0xa8, 0x85, 0x90, 0x0e, 0x21, 0x0d, 0x72, 0xfe, 0xc4, 0x12, 0x72, 0x09, 0x38, 0x87, 0x14, 0x2f, - 0xf6, 0x36, 0x4f, 0x6d, 0x3a, 0x7f, 0x53, 0x29, 0xd3, 0x8c, 0x61, 0x5a, 0x70, 0x4c, 0x85, 0x90, - 0x8a, 0xd6, 0xe1, 0x7a, 0xba, 0x43, 0xf5, 0x9c, 0x01, 0xd0, 0xb4, 0xa9, 0xee, 0x04, 0xdd, 0x21, - 0x6d, 0x70, 0x5d, 0x32, 0x28, 0xa4, 0x80, 0x46, 0xdd, 0x7f, 0x32, 0xed, 0x9e, 0x0f, 0xe9, 0xe0, - 0xde, 0xb4, 0xfb, 0x67, 0x54, 0x24, 0x19, 0x1b, 0x78, 0xa8, 0xf3, 0x92, 0x90, 0x5f, 0x57, 0x76, - 0xce, 0x77, 0x30, 0x82, 0x76, 0x70, 0xd1, 0x94, 0xfd, 0x67, 0x38, 0xbf, 0x6e, 0x3f, 0x9f, 0xff, - 0x9b, 0xde, 0x4b, 0xef, 0xb5, 0x72, 0xcd, 0x55, 0xe5, 0x9a, 0x1f, 0x95, 0x6b, 0xde, 0xad, 0x5d, - 0x63, 0xb5, 0x76, 0x8d, 0xf7, 0xb5, 0x6b, 0xd8, 0x47, 0xb1, 0xcc, 0xbb, 0x7f, 0xeb, 0xfd, 0xbe, - 0xac, 0x2f, 0x65, 0xb2, 0xd9, 0xcb, 0xc4, 0xbc, 0x3a, 0x49, 0xb9, 0xba, 0x99, 0xcf, 0x50, 0x2c, - 0x73, 0xdc, 0x79, 0xf5, 0x0f, 0x56, 0x7f, 0xe8, 0x87, 0xe3, 0x60, 0xfa, 0x68, 0x6d, 0x9d, 0x9e, - 0xdf, 0x54, 0x0b, 0xd1, 0xb8, 0xad, 0x16, 0xe8, 0xd5, 0xa6, 0x2d, 0xf2, 0xb6, 0x95, 0x8d, 0x9a, - 0x6c, 0x14, 0x46, 0x6d, 0x36, 0xd2, 0xb3, 0x91, 0x96, 0xad, 0xac, 0xd3, 0xce, 0xd9, 0x68, 0x34, - 0xf1, 0x7c, 0xa6, 0x68, 0x42, 0x15, 0xfd, 0xb2, 0x8e, 0x35, 0x87, 0x90, 0x06, 0x22, 0x24, 0x24, - 0xa4, 0xa5, 0x08, 0xd1, 0x2d, 0x42, 0x34, 0x6c, 0xd6, 0xff, 0x39, 0xb8, 0x83, 0xef, 0x00, 0x00, - 0x00, 0xff, 0xff, 0xa7, 0x02, 0x03, 0xa6, 0xcc, 0x03, 0x00, 0x00, + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x1d, 0xea, + 0xe4, 0x81, 0x42, 0x83, 0x52, 0x3b, 0x44, 0x8a, 0xa6, 0x10, 0x24, 0x20, 0xd7, 0xe4, 0x88, 0x07, + 0xcd, 0x5d, 0xc9, 0x77, 0x2d, 0x1d, 0x7d, 0x04, 0x9f, 0xc0, 0xc1, 0x51, 0x10, 0xdc, 0x7c, 0x05, + 0x71, 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x14, 0x52, 0x7b, 0x90, 0xeb, 0x9a, 0x4e, 0x37, 0x7c, + 0xfc, 0x7f, 0xf7, 0xe7, 0xe3, 0x73, 0x7b, 0x5d, 0x00, 0xa6, 0x42, 0x2a, 0xd4, 0x98, 0xe1, 0x42, + 0x66, 0xd3, 0x31, 0x03, 0x3c, 0xc7, 0x3c, 0x63, 0x42, 0x71, 0xc5, 0x19, 0x60, 0x55, 0x52, 0x01, + 0x34, 0x55, 0x5c, 0x0a, 0xc0, 0x53, 0x31, 0x29, 0xe5, 0x8c, 0x03, 0x97, 0x02, 0x03, 0x2b, 0x67, + 0x3c, 0x65, 0x68, 0x52, 0x4a, 0x25, 0x3b, 0x27, 0x06, 0x84, 0x34, 0x84, 0xe6, 0xa8, 0x86, 0x90, + 0x09, 0x21, 0x03, 0xf2, 0xf6, 0x52, 0x09, 0x85, 0x04, 0x5c, 0x40, 0x8e, 0x67, 0x87, 0xab, 0x67, + 0x6d, 0x7a, 0x5b, 0x94, 0x2b, 0x18, 0x00, 0xcd, 0x75, 0x39, 0x2f, 0x6a, 0x0e, 0x19, 0x83, 0xbb, + 0x92, 0xc1, 0x44, 0x0a, 0xd0, 0xea, 0xd1, 0xab, 0xed, 0xb6, 0x42, 0xc8, 0x3b, 0x4f, 0xb6, 0xdb, + 0xbe, 0xa4, 0x22, 0x1b, 0xb3, 0x4e, 0x80, 0x1a, 0xaf, 0x01, 0x85, 0xeb, 0xca, 0xde, 0xd5, 0x16, + 0x46, 0x54, 0x0f, 0xae, 0x75, 0xd9, 0x7d, 0xcb, 0xdb, 0x79, 0xf8, 0x79, 0x3b, 0xb0, 0x83, 0xf7, + 0xd6, 0x47, 0xe5, 0xdb, 0x8b, 0xca, 0xb7, 0xbf, 0x2b, 0xdf, 0x7e, 0x5c, 0xfa, 0xd6, 0x62, 0xe9, + 0x5b, 0x5f, 0x4b, 0xdf, 0x72, 0x4f, 0x53, 0x59, 0x34, 0xff, 0x36, 0xd8, 0xbd, 0x59, 0xdf, 0xc2, + 0x60, 0xb5, 0x97, 0x81, 0x7d, 0x7b, 0x9e, 0x73, 0x75, 0x3f, 0x1d, 0xa1, 0x54, 0x16, 0xb8, 0xf1, + 0xea, 0x9f, 0x9d, 0x76, 0x37, 0x8c, 0xfb, 0xd1, 0xf0, 0xc5, 0xd9, 0x38, 0xae, 0x50, 0x57, 0x8b, + 0x51, 0xbf, 0xae, 0x16, 0x99, 0xd5, 0x86, 0x35, 0xf2, 0xb9, 0x91, 0x4d, 0x74, 0x36, 0x89, 0x93, + 0x3a, 0x9b, 0x98, 0xd9, 0xc4, 0xc8, 0x56, 0xce, 0x45, 0xe3, 0x6c, 0xd2, 0x1b, 0x04, 0x21, 0x53, + 0x34, 0xa3, 0x8a, 0xfe, 0x3a, 0x67, 0x86, 0x43, 0x88, 0x86, 0x08, 0x89, 0x09, 0xa9, 0x29, 0x42, + 0x4c, 0x8b, 0x10, 0x03, 0x1b, 0xb5, 0xff, 0x0f, 0xee, 0xf8, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xfa, + 0x54, 0x02, 0x58, 0xae, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/unprovision/service.pb.gw.go b/x/identities/transactions/unprovision/service.pb.gw.go deleted file mode 100644 index 56c2d6262..000000000 --- a/x/identities/transactions/unprovision/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/unprovision/service.proto - -/* -Package unprovision is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package unprovision - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "unprovision"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/identities/transactions/update/service.pb.go b/x/identities/transactions/update/service.pb.go index 41d7798c0..2468e5f8b 100644 --- a/x/identities/transactions/update/service.pb.go +++ b/x/identities/transactions/update/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_188ef3d964dd38f9 = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xc3, 0x40, - 0x14, 0xc0, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0xf8, 0x67, - 0xd0, 0x03, 0xd1, 0x66, 0xd1, 0x0e, 0xc1, 0xa2, 0x2d, 0x04, 0x09, 0xc8, 0x35, 0x39, 0x62, 0x20, - 0xb9, 0x0b, 0x79, 0xd7, 0xd2, 0xd1, 0x8f, 0xe0, 0xe0, 0xe2, 0xaa, 0x9b, 0x93, 0x1f, 0x43, 0x9c, - 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0x7e, 0x0a, 0x69, 0x2f, 0x90, 0x74, 0xbd, 0x29, 0xf0, 0xc2, 0xef, - 0x77, 0x3f, 0x1e, 0xcf, 0xf6, 0xfa, 0x00, 0x4c, 0xfa, 0x94, 0xcb, 0x8c, 0xe1, 0x5c, 0xc4, 0xd3, - 0x8c, 0x01, 0x9e, 0xe3, 0x34, 0x66, 0x5c, 0xa6, 0x32, 0x65, 0x80, 0x65, 0x49, 0x39, 0xd0, 0x48, - 0xa6, 0x82, 0x03, 0x9e, 0x16, 0x31, 0x95, 0x0c, 0x03, 0x2b, 0x67, 0x69, 0xc4, 0x50, 0x51, 0x0a, - 0x29, 0x7a, 0xc7, 0x2d, 0x07, 0xaa, 0x1d, 0x68, 0x8e, 0x1a, 0x07, 0x6a, 0x3b, 0x90, 0x72, 0x38, - 0x3b, 0x91, 0x80, 0x5c, 0x00, 0xce, 0x21, 0xc1, 0xb3, 0x83, 0xd5, 0x47, 0xe9, 0x9c, 0xdd, 0x44, - 0x88, 0x24, 0x63, 0x98, 0x16, 0x29, 0xa6, 0x9c, 0x0b, 0x49, 0x15, 0xa7, 0xfe, 0xea, 0x05, 0xe7, - 0x0c, 0x80, 0x26, 0x75, 0xb0, 0x73, 0xad, 0xe5, 0x68, 0xcd, 0xee, 0x4b, 0x06, 0x85, 0xe0, 0x50, - 0x0b, 0x0f, 0xdf, 0x4c, 0xbb, 0xe3, 0x43, 0xd2, 0x7b, 0x36, 0xed, 0xee, 0x15, 0xe5, 0x71, 0xc6, - 0x7a, 0x67, 0x48, 0x67, 0x2b, 0xc8, 0x57, 0xa1, 0xce, 0x40, 0x0f, 0x1f, 0x35, 0xb3, 0x9b, 0x3a, - 0x71, 0xcf, 0x70, 0xb6, 0x1e, 0x7f, 0x3f, 0xf6, 0x4d, 0xef, 0xa5, 0xf3, 0x59, 0xb9, 0xe6, 0xa2, - 0x72, 0xcd, 0x9f, 0xca, 0x35, 0x9f, 0x96, 0xae, 0xb1, 0x58, 0xba, 0xc6, 0xf7, 0xd2, 0x35, 0xec, - 0x93, 0x48, 0xe4, 0x5a, 0x2f, 0x7a, 0xdb, 0xb7, 0xea, 0x16, 0x86, 0xab, 0x45, 0x0c, 0xcd, 0xbb, - 0xf3, 0x24, 0x95, 0x0f, 0xd3, 0x09, 0x8a, 0x44, 0x8e, 0x75, 0xd6, 0xfc, 0x6a, 0x75, 0xfb, 0x7e, - 0x30, 0x18, 0x8d, 0xdf, 0xad, 0x8d, 0xbb, 0xf2, 0xeb, 0xa0, 0x00, 0x0d, 0x9a, 0xa0, 0x51, 0x3b, - 0x68, 0xbc, 0xe6, 0xbf, 0x36, 0xb0, 0xb0, 0xc6, 0xc2, 0x20, 0x6c, 0xb0, 0xb0, 0x8d, 0x85, 0x0a, - 0xab, 0xac, 0x0b, 0x1d, 0x2c, 0xbc, 0x1c, 0x7a, 0x3e, 0x93, 0x34, 0xa6, 0x92, 0xfe, 0x59, 0xa7, - 0x2d, 0x05, 0x21, 0xb5, 0x83, 0x90, 0x80, 0x90, 0xc6, 0x42, 0x48, 0x5b, 0x43, 0x88, 0xf2, 0x4c, - 0xba, 0xeb, 0x43, 0x3a, 0xfa, 0x0f, 0x00, 0x00, 0xff, 0xff, 0xd7, 0x31, 0x3c, 0x77, 0x90, 0x03, - 0x00, 0x00, + // 356 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0x80, 0x73, 0x29, 0xbf, 0x0e, 0xe1, 0x37, 0x75, 0x11, 0x32, 0x64, 0x70, 0x74, 0xb8, 0xc3, + 0x3f, 0x83, 0x1e, 0x88, 0x36, 0x8b, 0x76, 0x08, 0x16, 0x6d, 0x21, 0x48, 0x40, 0xae, 0xc9, 0x11, + 0x03, 0x4d, 0xae, 0xe4, 0xbd, 0x96, 0x8e, 0x7e, 0x04, 0x07, 0x17, 0x57, 0xdd, 0x9c, 0xfc, 0x18, + 0xe2, 0xd4, 0xd1, 0x51, 0x92, 0x41, 0xf0, 0x53, 0x48, 0x9b, 0x83, 0x5c, 0xd7, 0x9b, 0x02, 0x2f, + 0x3c, 0x4f, 0x9e, 0xbc, 0x79, 0x1d, 0xbf, 0x0f, 0xc0, 0x65, 0xc0, 0x0a, 0x39, 0xe5, 0x24, 0x17, + 0xc9, 0x7c, 0xca, 0x81, 0x2c, 0x49, 0x96, 0xf0, 0x42, 0x66, 0x32, 0xe3, 0x40, 0x64, 0xc9, 0x0a, + 0x60, 0xb1, 0xcc, 0x44, 0x01, 0x64, 0x3e, 0x4b, 0x98, 0xe4, 0x04, 0x78, 0xb9, 0xc8, 0x62, 0x8e, + 0x67, 0xa5, 0x90, 0xa2, 0x77, 0xa4, 0x39, 0xb0, 0x72, 0xe0, 0x25, 0x6e, 0x1d, 0x58, 0x77, 0xe0, + 0xc6, 0xe1, 0xee, 0xc4, 0x02, 0x72, 0x01, 0x24, 0x87, 0x94, 0x2c, 0xf6, 0xd7, 0x8f, 0x46, 0xe7, + 0x9a, 0x25, 0xe5, 0x1c, 0x80, 0xa5, 0x2a, 0xc9, 0xbd, 0x32, 0x72, 0x68, 0xb3, 0xbb, 0x92, 0xc3, + 0x4c, 0x14, 0xa0, 0x84, 0x07, 0xaf, 0xc8, 0xe9, 0x04, 0x90, 0xf6, 0x9e, 0x90, 0xd3, 0xbd, 0x64, + 0x45, 0x32, 0xe5, 0xbd, 0x53, 0x6c, 0xf2, 0xdd, 0x38, 0x68, 0x42, 0xdd, 0x81, 0x19, 0x3e, 0x6a, + 0x67, 0xd7, 0x2a, 0x71, 0xd7, 0x72, 0xff, 0x3d, 0xfc, 0xbc, 0xef, 0x21, 0xff, 0xb9, 0xf3, 0x51, + 0x79, 0x68, 0x55, 0x79, 0xe8, 0xbb, 0xf2, 0xd0, 0x63, 0xed, 0x59, 0xab, 0xda, 0xb3, 0xbe, 0x6a, + 0xcf, 0x72, 0x8e, 0x63, 0x91, 0x1b, 0xbd, 0xd1, 0xff, 0x7f, 0xd3, 0xfc, 0xed, 0xe1, 0x7a, 0x11, + 0x43, 0x74, 0x7b, 0x96, 0x66, 0xf2, 0x7e, 0x3e, 0xc1, 0xb1, 0xc8, 0x89, 0xc9, 0x9a, 0x5f, 0xec, + 0x6e, 0x3f, 0x08, 0x07, 0xa3, 0xf1, 0x9b, 0xbd, 0x75, 0x39, 0x81, 0x0a, 0x0a, 0xf1, 0xa0, 0x0d, + 0x1a, 0xe9, 0x41, 0xe3, 0x0d, 0xff, 0xb9, 0x85, 0x45, 0x0a, 0x8b, 0xc2, 0xa8, 0xc5, 0x22, 0x1d, + 0x8b, 0x1a, 0xac, 0xb2, 0xcf, 0x4d, 0xb0, 0xe8, 0x62, 0xe8, 0x07, 0x5c, 0xb2, 0x84, 0x49, 0xf6, + 0x6b, 0x9f, 0x68, 0x0a, 0x4a, 0x95, 0x83, 0xd2, 0x90, 0xd2, 0xd6, 0x42, 0xa9, 0xae, 0xa1, 0xb4, + 0xf1, 0x4c, 0xba, 0x9b, 0x43, 0x3a, 0xfc, 0x0b, 0x00, 0x00, 0xff, 0xff, 0x67, 0xa8, 0x09, 0xce, + 0x72, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/identities/transactions/update/service.pb.gw.go b/x/identities/transactions/update/service.pb.gw.go deleted file mode 100644 index 701b803e0..000000000 --- a/x/identities/transactions/update/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/identities/transactions/update/service.proto - -/* -Package update is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package update - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "identities", "update"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/maintainers/queries/maintainer/service.pb.go b/x/maintainers/queries/maintainer/service.pb.go index cda232622..f15e8a99c 100644 --- a/x/maintainers/queries/maintainer/service.pb.go +++ b/x/maintainers/queries/maintainer/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,28 @@ func init() { } var fileDescriptor_c025cc7a1d39ab0c = []byte{ - // 361 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0x86, 0x9b, 0x88, 0x1d, 0x82, 0x53, 0xc6, 0x22, 0x19, 0x1c, 0xc4, 0xe9, 0x8e, 0xaa, 0x83, - 0xde, 0xa2, 0x8d, 0x83, 0x75, 0x38, 0x68, 0x75, 0x09, 0x12, 0x90, 0x6b, 0xfb, 0x51, 0x0f, 0x92, - 0xbb, 0x36, 0x77, 0x29, 0x75, 0xf5, 0x17, 0x08, 0x4e, 0xae, 0x8e, 0xfe, 0x0b, 0x37, 0xd1, 0xa5, - 0xe0, 0xe2, 0x28, 0xa9, 0x93, 0xbf, 0x42, 0xda, 0x1c, 0x78, 0x5d, 0xd3, 0xf5, 0x0d, 0xef, 0xc3, - 0xf3, 0xe6, 0x3e, 0x2f, 0x6c, 0x29, 0x05, 0x9a, 0x32, 0xa1, 0x13, 0xc0, 0xa9, 0x1c, 0xe4, 0x09, - 0x28, 0x3c, 0xc5, 0x29, 0xe3, 0x42, 0x33, 0x2e, 0x20, 0x53, 0x78, 0x9c, 0x43, 0xc6, 0x41, 0x59, - 0x19, 0x56, 0x90, 0x4d, 0x78, 0x1f, 0xd0, 0x28, 0x93, 0x5a, 0xfa, 0x87, 0x16, 0x03, 0x19, 0x06, - 0x9a, 0x22, 0x8b, 0x81, 0x0c, 0xc3, 0xca, 0x1a, 0xdb, 0x43, 0x29, 0x87, 0x09, 0x60, 0x36, 0xe2, - 0x98, 0x09, 0x21, 0x35, 0xd3, 0x5c, 0x0a, 0x55, 0x32, 0x1b, 0xed, 0x4a, 0x5e, 0x8b, 0xe8, 0xee, - 0x26, 0x83, 0x71, 0x0e, 0x4a, 0x1b, 0xd2, 0xc5, 0x5a, 0x24, 0x35, 0x92, 0x42, 0x99, 0xa1, 0xfb, - 0x1f, 0x8e, 0xb7, 0xd9, 0x5d, 0x7c, 0xf0, 0x5f, 0x1d, 0xaf, 0xde, 0x66, 0x62, 0x90, 0x80, 0x1f, - 0xa2, 0x2a, 0xf3, 0xd1, 0x92, 0x73, 0x59, 0x9a, 0x36, 0xce, 0xd6, 0x62, 0x94, 0x8e, 0x3b, 0xe8, - 0xfe, 0xf3, 0xe7, 0xd1, 0xdd, 0xf3, 0x77, 0x71, 0x6a, 0xc6, 0x5a, 0x13, 0x27, 0xcd, 0x1e, 0x68, - 0xd6, 0xb4, 0xb2, 0xf0, 0x69, 0xe3, 0xad, 0x08, 0x9c, 0x59, 0x11, 0x38, 0xdf, 0x45, 0xe0, 0x3c, - 0xcc, 0x83, 0xda, 0x6c, 0x1e, 0xd4, 0xbe, 0xe6, 0x41, 0xcd, 0x3b, 0xea, 0xcb, 0xb4, 0x92, 0x52, - 0xb8, 0x75, 0x55, 0x9e, 0x46, 0x67, 0xf1, 0xc3, 0x3a, 0xce, 0xf5, 0xc9, 0x90, 0xeb, 0xdb, 0xbc, - 0x87, 0xfa, 0x32, 0xc5, 0x55, 0x1e, 0xe2, 0xd9, 0xad, 0xb7, 0x68, 0x44, 0xbb, 0xf4, 0xc5, 0x5d, - 0x39, 0x33, 0x6a, 0x84, 0x22, 0x44, 0x2d, 0xa1, 0xae, 0x11, 0xfa, 0xcf, 0xde, 0x57, 0x6a, 0xb1, - 0xa9, 0xc5, 0x51, 0x6c, 0xd5, 0x62, 0x53, 0xb3, 0xb2, 0xc2, 0x3d, 0xad, 0x52, 0x8b, 0xcf, 0x3b, - 0x21, 0x05, 0xcd, 0x06, 0x4c, 0xb3, 0x5f, 0xf7, 0xd8, 0x42, 0x10, 0x62, 0x18, 0x84, 0x44, 0x84, - 0x58, 0x14, 0x42, 0x0c, 0xc6, 0x4e, 0x7b, 0xf5, 0xe5, 0xc1, 0x1d, 0xfc, 0x05, 0x00, 0x00, 0xff, - 0xff, 0xcc, 0x0e, 0xfc, 0x4f, 0x9f, 0x03, 0x00, 0x00, + // 322 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xb1, 0x4e, 0xf3, 0x30, + 0x14, 0x85, 0xe3, 0xfc, 0xfa, 0x3b, 0x44, 0x4c, 0x1d, 0x3b, 0x78, 0xe0, 0x01, 0x6c, 0x09, 0x18, + 0xc0, 0x0b, 0x34, 0x0c, 0x94, 0xc1, 0x52, 0x02, 0x4b, 0x84, 0x22, 0x21, 0x37, 0xb9, 0x82, 0x48, + 0x49, 0xdc, 0xc6, 0x0e, 0x2a, 0x6f, 0x81, 0xc4, 0xc4, 0xc0, 0xc2, 0xc8, 0x93, 0x20, 0xa6, 0x8e, + 0x8c, 0x28, 0xd9, 0x78, 0x0a, 0x94, 0xc6, 0x12, 0xee, 0x9a, 0xae, 0xc7, 0x3a, 0xdf, 0x39, 0xf7, + 0xfa, 0x7a, 0xfe, 0x54, 0x29, 0xd0, 0x5c, 0x94, 0x3a, 0x07, 0x5a, 0xc8, 0xb4, 0xce, 0x41, 0xd1, + 0x15, 0x2d, 0x44, 0x56, 0x6a, 0x91, 0x95, 0x50, 0x29, 0xba, 0xac, 0xa1, 0xca, 0x40, 0x59, 0x1a, + 0x55, 0x50, 0x3d, 0x64, 0x09, 0x90, 0x45, 0x25, 0xb5, 0x1c, 0x1f, 0x59, 0x0c, 0x62, 0x18, 0x64, + 0x45, 0x2c, 0x06, 0x31, 0x0c, 0x4b, 0x9b, 0xcc, 0x06, 0x25, 0x77, 0xd2, 0xe3, 0x6d, 0x05, 0xcb, + 0x1a, 0x94, 0xee, 0xf3, 0x27, 0x97, 0x3b, 0x91, 0xd4, 0x42, 0x96, 0xca, 0x8c, 0x72, 0xf0, 0x8a, + 0xbc, 0xff, 0x61, 0xf7, 0x30, 0x7e, 0x46, 0xde, 0x68, 0x26, 0xca, 0x34, 0x87, 0xb1, 0x4f, 0x86, + 0x0c, 0x48, 0x36, 0x9c, 0xab, 0xbe, 0xe9, 0xe4, 0x7c, 0x27, 0x46, 0xdf, 0x71, 0xdf, 0xf1, 0x5f, + 0xfe, 0x7d, 0x34, 0x18, 0xad, 0x1b, 0x8c, 0xbe, 0x1b, 0x8c, 0x9e, 0x5a, 0xec, 0xac, 0x5b, 0xec, + 0x7c, 0xb5, 0xd8, 0xf1, 0x8e, 0x13, 0x59, 0x0c, 0x0a, 0xf1, 0xf7, 0xae, 0xfb, 0xef, 0x0c, 0xba, + 0x15, 0x04, 0xe8, 0xe6, 0xf4, 0x2e, 0xd3, 0xf7, 0xf5, 0x9c, 0x24, 0xb2, 0xa0, 0x43, 0x56, 0xfb, + 0xe6, 0x8e, 0xa6, 0x3c, 0xe2, 0x21, 0x7f, 0x77, 0xb7, 0x4e, 0x83, 0x9b, 0x42, 0x11, 0xe1, 0x56, + 0xa1, 0xd0, 0x14, 0xfa, 0xd3, 0x3e, 0xb7, 0x6c, 0xb1, 0xb1, 0xc5, 0x51, 0x6c, 0xd9, 0x62, 0x63, + 0xb3, 0xb4, 0xc6, 0x3d, 0x1b, 0x62, 0x8b, 0x2f, 0x02, 0x9f, 0x83, 0x16, 0xa9, 0xd0, 0xe2, 0xc7, + 0x3d, 0xb1, 0x10, 0x8c, 0x19, 0x06, 0x63, 0x11, 0x63, 0x16, 0x85, 0x31, 0x83, 0xb1, 0xd5, 0xf9, + 0x68, 0x73, 0x42, 0x87, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x59, 0xcb, 0x51, 0x13, 0x53, 0x03, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/maintainers/queries/maintainer/service.pb.gw.go b/x/maintainers/queries/maintainer/service.pb.gw.go deleted file mode 100644 index 12689aa53..000000000 --- a/x/maintainers/queries/maintainer/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/maintainers/queries/maintainer/service.proto - -/* -Package maintainer is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package maintainer - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "maintainers", "v1beta1", "maintainer"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/maintainers/queries/maintainers/service.pb.go b/x/maintainers/queries/maintainers/service.pb.go index 71ab16b19..37d764696 100644 --- a/x/maintainers/queries/maintainers/service.pb.go +++ b/x/maintainers/queries/maintainers/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_67e152e12e117b6c = []byte{ - // 366 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x3f, 0x4b, 0xf3, 0x40, - 0x1c, 0xc7, 0x9b, 0x3c, 0x3c, 0x1d, 0xc2, 0x33, 0x65, 0x2c, 0x0f, 0x19, 0x5c, 0xc4, 0xe5, 0x8e, - 0x2a, 0x0e, 0xde, 0x64, 0x5b, 0xc1, 0x3f, 0x70, 0xd0, 0xea, 0x12, 0x24, 0x20, 0xd7, 0xf6, 0x47, - 0x3d, 0x48, 0xee, 0xda, 0xdc, 0xa5, 0xd4, 0xd5, 0x57, 0x20, 0xf8, 0x02, 0x04, 0x47, 0x5f, 0x87, - 0x83, 0x38, 0x48, 0xc1, 0xc5, 0x51, 0x52, 0x27, 0x5f, 0x85, 0xa4, 0xb9, 0xe1, 0xe2, 0x98, 0xae, - 0x9f, 0xe4, 0xfb, 0xe1, 0xfb, 0xfb, 0xdd, 0xcf, 0xeb, 0x75, 0x94, 0x02, 0x4d, 0x99, 0xd0, 0x31, - 0xe0, 0x44, 0x8e, 0xb3, 0x18, 0x14, 0x5e, 0xe0, 0x84, 0x71, 0xa1, 0x19, 0x17, 0x90, 0x2a, 0x3c, - 0xcb, 0x20, 0xe5, 0xa0, 0x2a, 0x4c, 0x41, 0x3a, 0xe7, 0x23, 0x40, 0xd3, 0x54, 0x6a, 0xe9, 0xef, - 0x5b, 0x12, 0x64, 0x24, 0x68, 0x81, 0xac, 0x00, 0x32, 0x12, 0x9b, 0xb5, 0xfe, 0x4f, 0xa4, 0x9c, - 0xc4, 0x80, 0xd9, 0x94, 0x63, 0x26, 0x84, 0xd4, 0x4c, 0x73, 0x29, 0x54, 0x29, 0x6d, 0x9d, 0xd6, - 0x6b, 0x56, 0xb0, 0x9b, 0xab, 0x14, 0x66, 0x19, 0x28, 0x6d, 0x54, 0x67, 0x9b, 0xa9, 0xd4, 0x54, - 0x0a, 0x65, 0x66, 0xdd, 0x7d, 0x73, 0xbc, 0xbf, 0x83, 0xe2, 0x83, 0xff, 0xec, 0x78, 0xcd, 0x13, - 0x26, 0xc6, 0x31, 0xf8, 0x3d, 0x54, 0x6b, 0x03, 0x68, 0x2d, 0x3a, 0x2f, 0xbb, 0xb6, 0x8e, 0x36, - 0x93, 0x94, 0x2d, 0xb7, 0xf0, 0xed, 0xfb, 0xd7, 0xbd, 0xbb, 0xe3, 0x6f, 0xe3, 0xc4, 0xcc, 0x6b, - 0x4d, 0x34, 0x6f, 0x0f, 0x41, 0xb3, 0xb6, 0xcd, 0xba, 0x0f, 0x7f, 0x5e, 0xf2, 0xc0, 0x59, 0xe6, - 0x81, 0xf3, 0x99, 0x07, 0xce, 0xdd, 0x2a, 0x68, 0x2c, 0x57, 0x41, 0xe3, 0x63, 0x15, 0x34, 0xbc, - 0x83, 0x91, 0x4c, 0xea, 0x95, 0xea, 0xfe, 0xbb, 0x28, 0x2f, 0xa4, 0x5f, 0x2c, 0xad, 0xef, 0x5c, - 0x1e, 0x4e, 0xb8, 0xbe, 0xce, 0x86, 0x68, 0x24, 0x13, 0x5c, 0xeb, 0x35, 0x1e, 0xdd, 0x66, 0x87, - 0x86, 0x74, 0x40, 0x9f, 0xdc, 0xca, 0xb9, 0x51, 0x53, 0x29, 0x44, 0xf4, 0xd7, 0x4e, 0x8a, 0x4a, - 0x16, 0x7b, 0xad, 0xe4, 0x22, 0x93, 0x8b, 0xc2, 0xc8, 0xfa, 0x27, 0x32, 0x39, 0x9b, 0xe5, 0x6e, - 0xa7, 0x56, 0x2e, 0x3a, 0xee, 0x77, 0x29, 0x68, 0x36, 0x66, 0x9a, 0x7d, 0xbb, 0xc4, 0x72, 0x10, - 0x62, 0x24, 0x84, 0x84, 0x84, 0x58, 0x11, 0x42, 0x8c, 0xa7, 0x42, 0x87, 0xcd, 0xf5, 0xe5, 0xed, - 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0x3f, 0x6e, 0xb6, 0x8c, 0xac, 0x03, 0x00, 0x00, + // 320 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x76, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4d, 0xcc, 0xcc, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, 0x2a, 0xd6, 0x2f, 0x2c, + 0x4d, 0x2d, 0xca, 0x4c, 0x2d, 0x46, 0x11, 0x2b, 0x4e, 0x2d, 0x2a, 0xcb, 0x4c, 0x4e, 0xd5, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x32, 0x45, 0x32, 0x44, 0x0f, 0x6a, 0x88, 0x5e, 0x85, 0x1e, 0x92, + 0x06, 0x3d, 0xa8, 0x21, 0xc8, 0x62, 0x52, 0x9e, 0xe4, 0xd9, 0x0d, 0x12, 0xab, 0x8c, 0x2f, 0x4a, + 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x81, 0xb8, 0x40, 0xca, 0x8b, 0x32, 0xa3, 0x8a, 0x0b, 0xf2, 0xf3, + 0x8a, 0xa1, 0xbe, 0x31, 0x9a, 0xcf, 0xc8, 0xc5, 0x1a, 0x08, 0x92, 0x10, 0x9a, 0xca, 0xc8, 0xc5, + 0xe6, 0x91, 0x98, 0x97, 0x92, 0x93, 0x2a, 0xe4, 0xac, 0x47, 0x96, 0x1f, 0xf5, 0xc0, 0x06, 0x05, + 0x41, 0xdc, 0x2a, 0xe5, 0x42, 0x99, 0x21, 0x10, 0x57, 0x2a, 0x31, 0x38, 0xcd, 0x67, 0x3e, 0xf1, + 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, + 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x06, 0x2e, 0xcb, 0xe4, 0xfc, 0x5c, 0xf2, 0x6c, 0x71, + 0xe2, 0x09, 0x86, 0x44, 0x6a, 0x00, 0x28, 0x14, 0x02, 0x18, 0xa3, 0x1c, 0xd2, 0x33, 0x4b, 0x32, + 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0xc9, 0x0a, 0xde, 0x45, 0x4c, 0x6c, 0x8e, 0xbe, 0x11, + 0xbe, 0x81, 0xbe, 0xab, 0x98, 0x50, 0x52, 0x88, 0x2f, 0xd4, 0x49, 0x11, 0x7a, 0xbe, 0x68, 0x9e, + 0x04, 0x39, 0x09, 0x49, 0xec, 0x14, 0x8a, 0xbe, 0x18, 0xa8, 0xbe, 0x98, 0x88, 0x18, 0x24, 0x35, + 0x31, 0x50, 0x7d, 0xc8, 0x62, 0x8f, 0x98, 0x1c, 0xc9, 0xd2, 0x17, 0xe3, 0x1e, 0xe0, 0xe4, 0x9b, + 0x5a, 0x92, 0x98, 0x92, 0x58, 0x92, 0xf8, 0x8a, 0xc9, 0x0a, 0xc9, 0x0c, 0x2b, 0x2b, 0xa8, 0x21, + 0x56, 0x56, 0x11, 0x56, 0x56, 0x48, 0x5a, 0xac, 0xac, 0xa0, 0xe6, 0xa0, 0x88, 0x26, 0xb1, 0x81, + 0x93, 0x92, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xe5, 0x11, 0x91, 0x5f, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/maintainers/queries/maintainers/service.pb.gw.go b/x/maintainers/queries/maintainers/service.pb.gw.go deleted file mode 100644 index ec517dff6..000000000 --- a/x/maintainers/queries/maintainers/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/maintainers/queries/maintainers/service.proto - -/* -Package maintainers is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package maintainers - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "maintainers", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/metas/queries/meta/service.pb.go b/x/metas/queries/meta/service.pb.go index 5b2f87e3f..c371ca6ba 100644 --- a/x/metas/queries/meta/service.pb.go +++ b/x/metas/queries/meta/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_aef7a6cab4cafd46 = []byte{ - // 355 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0xc7, 0x9b, 0x80, 0x1d, 0x82, 0x53, 0xc6, 0x50, 0x32, 0x74, 0x72, 0xd0, 0x3b, 0x6a, 0xa5, - 0xc2, 0xa1, 0x43, 0xbb, 0xe8, 0x72, 0xd0, 0xea, 0x12, 0x24, 0x20, 0xd7, 0xf6, 0x51, 0x03, 0xc9, - 0x5d, 0x9b, 0xbb, 0x94, 0xba, 0xfa, 0x09, 0x04, 0x67, 0x17, 0x17, 0xc1, 0x4f, 0x22, 0x4e, 0x15, - 0x17, 0x47, 0x49, 0x9c, 0xfc, 0x14, 0x92, 0xcb, 0x0d, 0xed, 0x96, 0x4e, 0xc7, 0x9f, 0xfb, 0xff, - 0xee, 0xff, 0xde, 0xbb, 0xe7, 0xf4, 0xfa, 0x52, 0x82, 0xa2, 0x8c, 0xab, 0x18, 0x70, 0x22, 0xa6, - 0x59, 0x0c, 0x12, 0xaf, 0x70, 0x02, 0x8a, 0x49, 0xbc, 0xc8, 0x20, 0x8d, 0x40, 0x6a, 0x85, 0x25, - 0xa4, 0xcb, 0x68, 0x02, 0x68, 0x9e, 0x0a, 0x25, 0xdc, 0x83, 0x0d, 0x0e, 0x19, 0x0e, 0xad, 0x90, - 0xe6, 0x90, 0xe1, 0xb4, 0xf2, 0x5a, 0x33, 0x21, 0x66, 0x31, 0x60, 0x36, 0x8f, 0x30, 0xe3, 0x5c, - 0x28, 0xa6, 0x22, 0xc1, 0x65, 0xf5, 0x8e, 0x77, 0x56, 0x3b, 0xbf, 0x14, 0xf7, 0xb7, 0x29, 0x2c, - 0x32, 0x90, 0xca, 0xd0, 0xe7, 0x3b, 0xd3, 0x72, 0x2e, 0xb8, 0x34, 0x4d, 0x1c, 0xbf, 0x5a, 0xce, - 0xde, 0xa8, 0xbc, 0x70, 0x9f, 0x2d, 0xa7, 0x79, 0xc9, 0xf8, 0x34, 0x06, 0xb7, 0x87, 0xea, 0xb6, - 0x86, 0x34, 0x7b, 0x55, 0x55, 0xe4, 0x9d, 0xee, 0xcc, 0x55, 0xb5, 0xb4, 0xdb, 0x0f, 0x5f, 0xbf, - 0x4f, 0x76, 0xcb, 0xf5, 0x70, 0x62, 0x1a, 0xd1, 0xe5, 0x2f, 0x3b, 0x63, 0x50, 0xac, 0xa3, 0xd5, - 0xe0, 0xd3, 0x7e, 0xcf, 0x7d, 0x6b, 0x9d, 0xfb, 0xd6, 0x4f, 0xee, 0x5b, 0x8f, 0x85, 0xdf, 0x58, - 0x17, 0x7e, 0xe3, 0xbb, 0xf0, 0x1b, 0xce, 0xe1, 0x44, 0x24, 0xb5, 0xa3, 0x07, 0xfb, 0xd7, 0xd5, - 0x37, 0x0e, 0xcb, 0x01, 0x0c, 0xad, 0x9b, 0xee, 0x2c, 0x52, 0x77, 0xd9, 0x18, 0x4d, 0x44, 0x82, - 0xeb, 0x0e, 0xf3, 0xc5, 0x6e, 0xf6, 0x69, 0x40, 0x47, 0xf4, 0xcd, 0xde, 0x5a, 0x03, 0x6a, 0x82, - 0x03, 0x44, 0x75, 0xf0, 0xc8, 0x04, 0x97, 0xea, 0x63, 0xcb, 0x1a, 0x1a, 0x6b, 0x18, 0x84, 0xda, - 0x1a, 0x1a, 0xab, 0x56, 0xb9, 0x7d, 0x52, 0xd7, 0x1a, 0x5e, 0x0c, 0x07, 0xe5, 0x39, 0x65, 0x8a, - 0xfd, 0xd9, 0x47, 0x1b, 0x18, 0x21, 0x86, 0x23, 0x24, 0x20, 0x44, 0x93, 0x84, 0x18, 0xb4, 0xd2, - 0xe3, 0xa6, 0x5e, 0x82, 0xee, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe4, 0xba, 0xbb, 0x45, 0x03, - 0x03, 0x00, 0x00, + // 309 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x73, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4d, 0x2d, 0x49, 0x2c, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, 0x06, + 0xf3, 0xf4, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, + 0x34, 0x90, 0xf4, 0xe9, 0x41, 0xf5, 0xe9, 0x55, 0xe8, 0x81, 0xf5, 0xe9, 0x41, 0xf5, 0x81, 0x79, + 0x52, 0x36, 0x44, 0xdb, 0x00, 0xe2, 0x54, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x40, + 0xec, 0x91, 0xb2, 0x25, 0x59, 0x77, 0x71, 0x41, 0x7e, 0x5e, 0x31, 0xd4, 0x99, 0x46, 0x2d, 0x8c, + 0x5c, 0xac, 0x81, 0x20, 0x09, 0xa1, 0x6a, 0x2e, 0x36, 0x8f, 0xc4, 0xbc, 0x94, 0x9c, 0x54, 0x21, + 0x33, 0x3d, 0x62, 0xdd, 0xae, 0x07, 0xd6, 0x1a, 0x04, 0x71, 0x90, 0x94, 0x39, 0xc9, 0xfa, 0x20, + 0x4e, 0x51, 0x62, 0x70, 0xba, 0xc8, 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, + 0x5c, 0x3a, 0xc9, 0xf9, 0xb9, 0x44, 0x1b, 0xec, 0xc4, 0x13, 0x0c, 0x89, 0x85, 0x00, 0x90, 0xef, + 0x02, 0x18, 0xa3, 0x8c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x89, + 0x0d, 0xa9, 0x45, 0x4c, 0x6c, 0x8e, 0xbe, 0x11, 0xbe, 0x81, 0xbe, 0xab, 0x98, 0x50, 0x62, 0xd1, + 0x17, 0x6a, 0x71, 0x84, 0x9e, 0x2f, 0xd8, 0xe2, 0x40, 0xa8, 0xc5, 0x20, 0xde, 0x29, 0x14, 0xa5, + 0x31, 0x50, 0xa5, 0x31, 0x11, 0x31, 0x60, 0xa5, 0x31, 0x50, 0xa5, 0x60, 0xde, 0x23, 0x26, 0x13, + 0x62, 0x95, 0xc6, 0xb8, 0x07, 0x38, 0x81, 0xe8, 0x94, 0xc4, 0x92, 0xc4, 0x57, 0x4c, 0xba, 0x48, + 0xda, 0xac, 0xac, 0xa0, 0xfa, 0xac, 0xac, 0x22, 0xac, 0xac, 0xc0, 0x3a, 0xad, 0xac, 0xa0, 0x5a, + 0x21, 0xfc, 0x24, 0x36, 0x70, 0x0c, 0x1b, 0x03, 0x02, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xd1, 0x6c, + 0xa3, 0xc2, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/metas/queries/meta/service.pb.gw.go b/x/metas/queries/meta/service.pb.gw.go deleted file mode 100644 index d449a9311..000000000 --- a/x/metas/queries/meta/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/metas/queries/meta/service.proto - -/* -Package meta is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package meta - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "metas", "v1beta1", "meta"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/metas/queries/metas/service.pb.go b/x/metas/queries/metas/service.pb.go index 8aba58ace..2c19abae4 100644 --- a/x/metas/queries/metas/service.pb.go +++ b/x/metas/queries/metas/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_b733e355d827f495 = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xcf, 0x4a, 0xf3, 0x40, - 0x14, 0xc5, 0x9b, 0xc0, 0xd7, 0x45, 0xf8, 0x56, 0x59, 0x56, 0xcd, 0x42, 0x57, 0x2e, 0x9c, 0xa1, - 0xfe, 0xa1, 0x32, 0xa0, 0xd0, 0x6e, 0x74, 0x13, 0x68, 0x75, 0x13, 0x24, 0x20, 0xd3, 0xf6, 0x52, - 0x03, 0x49, 0xa6, 0xcd, 0x4c, 0x4a, 0xdd, 0xfa, 0x04, 0x82, 0x2f, 0x20, 0x2e, 0xfb, 0x24, 0xe2, - 0xaa, 0xe0, 0x42, 0x97, 0x92, 0xba, 0xf2, 0x29, 0x24, 0x33, 0x17, 0x69, 0x77, 0xe9, 0x2e, 0x87, - 0x39, 0xbf, 0xdc, 0x73, 0xee, 0x8c, 0xd3, 0x6a, 0x4b, 0x09, 0xca, 0xe7, 0xa9, 0x8a, 0x81, 0x26, - 0x62, 0x98, 0xc7, 0x20, 0xe9, 0x8c, 0x26, 0xa0, 0xb8, 0xa4, 0x93, 0x1c, 0xb2, 0x08, 0x24, 0x2a, - 0x09, 0xd9, 0x34, 0x1a, 0x00, 0x19, 0x67, 0x42, 0x09, 0x77, 0x7f, 0x05, 0x24, 0x08, 0x92, 0x19, - 0xd1, 0x56, 0x82, 0xa0, 0x51, 0x8d, 0xed, 0x91, 0x10, 0xa3, 0x18, 0x28, 0x1f, 0x47, 0x94, 0xa7, - 0xa9, 0x50, 0x5c, 0x45, 0x22, 0x95, 0xe6, 0x47, 0x8d, 0xb3, 0xea, 0x09, 0x4a, 0x75, 0x7f, 0x9b, - 0xc1, 0x24, 0x07, 0xa9, 0x10, 0x3f, 0xdf, 0x1c, 0x97, 0x63, 0x91, 0x4a, 0xec, 0x71, 0x38, 0xb7, - 0x9c, 0x7f, 0xbd, 0xf2, 0xc0, 0x7d, 0xb6, 0x9c, 0xfa, 0x25, 0x4f, 0x87, 0x31, 0xb8, 0x2d, 0x52, - 0xb9, 0x1d, 0xd1, 0xf0, 0x95, 0xc9, 0xd4, 0x38, 0xdd, 0x1c, 0x34, 0x69, 0x76, 0xf7, 0x1e, 0xde, - 0xbf, 0x9f, 0xec, 0x1d, 0x77, 0x8b, 0x26, 0xd8, 0x45, 0x67, 0x9e, 0x36, 0xfb, 0xa0, 0x78, 0xd3, - 0xa8, 0xce, 0x87, 0xfd, 0x5a, 0x78, 0xd6, 0xa2, 0xf0, 0xac, 0xaf, 0xc2, 0xb3, 0x1e, 0x97, 0x5e, - 0x6d, 0xb1, 0xf4, 0x6a, 0x9f, 0x4b, 0xaf, 0xe6, 0x1c, 0x0c, 0x44, 0x52, 0x7d, 0x78, 0xe7, 0xff, - 0xb5, 0xb9, 0xcd, 0x6e, 0xb9, 0x84, 0xae, 0x75, 0x73, 0x3c, 0x8a, 0xd4, 0x5d, 0xde, 0x27, 0x03, - 0x91, 0xd0, 0xca, 0x1b, 0x7d, 0xb1, 0xeb, 0x6d, 0x3f, 0xf0, 0x7b, 0xfe, 0xdc, 0x5e, 0x7b, 0x0e, - 0x3e, 0x8e, 0x0e, 0x88, 0xff, 0xd7, 0xb4, 0x1c, 0xad, 0xd5, 0xdb, 0x9a, 0x37, 0x44, 0x6f, 0x18, - 0x84, 0xfa, 0x34, 0x44, 0xaf, 0x51, 0x85, 0x7d, 0x52, 0xd9, 0x1b, 0x5e, 0x74, 0x3b, 0xe5, 0xc7, - 0x90, 0x2b, 0xfe, 0x63, 0xaf, 0xae, 0x82, 0x31, 0x04, 0x19, 0x0b, 0x18, 0xd3, 0x66, 0xc6, 0x90, - 0x45, 0xdd, 0xaf, 0xeb, 0xd7, 0x70, 0xf4, 0x1b, 0x00, 0x00, 0xff, 0xff, 0x71, 0x48, 0xe6, 0xa0, - 0x10, 0x03, 0x00, 0x00, + // 306 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x32, 0x77, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4d, 0x2d, 0x49, 0x2c, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, 0x86, + 0xf2, 0x8a, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0x34, + 0x91, 0x34, 0xea, 0x41, 0x35, 0xea, 0x55, 0xe8, 0x81, 0x95, 0xea, 0x41, 0x35, 0x42, 0x78, 0x52, + 0xb6, 0xc4, 0xdb, 0x01, 0xe2, 0x55, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x40, 0x6c, + 0x92, 0xb2, 0x23, 0x5d, 0x7b, 0x71, 0x41, 0x7e, 0x5e, 0x31, 0xd4, 0xa5, 0x46, 0x6d, 0x8c, 0x5c, + 0xac, 0x81, 0x20, 0x09, 0xa1, 0x5a, 0x2e, 0x36, 0x8f, 0xc4, 0xbc, 0x94, 0x9c, 0x54, 0x21, 0x73, + 0x3d, 0xa2, 0x9d, 0xaf, 0x07, 0xd6, 0x1b, 0x04, 0x71, 0x92, 0x94, 0x05, 0xe9, 0x1a, 0x21, 0x8e, + 0x51, 0x62, 0x70, 0xba, 0xce, 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, 0x5c, + 0xba, 0xc9, 0xf9, 0xb9, 0xc4, 0x9b, 0xec, 0xc4, 0x13, 0x0c, 0x89, 0x8b, 0x00, 0x90, 0x07, 0x03, + 0x18, 0xa3, 0x4c, 0xd2, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x89, 0x0e, + 0xad, 0x45, 0x4c, 0x6c, 0x8e, 0xbe, 0x11, 0xbe, 0x81, 0xbe, 0xab, 0x98, 0x50, 0x22, 0xd3, 0x17, + 0x6a, 0x75, 0x84, 0x9e, 0x2f, 0xdc, 0x1b, 0x20, 0xab, 0xc1, 0xbc, 0x53, 0x28, 0x6a, 0x63, 0xa0, + 0x6a, 0x63, 0x22, 0x62, 0xc0, 0xb2, 0x31, 0x50, 0xb5, 0x10, 0xde, 0x23, 0x26, 0x53, 0xa2, 0xd5, + 0xc6, 0xb8, 0x07, 0x38, 0x81, 0x18, 0x29, 0x89, 0x25, 0x89, 0xaf, 0x98, 0x90, 0x83, 0xc2, 0xca, + 0x0a, 0xaa, 0xd1, 0xca, 0x2a, 0xc2, 0xca, 0x0a, 0xac, 0xd8, 0xca, 0x0a, 0xaa, 0x17, 0xca, 0x4f, + 0x62, 0x03, 0xc7, 0xb4, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x8e, 0x19, 0xd1, 0xd2, 0xce, 0x02, + 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/metas/queries/metas/service.pb.gw.go b/x/metas/queries/metas/service.pb.gw.go deleted file mode 100644 index 34425014e..000000000 --- a/x/metas/queries/metas/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/metas/queries/metas/service.proto - -/* -Package metas is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package metas - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "metas", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/metas/transactions/reveal/service.pb.go b/x/metas/transactions/reveal/service.pb.go index 6ec7bba91..9f1ae312c 100644 --- a/x/metas/transactions/reveal/service.pb.go +++ b/x/metas/transactions/reveal/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_afd3f92ba94b138a = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0x2f, 0x6f, 0x87, 0xe0, 0xd4, 0x45, 0x08, 0x92, 0xc1, 0xd1, 0xe1, 0x0e, - 0xad, 0x83, 0x9c, 0x38, 0xb4, 0x08, 0x8a, 0x10, 0x28, 0xb5, 0x43, 0x90, 0x80, 0x5c, 0xd3, 0x23, - 0x06, 0x72, 0x77, 0x25, 0xcf, 0xb5, 0x74, 0x74, 0x76, 0x72, 0x75, 0x75, 0x74, 0xf2, 0x63, 0x88, - 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0xaf, 0xe0, 0x22, 0xcd, 0x1d, 0x78, 0x1d, 0x6f, 0x0a, 0xdc, - 0xf1, 0xfb, 0xe7, 0x9f, 0x27, 0x4f, 0x78, 0xd6, 0x07, 0x60, 0x2a, 0xa1, 0x42, 0x55, 0x0c, 0x73, - 0x39, 0x9d, 0x57, 0x0c, 0xf0, 0x12, 0x73, 0xa6, 0x28, 0x60, 0x55, 0x53, 0x01, 0x34, 0x57, 0xa5, - 0x14, 0x80, 0x6b, 0xb6, 0x60, 0xb4, 0xc2, 0xc0, 0xea, 0x45, 0x99, 0x33, 0x34, 0xab, 0xa5, 0x92, - 0x5d, 0x6c, 0x71, 0x64, 0x38, 0x5a, 0xa2, 0x96, 0x23, 0x9b, 0x23, 0xcd, 0xa3, 0xdd, 0x5c, 0x02, - 0x97, 0x80, 0x39, 0x14, 0x78, 0x71, 0xb8, 0x79, 0xe8, 0xa4, 0x68, 0xaf, 0x90, 0xb2, 0xa8, 0x18, - 0xa6, 0xb3, 0x12, 0x53, 0x21, 0xa4, 0xa2, 0xda, 0xe9, 0x5b, 0xe7, 0x9a, 0x9c, 0x01, 0xd0, 0xc2, - 0xd4, 0x8c, 0xae, 0x5c, 0xb9, 0x75, 0x76, 0x5b, 0x33, 0x98, 0x49, 0x01, 0x26, 0xeb, 0xe8, 0xc9, - 0x0f, 0xff, 0x25, 0x50, 0x74, 0x1f, 0xfc, 0xb0, 0x73, 0x49, 0xc5, 0xb4, 0x62, 0xdd, 0x13, 0xe4, - 0x38, 0x06, 0x94, 0xe8, 0x7a, 0xd1, 0xb9, 0xb3, 0x1c, 0xff, 0x9d, 0x8d, 0x4c, 0xb1, 0x7d, 0x2f, - 0xfa, 0x7f, 0xff, 0xf5, 0x7a, 0xe0, 0x0f, 0x7e, 0x82, 0xb7, 0x26, 0xf6, 0x57, 0x4d, 0xec, 0x7f, - 0x36, 0xb1, 0xff, 0xb8, 0x8e, 0xbd, 0xd5, 0x3a, 0xf6, 0x3e, 0xd6, 0xb1, 0x17, 0xf6, 0x72, 0xc9, - 0x5d, 0x5f, 0x36, 0xd8, 0xb9, 0xd6, 0x7f, 0x7b, 0xb8, 0xf9, 0xf2, 0xa1, 0x7f, 0x43, 0x8a, 0x52, - 0xdd, 0xcd, 0x27, 0x28, 0x97, 0x1c, 0x3b, 0x8e, 0xf4, 0x39, 0xe8, 0xf4, 0x93, 0x34, 0x19, 0x8f, - 0x5e, 0x82, 0xad, 0xa5, 0x49, 0x4c, 0x8d, 0x14, 0x25, 0x6d, 0x8d, 0xb1, 0x5d, 0x63, 0xd4, 0xd2, - 0xf7, 0x2d, 0x91, 0x19, 0x91, 0xa5, 0x59, 0x2b, 0x32, 0x5b, 0x64, 0x5a, 0x34, 0xc1, 0xa9, 0xa3, - 0xc8, 0x2e, 0x86, 0x83, 0xcd, 0xe5, 0x94, 0x2a, 0xfa, 0x1d, 0x1c, 0x5b, 0x9a, 0x10, 0xc3, 0x09, - 0x49, 0x09, 0x69, 0x03, 0x08, 0xb1, 0x13, 0x08, 0xd1, 0x11, 0x93, 0x4e, 0xbb, 0x20, 0xbd, 0xdf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x08, 0x58, 0x33, 0x4f, 0x54, 0x03, 0x00, 0x00, + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x5c, 0xc4, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x1d, 0x5a, + 0x07, 0x39, 0x71, 0x68, 0x11, 0x14, 0xe1, 0xa0, 0xd4, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8f, 0x58, + 0xc8, 0xe5, 0x4a, 0xde, 0xb5, 0x74, 0x74, 0x76, 0x72, 0x75, 0x75, 0x74, 0xf2, 0x63, 0x88, 0x53, + 0x47, 0x47, 0x49, 0x07, 0xc1, 0xaf, 0xe0, 0x22, 0x49, 0x0e, 0xbc, 0x8e, 0x37, 0x05, 0x2e, 0xfc, + 0xfe, 0xf9, 0xbf, 0xdc, 0x0b, 0xce, 0xfb, 0x00, 0x42, 0x33, 0x5e, 0xe8, 0x5c, 0x10, 0xa9, 0xa6, + 0x8b, 0x5c, 0x00, 0x59, 0x11, 0x29, 0x34, 0x07, 0xa2, 0x4b, 0x5e, 0x00, 0x4f, 0xf5, 0x4c, 0x15, + 0x40, 0x4a, 0xb1, 0x14, 0x3c, 0x27, 0x20, 0xca, 0xe5, 0x2c, 0x15, 0x78, 0x5e, 0x2a, 0xad, 0xba, + 0xc4, 0xe2, 0xd8, 0x70, 0xbc, 0xc2, 0x0d, 0xc7, 0x36, 0xc7, 0x2d, 0x0f, 0xf7, 0x53, 0x05, 0x52, + 0x01, 0x91, 0x90, 0x91, 0xe5, 0x51, 0xfd, 0x68, 0x93, 0x42, 0xe7, 0x22, 0x52, 0x00, 0xf0, 0xcc, + 0x14, 0x09, 0xaf, 0x5d, 0xb9, 0x75, 0x76, 0x57, 0x0a, 0x98, 0xab, 0x02, 0x4c, 0xd6, 0xf1, 0x33, + 0x0a, 0x76, 0x18, 0x64, 0xdd, 0x47, 0x14, 0x74, 0xae, 0x78, 0x31, 0xcd, 0x45, 0xf7, 0x14, 0x3b, + 0x0e, 0x8a, 0x59, 0x5b, 0x2f, 0xbc, 0x70, 0x96, 0xe3, 0xff, 0xb3, 0x91, 0x29, 0x76, 0xe0, 0x85, + 0xbb, 0x0f, 0xdf, 0x6f, 0x87, 0x68, 0xf0, 0xeb, 0xbf, 0x57, 0x11, 0x5a, 0x57, 0x11, 0xfa, 0xaa, + 0x22, 0xf4, 0xb4, 0x89, 0xbc, 0xf5, 0x26, 0xf2, 0x3e, 0x37, 0x91, 0x17, 0xf4, 0x52, 0x25, 0x5d, + 0x3f, 0x36, 0xd8, 0xbb, 0x69, 0xef, 0x73, 0x58, 0x4f, 0x3e, 0x44, 0xb7, 0x34, 0x9b, 0xe9, 0xfb, + 0xc5, 0x04, 0xa7, 0x4a, 0x12, 0xc7, 0x5f, 0xfa, 0xe2, 0x77, 0xfa, 0x2c, 0x66, 0xe3, 0xd1, 0xab, + 0xbf, 0xb5, 0x16, 0xcc, 0xd4, 0x88, 0x31, 0x6b, 0x6a, 0x8c, 0xed, 0x1a, 0xa3, 0x86, 0x7e, 0x6c, + 0x89, 0xc4, 0x88, 0x24, 0x4e, 0x1a, 0x91, 0xd8, 0x22, 0x69, 0x45, 0xe5, 0x9f, 0x39, 0x8a, 0xe4, + 0x72, 0x38, 0xa8, 0x5f, 0x4e, 0xb9, 0xe6, 0x3f, 0xfe, 0x89, 0xa5, 0x29, 0x35, 0x9c, 0xd2, 0x98, + 0xd2, 0x26, 0x80, 0x52, 0x3b, 0x81, 0xd2, 0x36, 0x62, 0xd2, 0x69, 0x16, 0xa4, 0xf7, 0x17, 0x00, + 0x00, 0xff, 0xff, 0x5e, 0x91, 0xda, 0x02, 0x36, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/metas/transactions/reveal/service.pb.gw.go b/x/metas/transactions/reveal/service.pb.gw.go deleted file mode 100644 index c1f032e62..000000000 --- a/x/metas/transactions/reveal/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/metas/transactions/reveal/service.proto - -/* -Package reveal is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package reveal - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "metas", "reveal"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/queries/order/service.pb.go b/x/orders/queries/order/service.pb.go index 7ddbb9a12..4488fa888 100644 --- a/x/orders/queries/order/service.pb.go +++ b/x/orders/queries/order/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_c8a16121f34d51bd = []byte{ - // 356 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x18, 0x86, 0x9b, 0x80, 0x1d, 0x82, 0x53, 0xc6, 0x52, 0x6e, 0x10, 0x27, 0x87, 0x3b, 0xaa, 0x28, - 0xf5, 0x06, 0xa5, 0x5d, 0x74, 0x09, 0x6d, 0x75, 0x09, 0x12, 0x90, 0x6b, 0xf3, 0x51, 0x03, 0x69, - 0xae, 0xcd, 0x5d, 0x4a, 0x5d, 0xfd, 0x05, 0x82, 0xff, 0x40, 0x37, 0xc1, 0xff, 0x21, 0x4e, 0x05, - 0x17, 0x17, 0x41, 0x52, 0x27, 0x7f, 0x85, 0xa4, 0xdf, 0x0d, 0xed, 0x96, 0x76, 0x7c, 0x93, 0xf7, - 0xb9, 0xf7, 0x7b, 0xef, 0x3e, 0xa7, 0xd9, 0x52, 0x0a, 0xb4, 0x27, 0x12, 0x1d, 0x03, 0x1b, 0xc9, - 0x30, 0x8b, 0x41, 0xb1, 0x19, 0x93, 0x69, 0x08, 0xa9, 0x62, 0x93, 0x0c, 0xd2, 0x08, 0x14, 0x4a, - 0xa6, 0x20, 0x9d, 0x46, 0x03, 0xa0, 0xe3, 0x54, 0x6a, 0xe9, 0x1e, 0xac, 0x90, 0xd4, 0x90, 0x74, - 0x46, 0x91, 0xa4, 0x86, 0x44, 0x59, 0xab, 0x0f, 0xa5, 0x1c, 0xc6, 0xc0, 0xc4, 0x38, 0x62, 0x22, - 0x49, 0xa4, 0x16, 0x3a, 0x92, 0x89, 0xc2, 0x93, 0x6a, 0x67, 0x1b, 0xcc, 0x50, 0xa8, 0xfb, 0xdb, - 0x14, 0x26, 0x19, 0x28, 0x6d, 0xf8, 0xf3, 0x2d, 0x78, 0x35, 0x96, 0x89, 0x32, 0x55, 0x0e, 0xdf, - 0x2c, 0x67, 0xa7, 0x57, 0xfc, 0x70, 0x5f, 0x2c, 0xa7, 0x7a, 0x29, 0x92, 0x30, 0x06, 0xb7, 0x49, - 0xcb, 0x17, 0xa4, 0x4b, 0xfa, 0x0a, 0xa7, 0xaa, 0x9d, 0x6e, 0x41, 0xe2, 0x3c, 0x7b, 0xfb, 0x0f, - 0x9f, 0xbf, 0x4f, 0x36, 0x71, 0xeb, 0x6c, 0x84, 0x75, 0x4c, 0x89, 0x69, 0xa3, 0x0f, 0x5a, 0x34, - 0x50, 0xb6, 0xbf, 0xed, 0xf7, 0x9c, 0x58, 0xf3, 0x9c, 0x58, 0x3f, 0x39, 0xb1, 0x1e, 0x17, 0xa4, - 0x32, 0x5f, 0x90, 0xca, 0xd7, 0x82, 0x54, 0x1c, 0x3a, 0x90, 0xa3, 0x0d, 0xe2, 0xdb, 0xbb, 0xd7, - 0xf8, 0xa8, 0xdd, 0xe2, 0x22, 0xba, 0xd6, 0xcd, 0xf1, 0x30, 0xd2, 0x77, 0x59, 0xbf, 0x38, 0x86, - 0x95, 0xbf, 0xd6, 0x67, 0xbb, 0xda, 0xf2, 0xfc, 0x4e, 0xaf, 0xf3, 0x6a, 0xaf, 0xad, 0x85, 0x67, - 0xc2, 0x7d, 0xda, 0xc1, 0xf0, 0x9e, 0x09, 0x5f, 0xca, 0x8f, 0x35, 0x73, 0x60, 0xcc, 0x81, 0x1f, - 0xa0, 0x39, 0x30, 0x66, 0x94, 0xb9, 0x7d, 0x52, 0xde, 0x1c, 0x5c, 0x74, 0xdb, 0x1e, 0x68, 0x11, - 0x0a, 0x2d, 0xfe, 0xec, 0xd5, 0x22, 0x9c, 0x1b, 0x92, 0x73, 0x9f, 0x73, 0x64, 0x39, 0x37, 0xb0, - 0xf9, 0xd0, 0xaf, 0x2e, 0xd7, 0xe2, 0xe8, 0x3f, 0x00, 0x00, 0xff, 0xff, 0x4a, 0xfa, 0x7c, 0x1a, - 0x1d, 0x03, 0x00, 0x00, + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x70, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x2f, 0x4a, 0x49, 0x2d, 0x2a, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, + 0x86, 0x70, 0xf5, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, + 0x85, 0xb4, 0x90, 0x74, 0xea, 0x41, 0x75, 0xea, 0x55, 0xe8, 0x41, 0x74, 0xea, 0x41, 0x75, 0x42, + 0xb8, 0x52, 0x76, 0x24, 0xd8, 0x02, 0xe2, 0x55, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, + 0x40, 0xec, 0x92, 0xb2, 0x27, 0x43, 0x7f, 0x71, 0x41, 0x7e, 0x5e, 0x31, 0xd4, 0xb1, 0x46, 0x1d, + 0x8c, 0x5c, 0xac, 0x81, 0x20, 0x09, 0xa1, 0x7a, 0x2e, 0x36, 0x8f, 0xc4, 0xbc, 0x94, 0x9c, 0x54, + 0x21, 0x0b, 0x3d, 0xe2, 0x7d, 0xa0, 0x07, 0xd6, 0x1c, 0x04, 0x71, 0x94, 0x94, 0x25, 0x19, 0x3a, + 0x21, 0xce, 0x51, 0x62, 0x70, 0xba, 0xcb, 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, 0x5c, 0x7a, 0xc9, 0xf9, 0xb9, 0x24, 0x18, 0xed, 0xc4, 0x13, 0x0c, 0x89, 0x91, 0x00, 0x90, + 0x1f, 0x03, 0x18, 0xa3, 0x4c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0x40, 0xc6, 0xe8, 0x13, 0x1f, + 0x62, 0x8b, 0x98, 0xd8, 0x1c, 0x7d, 0x23, 0xfc, 0x03, 0xfd, 0x57, 0x31, 0xa1, 0xc4, 0xa9, 0x2f, + 0xd4, 0xf2, 0x08, 0x3d, 0x7f, 0x88, 0xe5, 0x81, 0x50, 0xcb, 0xc1, 0xdc, 0x53, 0x28, 0x8a, 0x63, + 0xa0, 0x8a, 0x63, 0x22, 0x62, 0x20, 0x8a, 0x63, 0xa0, 0x8a, 0x21, 0xdc, 0x47, 0x4c, 0x66, 0xc4, + 0x2b, 0x8e, 0x71, 0x0f, 0x70, 0xf2, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x7c, 0xc5, 0x84, + 0xec, 0x11, 0x2b, 0x2b, 0xa8, 0x4e, 0x2b, 0xab, 0x08, 0x2b, 0x2b, 0x88, 0x5e, 0x2b, 0x2b, 0xa8, + 0x66, 0xa8, 0x40, 0x12, 0x1b, 0x38, 0xc6, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd6, 0xc4, + 0x0f, 0x9d, 0xda, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/queries/order/service.pb.gw.go b/x/orders/queries/order/service.pb.gw.go deleted file mode 100644 index 10e34b17a..000000000 --- a/x/orders/queries/order/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/queries/order/service.proto - -/* -Package order is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package order - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "orders", "v1beta1", "order"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/queries/orders/service.pb.go b/x/orders/queries/orders/service.pb.go index 8ea65c4c2..8bbcfdd55 100644 --- a/x/orders/queries/orders/service.pb.go +++ b/x/orders/queries/orders/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_53678e05903a1112 = []byte{ - // 359 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xfb, 0x40, - 0x18, 0xc6, 0x9b, 0xc0, 0xbf, 0x43, 0xf8, 0x4f, 0x19, 0x8b, 0x46, 0x10, 0x9c, 0x84, 0x3b, 0xab, - 0xa0, 0xf4, 0x16, 0x6d, 0x17, 0x5d, 0x42, 0x5b, 0x5d, 0x82, 0x04, 0xe4, 0xda, 0xbc, 0xd4, 0x40, - 0x92, 0x6b, 0x73, 0x97, 0x52, 0x57, 0x3f, 0x81, 0xe0, 0x37, 0x70, 0x70, 0x70, 0xf2, 0x63, 0x88, - 0x53, 0xc1, 0xc5, 0x51, 0x12, 0x27, 0x3f, 0x85, 0xa4, 0xf7, 0x16, 0xdb, 0x31, 0x1d, 0x9f, 0xdc, - 0xf3, 0x7b, 0xef, 0x79, 0x2e, 0xaf, 0xd5, 0x6a, 0x4b, 0x09, 0xca, 0xe5, 0x89, 0x8a, 0x80, 0xc6, - 0x22, 0xc8, 0x22, 0x90, 0x74, 0x46, 0x45, 0x1a, 0x40, 0x2a, 0xe9, 0x24, 0x83, 0x34, 0x04, 0xb9, - 0x94, 0x12, 0xd2, 0x69, 0x38, 0x04, 0x32, 0x4e, 0x85, 0x12, 0xf6, 0xfe, 0x0a, 0x4a, 0x10, 0x25, - 0x33, 0xa2, 0xbd, 0x04, 0x51, 0x94, 0x8d, 0xad, 0x91, 0x10, 0xa3, 0x08, 0x28, 0x1f, 0x87, 0x94, - 0x27, 0x89, 0x50, 0x5c, 0x85, 0x22, 0x91, 0x7a, 0x54, 0xe3, 0xb4, 0x4a, 0x8a, 0x52, 0xde, 0xdd, - 0xa4, 0x30, 0xc9, 0x40, 0x2a, 0x1c, 0x70, 0xb6, 0xc9, 0x00, 0x39, 0x16, 0x89, 0xc4, 0x36, 0x87, - 0xaf, 0x86, 0xf5, 0xaf, 0x5f, 0x1e, 0xd8, 0xcf, 0x86, 0x55, 0xbf, 0xe0, 0x49, 0x10, 0x81, 0xdd, - 0x22, 0x15, 0x3a, 0x92, 0x05, 0x7e, 0xa9, 0x73, 0x35, 0xd8, 0x26, 0xa8, 0x4e, 0xb4, 0xbb, 0x77, - 0xff, 0xf1, 0xfd, 0x68, 0xee, 0xd8, 0xdb, 0x34, 0xd6, 0x8d, 0x30, 0xf8, 0xb4, 0x39, 0x00, 0xc5, - 0x9b, 0x28, 0x3b, 0x85, 0xf9, 0x96, 0x3b, 0xc6, 0x3c, 0x77, 0x8c, 0xaf, 0xdc, 0x31, 0x1e, 0x0a, - 0xa7, 0x36, 0x2f, 0x9c, 0xda, 0x67, 0xe1, 0xd4, 0x2c, 0x3a, 0x14, 0x71, 0x95, 0x00, 0x9d, 0xff, - 0x57, 0xfa, 0xdf, 0xf6, 0xca, 0xc7, 0xe8, 0x19, 0xd7, 0xc7, 0xa3, 0x50, 0xdd, 0x66, 0x03, 0x32, - 0x14, 0x31, 0xad, 0xf0, 0xb6, 0x4f, 0x66, 0xbd, 0xed, 0x7a, 0xdd, 0x7e, 0xf7, 0xc5, 0x5c, 0x5b, - 0x0f, 0x17, 0xaf, 0xf7, 0x48, 0xf7, 0xaf, 0x70, 0x79, 0xbd, 0x96, 0xef, 0x6b, 0x6e, 0x1f, 0xdd, - 0xbe, 0xe7, 0xeb, 0x63, 0x1f, 0xdd, 0x28, 0x73, 0xf3, 0xa4, 0x82, 0xdb, 0x3f, 0xef, 0x75, 0x5c, - 0x50, 0x3c, 0xe0, 0x8a, 0xff, 0x98, 0x07, 0x2b, 0x24, 0x63, 0x88, 0x32, 0xe6, 0x31, 0xa6, 0xdd, - 0x8c, 0x21, 0xbd, 0xfc, 0x30, 0xa8, 0x2f, 0xf6, 0xe3, 0xe8, 0x37, 0x00, 0x00, 0xff, 0xff, 0x20, - 0x3d, 0x75, 0x59, 0x2a, 0x03, 0x00, 0x00, + // 312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x74, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x2f, 0x4a, 0x49, 0x2d, 0x2a, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, + 0x86, 0x71, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, + 0xb4, 0x91, 0xb4, 0xea, 0x41, 0xb5, 0xea, 0x55, 0xe8, 0x41, 0xd4, 0xea, 0x41, 0xb5, 0x42, 0xb9, + 0x52, 0xf6, 0xa4, 0xd8, 0x03, 0xe2, 0x56, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x40, + 0x6c, 0x93, 0x72, 0x20, 0xc7, 0x80, 0xe2, 0x82, 0xfc, 0xbc, 0x62, 0xa8, 0x7b, 0x8d, 0xba, 0x19, + 0xb9, 0x58, 0x03, 0x41, 0x12, 0x42, 0x8d, 0x8c, 0x5c, 0x6c, 0x1e, 0x89, 0x79, 0x29, 0x39, 0xa9, + 0x42, 0x96, 0x7a, 0x24, 0xf8, 0x42, 0x0f, 0xac, 0x3d, 0x08, 0xe2, 0x2e, 0x29, 0x2b, 0x72, 0xb4, + 0x42, 0x5c, 0xa4, 0xc4, 0xe0, 0xf4, 0x98, 0xe9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, + 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, + 0x18, 0xb8, 0xf4, 0x93, 0xf3, 0x73, 0x49, 0x31, 0xdb, 0x89, 0x27, 0x18, 0x12, 0x31, 0x01, 0x20, + 0x7f, 0x06, 0x30, 0x46, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, + 0x93, 0x10, 0x6c, 0x8b, 0x98, 0xd8, 0x1c, 0x7d, 0x23, 0xfc, 0x03, 0xfd, 0x57, 0x31, 0xa1, 0xc4, + 0xad, 0x2f, 0xd4, 0xfa, 0x08, 0x3d, 0x7f, 0x84, 0x5f, 0x40, 0xd6, 0x43, 0xb8, 0xa7, 0x50, 0x54, + 0xc7, 0x40, 0x55, 0xc7, 0x44, 0xc4, 0x40, 0xa4, 0x63, 0xa0, 0xaa, 0xa1, 0xdc, 0x47, 0x4c, 0xe6, + 0x24, 0xa8, 0x8e, 0x71, 0x0f, 0x70, 0xf2, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x7c, 0xc5, + 0x64, 0x80, 0xa4, 0xd3, 0xca, 0x0a, 0xaa, 0xd5, 0xca, 0x2a, 0xc2, 0xca, 0x0a, 0xa2, 0xda, 0xca, + 0x0a, 0xaa, 0x1b, 0x26, 0x90, 0xc4, 0x06, 0x8e, 0x7a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x16, 0x9c, 0xf0, 0x32, 0xe7, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/queries/orders/service.pb.gw.go b/x/orders/queries/orders/service.pb.gw.go deleted file mode 100644 index 415ca98d3..000000000 --- a/x/orders/queries/orders/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/queries/orders/service.proto - -/* -Package orders is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package orders - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "orders", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/cancel/service.pb.go b/x/orders/transactions/cancel/service.pb.go index e0183f758..71b15e9c0 100644 --- a/x/orders/transactions/cancel/service.pb.go +++ b/x/orders/transactions/cancel/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,29 @@ func init() { } var fileDescriptor_309677b1d8455ef4 = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0xc3, 0x3b, 0xbe, - 0xc3, 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0xda, 0x22, 0x0a, 0x12, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, - 0x93, 0x23, 0x06, 0x92, 0xbb, 0x92, 0xe7, 0x5a, 0x3a, 0xea, 0xee, 0xe0, 0xee, 0xe6, 0xe8, 0xe4, - 0x9f, 0x21, 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0xff, 0x0a, 0x69, 0xef, 0xc0, 0xeb, 0x78, 0x53, - 0xe0, 0xc2, 0xe7, 0x9b, 0x6f, 0x9e, 0x7b, 0xfc, 0xe3, 0x2e, 0x00, 0x93, 0x11, 0xe5, 0xb2, 0x64, - 0xb8, 0x12, 0xd9, 0xb4, 0x64, 0x80, 0xe7, 0x58, 0xd4, 0x19, 0xab, 0x01, 0xcb, 0x9a, 0x72, 0xa0, - 0xa9, 0x2c, 0x04, 0x07, 0x9c, 0x52, 0x9e, 0xb2, 0x12, 0x03, 0xab, 0x67, 0x45, 0xca, 0xd0, 0xa4, - 0x16, 0x52, 0x74, 0xb6, 0x0c, 0x8f, 0xb4, 0x47, 0x73, 0xa4, 0x3c, 0x32, 0x3d, 0x52, 0x3e, 0xf8, - 0x93, 0x0a, 0xa8, 0x04, 0xe0, 0x0a, 0x72, 0x3c, 0xdb, 0x5e, 0x3d, 0x54, 0x54, 0xf0, 0x37, 0x17, - 0x22, 0x2f, 0x19, 0xa6, 0x93, 0x02, 0x53, 0xce, 0x85, 0xa4, 0xca, 0xa9, 0xb7, 0xf6, 0x45, 0x2b, - 0x06, 0x40, 0x73, 0x5d, 0x34, 0x38, 0xb7, 0xf6, 0xc6, 0xd9, 0x75, 0xcd, 0x60, 0x22, 0x38, 0xe8, - 0xb0, 0x9d, 0x47, 0xd7, 0x6f, 0x45, 0x90, 0x77, 0xee, 0x5d, 0xbf, 0x7d, 0x46, 0x79, 0x56, 0xb2, - 0xce, 0x01, 0xb2, 0x9d, 0x04, 0x8a, 0x54, 0xc1, 0xe0, 0xc4, 0x9e, 0x8e, 0x7e, 0xce, 0x2e, 0x74, - 0xb5, 0x7f, 0x4e, 0xf0, 0xeb, 0xf6, 0xf3, 0xe5, 0xbf, 0xdb, 0xbb, 0x6b, 0xbd, 0x36, 0xa1, 0xbb, - 0x68, 0x42, 0xf7, 0xa3, 0x09, 0xdd, 0x87, 0x65, 0xe8, 0x2c, 0x96, 0xa1, 0xf3, 0xbe, 0x0c, 0x1d, - 0x7f, 0x2f, 0x15, 0x95, 0xf5, 0xd7, 0x7a, 0xbf, 0x2f, 0xd5, 0x9d, 0x0f, 0x57, 0x3f, 0x3f, 0x74, - 0xaf, 0x0e, 0xf3, 0x42, 0xde, 0x4c, 0xc7, 0x28, 0x15, 0x15, 0xb6, 0x1d, 0xeb, 0x93, 0xd7, 0xee, - 0x46, 0xf1, 0x60, 0xd4, 0x7f, 0xf6, 0x36, 0x76, 0x27, 0xd2, 0x45, 0x62, 0x34, 0x50, 0x45, 0x46, - 0x66, 0x91, 0xfe, 0xda, 0xbe, 0x6d, 0x90, 0x44, 0x93, 0x24, 0x4e, 0x14, 0x49, 0x4c, 0x92, 0x28, - 0xd2, 0x78, 0x47, 0xb6, 0x24, 0x39, 0x1d, 0xf6, 0x22, 0x26, 0x69, 0x46, 0x25, 0xfd, 0xf2, 0xf6, - 0x0d, 0x4e, 0x88, 0xf6, 0x84, 0xc4, 0x84, 0xa8, 0x04, 0x42, 0xcc, 0x08, 0x42, 0x54, 0xc6, 0xb8, - 0xbd, 0x5e, 0x94, 0xdd, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0x25, 0x1d, 0x93, 0x02, 0x60, 0x03, - 0x00, 0x00, + // 350 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x9d, 0x3f, + 0x07, 0x4f, 0x11, 0xda, 0x22, 0x0a, 0x12, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x2f, 0x47, 0x2c, + 0x24, 0xb9, 0x92, 0x77, 0x2d, 0x1d, 0x75, 0x77, 0x70, 0x77, 0x73, 0x74, 0xf2, 0xcf, 0x10, 0xa7, + 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x7f, 0x85, 0xb4, 0x77, 0xe0, 0x75, 0xbc, 0x29, 0xf0, 0xe0, 0xf3, + 0xcd, 0xf7, 0x25, 0xcf, 0x3f, 0x6b, 0x03, 0x70, 0x19, 0xd1, 0x52, 0xe6, 0x1c, 0x17, 0x22, 0x9d, + 0xe4, 0x1c, 0xf0, 0x0c, 0x8b, 0x2a, 0xe5, 0x15, 0x60, 0x59, 0xd1, 0x12, 0x28, 0x93, 0x23, 0x51, + 0x02, 0x66, 0xb4, 0x64, 0x3c, 0xc7, 0xc0, 0xab, 0xe9, 0x88, 0x71, 0x34, 0xae, 0x84, 0x14, 0xad, + 0x5d, 0xc3, 0x23, 0xed, 0xd1, 0x0c, 0x29, 0x8f, 0x4c, 0x8f, 0x94, 0x0f, 0xb6, 0x98, 0x80, 0x42, + 0x00, 0x2e, 0x20, 0xc3, 0xd3, 0xbd, 0xe5, 0x43, 0x45, 0x05, 0xf6, 0x55, 0x0a, 0x0e, 0x40, 0x33, + 0x5d, 0x25, 0xb8, 0xb2, 0xf6, 0xc6, 0xec, 0xae, 0xe2, 0x30, 0x16, 0x25, 0xe8, 0xb0, 0xfd, 0x17, + 0xd7, 0x6f, 0x44, 0x90, 0xb5, 0x9e, 0x5c, 0xbf, 0x79, 0x49, 0xcb, 0x34, 0xe7, 0xad, 0x63, 0x64, + 0xbb, 0x2b, 0x8a, 0x54, 0xc1, 0xe0, 0xdc, 0x9e, 0x0e, 0xfe, 0x67, 0xd7, 0xba, 0xda, 0xb6, 0x13, + 0x6c, 0x3c, 0xfc, 0xbc, 0xef, 0xb8, 0x9d, 0xc7, 0xc6, 0x47, 0x1d, 0xba, 0xf3, 0x3a, 0x74, 0xbf, + 0xeb, 0xd0, 0x7d, 0x5e, 0x84, 0xce, 0x7c, 0x11, 0x3a, 0x5f, 0x8b, 0xd0, 0xf1, 0x0f, 0x99, 0x28, + 0xac, 0xdf, 0xd6, 0xd9, 0xbc, 0x51, 0x7f, 0xb5, 0xbf, 0x5c, 0xbe, 0xef, 0xde, 0x9e, 0x64, 0x23, + 0x79, 0x3f, 0x19, 0x22, 0x26, 0x0a, 0x6c, 0xfb, 0x59, 0x5f, 0xbd, 0x66, 0x3b, 0x8a, 0x7b, 0x83, + 0xee, 0x9b, 0xb7, 0x76, 0x1d, 0x91, 0x2e, 0x12, 0xa3, 0x9e, 0x2a, 0x32, 0x30, 0x8b, 0x74, 0x57, + 0xf6, 0x73, 0x8d, 0x24, 0x9a, 0x24, 0x71, 0xa2, 0x48, 0x62, 0x92, 0x44, 0x91, 0xda, 0x3b, 0xb5, + 0x25, 0xc9, 0x45, 0xbf, 0x13, 0x71, 0x49, 0x53, 0x2a, 0xe9, 0xaf, 0x77, 0x64, 0x70, 0x42, 0xb4, + 0x27, 0x24, 0x26, 0x44, 0x25, 0x10, 0x62, 0x46, 0x10, 0xa2, 0x32, 0x86, 0xcd, 0xd5, 0xa1, 0x1c, + 0xfc, 0x05, 0x00, 0x00, 0xff, 0xff, 0x5a, 0xb5, 0x1b, 0xf8, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/cancel/service.pb.gw.go b/x/orders/transactions/cancel/service.pb.gw.go deleted file mode 100644 index 961de57cd..000000000 --- a/x/orders/transactions/cancel/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/cancel/service.proto - -/* -Package cancel is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package cancel - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "cancel"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/define/service.pb.go b/x/orders/transactions/define/service.pb.go index 88c7510c4..e5d27a56a 100644 --- a/x/orders/transactions/define/service.pb.go +++ b/x/orders/transactions/define/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_81719b2aa52d08bc = []byte{ - // 366 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xc3, 0x40, - 0x18, 0x06, 0xf0, 0x24, 0xc5, 0x0e, 0xc1, 0xa9, 0x8b, 0x10, 0x24, 0x83, 0xa3, 0xc3, 0x9d, 0x7f, - 0x07, 0x4f, 0x11, 0x5a, 0x2a, 0x0a, 0x12, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x33, 0x06, - 0x92, 0xbb, 0x92, 0xf7, 0x5a, 0x3a, 0xea, 0xee, 0xe0, 0xee, 0xe6, 0xe8, 0xe4, 0xc7, 0x10, 0xa7, - 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0x9f, 0x42, 0xda, 0x0b, 0x78, 0x1d, 0x6f, 0x0a, 0x5c, 0xf8, 0x3d, - 0x79, 0xf2, 0xde, 0xeb, 0x9e, 0xb6, 0x01, 0x98, 0x0c, 0x28, 0x97, 0x39, 0xc3, 0x85, 0x48, 0xc6, - 0x39, 0x03, 0x3c, 0xc5, 0xa2, 0x4c, 0x58, 0x09, 0x58, 0x96, 0x94, 0x03, 0x8d, 0x65, 0x26, 0x38, - 0xe0, 0x84, 0xdd, 0x65, 0x9c, 0x61, 0x60, 0xe5, 0x24, 0x8b, 0x19, 0x1a, 0x95, 0x42, 0x8a, 0xd6, - 0x8e, 0xe6, 0x51, 0xed, 0xd1, 0x14, 0x29, 0x8f, 0x74, 0x8f, 0x94, 0xf7, 0x36, 0x62, 0x01, 0x85, - 0x00, 0x5c, 0x40, 0x8a, 0x27, 0xbb, 0x8b, 0x87, 0x8a, 0xf2, 0x36, 0x53, 0x21, 0xd2, 0x9c, 0x61, - 0x3a, 0xca, 0x30, 0xe5, 0x5c, 0x48, 0xaa, 0x9c, 0x7a, 0x6b, 0x5e, 0xb4, 0x60, 0x00, 0x34, 0xad, - 0x8b, 0x7a, 0x97, 0xc6, 0x5e, 0x3b, 0xbb, 0x2d, 0x19, 0x8c, 0x04, 0x87, 0x3a, 0x6c, 0xef, 0xc5, - 0x76, 0x1b, 0x01, 0xa4, 0xad, 0x27, 0xdb, 0x6d, 0x5e, 0x50, 0x9e, 0xe4, 0xac, 0x75, 0x84, 0x4c, - 0x27, 0x81, 0x02, 0x55, 0xd0, 0x3b, 0x33, 0xa7, 0x83, 0xff, 0xb3, 0xab, 0xba, 0xda, 0x96, 0xe5, - 0xad, 0x3d, 0xfc, 0xbc, 0x6f, 0xdb, 0x9d, 0xc7, 0xc6, 0x47, 0xe5, 0xdb, 0xb3, 0xca, 0xb7, 0xbf, - 0x2b, 0xdf, 0x7e, 0x9e, 0xfb, 0xd6, 0x6c, 0xee, 0x5b, 0x5f, 0x73, 0xdf, 0x72, 0x0f, 0x62, 0x51, - 0x18, 0x7f, 0xad, 0xb3, 0x7e, 0xad, 0xee, 0xbc, 0xbf, 0xf8, 0xf9, 0xbe, 0x7d, 0x73, 0x9c, 0x66, - 0xf2, 0x7e, 0x3c, 0x44, 0xb1, 0x28, 0xb0, 0xe9, 0x58, 0x5f, 0x9d, 0x66, 0x3b, 0x08, 0x7b, 0x83, - 0xee, 0x9b, 0xb3, 0xb2, 0x3b, 0x41, 0x5d, 0x24, 0x44, 0x3d, 0x55, 0x64, 0xa0, 0x17, 0xe9, 0x2e, - 0xed, 0xe7, 0x0a, 0x89, 0x6a, 0x12, 0x85, 0x91, 0x22, 0x91, 0x4e, 0x22, 0x45, 0x2a, 0xe7, 0xc4, - 0x94, 0x44, 0xe7, 0xfd, 0x4e, 0xc0, 0x24, 0x4d, 0xa8, 0xa4, 0xbf, 0xce, 0xa1, 0xc6, 0x09, 0xa9, - 0x3d, 0x21, 0x21, 0x21, 0x2a, 0x81, 0x10, 0x3d, 0x82, 0x10, 0x95, 0x31, 0x6c, 0x2e, 0x17, 0x65, - 0xff, 0x2f, 0x00, 0x00, 0xff, 0xff, 0xd6, 0x3f, 0xe6, 0xd9, 0x60, 0x03, 0x00, 0x00, + // 352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xfb, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xca, 0xaf, 0x43, 0xf8, 0x4d, 0x5d, 0x84, 0x0c, 0x19, 0x1c, 0x1d, 0xee, + 0xfc, 0x3b, 0x78, 0x8a, 0xd0, 0x52, 0x51, 0x90, 0xd0, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x9c, + 0x31, 0xd0, 0xe4, 0x4a, 0x9e, 0x6b, 0xe9, 0xa8, 0xbb, 0x83, 0xbb, 0x9b, 0xa3, 0x93, 0x2f, 0x43, + 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xbe, 0x0a, 0x69, 0xef, 0xc0, 0xeb, 0x78, 0x53, 0xe0, 0x81, + 0xcf, 0x37, 0xdf, 0x27, 0x79, 0xbc, 0x93, 0x36, 0x00, 0x97, 0x21, 0x2b, 0xe5, 0x88, 0x93, 0x42, + 0xa4, 0x93, 0x11, 0x07, 0x32, 0x23, 0xa2, 0x4a, 0x79, 0x05, 0x44, 0x56, 0xac, 0x04, 0x96, 0xc8, + 0x5c, 0x94, 0x40, 0x52, 0x7e, 0x9b, 0x97, 0x9c, 0x00, 0xaf, 0xa6, 0x79, 0xc2, 0xf1, 0xb8, 0x12, + 0x52, 0xb4, 0xb6, 0x0d, 0x8f, 0xb5, 0xc7, 0x33, 0xac, 0x3c, 0x36, 0x3d, 0x56, 0xde, 0xdf, 0x48, + 0x04, 0x14, 0x02, 0x48, 0x01, 0x19, 0x99, 0xee, 0x2c, 0x1f, 0x2a, 0xca, 0xb7, 0xaf, 0x52, 0x70, + 0x00, 0x96, 0xe9, 0x2a, 0xfe, 0x85, 0xb5, 0x37, 0x66, 0x37, 0x15, 0x87, 0xb1, 0x28, 0x41, 0x87, + 0xed, 0x3e, 0x23, 0xaf, 0x11, 0x42, 0xd6, 0x7a, 0x44, 0x5e, 0xf3, 0x9c, 0x95, 0xe9, 0x88, 0xb7, + 0x0e, 0xb1, 0xed, 0xae, 0x38, 0x54, 0x05, 0xfd, 0x53, 0x7b, 0x3a, 0xf8, 0x9b, 0x5d, 0xea, 0x6a, + 0x9b, 0x8e, 0xff, 0xef, 0xfe, 0xfb, 0x6d, 0x0b, 0x75, 0x1e, 0x1a, 0xef, 0x75, 0x80, 0xe6, 0x75, + 0x80, 0xbe, 0xea, 0x00, 0x3d, 0x2d, 0x02, 0x67, 0xbe, 0x08, 0x9c, 0xcf, 0x45, 0xe0, 0x78, 0xfb, + 0x89, 0x28, 0xac, 0xdf, 0xd6, 0xf9, 0x7f, 0xa5, 0xfe, 0x6a, 0x7f, 0xb9, 0x7c, 0x1f, 0x5d, 0x1f, + 0x65, 0xb9, 0xbc, 0x9b, 0x0c, 0x71, 0x22, 0x0a, 0x62, 0xfb, 0x59, 0x5f, 0xdc, 0x66, 0x3b, 0x8c, + 0x7a, 0x83, 0xee, 0xab, 0xbb, 0x76, 0x1d, 0xa1, 0x2e, 0x12, 0xe1, 0x9e, 0x2a, 0x32, 0x30, 0x8b, + 0x74, 0x57, 0xf6, 0x63, 0x8d, 0xc4, 0x9a, 0xc4, 0x51, 0xac, 0x48, 0x6c, 0x92, 0x58, 0x91, 0xda, + 0x3d, 0xb6, 0x25, 0xf1, 0x59, 0xbf, 0x13, 0x72, 0xc9, 0x52, 0x26, 0xd9, 0x8f, 0x7b, 0x60, 0x70, + 0x4a, 0xb5, 0xa7, 0x34, 0xa2, 0x54, 0x25, 0x50, 0x6a, 0x46, 0x50, 0xaa, 0x32, 0x86, 0xcd, 0xd5, + 0xa1, 0xec, 0xfd, 0x06, 0x00, 0x00, 0xff, 0xff, 0x35, 0x30, 0xd3, 0x57, 0x42, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/define/service.pb.gw.go b/x/orders/transactions/define/service.pb.gw.go deleted file mode 100644 index 5533444a0..000000000 --- a/x/orders/transactions/define/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/define/service.proto - -/* -Package define is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package define - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "define"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/deputize/service.pb.go b/x/orders/transactions/deputize/service.pb.go index d43e78269..95236e57f 100644 --- a/x/orders/transactions/deputize/service.pb.go +++ b/x/orders/transactions/deputize/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_7f61c89944722a3a = []byte{ - // 371 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x58, 0x41, - 0xe1, 0x44, 0xb1, 0xa5, 0x50, 0x97, 0xd0, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, - 0xe4, 0x42, 0xfe, 0x6b, 0x29, 0x4e, 0xbe, 0x80, 0xd0, 0x37, 0x10, 0x1c, 0x9d, 0x7c, 0x0c, 0x71, - 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x14, 0x52, 0xef, 0x8a, 0xd7, 0xb1, 0x99, 0x02, 0x7f, 0xf8, - 0xbe, 0x7c, 0xfc, 0xf9, 0xed, 0xcb, 0x0e, 0x00, 0x13, 0x1e, 0xcd, 0x45, 0xca, 0x70, 0xc6, 0xa3, - 0x49, 0xca, 0x00, 0xcf, 0x30, 0x2f, 0x23, 0x56, 0x02, 0x16, 0x25, 0xcd, 0x81, 0x86, 0x22, 0xe1, - 0x39, 0xe0, 0x88, 0x15, 0x13, 0x91, 0x3c, 0x30, 0x0c, 0xac, 0x9c, 0x26, 0x21, 0x43, 0x45, 0xc9, - 0x05, 0x6f, 0xb5, 0x35, 0x03, 0x52, 0x06, 0x34, 0x43, 0xd2, 0x80, 0x74, 0x03, 0x5a, 0x1b, 0x9c, - 0xbd, 0x90, 0x43, 0xc6, 0x01, 0x67, 0x10, 0xe3, 0xe9, 0xd1, 0xea, 0x21, 0x65, 0xce, 0x7e, 0xcc, - 0x79, 0x9c, 0x32, 0x4c, 0x8b, 0x04, 0xd3, 0x3c, 0xe7, 0x82, 0x4a, 0x52, 0xbe, 0xad, 0x13, 0x9b, - 0x31, 0x00, 0x1a, 0xab, 0x58, 0xc7, 0xab, 0x61, 0xd0, 0xa6, 0x77, 0x25, 0x83, 0x82, 0xe7, 0xa0, - 0x74, 0xed, 0x67, 0xd3, 0x6e, 0x78, 0x10, 0xb7, 0xe6, 0xa6, 0xdd, 0xbc, 0xa2, 0x79, 0x94, 0xb2, - 0xd6, 0x19, 0xda, 0x7e, 0x1f, 0xc8, 0x93, 0x91, 0x4e, 0xbf, 0x0e, 0x3c, 0xfa, 0x9f, 0x5e, 0xab, - 0xbc, 0x03, 0xc3, 0xd9, 0x79, 0xfc, 0x7e, 0x3b, 0x34, 0xbb, 0x4f, 0x8d, 0xf7, 0xca, 0x35, 0x17, - 0x95, 0x6b, 0x7e, 0x55, 0xae, 0x39, 0x5f, 0xba, 0xc6, 0x62, 0xe9, 0x1a, 0x9f, 0x4b, 0xd7, 0xb0, - 0x4f, 0x42, 0x9e, 0xd5, 0xf8, 0x5e, 0x77, 0xf7, 0x46, 0xfe, 0xff, 0xe1, 0x6a, 0x05, 0x43, 0xf3, - 0xf6, 0x3c, 0x4e, 0xc4, 0xfd, 0x64, 0x8c, 0x42, 0x9e, 0xe1, 0xed, 0xd7, 0xfb, 0x62, 0x35, 0x3b, - 0x9e, 0x3f, 0x18, 0xf5, 0x5e, 0xad, 0x8d, 0x4b, 0xf2, 0x54, 0x8c, 0x8f, 0x06, 0x32, 0x66, 0xa4, - 0xc7, 0xf4, 0x14, 0xfd, 0xb1, 0x01, 0x05, 0x0a, 0x0a, 0xfc, 0x40, 0x42, 0x81, 0x0e, 0x05, 0x6b, - 0xa8, 0xb2, 0x2e, 0xb6, 0x87, 0x82, 0xfe, 0xb0, 0xeb, 0x31, 0x41, 0x23, 0x2a, 0xe8, 0x8f, 0x75, - 0xaa, 0x09, 0x08, 0x51, 0x06, 0x42, 0x7c, 0x42, 0xa4, 0x83, 0x10, 0x5d, 0x42, 0xc8, 0xda, 0x32, - 0x6e, 0xfe, 0x1d, 0xce, 0xf1, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xed, 0xa8, 0x2d, 0x36, 0x78, - 0x03, 0x00, 0x00, + // 359 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x80, 0x73, 0x29, 0x5f, 0x87, 0xf0, 0x4d, 0x5d, 0x3e, 0xc8, 0x90, 0xe1, 0x1b, 0xbf, 0xe1, + 0x8e, 0xaf, 0x82, 0xc2, 0x89, 0x62, 0x4b, 0xa1, 0x2e, 0x47, 0x8b, 0x76, 0x08, 0x12, 0x90, 0x6b, + 0x72, 0xc4, 0x40, 0x93, 0x2b, 0x79, 0xaf, 0xa5, 0x38, 0xf9, 0x07, 0x84, 0xfe, 0x03, 0xc1, 0xd1, + 0xc9, 0x9f, 0x21, 0x4e, 0x1d, 0x1d, 0x25, 0x1d, 0x04, 0x7f, 0x85, 0xd4, 0xbb, 0xe2, 0x75, 0x6c, + 0xa6, 0xc0, 0x0b, 0xcf, 0x93, 0x27, 0x6f, 0x5e, 0xef, 0xac, 0x03, 0x20, 0x14, 0xe3, 0x85, 0x9a, + 0x08, 0x92, 0xcb, 0x64, 0x36, 0x11, 0x40, 0x16, 0x44, 0x96, 0x89, 0x28, 0x81, 0xa8, 0x92, 0x17, + 0xc0, 0x63, 0x95, 0xc9, 0x02, 0x48, 0x22, 0xa6, 0x33, 0x95, 0xdd, 0x0a, 0x02, 0xa2, 0x9c, 0x67, + 0xb1, 0xc0, 0xd3, 0x52, 0x2a, 0xd9, 0x6a, 0x5b, 0x06, 0x6c, 0x0c, 0x78, 0x81, 0xb5, 0x01, 0xdb, + 0x06, 0xbc, 0x35, 0xf8, 0x7f, 0x62, 0x09, 0xb9, 0x04, 0x92, 0x43, 0x4a, 0xe6, 0xff, 0x37, 0x0f, + 0x2d, 0xf3, 0xeb, 0xe4, 0xe4, 0x02, 0x80, 0xa7, 0x26, 0xc7, 0x67, 0x35, 0x0c, 0xd6, 0xf4, 0xba, + 0x14, 0x30, 0x95, 0x05, 0x18, 0x5d, 0xfb, 0x01, 0x79, 0x0d, 0x06, 0x69, 0x6b, 0x89, 0xbc, 0xe6, + 0x39, 0x2f, 0x92, 0x89, 0x68, 0x1d, 0xe3, 0xfd, 0xbf, 0x18, 0x33, 0x1d, 0xe9, 0xf7, 0xeb, 0xc0, + 0xa3, 0x9f, 0xe9, 0x85, 0xc9, 0xfb, 0xeb, 0xf8, 0xbf, 0xee, 0x3e, 0x9e, 0xff, 0xa1, 0xee, 0x7d, + 0xe3, 0xa5, 0x0a, 0xd0, 0xaa, 0x0a, 0xd0, 0x7b, 0x15, 0xa0, 0xe5, 0x3a, 0x70, 0x56, 0xeb, 0xc0, + 0x79, 0x5b, 0x07, 0x8e, 0x77, 0x18, 0xcb, 0xbc, 0xc6, 0xfb, 0xba, 0xbf, 0x2f, 0xf5, 0x1f, 0x1e, + 0x6e, 0x56, 0x30, 0x44, 0x57, 0x27, 0x69, 0xa6, 0x6e, 0x66, 0x63, 0x1c, 0xcb, 0x9c, 0xec, 0xbf, + 0xde, 0x47, 0xb7, 0xd9, 0x61, 0xe1, 0x60, 0xd4, 0x7b, 0x72, 0x77, 0x6e, 0x85, 0x99, 0x98, 0x10, + 0x0f, 0x74, 0xcc, 0xc8, 0x8e, 0xe9, 0x19, 0xfa, 0x75, 0x07, 0x8a, 0x0c, 0x14, 0x85, 0x91, 0x86, + 0x22, 0x1b, 0x8a, 0xb6, 0x50, 0xe5, 0x9e, 0xee, 0x0f, 0x45, 0xfd, 0x61, 0x97, 0x09, 0xc5, 0x13, + 0xae, 0xf8, 0xa7, 0x7b, 0x64, 0x09, 0x28, 0x35, 0x06, 0x4a, 0x43, 0x4a, 0xb5, 0x83, 0x52, 0x5b, + 0x42, 0xe9, 0xd6, 0x32, 0x6e, 0x7e, 0x1f, 0xce, 0xc1, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0xa7, + 0x74, 0x1a, 0xbd, 0x5a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/deputize/service.pb.gw.go b/x/orders/transactions/deputize/service.pb.gw.go deleted file mode 100644 index 3c2cfa9e9..000000000 --- a/x/orders/transactions/deputize/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/deputize/service.proto - -/* -Package deputize is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package deputize - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "deputize"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/get/service.pb.go b/x/orders/transactions/get/service.pb.go index b3159d285..c249d7add 100644 --- a/x/orders/transactions/get/service.pb.go +++ b/x/orders/transactions/get/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,29 @@ func init() { } var fileDescriptor_643e03a23de377cc = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x6b, 0xe3, 0x30, - 0x14, 0xc7, 0x6d, 0x1f, 0x97, 0xc1, 0xdc, 0x94, 0xe5, 0xc0, 0x1c, 0x1e, 0x6e, 0x2c, 0x54, 0x22, - 0x29, 0x94, 0x56, 0x9d, 0xe2, 0xc5, 0x59, 0x4c, 0x42, 0x9b, 0xc1, 0x14, 0x43, 0x51, 0xec, 0x87, - 0x6a, 0xb0, 0xad, 0xe0, 0xa7, 0x84, 0x8c, 0x9d, 0x3a, 0x77, 0xe9, 0x17, 0xe8, 0xd8, 0xa9, 0x1f, - 0xa3, 0x74, 0xca, 0xd8, 0xb1, 0x38, 0x43, 0xa1, 0x4b, 0xbf, 0x42, 0x49, 0x65, 0xa8, 0x33, 0x6a, - 0x32, 0x3c, 0xff, 0x7f, 0x4f, 0x3f, 0x3d, 0x3d, 0xf7, 0x6c, 0x84, 0x08, 0x2a, 0xe2, 0x95, 0x2a, - 0x80, 0x96, 0x32, 0x5b, 0x16, 0x80, 0x74, 0x4d, 0x65, 0x9d, 0x41, 0x8d, 0x54, 0xd5, 0xbc, 0x42, - 0x9e, 0xaa, 0x5c, 0x56, 0x48, 0x05, 0x28, 0x8a, 0x50, 0xaf, 0xf2, 0x14, 0xc8, 0xa2, 0x96, 0x4a, - 0xf6, 0x0f, 0x3b, 0x30, 0x69, 0x61, 0xb2, 0x26, 0x1a, 0x26, 0x5d, 0x98, 0x08, 0x50, 0xde, 0xdf, - 0x54, 0x62, 0x29, 0x91, 0x96, 0x28, 0xe8, 0x6a, 0xb0, 0xfb, 0xe8, 0x3e, 0xde, 0x3f, 0x21, 0xa5, - 0x28, 0x80, 0xf2, 0x45, 0x4e, 0x79, 0x55, 0x49, 0xc5, 0x35, 0xa4, 0xff, 0x1a, 0x2a, 0x96, 0x80, - 0xc8, 0x45, 0xab, 0xe8, 0x8d, 0xcd, 0xe0, 0x4e, 0xe1, 0xaa, 0x06, 0x5c, 0xc8, 0x0a, 0xdb, 0x4e, - 0xc3, 0x7b, 0xdb, 0xfd, 0x15, 0xa1, 0xe8, 0xdf, 0xda, 0x6e, 0x6f, 0xcc, 0xab, 0xac, 0x80, 0xfe, - 0x31, 0x31, 0x1a, 0x00, 0x89, 0xb4, 0x9a, 0x17, 0x18, 0x72, 0xb3, 0x9f, 0xc2, 0x79, 0x2b, 0xf5, - 0xdf, 0xf2, 0x7e, 0xdf, 0xbc, 0x3f, 0x1d, 0xd8, 0xc1, 0xa7, 0xf3, 0xdc, 0xf8, 0xf6, 0xa6, 0xf1, - 0xed, 0xb7, 0xc6, 0xb7, 0xef, 0xb6, 0xbe, 0xb5, 0xd9, 0xfa, 0xd6, 0xeb, 0xd6, 0xb7, 0xdc, 0x41, - 0x2a, 0x4b, 0xb3, 0xa3, 0x82, 0x3f, 0x17, 0xfa, 0x85, 0xa7, 0xbb, 0x3b, 0x4f, 0xed, 0xcb, 0x13, - 0x91, 0xab, 0xeb, 0xe5, 0x9c, 0xa4, 0xb2, 0xa4, 0x46, 0xa3, 0x7c, 0x70, 0x7a, 0xa3, 0x28, 0x9e, - 0xcc, 0xc2, 0x47, 0x67, 0x6f, 0x4d, 0xa2, 0x56, 0x21, 0x26, 0x13, 0xad, 0x30, 0xeb, 0x2a, 0x84, - 0xa0, 0x5e, 0xf6, 0xf2, 0x49, 0x9b, 0x4f, 0xe2, 0x44, 0xe7, 0x93, 0x6e, 0x3e, 0x09, 0x41, 0x35, - 0xce, 0xa9, 0x51, 0x3e, 0x09, 0xa7, 0x41, 0x04, 0x8a, 0x67, 0x5c, 0xf1, 0x0f, 0x67, 0xd8, 0x61, - 0x19, 0x6b, 0x61, 0xc6, 0x62, 0xc6, 0x34, 0xce, 0x58, 0x97, 0x67, 0x2c, 0x04, 0x35, 0xef, 0x7d, - 0x2f, 0xc4, 0xd1, 0x57, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3e, 0x2a, 0x52, 0xf1, 0x3c, 0x03, 0x00, - 0x00, + // 352 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0xc7, 0x93, 0xbc, 0xbc, 0x1d, 0xc2, 0x3b, 0x75, 0x79, 0x21, 0x43, 0x06, 0x47, 0xc1, 0x3b, + 0x5a, 0x41, 0xf4, 0x9c, 0x9a, 0x25, 0x5d, 0x42, 0x8b, 0x76, 0x08, 0x12, 0x90, 0x6b, 0xf2, 0x10, + 0x0b, 0x4d, 0xae, 0xe4, 0xb9, 0x96, 0x8e, 0x4e, 0xce, 0x2e, 0x7e, 0x01, 0x47, 0x27, 0x3f, 0x86, + 0x38, 0x75, 0x74, 0x94, 0x74, 0x10, 0x5c, 0xfc, 0x0a, 0x52, 0xef, 0xc0, 0xeb, 0x78, 0xd3, 0xc1, + 0xc3, 0xff, 0xf7, 0xdc, 0xef, 0xb9, 0x7b, 0xfc, 0xf3, 0x01, 0x22, 0xc8, 0x84, 0xd7, 0x72, 0x0e, + 0xb4, 0x12, 0xc5, 0x72, 0x0e, 0x48, 0xd7, 0x54, 0x34, 0x05, 0x34, 0x48, 0x65, 0xc3, 0x6b, 0xe4, + 0xb9, 0x9c, 0x89, 0x1a, 0x69, 0x09, 0x92, 0x22, 0x34, 0xab, 0x59, 0x0e, 0x64, 0xd1, 0x08, 0x29, + 0xba, 0x47, 0x06, 0x4c, 0x34, 0x4c, 0xd6, 0x44, 0xc1, 0xc4, 0x84, 0x49, 0x09, 0x32, 0xf8, 0x9f, + 0x0b, 0xac, 0x04, 0xd2, 0x0a, 0x4b, 0xba, 0xea, 0xed, 0x0e, 0xd5, 0x27, 0xb0, 0x94, 0xa8, 0x00, + 0x91, 0x97, 0x5a, 0x22, 0x18, 0xda, 0xc1, 0x46, 0xe1, 0xba, 0x01, 0x5c, 0x88, 0x1a, 0x75, 0xa7, + 0xfe, 0x83, 0xeb, 0xff, 0x49, 0xb0, 0xec, 0xde, 0xb9, 0x7e, 0x67, 0xc8, 0xeb, 0x62, 0x0e, 0xdd, + 0x13, 0x62, 0x35, 0x22, 0x49, 0x94, 0x5a, 0x10, 0x59, 0x72, 0x93, 0xdf, 0xc2, 0x85, 0x96, 0x3a, + 0x70, 0x82, 0xbf, 0xb7, 0x1f, 0xcf, 0x87, 0x6e, 0xf4, 0xe5, 0xbd, 0xb4, 0xa1, 0xbb, 0x69, 0x43, + 0xf7, 0xbd, 0x0d, 0xdd, 0xfb, 0x6d, 0xe8, 0x6c, 0xb6, 0xa1, 0xf3, 0xb6, 0x0d, 0x1d, 0xbf, 0x97, + 0x8b, 0xca, 0xee, 0xaa, 0xe8, 0xdf, 0xa5, 0xfa, 0xc3, 0xf1, 0x6e, 0xe6, 0xb1, 0x7b, 0x75, 0x5a, + 0xce, 0xe4, 0xcd, 0x72, 0x4a, 0x72, 0x51, 0x51, 0xab, 0xa7, 0x7c, 0xf4, 0x3a, 0x83, 0x24, 0x1d, + 0x4d, 0xe2, 0x27, 0x6f, 0x6f, 0x11, 0x12, 0xad, 0x90, 0x92, 0x91, 0x52, 0x98, 0x98, 0x0a, 0x31, + 0xc8, 0xd7, 0xbd, 0x7c, 0xa6, 0xf3, 0x59, 0x9a, 0xa9, 0x7c, 0x66, 0xe6, 0xb3, 0x18, 0x64, 0xeb, + 0x9d, 0x59, 0xe5, 0xb3, 0x78, 0x1c, 0x25, 0x20, 0x79, 0xc1, 0x25, 0xff, 0xf4, 0xfa, 0x06, 0xcb, + 0x98, 0x86, 0x19, 0x4b, 0x19, 0x53, 0x38, 0x63, 0x26, 0xcf, 0x58, 0x0c, 0x72, 0xda, 0xf9, 0x59, + 0x88, 0xe3, 0xef, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x64, 0x4c, 0xdb, 0x1e, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/get/service.pb.gw.go b/x/orders/transactions/get/service.pb.gw.go deleted file mode 100644 index 82f66b9a4..000000000 --- a/x/orders/transactions/get/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/get/service.proto - -/* -Package get is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package get - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "get"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/immediate/service.pb.go b/x/orders/transactions/immediate/service.pb.go index d0ad42dfc..89a7ec303 100644 --- a/x/orders/transactions/immediate/service.pb.go +++ b/x/orders/transactions/immediate/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_0dcccd3b865dd390 = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x18, 0x80, 0x93, 0x14, 0x3b, 0x04, 0xa7, 0x2e, 0x42, 0x90, 0x0c, 0x8e, 0x0e, 0x77, 0x68, 0x07, - 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x87, 0xd8, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, 0x90, - 0xcb, 0x95, 0xfc, 0xd7, 0xd2, 0xd1, 0x47, 0x10, 0x7d, 0x02, 0x1d, 0x9d, 0x7c, 0x0c, 0x71, 0xea, - 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x14, 0x52, 0x2f, 0xd6, 0xeb, 0x7a, 0x53, 0xe0, 0x0f, 0xdf, 0x77, - 0x1f, 0x3f, 0xbf, 0xdb, 0xe9, 0x00, 0x30, 0x19, 0xd0, 0x42, 0xe6, 0x0c, 0x73, 0x91, 0x4c, 0x73, - 0x06, 0x78, 0x8e, 0x45, 0x99, 0xb0, 0x12, 0xb0, 0x2c, 0x69, 0x01, 0x34, 0x96, 0x99, 0x28, 0x00, - 0x67, 0x9c, 0xb3, 0x24, 0xa3, 0x92, 0x61, 0x60, 0xe5, 0x2c, 0x8b, 0x19, 0x9a, 0x94, 0x42, 0x8a, - 0x56, 0x5b, 0x53, 0xa0, 0x5a, 0x81, 0xe6, 0x48, 0x29, 0x90, 0xae, 0x40, 0x6b, 0x85, 0xb7, 0x13, - 0x0b, 0xe0, 0x02, 0x30, 0x87, 0x14, 0xcf, 0x0e, 0x56, 0x1f, 0x65, 0xf3, 0x76, 0x53, 0x21, 0xd2, - 0x9c, 0x61, 0x3a, 0xc9, 0x30, 0x2d, 0x0a, 0x21, 0xa9, 0x42, 0xd5, 0x5f, 0xa3, 0x5c, 0xce, 0x00, - 0x68, 0x5a, 0xe7, 0x7a, 0x17, 0x26, 0x0a, 0x6d, 0x7c, 0x53, 0x32, 0x98, 0x88, 0x02, 0x6a, 0xdf, - 0xe1, 0x93, 0xed, 0x36, 0x02, 0x48, 0x5b, 0x0f, 0xb6, 0xdb, 0xec, 0xd1, 0x22, 0xc9, 0x59, 0xeb, - 0x04, 0x19, 0xac, 0x04, 0x05, 0x2a, 0xd3, 0xeb, 0x19, 0xd1, 0xa3, 0xff, 0xf1, 0x65, 0x1d, 0xb8, - 0x67, 0x79, 0x5b, 0x77, 0x5f, 0xaf, 0xfb, 0x76, 0xf7, 0xb1, 0xf1, 0x56, 0xf9, 0xf6, 0xa2, 0xf2, - 0xed, 0xcf, 0xca, 0xb7, 0xef, 0x97, 0xbe, 0xb5, 0x58, 0xfa, 0xd6, 0xc7, 0xd2, 0xb7, 0xdc, 0xa3, - 0x58, 0x70, 0x93, 0x07, 0xbb, 0xdb, 0x57, 0xea, 0x0a, 0x86, 0xab, 0x2d, 0x0c, 0xed, 0xeb, 0xd3, - 0x34, 0x93, 0xb7, 0xd3, 0x31, 0x8a, 0x05, 0xc7, 0x06, 0x2b, 0x7e, 0x76, 0x9a, 0x9d, 0x20, 0x1c, - 0x8c, 0xfa, 0x2f, 0xce, 0xc6, 0x41, 0x05, 0x75, 0x4e, 0x88, 0x06, 0x2a, 0x67, 0xa4, 0xe7, 0xf4, - 0xff, 0xf0, 0xf7, 0x0d, 0x2a, 0xaa, 0xa9, 0x28, 0x8c, 0x14, 0x15, 0xe9, 0x54, 0xb4, 0xa6, 0x2a, - 0xe7, 0xcc, 0x80, 0x8a, 0xce, 0x87, 0xdd, 0x80, 0x49, 0x9a, 0x50, 0x49, 0xbf, 0x9d, 0x63, 0xcd, - 0x40, 0x48, 0xad, 0x20, 0x24, 0x24, 0x44, 0x49, 0x08, 0xd1, 0x2d, 0x84, 0xac, 0x35, 0xe3, 0xe6, - 0xef, 0x01, 0xb5, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0xe5, 0xac, 0x92, 0x90, 0x84, 0x03, 0x00, - 0x00, + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x80, 0x93, 0x94, 0xaf, 0x43, 0xf8, 0xa6, 0x2e, 0x42, 0x86, 0x0c, 0x8e, 0x0e, 0x77, 0x68, + 0x07, 0xe5, 0x10, 0xa5, 0x5d, 0x6c, 0x87, 0xd8, 0xa2, 0x1d, 0x82, 0x04, 0xe4, 0x9a, 0x1c, 0x31, + 0xd0, 0xcb, 0x95, 0xbc, 0xd7, 0xd2, 0xd1, 0x9f, 0x20, 0xfa, 0x0b, 0x74, 0x74, 0xf2, 0x67, 0x88, + 0x53, 0x47, 0x47, 0x49, 0x07, 0xc1, 0x5f, 0x21, 0xf5, 0xce, 0x7a, 0x5d, 0x6f, 0x0a, 0xbc, 0xf0, + 0x3c, 0x79, 0xf2, 0xe6, 0xf5, 0x3b, 0x1d, 0x00, 0x26, 0x23, 0x5a, 0xca, 0x09, 0xc3, 0x5c, 0x64, + 0xb3, 0x09, 0x03, 0xbc, 0xc0, 0xa2, 0xca, 0x58, 0x05, 0x58, 0x56, 0xb4, 0x04, 0x9a, 0xca, 0x42, + 0x94, 0x80, 0x0b, 0xce, 0x59, 0x56, 0x50, 0xc9, 0x30, 0xb0, 0x6a, 0x5e, 0xa4, 0x0c, 0x4d, 0x2b, + 0x21, 0x45, 0xab, 0x6d, 0x28, 0x90, 0x56, 0xa0, 0x05, 0x52, 0x0a, 0x64, 0x2a, 0xd0, 0x46, 0x11, + 0xec, 0xa4, 0x02, 0xb8, 0x00, 0xcc, 0x21, 0xc7, 0xf3, 0xfd, 0xf5, 0x43, 0xd9, 0x02, 0xab, 0x20, + 0xce, 0x00, 0x68, 0xae, 0x83, 0x82, 0x73, 0x1b, 0x85, 0x31, 0xbe, 0xae, 0x18, 0x4c, 0x45, 0x09, + 0xda, 0x77, 0xf0, 0xe8, 0xfa, 0x8d, 0x08, 0xf2, 0xd6, 0xbd, 0xeb, 0x37, 0x7b, 0xb4, 0xcc, 0x26, + 0xac, 0x75, 0x8c, 0x2c, 0x3e, 0x1a, 0x45, 0x2a, 0x33, 0xe8, 0x59, 0xd1, 0xa3, 0xbf, 0xf1, 0x85, + 0x0e, 0xdc, 0x75, 0x82, 0x7f, 0xb7, 0x9f, 0x2f, 0x7b, 0x6e, 0xf7, 0xa1, 0xf1, 0x5a, 0x87, 0xee, + 0xb2, 0x0e, 0xdd, 0x8f, 0x3a, 0x74, 0xef, 0x56, 0xa1, 0xb3, 0x5c, 0x85, 0xce, 0xfb, 0x2a, 0x74, + 0xfc, 0xc3, 0x54, 0x70, 0x9b, 0x17, 0x76, 0xff, 0x5f, 0xaa, 0xff, 0x3c, 0x5c, 0x6f, 0x61, 0xe8, + 0x5e, 0x9d, 0xe4, 0x85, 0xbc, 0x99, 0x8d, 0x51, 0x2a, 0x38, 0xb6, 0x58, 0xf1, 0x93, 0xd7, 0xec, + 0x44, 0xf1, 0x60, 0xd4, 0x7f, 0xf6, 0xb6, 0x4e, 0x26, 0xd2, 0x39, 0x31, 0x1a, 0xa8, 0x9c, 0x91, + 0x99, 0xd3, 0xff, 0xc5, 0xdf, 0xb6, 0xa8, 0x44, 0x53, 0x49, 0x9c, 0x28, 0x2a, 0x31, 0xa9, 0x64, + 0x43, 0xd5, 0xde, 0xa9, 0x05, 0x95, 0x9c, 0x0d, 0xbb, 0x11, 0x93, 0x34, 0xa3, 0x92, 0x7e, 0x79, + 0x47, 0x86, 0x81, 0x10, 0xad, 0x20, 0x24, 0x26, 0x44, 0x49, 0x08, 0x31, 0x2d, 0x84, 0x6c, 0x34, + 0xe3, 0xe6, 0xcf, 0x01, 0xb5, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0xe0, 0xcb, 0x1b, 0xdf, 0x66, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/immediate/service.pb.gw.go b/x/orders/transactions/immediate/service.pb.gw.go deleted file mode 100644 index 61cc7fcbe..000000000 --- a/x/orders/transactions/immediate/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/immediate/service.proto - -/* -Package immediate is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package immediate - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "immediate"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/make/service.pb.go b/x/orders/transactions/make/service.pb.go index b1b23dd14..e53b6cf24 100644 --- a/x/orders/transactions/make/service.pb.go +++ b/x/orders/transactions/make/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_fbbf961e1e7c95c7 = []byte{ - // 363 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xfb, 0x40, - 0x14, 0xc0, 0xf1, 0x24, 0x3f, 0x7e, 0x1d, 0x82, 0x53, 0x17, 0x21, 0x48, 0x06, 0x47, 0x87, 0x3b, - 0x6c, 0x07, 0xf1, 0x70, 0x69, 0x1d, 0xd4, 0xe1, 0x68, 0xd1, 0x0e, 0x41, 0x02, 0x72, 0x4d, 0x8e, - 0x18, 0x9a, 0xe4, 0x4a, 0xde, 0xb5, 0x74, 0x74, 0x74, 0x74, 0x73, 0x77, 0x74, 0xf2, 0xcf, 0x10, - 0xa7, 0x8e, 0x8e, 0x92, 0x0e, 0x82, 0xbb, 0xbb, 0xc4, 0x3b, 0xf0, 0x3a, 0xde, 0x14, 0xb8, 0xf0, - 0x79, 0xf9, 0xe6, 0x25, 0xfe, 0xc9, 0x00, 0x80, 0x4b, 0xca, 0x2a, 0x59, 0x70, 0x5c, 0x8a, 0x74, - 0x51, 0x70, 0xc0, 0x2b, 0x2c, 0xea, 0x94, 0xd7, 0x80, 0x65, 0xcd, 0x2a, 0x60, 0x89, 0xcc, 0x45, - 0x05, 0xb8, 0x64, 0x33, 0x8e, 0x81, 0xd7, 0xcb, 0x3c, 0xe1, 0x68, 0x5e, 0x0b, 0x29, 0xba, 0xc8, - 0xd0, 0x48, 0x6b, 0xb4, 0x42, 0x4a, 0x23, 0x53, 0xa3, 0x56, 0x07, 0xbb, 0x89, 0x80, 0x52, 0x00, - 0x2e, 0x21, 0xc3, 0xcb, 0xc3, 0xf6, 0xa2, 0x06, 0x05, 0x7b, 0x99, 0x10, 0x59, 0xc1, 0x31, 0x9b, - 0xe7, 0x98, 0x55, 0x95, 0x90, 0x4c, 0x29, 0x75, 0xd7, 0x36, 0xb2, 0xe4, 0x00, 0x2c, 0xd3, 0x91, - 0xc1, 0x85, 0xa5, 0x36, 0x4e, 0x6e, 0x6a, 0x0e, 0x73, 0x51, 0x81, 0x1e, 0xd5, 0x7b, 0x74, 0xfd, - 0x7f, 0x14, 0xb2, 0xee, 0xbd, 0xeb, 0x77, 0xce, 0x59, 0x95, 0x16, 0xbc, 0x7b, 0x64, 0xb9, 0x03, - 0x44, 0x55, 0x5c, 0x70, 0x6a, 0x0b, 0x27, 0x7f, 0x27, 0x97, 0x3a, 0x6b, 0xdf, 0x09, 0xfe, 0xdf, - 0x7d, 0xbe, 0x1c, 0xb8, 0xc3, 0x6f, 0xef, 0xb5, 0x09, 0xdd, 0x75, 0x13, 0xba, 0x1f, 0x4d, 0xe8, - 0x3e, 0x6c, 0x42, 0x67, 0xbd, 0x09, 0x9d, 0xf7, 0x4d, 0xe8, 0xf8, 0xbd, 0x44, 0x94, 0x96, 0xcf, - 0x1a, 0xee, 0x5c, 0xa9, 0xef, 0x3c, 0x6e, 0x5f, 0x7b, 0xec, 0x5e, 0x1f, 0x67, 0xb9, 0xbc, 0x5d, - 0x4c, 0x51, 0x22, 0x4a, 0x6c, 0xb7, 0xce, 0x27, 0xaf, 0x33, 0xa0, 0xd1, 0x68, 0x42, 0x9f, 0xbd, - 0xad, 0x08, 0xaa, 0x23, 0x22, 0x34, 0x52, 0x11, 0x13, 0x33, 0x82, 0xb2, 0x19, 0x7f, 0xdb, 0x02, - 0xb1, 0x06, 0x71, 0x14, 0x2b, 0x10, 0x9b, 0x20, 0x6e, 0x41, 0xe3, 0x11, 0x3b, 0x10, 0x9f, 0x8d, - 0x87, 0x94, 0x4b, 0x96, 0x32, 0xc9, 0xbe, 0xbc, 0xbe, 0x81, 0x09, 0xd1, 0x9a, 0x90, 0x88, 0x10, - 0xe5, 0x09, 0x31, 0x07, 0x10, 0xd2, 0x4e, 0x98, 0x76, 0x7e, 0x7f, 0x8c, 0xfe, 0x4f, 0x00, 0x00, - 0x00, 0xff, 0xff, 0x07, 0x3b, 0x2e, 0x36, 0x48, 0x03, 0x00, 0x00, + // 345 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc0, 0xf1, 0x24, 0x62, 0x87, 0xe0, 0xd4, 0x45, 0xc8, 0x90, 0xc1, 0xd1, 0xe1, 0x0e, 0xdb, + 0x41, 0x3c, 0x5c, 0x5a, 0x07, 0x75, 0x38, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x23, 0x96, + 0xf6, 0x72, 0x25, 0xef, 0x5a, 0x3a, 0x3a, 0x3a, 0xba, 0xb9, 0x3b, 0x3a, 0xf9, 0x31, 0xc4, 0xa9, + 0xa3, 0xa3, 0xa4, 0x83, 0xe0, 0xee, 0x2e, 0xf1, 0x0e, 0xbc, 0x8e, 0x37, 0x05, 0x0e, 0x7e, 0x2f, + 0xff, 0x97, 0x5c, 0x78, 0xda, 0x03, 0xe0, 0x8a, 0xb2, 0x52, 0xcd, 0x38, 0x16, 0x32, 0x5f, 0xcc, + 0x38, 0xe0, 0x15, 0x96, 0x55, 0xce, 0x2b, 0xc0, 0xaa, 0x62, 0x25, 0xb0, 0x4c, 0x4d, 0x64, 0x09, + 0x58, 0xb0, 0x29, 0xc7, 0xc0, 0xab, 0xe5, 0x24, 0xe3, 0x68, 0x5e, 0x49, 0x25, 0xdb, 0xc8, 0xd2, + 0xc8, 0x68, 0xb4, 0x42, 0x5a, 0x23, 0x5b, 0xa3, 0x46, 0x47, 0xfb, 0x99, 0x04, 0x21, 0x01, 0x0b, + 0x28, 0xf0, 0xf2, 0xa8, 0x79, 0xe8, 0x41, 0x91, 0x6b, 0x86, 0xe0, 0x00, 0xac, 0x30, 0x19, 0xd1, + 0xa5, 0xa3, 0xb6, 0x4e, 0x6e, 0x2b, 0x0e, 0x73, 0x59, 0x82, 0x19, 0xd5, 0x79, 0xf2, 0xc3, 0x1d, + 0x0a, 0x45, 0xfb, 0xc1, 0x0f, 0x5b, 0x17, 0xac, 0xcc, 0x67, 0xbc, 0x7d, 0xec, 0xb8, 0x25, 0xa2, + 0x3a, 0x2e, 0x3a, 0x73, 0x85, 0xa3, 0xff, 0x93, 0x2b, 0x93, 0x75, 0xe0, 0x45, 0xbb, 0xf7, 0x5f, + 0xaf, 0x87, 0x7e, 0xff, 0x27, 0x78, 0xab, 0x63, 0x7f, 0x5d, 0xc7, 0xfe, 0x67, 0x1d, 0xfb, 0x8f, + 0x9b, 0xd8, 0x5b, 0x6f, 0x62, 0xef, 0x63, 0x13, 0x7b, 0x61, 0x27, 0x93, 0xc2, 0xf1, 0x5d, 0xfd, + 0xbd, 0x6b, 0xfd, 0x27, 0x87, 0xcd, 0xda, 0x43, 0xff, 0xe6, 0xa4, 0x98, 0xa8, 0xbb, 0xc5, 0x18, + 0x65, 0x52, 0x60, 0xb7, 0xcf, 0xf9, 0x1c, 0xb4, 0x7a, 0x34, 0x19, 0x8c, 0xe8, 0x4b, 0xb0, 0x15, + 0x41, 0x4d, 0x44, 0x82, 0x06, 0x3a, 0x62, 0x64, 0x47, 0x50, 0x36, 0xe5, 0xef, 0x5b, 0x20, 0x35, + 0x20, 0x4d, 0x52, 0x0d, 0x52, 0x1b, 0xa4, 0x0d, 0xa8, 0x03, 0xe2, 0x06, 0xd2, 0xf3, 0x61, 0x9f, + 0x72, 0xc5, 0x72, 0xa6, 0xd8, 0x77, 0xd0, 0xb5, 0x30, 0x21, 0x46, 0x13, 0x92, 0x10, 0xa2, 0x3d, + 0x21, 0xf6, 0x00, 0x42, 0x9a, 0x09, 0xe3, 0xd6, 0xdf, 0xc5, 0xe8, 0xfe, 0x06, 0x00, 0x00, 0xff, + 0xff, 0x0c, 0x66, 0x18, 0x81, 0x2a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/make/service.pb.gw.go b/x/orders/transactions/make/service.pb.gw.go deleted file mode 100644 index 600841b6c..000000000 --- a/x/orders/transactions/make/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/make/service.proto - -/* -Package make is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package make - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "make"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/modify/service.pb.go b/x/orders/transactions/modify/service.pb.go index 4b670af1a..7829f0aa6 100644 --- a/x/orders/transactions/modify/service.pb.go +++ b/x/orders/transactions/modify/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_8ff4398d92b669f7 = []byte{ - // 369 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x3f, 0x4b, 0xf3, 0x40, - 0x1c, 0x07, 0xf0, 0x24, 0xe5, 0xe9, 0x10, 0x9e, 0xa9, 0x8b, 0x10, 0x24, 0x83, 0xa3, 0xc3, 0x9d, - 0x7f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x39, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x6b, - 0x0c, 0x24, 0xb9, 0x92, 0xdf, 0xb5, 0xb4, 0x9b, 0xee, 0x0e, 0xee, 0x6e, 0x8e, 0x4e, 0xbe, 0x0c, - 0x71, 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x2a, 0xa4, 0xbd, 0x80, 0xd7, 0xf1, 0xa6, 0xc0, 0x5d, - 0x3e, 0xdf, 0x7c, 0x73, 0xf7, 0x73, 0x4f, 0xdb, 0x00, 0x5c, 0x52, 0x56, 0xc8, 0x8c, 0xe3, 0x5c, - 0xc4, 0xe3, 0x8c, 0x03, 0x9e, 0x62, 0x51, 0xc6, 0xbc, 0x04, 0x2c, 0x4b, 0x56, 0x00, 0x8b, 0x64, - 0x2a, 0x0a, 0x58, 0xee, 0xa6, 0xc3, 0x19, 0x06, 0x5e, 0x4e, 0xd2, 0x88, 0xa3, 0x51, 0x29, 0xa4, - 0x68, 0xed, 0x68, 0x1e, 0xd5, 0x1e, 0x4d, 0x91, 0xf2, 0x48, 0xf7, 0x48, 0x79, 0x6f, 0x23, 0x12, - 0x90, 0x0b, 0xc0, 0x39, 0x24, 0x78, 0xb2, 0xbb, 0x7c, 0xa8, 0x28, 0x6f, 0x33, 0x11, 0x22, 0xc9, - 0x38, 0x66, 0xa3, 0x14, 0xb3, 0xa2, 0x10, 0x92, 0x29, 0xa7, 0x76, 0xcd, 0x8b, 0xe6, 0x1c, 0x80, - 0x25, 0x75, 0x51, 0xef, 0xd2, 0xd8, 0x6b, 0x6b, 0xb7, 0x25, 0x87, 0x91, 0x28, 0xa0, 0x0e, 0xdb, - 0x7b, 0xb6, 0xdd, 0x06, 0x85, 0xa4, 0xf5, 0x68, 0xbb, 0xcd, 0x0b, 0x56, 0xc4, 0x19, 0x6f, 0x1d, - 0x21, 0xd3, 0x93, 0x40, 0x54, 0x15, 0xf4, 0xce, 0xcc, 0x69, 0xff, 0x6f, 0xed, 0xaa, 0xae, 0xb6, - 0x65, 0x79, 0xff, 0xee, 0xbf, 0xdf, 0xb6, 0xed, 0xce, 0x43, 0xe3, 0xbd, 0xf2, 0xed, 0x79, 0xe5, - 0xdb, 0x5f, 0x95, 0x6f, 0x3f, 0x2d, 0x7c, 0x6b, 0xbe, 0xf0, 0xad, 0xcf, 0x85, 0x6f, 0xb9, 0x07, - 0x91, 0xc8, 0x8d, 0xbf, 0xd6, 0xf9, 0x7f, 0xad, 0xee, 0xbc, 0xb7, 0xfc, 0xf9, 0x9e, 0x7d, 0x73, - 0x9c, 0xa4, 0xf2, 0x6e, 0x3c, 0x40, 0x91, 0xc8, 0xb1, 0xe9, 0xb1, 0xbe, 0x38, 0xcd, 0x36, 0x0d, - 0xba, 0x7d, 0xfa, 0xea, 0xac, 0xcd, 0x0e, 0xad, 0x8b, 0x04, 0xa8, 0xab, 0x8a, 0xf4, 0xf5, 0x22, - 0x74, 0x65, 0x3f, 0xd6, 0x48, 0x58, 0x93, 0x30, 0x08, 0x15, 0x09, 0x75, 0x12, 0x2a, 0x52, 0x39, - 0x27, 0xa6, 0x24, 0x3c, 0xef, 0x75, 0x28, 0x97, 0x2c, 0x66, 0x92, 0xfd, 0x38, 0x87, 0x1a, 0x27, - 0xa4, 0xf6, 0x84, 0x04, 0x84, 0xa8, 0x04, 0x42, 0xf4, 0x88, 0xd5, 0x1b, 0xe9, 0x70, 0x36, 0x68, - 0xae, 0x06, 0x65, 0xff, 0x37, 0x00, 0x00, 0xff, 0xff, 0x5a, 0x50, 0x3d, 0xb2, 0x60, 0x03, 0x00, - 0x00, + // 355 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0x19, 0x32, 0xbc, 0xa3, 0xc3, + 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x39, 0x5a, 0xb4, 0x43, 0x90, 0x80, 0x5c, 0x93, + 0x6b, 0x0c, 0x34, 0xb9, 0x92, 0xe7, 0x5a, 0xda, 0x4d, 0x77, 0x07, 0x77, 0x37, 0x47, 0x27, 0xff, + 0x0c, 0x71, 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xf8, 0x57, 0x48, 0x7b, 0x07, 0x5e, 0xc7, 0x9b, 0x02, + 0x97, 0x7c, 0xbe, 0xf9, 0x3e, 0xc9, 0xe3, 0x9f, 0xb4, 0x01, 0xb8, 0xa4, 0xac, 0x94, 0x23, 0x8e, + 0x0b, 0x91, 0x4e, 0x46, 0x1c, 0xf0, 0x0c, 0x8b, 0x2a, 0xe5, 0x15, 0x60, 0x59, 0xb1, 0x12, 0x58, + 0x22, 0x73, 0x51, 0xc2, 0xea, 0x6e, 0x3e, 0x9c, 0x63, 0xe0, 0xd5, 0x34, 0x4f, 0x38, 0x1a, 0x57, + 0x42, 0x8a, 0xd6, 0xb6, 0xe1, 0x91, 0xf6, 0x68, 0x86, 0x94, 0x47, 0xa6, 0x47, 0xca, 0x07, 0xff, + 0x12, 0x01, 0x85, 0x00, 0x5c, 0x40, 0x86, 0xa7, 0x3b, 0xab, 0x8b, 0x8a, 0x0a, 0xec, 0xab, 0x14, + 0x1c, 0x80, 0x65, 0xba, 0x4a, 0x70, 0x61, 0xed, 0x8d, 0xb3, 0x9b, 0x8a, 0xc3, 0x58, 0x94, 0xa0, + 0xc3, 0x76, 0x9f, 0x5c, 0xbf, 0x41, 0x21, 0x6b, 0x3d, 0xb8, 0x7e, 0xf3, 0x9c, 0x95, 0xe9, 0x88, + 0xb7, 0x0e, 0x91, 0xed, 0xac, 0x88, 0xaa, 0x82, 0xc1, 0xa9, 0x3d, 0xed, 0xff, 0x9e, 0x5d, 0xea, + 0x6a, 0xff, 0x9d, 0xe0, 0xcf, 0xdd, 0xd7, 0xeb, 0x96, 0xdb, 0xb9, 0x6f, 0xbc, 0xd5, 0xa1, 0xbb, + 0xa8, 0x43, 0xf7, 0xb3, 0x0e, 0xdd, 0xc7, 0x65, 0xe8, 0x2c, 0x96, 0xa1, 0xf3, 0xb1, 0x0c, 0x1d, + 0x7f, 0x3f, 0x11, 0x85, 0xf5, 0xdb, 0x3a, 0x7f, 0xaf, 0xd4, 0x5f, 0xed, 0xad, 0x86, 0xef, 0xb9, + 0xd7, 0x47, 0x59, 0x2e, 0x6f, 0x27, 0x03, 0x94, 0x88, 0x02, 0xdb, 0x7e, 0xd6, 0x67, 0xaf, 0xd9, + 0xa6, 0x51, 0xb7, 0x4f, 0x5f, 0xbc, 0x8d, 0xed, 0xa0, 0xba, 0x48, 0x84, 0xba, 0xaa, 0x48, 0xdf, + 0x2c, 0x42, 0xd7, 0xf6, 0x7d, 0x83, 0xc4, 0x9a, 0xc4, 0x51, 0xac, 0x48, 0x6c, 0x92, 0x58, 0x91, + 0xda, 0x3b, 0xb6, 0x25, 0xf1, 0x59, 0xaf, 0x43, 0xb9, 0x64, 0x29, 0x93, 0xec, 0xdb, 0x3b, 0x30, + 0x38, 0x21, 0xda, 0x13, 0x12, 0x11, 0xa2, 0x12, 0x08, 0x31, 0x23, 0xd6, 0x4f, 0xe4, 0xc3, 0xf9, + 0xa0, 0xb9, 0x5e, 0x94, 0xbd, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc3, 0x98, 0x4d, 0x5b, 0x42, + 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/modify/service.pb.gw.go b/x/orders/transactions/modify/service.pb.gw.go deleted file mode 100644 index aa9a824fb..000000000 --- a/x/orders/transactions/modify/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/modify/service.proto - -/* -Package modify is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package modify - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "modify"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/put/service.pb.go b/x/orders/transactions/put/service.pb.go index c0775de06..a61a1a4ff 100644 --- a/x/orders/transactions/put/service.pb.go +++ b/x/orders/transactions/put/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,29 @@ func init() { } var fileDescriptor_ca7dda5a8ae78412 = []byte{ - // 370 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0x31, 0x4b, 0xe4, 0x40, - 0x14, 0xc7, 0x93, 0x1c, 0xb7, 0x45, 0xb8, 0x6a, 0x9b, 0x83, 0x70, 0xa4, 0xb8, 0x52, 0x70, 0x86, - 0x5d, 0x41, 0x74, 0xac, 0x36, 0x8d, 0xdb, 0x84, 0x0d, 0xba, 0x45, 0x90, 0x80, 0xcc, 0x26, 0x43, - 0x0c, 0x24, 0x99, 0x90, 0xf7, 0xb2, 0x6c, 0x69, 0x65, 0x6d, 0xe3, 0x17, 0xb0, 0xb4, 0xf2, 0x63, - 0x88, 0xd5, 0x96, 0x96, 0x92, 0x2d, 0x04, 0x1b, 0xbf, 0x82, 0xec, 0x66, 0xc0, 0x6c, 0x39, 0x55, - 0xe0, 0xe5, 0xff, 0x7b, 0xf3, 0x9b, 0x37, 0xcf, 0x3e, 0x9b, 0x00, 0x08, 0xf4, 0x79, 0x89, 0xb9, - 0xa0, 0x85, 0x4c, 0x9a, 0x5c, 0x00, 0x5d, 0x51, 0x59, 0x27, 0xa2, 0x06, 0x8a, 0x35, 0x2f, 0x81, - 0xc7, 0x98, 0xc9, 0x12, 0x68, 0xd5, 0x20, 0x05, 0x51, 0x2f, 0xb3, 0x58, 0x90, 0xaa, 0x96, 0x28, - 0x87, 0x87, 0x3d, 0x98, 0x28, 0x98, 0xac, 0x48, 0x07, 0x93, 0x3e, 0x4c, 0xaa, 0x06, 0x9d, 0xbf, - 0xb1, 0x84, 0x42, 0x02, 0x2d, 0x20, 0xa5, 0xcb, 0xd1, 0xf6, 0xd3, 0xf5, 0x71, 0xfe, 0xa5, 0x52, - 0xa6, 0xb9, 0xa0, 0xbc, 0xca, 0x28, 0x2f, 0x4b, 0x89, 0x5c, 0x41, 0xbb, 0xbf, 0x9a, 0x8a, 0x85, - 0x00, 0xe0, 0xa9, 0x52, 0x74, 0xa6, 0x7a, 0x70, 0xaf, 0x70, 0x5d, 0x0b, 0xa8, 0x64, 0x09, 0xaa, - 0xd3, 0xf8, 0xc1, 0xb4, 0x7f, 0xf9, 0x90, 0x0e, 0xef, 0x4c, 0x7b, 0x30, 0xe5, 0x65, 0x92, 0x8b, - 0xe1, 0x31, 0xd1, 0x1a, 0x00, 0xf1, 0x3b, 0x35, 0xc7, 0xd3, 0xe4, 0xe6, 0x3f, 0x85, 0x0b, 0x25, - 0xf5, 0xdf, 0x70, 0x7e, 0xdf, 0x7e, 0x3c, 0x1f, 0x98, 0xde, 0x97, 0xf5, 0xd2, 0xba, 0xe6, 0xba, - 0x75, 0xcd, 0xf7, 0xd6, 0x35, 0xef, 0x37, 0xae, 0xb1, 0xde, 0xb8, 0xc6, 0xdb, 0xc6, 0x35, 0xec, - 0x51, 0x2c, 0x0b, 0xbd, 0xa3, 0xbc, 0x3f, 0x97, 0xdd, 0x0b, 0x07, 0xdb, 0x3b, 0x07, 0xe6, 0xd5, - 0x49, 0x9a, 0xe1, 0x4d, 0xb3, 0x20, 0xb1, 0x2c, 0xa8, 0xd6, 0x28, 0x1f, 0xad, 0xc1, 0xc4, 0x0f, - 0x67, 0xf3, 0xe0, 0xc9, 0xda, 0x5b, 0x13, 0x5f, 0x29, 0x84, 0x64, 0xd6, 0x29, 0xcc, 0xfb, 0x0a, - 0x41, 0x83, 0xaf, 0x7b, 0xf9, 0x48, 0xe5, 0xa3, 0x30, 0xea, 0xf2, 0x51, 0x3f, 0x1f, 0x05, 0x0d, - 0xb6, 0xd6, 0xa9, 0x56, 0x3e, 0x3a, 0x0f, 0x3c, 0x5f, 0x20, 0x4f, 0x38, 0xf2, 0x4f, 0x6b, 0xdc, - 0x63, 0x19, 0x53, 0x30, 0x63, 0x21, 0x63, 0x1d, 0xce, 0x58, 0x9f, 0x67, 0x2c, 0x68, 0x70, 0x31, - 0xd8, 0x2d, 0xc4, 0xd1, 0x77, 0x00, 0x00, 0x00, 0xff, 0xff, 0xbc, 0x73, 0xed, 0xbb, 0x3c, 0x03, - 0x00, 0x00, + // 351 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xb1, 0x4b, 0xfb, 0x40, + 0x14, 0xc7, 0x93, 0xfc, 0xf8, 0x75, 0x08, 0x4e, 0x5d, 0x84, 0x0c, 0x19, 0x1c, 0x05, 0xef, 0x68, + 0x05, 0xd1, 0x73, 0x6a, 0x16, 0xbb, 0x84, 0x06, 0xed, 0x10, 0x24, 0x20, 0xd7, 0xe4, 0x88, 0x85, + 0x26, 0x17, 0xf2, 0xee, 0x4a, 0x47, 0x27, 0x67, 0x17, 0xff, 0x01, 0x47, 0x27, 0xff, 0x0c, 0x71, + 0xea, 0xe8, 0x28, 0xe9, 0x20, 0xb8, 0xf8, 0x2f, 0x48, 0xbd, 0x03, 0xaf, 0xe3, 0x4d, 0x07, 0x8f, + 0xef, 0xe7, 0xdd, 0xe7, 0xdd, 0x3d, 0xff, 0x7c, 0x04, 0xc0, 0x44, 0x4c, 0x6b, 0xb1, 0x60, 0xb8, + 0xe2, 0x85, 0x5c, 0x30, 0xc0, 0x2b, 0xcc, 0xdb, 0x82, 0xb5, 0x80, 0x45, 0x4b, 0x6b, 0xa0, 0xb9, + 0x98, 0xf3, 0x1a, 0x70, 0x23, 0x05, 0x06, 0xd6, 0x2e, 0xe7, 0x39, 0x43, 0x4d, 0xcb, 0x05, 0xef, + 0x1f, 0x19, 0x30, 0xd2, 0x30, 0x5a, 0x21, 0x05, 0x23, 0x13, 0x46, 0x8d, 0x14, 0xc1, 0x7e, 0xce, + 0xa1, 0xe2, 0x80, 0x2b, 0x28, 0xf1, 0x72, 0xb0, 0x3d, 0x54, 0x9f, 0xc0, 0x52, 0xa2, 0x62, 0x00, + 0xb4, 0xd4, 0x12, 0xc1, 0xd8, 0x0e, 0x36, 0x0a, 0x37, 0x2d, 0x83, 0x86, 0xd7, 0xa0, 0x3b, 0x0d, + 0x1f, 0x5d, 0xff, 0x5f, 0x0c, 0x65, 0xff, 0xde, 0xf5, 0x7b, 0x63, 0x5a, 0x17, 0x0b, 0xd6, 0x3f, + 0x41, 0x56, 0x23, 0xa2, 0x58, 0xa9, 0x05, 0x91, 0x25, 0x37, 0xfd, 0x2b, 0x5c, 0x6a, 0xa9, 0x03, + 0x27, 0xf8, 0x7f, 0xf7, 0xf9, 0x72, 0xe8, 0x46, 0xdf, 0xde, 0x6b, 0x17, 0xba, 0xeb, 0x2e, 0x74, + 0x3f, 0xba, 0xd0, 0x7d, 0xd8, 0x84, 0xce, 0x7a, 0x13, 0x3a, 0xef, 0x9b, 0xd0, 0xf1, 0x07, 0x39, + 0xaf, 0xec, 0xae, 0x8a, 0xf6, 0xae, 0xd4, 0x1f, 0x26, 0xdb, 0x99, 0x13, 0xf7, 0xfa, 0xb4, 0x9c, + 0x8b, 0x5b, 0x39, 0x43, 0x39, 0xaf, 0xb0, 0xd5, 0x53, 0x3e, 0x79, 0xbd, 0x51, 0x9c, 0x4e, 0xa6, + 0xc9, 0xb3, 0xb7, 0xb3, 0x08, 0xb1, 0x56, 0x48, 0xd1, 0x44, 0x29, 0x4c, 0x4d, 0x85, 0x44, 0x8a, + 0xb7, 0x9d, 0x7c, 0xa6, 0xf3, 0x59, 0x9a, 0xa9, 0x7c, 0x66, 0xe6, 0xb3, 0x44, 0x8a, 0xce, 0x3b, + 0xb3, 0xca, 0x67, 0x17, 0x49, 0x14, 0x33, 0x41, 0x0b, 0x2a, 0xe8, 0x97, 0x37, 0x34, 0x58, 0x42, + 0x34, 0x4c, 0x48, 0x4a, 0x88, 0xc2, 0x09, 0x31, 0x79, 0x42, 0x12, 0x29, 0x66, 0xbd, 0xdf, 0x85, + 0x38, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0xd5, 0x77, 0x99, 0xc6, 0x1e, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/put/service.pb.gw.go b/x/orders/transactions/put/service.pb.gw.go deleted file mode 100644 index abcc4c4e4..000000000 --- a/x/orders/transactions/put/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/put/service.proto - -/* -Package put is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package put - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "put"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/revoke/service.pb.go b/x/orders/transactions/revoke/service.pb.go index 2f0697800..07716844b 100644 --- a/x/orders/transactions/revoke/service.pb.go +++ b/x/orders/transactions/revoke/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,31 +31,30 @@ func init() { } var fileDescriptor_d9b7810b72c042ec = []byte{ - // 370 bytes of a gzipped FileDescriptorProto + // 353 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xbf, 0x4b, 0xf3, 0x40, - 0x18, 0x07, 0xf0, 0x24, 0xe5, 0xed, 0x10, 0xde, 0xa9, 0xcb, 0x0b, 0xe1, 0x25, 0xc3, 0x3b, 0xbe, - 0xc3, 0x9d, 0x3f, 0x07, 0x4f, 0x11, 0x5a, 0x10, 0x05, 0x09, 0x2d, 0xb5, 0x43, 0x90, 0x80, 0x5c, - 0x93, 0x23, 0x06, 0x93, 0x3c, 0x25, 0xcf, 0xb5, 0x74, 0xd4, 0xdd, 0xc1, 0xdd, 0xcd, 0xd1, 0xc9, - 0x3f, 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xfe, 0x15, 0xd2, 0x5e, 0xc0, 0xeb, 0x78, 0x53, - 0xe0, 0xc2, 0xe7, 0x9b, 0x6f, 0x9e, 0x7b, 0xdc, 0xe3, 0x2e, 0xa2, 0x90, 0x01, 0x2f, 0x65, 0x2e, - 0x68, 0x01, 0xc9, 0x34, 0x17, 0x48, 0xe7, 0x14, 0xaa, 0x44, 0x54, 0x48, 0x65, 0xc5, 0x4b, 0xe4, - 0xb1, 0xcc, 0xa0, 0x44, 0x5a, 0x89, 0x19, 0xdc, 0x08, 0x8a, 0xa2, 0x9a, 0x65, 0xb1, 0x20, 0x93, - 0x0a, 0x24, 0x74, 0xb6, 0x34, 0x4f, 0x1a, 0x4f, 0xe6, 0x44, 0x79, 0xa2, 0x7b, 0xa2, 0xbc, 0xf7, - 0x27, 0x06, 0x2c, 0x00, 0x69, 0x81, 0x29, 0x9d, 0x6d, 0xaf, 0x1e, 0x2a, 0xca, 0xfb, 0x9b, 0x02, - 0xa4, 0xb9, 0xa0, 0x7c, 0x92, 0x51, 0x5e, 0x96, 0x20, 0xb9, 0x72, 0xea, 0xad, 0x79, 0xd1, 0x42, - 0x20, 0xf2, 0xb4, 0x29, 0xea, 0x9d, 0x1b, 0x7b, 0xed, 0xec, 0xaa, 0x12, 0x38, 0x81, 0x12, 0x9b, - 0xb0, 0x9d, 0x47, 0xdb, 0x6d, 0x05, 0x98, 0x76, 0xee, 0x6d, 0xb7, 0x7d, 0xc6, 0xcb, 0x24, 0x17, - 0x9d, 0x03, 0x62, 0x3a, 0x09, 0x12, 0xa8, 0x82, 0xde, 0x89, 0x39, 0x1d, 0xfd, 0x9c, 0x0d, 0x9b, - 0x6a, 0xff, 0x2c, 0xef, 0xd7, 0xed, 0xe7, 0xcb, 0x7f, 0xbb, 0x77, 0xd7, 0x7a, 0xad, 0x7d, 0x7b, - 0x51, 0xfb, 0xf6, 0x47, 0xed, 0xdb, 0x0f, 0x4b, 0xdf, 0x5a, 0x2c, 0x7d, 0xeb, 0x7d, 0xe9, 0x5b, - 0xee, 0x5e, 0x0c, 0x85, 0xf1, 0xd7, 0x7a, 0xbf, 0x2f, 0xd4, 0x9d, 0x0f, 0x56, 0x3f, 0x3f, 0xb0, - 0x2f, 0x0f, 0xd3, 0x4c, 0x5e, 0x4f, 0xc7, 0x24, 0x86, 0x82, 0x9a, 0x8e, 0xf5, 0xc9, 0x69, 0x77, - 0x83, 0xb0, 0x3f, 0x1a, 0x3e, 0x3b, 0x1b, 0xbb, 0x13, 0x34, 0x45, 0x42, 0xd2, 0x57, 0x45, 0x46, - 0x7a, 0x91, 0xe1, 0xda, 0xbe, 0x6d, 0x90, 0xa8, 0x21, 0x51, 0x18, 0x29, 0x12, 0xe9, 0x24, 0x52, - 0xa4, 0x76, 0x8e, 0x4c, 0x49, 0x74, 0x3a, 0xe8, 0x05, 0x42, 0xf2, 0x84, 0x4b, 0xfe, 0xe5, 0xec, - 0x6b, 0x9c, 0xb1, 0xc6, 0x33, 0x16, 0x32, 0xa6, 0x12, 0x18, 0xd3, 0x23, 0x18, 0x53, 0x19, 0xe3, - 0xf6, 0x7a, 0x51, 0x76, 0xbf, 0x03, 0x00, 0x00, 0xff, 0xff, 0x47, 0x0d, 0xa9, 0x75, 0x60, 0x03, - 0x00, 0x00, + 0x18, 0x07, 0xf0, 0x5c, 0xca, 0xdb, 0x21, 0xbc, 0x53, 0x97, 0x17, 0x32, 0x64, 0x78, 0x47, 0x87, + 0x3b, 0x7f, 0x0e, 0x9e, 0x22, 0xb4, 0x20, 0x0a, 0x12, 0x5a, 0x6a, 0x87, 0x20, 0x01, 0xb9, 0x26, + 0x47, 0x2c, 0x36, 0xb9, 0x72, 0xcf, 0xb5, 0x74, 0xd4, 0xdd, 0xc1, 0xdd, 0xcd, 0xd1, 0xc9, 0x3f, + 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xfe, 0x15, 0xd2, 0xde, 0x81, 0xd7, 0xf1, 0xa6, 0xc0, + 0x03, 0x9f, 0x6f, 0xbe, 0x4f, 0xf2, 0x04, 0x27, 0x6d, 0x00, 0xae, 0x62, 0x56, 0xa9, 0x31, 0x27, + 0xa5, 0xc8, 0xa7, 0x63, 0x0e, 0x64, 0x4e, 0x84, 0xcc, 0xb9, 0x04, 0xa2, 0x24, 0xab, 0x80, 0x65, + 0x6a, 0x24, 0x2a, 0x20, 0x92, 0xcf, 0xc4, 0x2d, 0x27, 0xc0, 0xe5, 0x6c, 0x94, 0x71, 0x3c, 0x91, + 0x42, 0x89, 0xd6, 0xb6, 0xe5, 0xb1, 0xf1, 0x78, 0x8e, 0xb5, 0xc7, 0xb6, 0xc7, 0xda, 0x87, 0xff, + 0x32, 0x01, 0xa5, 0x00, 0x52, 0x42, 0x41, 0x66, 0x3b, 0xab, 0x87, 0x8e, 0x0a, 0xdd, 0xab, 0x94, + 0x1c, 0x80, 0x15, 0xa6, 0x4a, 0x78, 0xe1, 0xec, 0xad, 0xd9, 0xb5, 0xe4, 0x30, 0x11, 0x15, 0x98, + 0xb0, 0xdd, 0x27, 0x14, 0x34, 0x62, 0x28, 0x5a, 0x0f, 0x28, 0x68, 0x9e, 0xb3, 0x2a, 0x1f, 0xf3, + 0xd6, 0x21, 0x76, 0xdd, 0x15, 0xc7, 0xba, 0x60, 0x78, 0xea, 0x4e, 0x07, 0xbf, 0xb3, 0xbe, 0xa9, + 0xf6, 0xdf, 0x0b, 0xff, 0xdc, 0x7d, 0xbd, 0x6e, 0xa1, 0xce, 0x7d, 0xe3, 0xad, 0x8e, 0xd0, 0xa2, + 0x8e, 0xd0, 0x67, 0x1d, 0xa1, 0xc7, 0x65, 0xe4, 0x2d, 0x96, 0x91, 0xf7, 0xb1, 0x8c, 0xbc, 0x60, + 0x3f, 0x13, 0xa5, 0xf3, 0xdb, 0x3a, 0x7f, 0x2f, 0xf5, 0x5f, 0xed, 0xad, 0x96, 0xef, 0xa1, 0xab, + 0xa3, 0x62, 0xa4, 0x6e, 0xa6, 0x43, 0x9c, 0x89, 0x92, 0xb8, 0x7e, 0xd6, 0x67, 0xbf, 0xd9, 0x8e, + 0x93, 0xee, 0xa0, 0xff, 0xe2, 0x6f, 0x5c, 0x47, 0x6c, 0x8a, 0x24, 0xb8, 0xab, 0x8b, 0x0c, 0xec, + 0x22, 0xfd, 0xb5, 0x7d, 0xdf, 0x20, 0xa9, 0x21, 0x69, 0x92, 0x6a, 0x92, 0xda, 0x24, 0xd5, 0xa4, + 0xf6, 0x8f, 0x5d, 0x49, 0x7a, 0xd6, 0xeb, 0xc4, 0x5c, 0xb1, 0x9c, 0x29, 0xf6, 0xed, 0x1f, 0x58, + 0x9c, 0x52, 0xe3, 0x29, 0x4d, 0x28, 0xd5, 0x09, 0x94, 0xda, 0x11, 0x94, 0xea, 0x8c, 0x61, 0x73, + 0x7d, 0x28, 0x7b, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x30, 0x12, 0x67, 0x70, 0x42, 0x03, 0x00, + 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/revoke/service.pb.gw.go b/x/orders/transactions/revoke/service.pb.gw.go deleted file mode 100644 index 2e772ae33..000000000 --- a/x/orders/transactions/revoke/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/revoke/service.proto - -/* -Package revoke is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package revoke - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "revoke"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/orders/transactions/take/service.pb.go b/x/orders/transactions/take/service.pb.go index 1c25a3033..463b0f1a1 100644 --- a/x/orders/transactions/take/service.pb.go +++ b/x/orders/transactions/take/service.pb.go @@ -9,7 +9,6 @@ import ( _ "github.com/cosmos/cosmos-sdk/types/msgservice" 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" @@ -32,30 +31,29 @@ func init() { } var fileDescriptor_bef3612b3af5a204 = []byte{ - // 364 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0xb1, 0x4b, 0xeb, 0x40, - 0x1c, 0xc0, 0xf1, 0x24, 0x8f, 0xd7, 0x21, 0xbc, 0xa9, 0xcb, 0x83, 0xf0, 0xc8, 0xf0, 0x46, 0x87, - 0x3b, 0x6c, 0x07, 0xf1, 0x70, 0x69, 0x1d, 0xd4, 0x21, 0xb4, 0x68, 0x86, 0x20, 0x01, 0xb9, 0x26, - 0x47, 0x0c, 0x4d, 0xee, 0x4a, 0x7e, 0xd7, 0xd2, 0xd1, 0xd1, 0xd1, 0xcd, 0xdd, 0xd1, 0xc9, 0x3f, - 0x43, 0x9c, 0x3a, 0x3a, 0x4a, 0x3a, 0x08, 0xee, 0xee, 0x12, 0xef, 0xc0, 0xeb, 0x78, 0x53, 0xe0, - 0xc2, 0xe7, 0x97, 0x6f, 0x7e, 0x89, 0x7f, 0x34, 0x02, 0x60, 0x32, 0xa2, 0x5c, 0x56, 0x0c, 0xd7, - 0x22, 0x5f, 0x56, 0x0c, 0xf0, 0x1a, 0x8b, 0x26, 0x67, 0x0d, 0x60, 0xd9, 0x50, 0x0e, 0x34, 0x93, - 0xa5, 0xe0, 0x80, 0x25, 0x9d, 0x33, 0x0c, 0xac, 0x59, 0x95, 0x19, 0x43, 0x8b, 0x46, 0x48, 0xd1, - 0x47, 0x86, 0x46, 0x5a, 0xa3, 0x35, 0x52, 0x1a, 0x99, 0x1a, 0x75, 0x3a, 0xf8, 0x9b, 0x09, 0xa8, - 0x05, 0xe0, 0x1a, 0x0a, 0xbc, 0xda, 0xef, 0x2e, 0x6a, 0x50, 0xf0, 0xaf, 0x10, 0xa2, 0xa8, 0x18, - 0xa6, 0x8b, 0x12, 0x53, 0xce, 0x85, 0xa4, 0x4a, 0xa9, 0xbb, 0xb6, 0x91, 0x35, 0x03, 0xa0, 0x85, - 0x8e, 0x0c, 0xce, 0x2c, 0xb5, 0x71, 0x72, 0xd5, 0x30, 0x58, 0x08, 0x0e, 0x7a, 0xd4, 0xe0, 0xde, - 0xf5, 0x7f, 0x45, 0x50, 0xf4, 0x6f, 0x5d, 0xbf, 0x77, 0x4a, 0x79, 0x5e, 0xb1, 0xfe, 0x81, 0xe5, - 0x0e, 0x50, 0xa4, 0xe2, 0x82, 0x63, 0x5b, 0x18, 0xff, 0x9c, 0x9c, 0xeb, 0xac, 0xff, 0x4e, 0xf0, - 0xfb, 0xe6, 0xfd, 0x69, 0xcf, 0x1d, 0x7f, 0x7a, 0xcf, 0x6d, 0xe8, 0x6e, 0xda, 0xd0, 0x7d, 0x6b, - 0x43, 0xf7, 0x6e, 0x1b, 0x3a, 0x9b, 0x6d, 0xe8, 0xbc, 0x6e, 0x43, 0xc7, 0x1f, 0x64, 0xa2, 0xb6, - 0x7c, 0xd6, 0xf8, 0xcf, 0x85, 0xfa, 0xce, 0xd3, 0xee, 0xb5, 0xa7, 0xee, 0xe5, 0x61, 0x51, 0xca, - 0xeb, 0xe5, 0x0c, 0x65, 0xa2, 0xc6, 0x76, 0xeb, 0x7c, 0xf0, 0x7a, 0xa3, 0x28, 0x99, 0xc4, 0xf1, - 0xa3, 0xb7, 0x13, 0x11, 0xe9, 0x88, 0x04, 0x4d, 0x54, 0x44, 0x6c, 0x46, 0xc4, 0x74, 0xce, 0x5e, - 0x76, 0x40, 0xaa, 0x41, 0x9a, 0xa4, 0x0a, 0xa4, 0x26, 0x48, 0x3b, 0xd0, 0x7a, 0xc4, 0x0e, 0xa4, - 0x27, 0xd3, 0x71, 0xc4, 0x24, 0xcd, 0xa9, 0xa4, 0x1f, 0xde, 0xd0, 0xc0, 0x84, 0x68, 0x4d, 0x48, - 0x42, 0x88, 0xf2, 0x84, 0x98, 0x03, 0x08, 0xe9, 0x26, 0xcc, 0x7a, 0xdf, 0x3f, 0xc6, 0xf0, 0x2b, - 0x00, 0x00, 0xff, 0xff, 0xd6, 0x20, 0x59, 0x49, 0x48, 0x03, 0x00, 0x00, + // 345 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd2, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc0, 0xf1, 0x5c, 0xc4, 0x0e, 0xc1, 0xa9, 0x8b, 0x90, 0x21, 0x83, 0xa3, 0xc3, 0x1d, 0xb6, + 0x83, 0x78, 0xb8, 0xb4, 0x0e, 0xea, 0x10, 0x5a, 0x34, 0x43, 0x90, 0x80, 0x5c, 0x93, 0x23, 0x96, + 0x36, 0xb9, 0x92, 0x77, 0x2d, 0x1d, 0x1d, 0x1d, 0xdd, 0xdc, 0x1d, 0x9d, 0xfc, 0x18, 0xe2, 0xd4, + 0xd1, 0x51, 0x92, 0x41, 0x70, 0x77, 0x97, 0x78, 0x07, 0x5e, 0xc7, 0x9b, 0x02, 0x07, 0xbf, 0x97, + 0xff, 0x4b, 0xce, 0x3b, 0x1d, 0x00, 0x70, 0x19, 0xb2, 0x52, 0xce, 0x39, 0x29, 0x44, 0xb6, 0x9c, + 0x73, 0x20, 0x6b, 0x22, 0xaa, 0x8c, 0x57, 0x40, 0x64, 0xc5, 0x4a, 0x60, 0xa9, 0x9c, 0x8a, 0x12, + 0x88, 0x64, 0x33, 0x4e, 0x80, 0x57, 0xab, 0x69, 0xca, 0xf1, 0xa2, 0x12, 0x52, 0x74, 0xb1, 0xa1, + 0xb1, 0xd6, 0x78, 0x8d, 0x95, 0xc6, 0xa6, 0xc6, 0xad, 0xf6, 0xf7, 0x53, 0x01, 0x85, 0x00, 0x52, + 0x40, 0x4e, 0x56, 0x47, 0xed, 0x43, 0x0d, 0xf2, 0x6d, 0x33, 0x0a, 0x0e, 0xc0, 0x72, 0x9d, 0xe1, + 0x5f, 0x5a, 0x6a, 0xe3, 0xe4, 0xb6, 0xe2, 0xb0, 0x10, 0x25, 0xe8, 0x51, 0xbd, 0x27, 0xe4, 0xed, + 0x84, 0x90, 0x77, 0x1f, 0x90, 0xd7, 0xb9, 0x60, 0x65, 0x36, 0xe7, 0xdd, 0x63, 0xcb, 0x2d, 0x71, + 0xa8, 0xe2, 0xfc, 0x33, 0x5b, 0x18, 0xfd, 0x9f, 0x5c, 0xe9, 0xac, 0x03, 0xc7, 0xdf, 0xbd, 0xff, + 0x7a, 0x3d, 0x44, 0xc3, 0x1f, 0xf7, 0xad, 0x0e, 0xd0, 0xa6, 0x0e, 0xd0, 0x67, 0x1d, 0xa0, 0xc7, + 0x26, 0x70, 0x36, 0x4d, 0xe0, 0x7c, 0x34, 0x81, 0xe3, 0xf5, 0x52, 0x51, 0x58, 0xbe, 0x6b, 0xb8, + 0x77, 0xad, 0xfe, 0xe4, 0xb8, 0x5d, 0x7b, 0x8c, 0x6e, 0x4e, 0xf2, 0xa9, 0xbc, 0x5b, 0x4e, 0x70, + 0x2a, 0x0a, 0x62, 0xf7, 0x39, 0x9f, 0xdd, 0xce, 0x20, 0x8c, 0x47, 0x51, 0xf4, 0xe2, 0x6e, 0x45, + 0x84, 0x3a, 0x22, 0xc6, 0x23, 0x15, 0x11, 0x99, 0x11, 0x11, 0x9b, 0xf1, 0xf7, 0x2d, 0x90, 0x68, + 0x90, 0xc4, 0x89, 0x02, 0x89, 0x09, 0x92, 0x16, 0xd4, 0x2e, 0xb5, 0x03, 0xc9, 0xf9, 0x78, 0x18, + 0x72, 0xc9, 0x32, 0x26, 0xd9, 0xb7, 0xdb, 0x37, 0x30, 0xa5, 0x5a, 0x53, 0x1a, 0x53, 0xaa, 0x3c, + 0xa5, 0xe6, 0x00, 0x4a, 0xdb, 0x09, 0x93, 0xce, 0xdf, 0xc5, 0xe8, 0xff, 0x06, 0x00, 0x00, 0xff, + 0xff, 0xc4, 0x53, 0x10, 0x96, 0x2a, 0x03, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/orders/transactions/take/service.pb.gw.go b/x/orders/transactions/take/service.pb.gw.go deleted file mode 100644 index 1a351d367..000000000 --- a/x/orders/transactions/take/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/orders/transactions/take/service.proto - -/* -Package take is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package take - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Msg_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client MsgClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Msg_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server MsgServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq Message - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Msg_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterMsgHandlerServer registers the http handlers for service Msg to "mux". -// UnaryRPC :call MsgServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterMsgHandlerFromEndpoint instead. -func RegisterMsgHandlerServer(ctx context.Context, mux *runtime.ServeMux, server MsgServer) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Msg_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterMsgHandlerFromEndpoint is same as RegisterMsgHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterMsgHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterMsgHandler(ctx, mux, conn) -} - -// RegisterMsgHandler registers the http handlers for service Msg to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterMsgHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterMsgHandlerClient(ctx, mux, NewMsgClient(conn)) -} - -// RegisterMsgHandlerClient registers the http handlers for service Msg -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "MsgClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "MsgClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "MsgClient" to call the correct interceptors. -func RegisterMsgHandlerClient(ctx context.Context, mux *runtime.ServeMux, client MsgClient) error { - - mux.Handle("POST", pattern_Msg_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Msg_Handle_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Msg_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Msg_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"mantle", "orders", "take"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Msg_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/splits/queries/balances/service.pb.go b/x/splits/queries/balances/service.pb.go index 5093b337d..a7868183a 100644 --- a/x/splits/queries/balances/service.pb.go +++ b/x/splits/queries/balances/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,28 @@ func init() { } var fileDescriptor_853cff3c2933ae7a = []byte{ - // 366 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xb1, 0x4a, 0xc3, 0x40, - 0x1c, 0xc6, 0x9b, 0x80, 0x1d, 0x82, 0x53, 0xc6, 0x22, 0x11, 0x5d, 0x9c, 0xbc, 0xa3, 0x75, 0xd1, - 0xab, 0x4b, 0xb3, 0xe8, 0x12, 0x68, 0xed, 0x12, 0x24, 0x20, 0x97, 0xf4, 0x4f, 0x0d, 0x24, 0x77, - 0x69, 0xee, 0x52, 0xea, 0xea, 0x13, 0x08, 0xbe, 0x81, 0xa3, 0x38, 0xfb, 0x0c, 0xe2, 0x54, 0x70, - 0x71, 0x94, 0xd4, 0xc9, 0xc5, 0x57, 0x90, 0xf6, 0x2e, 0xd2, 0x8e, 0xe9, 0x9a, 0x7c, 0xbf, 0x8f, - 0xdf, 0x77, 0x77, 0x56, 0xb7, 0x27, 0x04, 0x48, 0x8f, 0x32, 0x99, 0x00, 0x4e, 0xf9, 0xa8, 0x48, - 0x40, 0xe0, 0x19, 0x16, 0x59, 0x12, 0x4b, 0x81, 0x27, 0x05, 0xe4, 0x31, 0x08, 0x1c, 0xd2, 0x84, - 0xb2, 0x08, 0x04, 0x16, 0x90, 0x4f, 0xe3, 0x08, 0x50, 0x96, 0x73, 0xc9, 0xed, 0xe3, 0x35, 0x18, - 0x69, 0x18, 0xcd, 0x90, 0x82, 0x91, 0x86, 0x51, 0x05, 0xb7, 0xf6, 0xc6, 0x9c, 0x8f, 0x13, 0xc0, - 0x34, 0x8b, 0x31, 0x65, 0x8c, 0x4b, 0x2a, 0x63, 0xce, 0x84, 0x2a, 0x6b, 0xf5, 0xea, 0x99, 0x2c, - 0x3f, 0xdc, 0xdd, 0xe4, 0x30, 0x29, 0x40, 0x48, 0x5d, 0xe1, 0x6e, 0x57, 0x21, 0x32, 0xce, 0x84, - 0xde, 0xd4, 0x79, 0x35, 0xac, 0x9d, 0xc1, 0xf2, 0x87, 0xfd, 0x62, 0x58, 0xcd, 0x4b, 0xca, 0x46, - 0x09, 0xd8, 0x5d, 0x54, 0x6b, 0x29, 0x5a, 0x15, 0x5c, 0x29, 0xb7, 0xd6, 0xf9, 0x76, 0xb0, 0xb2, - 0x3a, 0x3c, 0xba, 0xff, 0xf8, 0x7e, 0x34, 0x0f, 0xec, 0x7d, 0x9c, 0xaa, 0x5d, 0x7a, 0xcd, 0xb4, - 0x1d, 0x82, 0xa4, 0xed, 0xff, 0x35, 0xee, 0xaf, 0xf9, 0x56, 0x3a, 0xc6, 0xbc, 0x74, 0x8c, 0xaf, - 0xd2, 0x31, 0x1e, 0x16, 0x4e, 0x63, 0xbe, 0x70, 0x1a, 0x9f, 0x0b, 0xa7, 0x61, 0xb5, 0x23, 0x9e, - 0xd6, 0x93, 0x70, 0x77, 0x87, 0xea, 0xa6, 0xfb, 0xcb, 0x43, 0xe9, 0x1b, 0xd7, 0xa7, 0xe3, 0x58, - 0xde, 0x16, 0x21, 0x8a, 0x78, 0x8a, 0x6b, 0x9d, 0xf2, 0x93, 0xd9, 0xec, 0x79, 0xfe, 0x70, 0xe0, - 0x3e, 0x9b, 0x1b, 0xcf, 0xc5, 0xd3, 0x0a, 0x3e, 0x1a, 0x2a, 0x85, 0x81, 0x56, 0x70, 0x35, 0xf8, - 0xbe, 0x91, 0x0f, 0x74, 0x3e, 0xf0, 0x03, 0x95, 0x0f, 0x74, 0x3e, 0xa8, 0xf2, 0xa5, 0x79, 0x56, - 0x2b, 0x1f, 0x5c, 0xf4, 0x5d, 0x0f, 0x24, 0x1d, 0x51, 0x49, 0x7f, 0xcc, 0xce, 0x1a, 0x4b, 0x88, - 0x86, 0x09, 0xf1, 0x09, 0x51, 0x38, 0x21, 0x9a, 0x27, 0xa4, 0x2a, 0x08, 0x9b, 0xab, 0x17, 0x73, - 0xf2, 0x17, 0x00, 0x00, 0xff, 0xff, 0x81, 0xb5, 0xed, 0xfb, 0x44, 0x03, 0x00, 0x00, + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0xe3, 0x48, 0x74, 0x88, 0x98, 0x3a, 0x76, 0xf0, 0xc0, 0x8e, 0x2d, 0xca, 0x02, 0x2e, + 0x4b, 0xbd, 0xc0, 0x12, 0xa9, 0xa5, 0x4b, 0x84, 0x2c, 0x21, 0x37, 0x7d, 0x82, 0x48, 0x69, 0x9c, + 0xc6, 0x0e, 0x2a, 0x07, 0x60, 0x86, 0x33, 0x30, 0x72, 0x12, 0xc4, 0xd4, 0x91, 0x11, 0x25, 0x1b, + 0x0b, 0x57, 0x40, 0xa9, 0x1d, 0xa9, 0x1d, 0xd3, 0x35, 0xf9, 0xbf, 0xff, 0x7d, 0x2f, 0x2f, 0xc1, + 0x68, 0xac, 0x35, 0x98, 0x50, 0x66, 0x26, 0x05, 0xba, 0x54, 0x8b, 0x32, 0x05, 0x4d, 0xd7, 0x54, + 0xe7, 0x69, 0x62, 0x34, 0x5d, 0x95, 0x50, 0x24, 0xa0, 0xe9, 0x5c, 0xa6, 0x32, 0x8b, 0x41, 0x53, + 0x0d, 0xc5, 0x53, 0x12, 0x03, 0xc9, 0x0b, 0x65, 0x54, 0xff, 0x74, 0x07, 0x26, 0x0e, 0x26, 0x6b, + 0x62, 0x61, 0xe2, 0x60, 0xd2, 0xc2, 0x83, 0x71, 0xb7, 0x59, 0xcd, 0x83, 0xe7, 0xfb, 0x02, 0x56, + 0x25, 0x68, 0x63, 0x27, 0x0e, 0xf8, 0x61, 0x15, 0x3a, 0x57, 0x99, 0x76, 0xd6, 0xc3, 0x57, 0x14, + 0x1c, 0x4d, 0x9b, 0x17, 0xfd, 0x17, 0x14, 0xf4, 0x6e, 0x64, 0xb6, 0x48, 0xa1, 0x3f, 0x22, 0x9d, + 0x76, 0x21, 0xdb, 0x82, 0x5b, 0xeb, 0x36, 0xb8, 0x3a, 0x0c, 0xb6, 0x56, 0x27, 0x1e, 0xff, 0xf3, + 0x3f, 0x2b, 0x8c, 0x36, 0x15, 0x46, 0x3f, 0x15, 0x46, 0x6f, 0x35, 0xf6, 0x36, 0x35, 0xf6, 0xbe, + 0x6b, 0xec, 0x05, 0x67, 0xb1, 0x5a, 0x76, 0x6b, 0xe7, 0xc7, 0x33, 0x7b, 0xa4, 0x49, 0xb3, 0xed, + 0x04, 0xdd, 0x5d, 0x3c, 0x24, 0xe6, 0xb1, 0x9c, 0x93, 0x58, 0x2d, 0x69, 0xa7, 0xcf, 0xf7, 0xee, + 0xf7, 0xc6, 0x61, 0x34, 0x9b, 0xf2, 0x0f, 0x7f, 0xef, 0xd2, 0xa1, 0x53, 0x88, 0xc8, 0xcc, 0x2a, + 0x4c, 0x9d, 0x02, 0x77, 0xe0, 0xd7, 0x5e, 0x5e, 0xb8, 0xbc, 0x88, 0x84, 0xcd, 0x0b, 0x97, 0x17, + 0x6d, 0xbe, 0xf2, 0x2f, 0x3b, 0xe5, 0xc5, 0xf5, 0x84, 0x87, 0x60, 0xe4, 0x42, 0x1a, 0xf9, 0xeb, + 0x0f, 0x77, 0x58, 0xc6, 0x1c, 0xcc, 0x58, 0xc4, 0x98, 0xc5, 0x19, 0x73, 0x3c, 0x63, 0x6d, 0xc1, + 0xbc, 0xb7, 0xfd, 0x15, 0xce, 0xff, 0x03, 0x00, 0x00, 0xff, 0xff, 0x88, 0xb2, 0xdd, 0x4a, 0xff, + 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/splits/queries/balances/service.pb.gw.go b/x/splits/queries/balances/service.pb.gw.go deleted file mode 100644 index 9cf320c4a..000000000 --- a/x/splits/queries/balances/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/splits/queries/balances/service.proto - -/* -Package balances is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package balances - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "splits", "v1beta1", "balances"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/splits/queries/split/service.pb.go b/x/splits/queries/split/service.pb.go index bce7c13b4..b75fb115a 100644 --- a/x/splits/queries/split/service.pb.go +++ b/x/splits/queries/split/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_69974d2b5d423779 = []byte{ - // 358 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xfb, 0x40, - 0x18, 0xc6, 0x9b, 0xc0, 0xbf, 0x43, 0xf8, 0x4f, 0x19, 0x4b, 0xb9, 0x41, 0x9c, 0x1c, 0xee, 0xa8, - 0xa2, 0xd4, 0x1b, 0x94, 0x76, 0xd1, 0x25, 0xd0, 0x9a, 0x25, 0x48, 0x40, 0xae, 0xed, 0x4b, 0x0d, - 0xa4, 0xb9, 0x34, 0x77, 0x29, 0x75, 0xf5, 0x13, 0x08, 0x7e, 0x03, 0xdd, 0x04, 0xbf, 0x87, 0x38, - 0x15, 0x5c, 0x5c, 0x04, 0x49, 0x9d, 0xfc, 0x14, 0x92, 0xbe, 0x37, 0xb4, 0x5b, 0xda, 0xf1, 0x49, - 0x9e, 0xdf, 0x3d, 0xef, 0x73, 0xf7, 0x3a, 0xed, 0x8e, 0x52, 0xa0, 0x3d, 0x91, 0xe8, 0x18, 0xd8, - 0x44, 0x8e, 0xf2, 0x18, 0x14, 0x9b, 0x33, 0x95, 0xc6, 0x91, 0x56, 0x6c, 0x9a, 0x43, 0x16, 0x81, - 0x42, 0xc9, 0x14, 0x64, 0xb3, 0x68, 0x08, 0x34, 0xcd, 0xa4, 0x96, 0xee, 0xc1, 0x1a, 0x49, 0x0d, - 0x49, 0xe7, 0x14, 0x49, 0x6a, 0x48, 0x94, 0x8d, 0xe6, 0x58, 0xca, 0x71, 0x0c, 0x4c, 0xa4, 0x11, - 0x13, 0x49, 0x22, 0xb5, 0xd0, 0x91, 0x4c, 0x14, 0x9e, 0xd4, 0x38, 0xdb, 0x62, 0x86, 0x52, 0xdd, - 0xdd, 0x64, 0x30, 0xcd, 0x41, 0x69, 0xc3, 0x9f, 0xef, 0xc0, 0xab, 0x54, 0x26, 0xca, 0x54, 0x39, - 0x7c, 0xb5, 0x9c, 0x7f, 0xfd, 0xf2, 0x87, 0xfb, 0x6c, 0x39, 0xf5, 0x4b, 0x91, 0x8c, 0x62, 0x70, - 0xdb, 0xb4, 0x7a, 0x41, 0xba, 0xa2, 0xaf, 0x70, 0xaa, 0xc6, 0xe9, 0x0e, 0x24, 0xce, 0xb3, 0xb7, - 0x7f, 0xff, 0xf1, 0xf3, 0x68, 0x13, 0xb7, 0xc9, 0x26, 0x58, 0xc7, 0x94, 0x98, 0xb5, 0x06, 0xa0, - 0x45, 0x0b, 0x65, 0xf7, 0xcb, 0x7e, 0x2b, 0x88, 0xb5, 0x28, 0x88, 0xf5, 0x5d, 0x10, 0xeb, 0x61, - 0x49, 0x6a, 0x8b, 0x25, 0xa9, 0x7d, 0x2e, 0x49, 0xcd, 0xa1, 0x43, 0x39, 0xd9, 0x22, 0xbe, 0xfb, - 0xdf, 0xc7, 0x47, 0xed, 0x95, 0x17, 0xd1, 0xb3, 0xae, 0x8f, 0xc7, 0x91, 0xbe, 0xcd, 0x07, 0xe5, - 0x31, 0xac, 0xfa, 0xb5, 0x3e, 0xd9, 0xf5, 0x8e, 0x17, 0xf8, 0x7d, 0xff, 0xc5, 0xde, 0x58, 0x0b, - 0xcf, 0x84, 0x07, 0xd4, 0xc7, 0xf0, 0xbe, 0x09, 0x5f, 0xc9, 0xf7, 0x0d, 0x73, 0x68, 0xcc, 0x61, - 0x10, 0xa2, 0x39, 0x34, 0x66, 0x94, 0x85, 0x7d, 0x52, 0xdd, 0x1c, 0x5e, 0xf4, 0xba, 0x1e, 0x68, - 0x31, 0x12, 0x5a, 0xfc, 0xda, 0xeb, 0x45, 0x38, 0x37, 0x24, 0xe7, 0x01, 0xe7, 0xc8, 0x72, 0x6e, - 0x60, 0xf3, 0x61, 0x50, 0x5f, 0xad, 0xc5, 0xd1, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x97, 0x80, - 0x80, 0x99, 0x1d, 0x03, 0x00, 0x00, + // 310 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x70, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x2f, 0x2e, 0xc8, 0xc9, 0x2c, 0x29, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, + 0x86, 0x70, 0xf5, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, + 0x85, 0xb4, 0x90, 0x74, 0xea, 0x41, 0x75, 0xea, 0x55, 0xe8, 0x41, 0x74, 0xea, 0x41, 0x75, 0x42, + 0xb8, 0x52, 0x76, 0x24, 0xd8, 0x02, 0xe2, 0x55, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, + 0x40, 0xec, 0x92, 0xb2, 0x27, 0x43, 0x7f, 0x71, 0x41, 0x7e, 0x5e, 0x31, 0xd4, 0xb1, 0x46, 0x1d, + 0x8c, 0x5c, 0xac, 0x81, 0x20, 0x09, 0xa1, 0x7a, 0x2e, 0x36, 0x8f, 0xc4, 0xbc, 0x94, 0x9c, 0x54, + 0x21, 0x0b, 0x3d, 0xe2, 0x7d, 0xa0, 0x07, 0xd6, 0x1c, 0x04, 0x71, 0x94, 0x94, 0x25, 0x19, 0x3a, + 0x21, 0xce, 0x51, 0x62, 0x70, 0xba, 0xcb, 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, 0x5c, 0x7a, 0xc9, 0xf9, 0xb9, 0x24, 0x18, 0xed, 0xc4, 0x13, 0x0c, 0x89, 0x91, 0x00, 0x90, + 0x1f, 0x03, 0x18, 0xa3, 0x4c, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0x40, 0xc6, 0xe8, 0x13, 0x1f, + 0x62, 0x8b, 0x98, 0xd8, 0x1c, 0x7d, 0x23, 0x82, 0x03, 0x83, 0x57, 0x31, 0xa1, 0xc4, 0xa9, 0x2f, + 0xd4, 0xf2, 0x08, 0xbd, 0x60, 0x88, 0xe5, 0x81, 0x50, 0xcb, 0xc1, 0xdc, 0x53, 0x28, 0x8a, 0x63, + 0xa0, 0x8a, 0x63, 0x22, 0x62, 0x20, 0x8a, 0x63, 0xa0, 0x8a, 0x21, 0xdc, 0x47, 0x4c, 0x66, 0xc4, + 0x2b, 0x8e, 0x71, 0x0f, 0x70, 0xf2, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x7c, 0xc5, 0x84, + 0xec, 0x11, 0x2b, 0x2b, 0xa8, 0x4e, 0x2b, 0xab, 0x08, 0x2b, 0x2b, 0x88, 0x5e, 0x2b, 0x2b, 0xa8, + 0x66, 0xa8, 0x40, 0x12, 0x1b, 0x38, 0xc6, 0x8d, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x4d, 0x7a, + 0x6d, 0x6b, 0xda, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/splits/queries/split/service.pb.gw.go b/x/splits/queries/split/service.pb.gw.go deleted file mode 100644 index 2c6318f80..000000000 --- a/x/splits/queries/split/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/splits/queries/split/service.proto - -/* -Package split is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package split - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "splits", "v1beta1", "split"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/splits/queries/splits/service.pb.go b/x/splits/queries/splits/service.pb.go index 084f85ac8..82baa4dc9 100644 --- a/x/splits/queries/splits/service.pb.go +++ b/x/splits/queries/splits/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_99bae0ab2f4f64e9 = []byte{ - // 360 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x40, - 0x18, 0xc7, 0x9b, 0xc0, 0xdb, 0x21, 0xbc, 0x53, 0xc6, 0xf2, 0xbe, 0x11, 0x04, 0x27, 0xe1, 0xce, - 0x2a, 0x28, 0xbd, 0x45, 0xdb, 0x45, 0x97, 0x40, 0x6b, 0x96, 0x20, 0x01, 0xb9, 0xb6, 0x0f, 0x35, - 0x90, 0xe4, 0xd2, 0xdc, 0xa5, 0xd4, 0xd5, 0x4f, 0x20, 0xf8, 0x0d, 0x1c, 0x1c, 0x9c, 0xfc, 0x18, - 0xe2, 0x54, 0x70, 0x71, 0x94, 0xc4, 0xc9, 0x4f, 0x21, 0xe9, 0x3d, 0xc5, 0x76, 0x4c, 0xc7, 0x7f, - 0xee, 0xff, 0x7b, 0xee, 0xff, 0xbf, 0x3c, 0x56, 0xa7, 0x2b, 0x25, 0x28, 0x97, 0x27, 0x2a, 0x02, - 0x1a, 0x8b, 0x71, 0x1e, 0x81, 0xa4, 0x73, 0x2a, 0xd3, 0x28, 0x54, 0x92, 0x4e, 0x73, 0xc8, 0x42, - 0x90, 0x2b, 0x29, 0x21, 0x9b, 0x85, 0x23, 0x20, 0x69, 0x26, 0x94, 0xb0, 0xf7, 0xd7, 0x50, 0x82, - 0x28, 0x99, 0x13, 0xed, 0x25, 0x88, 0xa2, 0x6c, 0xfd, 0x9b, 0x08, 0x31, 0x89, 0x80, 0xf2, 0x34, - 0xa4, 0x3c, 0x49, 0x84, 0xe2, 0x2a, 0x14, 0x89, 0xd4, 0xa3, 0x5a, 0xa7, 0x75, 0x52, 0x54, 0xf2, - 0xf6, 0x3a, 0x83, 0x69, 0x0e, 0x52, 0xe1, 0x80, 0xb3, 0x6d, 0x06, 0xc8, 0x54, 0x24, 0x12, 0xdb, - 0x1c, 0xbe, 0x18, 0xd6, 0x9f, 0x41, 0x75, 0x60, 0x3f, 0x19, 0x56, 0xf3, 0x82, 0x27, 0xe3, 0x08, - 0xec, 0x0e, 0xa9, 0xd1, 0x91, 0x2c, 0xf1, 0x4b, 0x9d, 0xab, 0xc5, 0xb6, 0x41, 0x75, 0xa2, 0xdd, - 0xbd, 0xbb, 0xf7, 0xaf, 0x07, 0x73, 0xc7, 0xfe, 0x4f, 0x63, 0xdd, 0x08, 0x83, 0xcf, 0xda, 0x43, - 0x50, 0xbc, 0x8d, 0xb2, 0x57, 0x9a, 0xaf, 0x85, 0x63, 0x2c, 0x0a, 0xc7, 0xf8, 0x2c, 0x1c, 0xe3, - 0xbe, 0x74, 0x1a, 0x8b, 0xd2, 0x69, 0x7c, 0x94, 0x4e, 0xc3, 0xa2, 0x23, 0x11, 0xd7, 0x09, 0xd0, - 0xfb, 0xeb, 0xe9, 0x7f, 0xdb, 0xaf, 0x1e, 0xa3, 0x6f, 0x5c, 0x1d, 0x4f, 0x42, 0x75, 0x93, 0x0f, - 0xc9, 0x48, 0xc4, 0xb4, 0xc6, 0xdb, 0x3e, 0x9a, 0xcd, 0xae, 0xeb, 0x7b, 0x03, 0xef, 0xd9, 0xdc, - 0x58, 0x0f, 0x17, 0xaf, 0xf7, 0x89, 0xf7, 0x5b, 0xb8, 0xba, 0x5e, 0xcb, 0xb7, 0x0d, 0x77, 0x80, - 0xee, 0xc0, 0x0f, 0xf4, 0x71, 0x80, 0x6e, 0x94, 0x85, 0x79, 0x52, 0xc3, 0x1d, 0x9c, 0xf7, 0x7b, - 0x2e, 0x28, 0x3e, 0xe6, 0x8a, 0x7f, 0x9b, 0x07, 0x6b, 0x24, 0x63, 0x88, 0x32, 0xe6, 0x33, 0xa6, - 0xdd, 0x8c, 0x21, 0xbd, 0xfa, 0x30, 0x6c, 0x2e, 0xf7, 0xe3, 0xe8, 0x27, 0x00, 0x00, 0xff, 0xff, - 0xfd, 0xcb, 0x99, 0xa8, 0x2a, 0x03, 0x00, 0x00, + // 312 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x74, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x2f, 0x2e, 0xc8, 0xc9, 0x2c, 0x29, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, + 0x86, 0x71, 0x8b, 0x53, 0x8b, 0xca, 0x32, 0x93, 0x53, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, + 0xb4, 0x91, 0xb4, 0xea, 0x41, 0xb5, 0xea, 0x55, 0xe8, 0x41, 0xd4, 0xea, 0x41, 0xb5, 0x42, 0xb9, + 0x52, 0xf6, 0xa4, 0xd8, 0x03, 0xe2, 0x56, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0x40, + 0x6c, 0x93, 0x72, 0x20, 0xc7, 0x80, 0xe2, 0x82, 0xfc, 0xbc, 0x62, 0xa8, 0x7b, 0x8d, 0xba, 0x19, + 0xb9, 0x58, 0x03, 0x41, 0x12, 0x42, 0x8d, 0x8c, 0x5c, 0x6c, 0x1e, 0x89, 0x79, 0x29, 0x39, 0xa9, + 0x42, 0x96, 0x7a, 0x24, 0xf8, 0x42, 0x0f, 0xac, 0x3d, 0x08, 0xe2, 0x2e, 0x29, 0x2b, 0x72, 0xb4, + 0x42, 0x5c, 0xa4, 0xc4, 0xe0, 0xf4, 0x98, 0xe9, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, + 0x1f, 0x3c, 0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, + 0x18, 0xb8, 0xf4, 0x93, 0xf3, 0x73, 0x49, 0x31, 0xdb, 0x89, 0x27, 0x18, 0x12, 0x31, 0x01, 0x20, + 0x7f, 0x06, 0x30, 0x46, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, 0xe7, 0xe7, 0xea, + 0x93, 0x10, 0x6c, 0x8b, 0x98, 0xd8, 0x1c, 0x7d, 0x23, 0x82, 0x03, 0x83, 0x57, 0x31, 0xa1, 0xc4, + 0xad, 0x2f, 0xd4, 0xfa, 0x08, 0xbd, 0x60, 0x84, 0x5f, 0x40, 0xd6, 0x43, 0xb8, 0xa7, 0x50, 0x54, + 0xc7, 0x40, 0x55, 0xc7, 0x44, 0xc4, 0x40, 0xa4, 0x63, 0xa0, 0xaa, 0xa1, 0xdc, 0x47, 0x4c, 0xe6, + 0x24, 0xa8, 0x8e, 0x71, 0x0f, 0x70, 0xf2, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x7c, 0xc5, + 0x64, 0x80, 0xa4, 0xd3, 0xca, 0x0a, 0xaa, 0xd5, 0xca, 0x2a, 0xc2, 0xca, 0x0a, 0xa2, 0xda, 0xca, + 0x0a, 0xaa, 0x1b, 0x26, 0x90, 0xc4, 0x06, 0x8e, 0x7a, 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, + 0x95, 0xb4, 0xd6, 0xbc, 0xe7, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/splits/queries/splits/service.pb.gw.go b/x/splits/queries/splits/service.pb.gw.go deleted file mode 100644 index ea84e753e..000000000 --- a/x/splits/queries/splits/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/splits/queries/splits/service.proto - -/* -Package splits is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package splits - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 1}, []string{"mantle", "splits", "v1beta1"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) diff --git a/x/splits/queries/supply/service.pb.go b/x/splits/queries/supply/service.pb.go index b05654ea2..ca273fc2e 100644 --- a/x/splits/queries/supply/service.pb.go +++ b/x/splits/queries/supply/service.pb.go @@ -8,7 +8,6 @@ import ( fmt "fmt" 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" @@ -31,30 +30,27 @@ func init() { } var fileDescriptor_b40cde5518a1c1ba = []byte{ - // 365 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, - 0x14, 0xc7, 0x9b, 0x80, 0x1d, 0x82, 0x53, 0xc6, 0xa2, 0x11, 0x04, 0x27, 0xe1, 0xce, 0x2a, 0x28, - 0xbd, 0x45, 0xdb, 0x45, 0x97, 0x40, 0x6b, 0x96, 0x20, 0x01, 0xb9, 0xb6, 0x8f, 0x1a, 0x48, 0x72, - 0x69, 0xee, 0x52, 0xda, 0xd5, 0x4f, 0x20, 0xf8, 0x0d, 0x1c, 0x1c, 0x9c, 0xfc, 0x18, 0xe2, 0x54, - 0x70, 0x71, 0x94, 0xc4, 0xc9, 0x4f, 0x21, 0xcd, 0xbd, 0xa1, 0x1d, 0xd3, 0x31, 0xe4, 0xff, 0x7b, - 0xff, 0xff, 0xff, 0xdd, 0xb3, 0x3a, 0x5d, 0x29, 0x41, 0xb9, 0x3c, 0x51, 0x11, 0xd0, 0x58, 0x8c, - 0xf3, 0x08, 0x24, 0x9d, 0x53, 0x99, 0x46, 0xa1, 0x92, 0x74, 0x9a, 0x43, 0x16, 0x82, 0xa4, 0x32, - 0x4f, 0xd3, 0x68, 0x41, 0x25, 0x64, 0xb3, 0x70, 0x04, 0x24, 0xcd, 0x84, 0x12, 0xf6, 0xf1, 0x1a, - 0x4a, 0x10, 0x25, 0x73, 0xa2, 0x51, 0x82, 0x28, 0xd1, 0x68, 0x6b, 0x6f, 0x22, 0xc4, 0x24, 0x02, - 0xca, 0xd3, 0x90, 0xf2, 0x24, 0x11, 0x8a, 0xab, 0x50, 0x24, 0x52, 0x8f, 0x6a, 0x5d, 0xd6, 0x49, - 0xb1, 0xfa, 0x5c, 0xdc, 0x67, 0x30, 0xcd, 0x41, 0x2a, 0x1c, 0x70, 0xb5, 0xcd, 0x00, 0x99, 0x8a, - 0x44, 0x62, 0x9b, 0xd3, 0x77, 0xc3, 0xda, 0x19, 0xac, 0x7e, 0xd8, 0xaf, 0x86, 0xd5, 0xbc, 0xe1, - 0xc9, 0x38, 0x02, 0xbb, 0x43, 0x6a, 0x74, 0x24, 0x15, 0x7e, 0xab, 0x73, 0xb5, 0xd8, 0x36, 0xa8, - 0x4e, 0x74, 0x78, 0xf4, 0xf8, 0xf5, 0xfb, 0x6c, 0x1e, 0xd8, 0xfb, 0x34, 0xd6, 0x8d, 0xb0, 0xc7, - 0xac, 0x3d, 0x04, 0xc5, 0xdb, 0xd8, 0xa3, 0x57, 0x9a, 0x1f, 0x85, 0x63, 0x2c, 0x0b, 0xc7, 0xf8, - 0x29, 0x1c, 0xe3, 0xa9, 0x74, 0x1a, 0xcb, 0xd2, 0x69, 0x7c, 0x97, 0x4e, 0xc3, 0xa2, 0x23, 0x11, - 0xd7, 0x09, 0xd0, 0xdb, 0xf5, 0xf4, 0xdb, 0xf6, 0x57, 0xcb, 0xe8, 0x1b, 0x77, 0xe7, 0x93, 0x50, - 0x3d, 0xe4, 0x43, 0x32, 0x12, 0x31, 0xad, 0xb1, 0xdb, 0x17, 0xb3, 0xd9, 0x75, 0x7d, 0x6f, 0xe0, - 0xbd, 0x99, 0x1b, 0xe7, 0xe1, 0xa2, 0xbd, 0x4f, 0x3c, 0x6d, 0x3f, 0x40, 0x7b, 0xaf, 0xc2, 0x3e, - 0x37, 0xd4, 0x01, 0xaa, 0x03, 0x3f, 0xd0, 0xea, 0x00, 0xd5, 0x81, 0x56, 0x17, 0xe6, 0x45, 0x0d, - 0x75, 0x70, 0xdd, 0xef, 0xb9, 0xa0, 0xf8, 0x98, 0x2b, 0xfe, 0x67, 0x9e, 0xac, 0x91, 0x8c, 0x21, - 0xca, 0x98, 0xcf, 0x98, 0x86, 0x19, 0x43, 0x9a, 0x31, 0x8d, 0x0f, 0x9b, 0xd5, 0x7d, 0x9c, 0xfd, - 0x07, 0x00, 0x00, 0xff, 0xff, 0xc7, 0xae, 0x0f, 0x9c, 0x2a, 0x03, 0x00, 0x00, + // 319 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd1, 0xb1, 0x4e, 0x84, 0x30, + 0x18, 0x07, 0x70, 0x4a, 0xe2, 0x0d, 0xc4, 0xe9, 0xc6, 0x1b, 0x3a, 0xb8, 0x9a, 0xb4, 0x46, 0x13, + 0xcd, 0x75, 0xd1, 0x63, 0xd1, 0x85, 0x04, 0x64, 0x21, 0xa6, 0x89, 0xe1, 0xa0, 0x51, 0x12, 0xa0, + 0x1c, 0x2d, 0xe6, 0x6e, 0x74, 0x76, 0xf1, 0x19, 0x1c, 0x7d, 0x12, 0xe3, 0x74, 0xa3, 0xa3, 0x81, + 0xcd, 0xa7, 0x30, 0xf0, 0x75, 0xb8, 0x1b, 0xb9, 0x91, 0xf0, 0xff, 0xf5, 0xff, 0xb5, 0x9f, 0x33, + 0x5f, 0x28, 0x25, 0xb4, 0x17, 0x97, 0x3a, 0x17, 0xb4, 0x90, 0x69, 0x93, 0x0b, 0x45, 0xd7, 0x54, + 0x55, 0x79, 0xa6, 0x15, 0x5d, 0x35, 0xa2, 0xce, 0x84, 0xa2, 0xaa, 0xa9, 0xaa, 0x7c, 0x43, 0x95, + 0xa8, 0x5f, 0xb2, 0x44, 0x90, 0xaa, 0x96, 0x5a, 0x4e, 0x4f, 0x77, 0x28, 0x31, 0x94, 0xac, 0x09, + 0x50, 0x62, 0x28, 0x01, 0x3a, 0xbb, 0x1e, 0xd3, 0xd3, 0x7f, 0x6e, 0x1e, 0x6b, 0xb1, 0x6a, 0x84, + 0xd2, 0xd0, 0x36, 0xbb, 0x39, 0xe4, 0x00, 0x55, 0xc9, 0x52, 0x99, 0x79, 0xcf, 0xdf, 0x90, 0x73, + 0x14, 0xf4, 0x3f, 0xa6, 0xaf, 0xc8, 0x99, 0xdc, 0xc5, 0x65, 0x9a, 0x8b, 0xe9, 0x9c, 0x8c, 0xb8, + 0x05, 0x19, 0xf8, 0x3d, 0xcc, 0x35, 0x63, 0x87, 0x50, 0x98, 0xe8, 0xc4, 0x72, 0x3b, 0xfb, 0xab, + 0xc5, 0x68, 0xdb, 0x62, 0xf4, 0xdb, 0x62, 0xf4, 0xde, 0x61, 0x6b, 0xdb, 0x61, 0xeb, 0xa7, 0xc3, + 0x96, 0x43, 0x13, 0x59, 0x8c, 0x39, 0xdb, 0x3d, 0x0e, 0x61, 0x31, 0x7e, 0x7f, 0x4f, 0x1f, 0x3d, + 0x5c, 0x3e, 0x65, 0xfa, 0xb9, 0x59, 0x92, 0x44, 0x16, 0x74, 0xc4, 0xb3, 0x7d, 0xd8, 0x93, 0x85, + 0x17, 0x85, 0x41, 0xf8, 0x69, 0xef, 0xed, 0xd6, 0x33, 0xf5, 0x11, 0x09, 0xa1, 0x3e, 0x30, 0xf5, + 0xe1, 0xc0, 0xbe, 0xf7, 0xd2, 0xdc, 0xa4, 0x79, 0xc4, 0x21, 0xcd, 0x4d, 0x9a, 0x43, 0xba, 0xb5, + 0xaf, 0x46, 0xa4, 0xf9, 0xad, 0xef, 0x7a, 0x42, 0xc7, 0x69, 0xac, 0xe3, 0x3f, 0xfb, 0x6c, 0x47, + 0x32, 0x66, 0x28, 0x63, 0x11, 0x63, 0x80, 0x19, 0x33, 0x9a, 0x31, 0xe0, 0xcb, 0xc9, 0xb0, 0xfa, + 0x8b, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6d, 0x1b, 0x2c, 0x54, 0xe7, 0x02, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. diff --git a/x/splits/queries/supply/service.pb.gw.go b/x/splits/queries/supply/service.pb.gw.go deleted file mode 100644 index e01c4684d..000000000 --- a/x/splits/queries/supply/service.pb.gw.go +++ /dev/null @@ -1,171 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: AssetMantle/modules/x/splits/queries/supply/service.proto - -/* -Package supply is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package supply - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -var ( - filter_Query_Handle_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Handle(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Handle_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Handle_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Handle(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Handle_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Handle_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Handle_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_Handle_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_Handle_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_Handle_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Handle_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mantle", "splits", "v1beta1", "supply"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Handle_0 = runtime.ForwardResponseMessage -) From da291de5daecd54ab50d9bcd05a2bedaaa795700 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 20 Aug 2024 00:47:44 +0530 Subject: [PATCH 27/64] code cleanup Signed-off-by: Deepanshu Tripathi --- helpers/message.go | 5 ----- x/assets/transactions/burn/message.go | 21 ------------------ x/assets/transactions/define/message.go | 21 ------------------ x/assets/transactions/deputize/message.go | 21 ------------------ x/assets/transactions/mint/message.go | 21 ------------------ x/assets/transactions/mutate/message.go | 21 ------------------ x/assets/transactions/renumerate/message.go | 21 ------------------ x/assets/transactions/revoke/message.go | 21 ------------------ x/assets/transactions/send/message.go | 22 +------------------ x/assets/transactions/unwrap/message.go | 21 ------------------ x/assets/transactions/wrap/message.go | 16 -------------- x/identities/transactions/define/message.go | 21 ------------------ x/identities/transactions/deputize/message.go | 21 ------------------ x/identities/transactions/issue/message.go | 21 ------------------ x/identities/transactions/name/message.go | 21 ------------------ .../transactions/provision/message.go | 21 ------------------ x/identities/transactions/quash/message.go | 21 ------------------ x/identities/transactions/revoke/message.go | 21 ------------------ .../transactions/unprovision/message.go | 21 ------------------ x/identities/transactions/update/message.go | 21 ------------------ x/metas/transactions/reveal/message.go | 21 ------------------ x/orders/transactions/cancel/message.go | 21 ------------------ x/orders/transactions/define/message.go | 21 ------------------ x/orders/transactions/deputize/message.go | 21 ------------------ x/orders/transactions/get/message.go | 21 ------------------ x/orders/transactions/immediate/message.go | 21 ------------------ x/orders/transactions/make/message.go | 21 ------------------ x/orders/transactions/modify/message.go | 21 ------------------ x/orders/transactions/put/message.go | 22 +------------------ x/orders/transactions/revoke/message.go | 21 ------------------ x/orders/transactions/take/message.go | 21 ------------------ 31 files changed, 2 insertions(+), 630 deletions(-) diff --git a/helpers/message.go b/helpers/message.go index 97d9ebc39..ed8a7a328 100644 --- a/helpers/message.go +++ b/helpers/message.go @@ -4,16 +4,11 @@ package helpers import ( - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" ) type Message interface { - // TODO check if register message code is required - RegisterLegacyAminoCodec(*codec.LegacyAmino) RegisterInterface(types.InterfaceRegistry) - Type() string - GetFromAddress() sdkTypes.AccAddress sdkTypes.Msg } diff --git a/x/assets/transactions/burn/message.go b/x/assets/transactions/burn/message.go index 1e49cd3f0..03dc9fcca 100644 --- a/x/assets/transactions/burn/message.go +++ b/x/assets/transactions/burn/message.go @@ -4,10 +4,8 @@ package burn import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -43,21 +33,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/define/message.go b/x/assets/transactions/define/message.go index 7a7e2af6e..a28bae5ce 100644 --- a/x/assets/transactions/define/message.go +++ b/x/assets/transactions/define/message.go @@ -4,12 +4,10 @@ package define import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -54,21 +44,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/deputize/message.go b/x/assets/transactions/deputize/message.go index 91e7ebd6e..3402db7c2 100644 --- a/x/assets/transactions/deputize/message.go +++ b/x/assets/transactions/deputize/message.go @@ -4,12 +4,10 @@ package deputize import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -51,21 +41,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/mint/message.go b/x/assets/transactions/mint/message.go index 9ab1d900e..f7fccad4d 100644 --- a/x/assets/transactions/mint/message.go +++ b/x/assets/transactions/mint/message.go @@ -4,12 +4,10 @@ package mint import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -60,21 +50,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/mutate/message.go b/x/assets/transactions/mutate/message.go index 2e8319b91..fc4e8cc44 100644 --- a/x/assets/transactions/mutate/message.go +++ b/x/assets/transactions/mutate/message.go @@ -4,12 +4,10 @@ package mutate import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -51,21 +41,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/renumerate/message.go b/x/assets/transactions/renumerate/message.go index 3d93e648f..fd1c44c0c 100644 --- a/x/assets/transactions/renumerate/message.go +++ b/x/assets/transactions/renumerate/message.go @@ -4,10 +4,8 @@ package renumerate import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -43,21 +33,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/revoke/message.go b/x/assets/transactions/revoke/message.go index 78c8daf85..d472ad4ea 100644 --- a/x/assets/transactions/revoke/message.go +++ b/x/assets/transactions/revoke/message.go @@ -4,10 +4,8 @@ package revoke import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -46,21 +36,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/send/message.go b/x/assets/transactions/send/message.go index 9b7f2b8f0..2bfeca9f6 100644 --- a/x/assets/transactions/send/message.go +++ b/x/assets/transactions/send/message.go @@ -5,10 +5,8 @@ package send import ( errorConstants "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -27,14 +25,7 @@ func (message *Message) GetValueAsInt() (sdkTypes.Int, error) { return value, nil } -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} + func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return errorConstants.InvalidMessage.Wrapf("invalid from address %s", err.Error()) @@ -60,21 +51,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/unwrap/message.go b/x/assets/transactions/unwrap/message.go index ba5061f4d..de0ec7393 100644 --- a/x/assets/transactions/unwrap/message.go +++ b/x/assets/transactions/unwrap/message.go @@ -6,10 +6,8 @@ package unwrap import ( errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return errorConstants.InvalidMessage.Wrapf("invalid from address %s", err.Error()) @@ -48,21 +38,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/assets/transactions/wrap/message.go b/x/assets/transactions/wrap/message.go index f89e645b5..ef4a4cdde 100644 --- a/x/assets/transactions/wrap/message.go +++ b/x/assets/transactions/wrap/message.go @@ -18,14 +18,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return errorConstants.InvalidMessage.Wrapf("invalid from address %s", err.Error()) @@ -55,14 +47,6 @@ func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegis interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/define/message.go b/x/identities/transactions/define/message.go index 7a7e2af6e..a28bae5ce 100644 --- a/x/identities/transactions/define/message.go +++ b/x/identities/transactions/define/message.go @@ -4,12 +4,10 @@ package define import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -54,21 +44,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/deputize/message.go b/x/identities/transactions/deputize/message.go index 3841e9f1a..c300890b1 100644 --- a/x/identities/transactions/deputize/message.go +++ b/x/identities/transactions/deputize/message.go @@ -4,12 +4,10 @@ package deputize import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -51,21 +41,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/issue/message.go b/x/identities/transactions/issue/message.go index 6da5898e8..7b7e3678d 100644 --- a/x/identities/transactions/issue/message.go +++ b/x/identities/transactions/issue/message.go @@ -4,12 +4,10 @@ package issue import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -57,21 +47,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/name/message.go b/x/identities/transactions/name/message.go index 7c4b42af1..179c6fe92 100644 --- a/x/identities/transactions/name/message.go +++ b/x/identities/transactions/name/message.go @@ -5,10 +5,8 @@ package name import ( "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -17,14 +15,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -47,21 +37,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/provision/message.go b/x/identities/transactions/provision/message.go index dba360cc3..bb1ae3e73 100644 --- a/x/identities/transactions/provision/message.go +++ b/x/identities/transactions/provision/message.go @@ -4,10 +4,8 @@ package provision import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -43,21 +33,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/quash/message.go b/x/identities/transactions/quash/message.go index b5ded96ec..f3679f444 100644 --- a/x/identities/transactions/quash/message.go +++ b/x/identities/transactions/quash/message.go @@ -4,10 +4,8 @@ package quash import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -43,21 +33,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/revoke/message.go b/x/identities/transactions/revoke/message.go index 78c8daf85..d472ad4ea 100644 --- a/x/identities/transactions/revoke/message.go +++ b/x/identities/transactions/revoke/message.go @@ -4,10 +4,8 @@ package revoke import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -46,21 +36,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/unprovision/message.go b/x/identities/transactions/unprovision/message.go index f05d2b67c..3f68d7fea 100644 --- a/x/identities/transactions/unprovision/message.go +++ b/x/identities/transactions/unprovision/message.go @@ -4,10 +4,8 @@ package unprovision import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -43,21 +33,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/identities/transactions/update/message.go b/x/identities/transactions/update/message.go index c4752de63..10b05d09a 100644 --- a/x/identities/transactions/update/message.go +++ b/x/identities/transactions/update/message.go @@ -4,12 +4,10 @@ package update import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -51,21 +41,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/metas/transactions/reveal/message.go b/x/metas/transactions/reveal/message.go index d9c1ab02e..5f7ba3b32 100644 --- a/x/metas/transactions/reveal/message.go +++ b/x/metas/transactions/reveal/message.go @@ -4,10 +4,8 @@ package reveal import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -40,21 +30,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/cancel/message.go b/x/orders/transactions/cancel/message.go index 31662050d..b5dd6c1a8 100644 --- a/x/orders/transactions/cancel/message.go +++ b/x/orders/transactions/cancel/message.go @@ -4,10 +4,8 @@ package cancel import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -43,21 +33,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/define/message.go b/x/orders/transactions/define/message.go index 7a7e2af6e..a28bae5ce 100644 --- a/x/orders/transactions/define/message.go +++ b/x/orders/transactions/define/message.go @@ -4,12 +4,10 @@ package define import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -54,21 +44,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/deputize/message.go b/x/orders/transactions/deputize/message.go index ca63920d8..25f1a6d39 100644 --- a/x/orders/transactions/deputize/message.go +++ b/x/orders/transactions/deputize/message.go @@ -4,12 +4,10 @@ package deputize import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -18,14 +16,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -51,21 +41,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/get/message.go b/x/orders/transactions/get/message.go index f86c06d44..a663d98de 100644 --- a/x/orders/transactions/get/message.go +++ b/x/orders/transactions/get/message.go @@ -4,10 +4,8 @@ package get import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -46,21 +36,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/immediate/message.go b/x/orders/transactions/immediate/message.go index 975b68334..4f70ba529 100644 --- a/x/orders/transactions/immediate/message.go +++ b/x/orders/transactions/immediate/message.go @@ -5,14 +5,12 @@ package immediate import ( errorConstants "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" typesSchema "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -21,14 +19,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -77,21 +67,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/make/message.go b/x/orders/transactions/make/message.go index 24f166dff..6280b28d7 100644 --- a/x/orders/transactions/make/message.go +++ b/x/orders/transactions/make/message.go @@ -5,14 +5,12 @@ package make import ( "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" typesSchema "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -21,14 +19,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -77,21 +67,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/modify/message.go b/x/orders/transactions/modify/message.go index ee38db03f..549d29636 100644 --- a/x/orders/transactions/modify/message.go +++ b/x/orders/transactions/modify/message.go @@ -5,14 +5,12 @@ package modify import ( "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" typesSchema "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -21,14 +19,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -62,21 +52,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/put/message.go b/x/orders/transactions/put/message.go index 9d2345ba7..03752276e 100644 --- a/x/orders/transactions/put/message.go +++ b/x/orders/transactions/put/message.go @@ -5,12 +5,10 @@ package put import ( "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" typesSchema "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -19,14 +17,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -65,20 +55,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} + func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/revoke/message.go b/x/orders/transactions/revoke/message.go index 78c8daf85..d472ad4ea 100644 --- a/x/orders/transactions/revoke/message.go +++ b/x/orders/transactions/revoke/message.go @@ -4,10 +4,8 @@ package revoke import ( - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -16,14 +14,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -46,21 +36,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } diff --git a/x/orders/transactions/take/message.go b/x/orders/transactions/take/message.go index 664267888..2af431e8b 100644 --- a/x/orders/transactions/take/message.go +++ b/x/orders/transactions/take/message.go @@ -5,10 +5,8 @@ package take import ( "github.com/AssetMantle/modules/helpers/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -17,14 +15,6 @@ import ( var _ helpers.Message = (*Message)(nil) -func (message *Message) Type() string { return Transaction.GetName() } -func (message *Message) GetFromAddress() sdkTypes.AccAddress { - from, err := sdkTypes.AccAddressFromBech32(message.From) - if err != nil { - panic(err) - } - return from -} func (message *Message) ValidateBasic() error { if _, err := sdkTypes.AccAddressFromBech32(message.From); err != nil { return err @@ -47,21 +37,10 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } -func messageFromInterface(msg sdkTypes.Msg) *Message { - switch value := msg.(type) { - case *Message: - return value - default: - return &Message{} - } -} func messagePrototype() helpers.Message { return &Message{} } From 17f8f1e343c93045722d6f4033cf4dda5732eb55 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 20 Aug 2024 00:54:22 +0530 Subject: [PATCH 28/64] refactor: simplifying service routing Signed-off-by: Deepanshu Tripathi --- helpers/base/module.go | 14 +--- helpers/base/queries.go | 4 +- helpers/base/queries_test.go | 2 +- helpers/base/query.go | 64 ++++++++----------- helpers/base/transaction.go | 46 ++++++------- helpers/base/transactions.go | 4 +- helpers/base/transactions_test.go | 2 +- helpers/query.go | 4 +- helpers/transaction.go | 4 +- x/assets/queries/asset/query.go | 18 +----- x/assets/queries/assets/query.go | 18 +----- x/assets/queries/prototype_test.go | 4 +- x/assets/transactions/burn/message_test.go | 2 +- x/assets/transactions/burn/transaction.go | 12 +--- x/assets/transactions/define/message_test.go | 2 +- x/assets/transactions/define/transaction.go | 12 +--- .../transactions/define/transaction_keeper.go | 2 +- .../transactions/deputize/message_test.go | 2 +- x/assets/transactions/deputize/transaction.go | 12 +--- .../deputize/transaction_keeper.go | 2 +- x/assets/transactions/mint/message_test.go | 2 +- x/assets/transactions/mint/transaction.go | 12 +--- .../transactions/mint/transaction_keeper.go | 2 +- x/assets/transactions/mutate/message_test.go | 2 +- x/assets/transactions/mutate/transaction.go | 12 +--- .../transactions/mutate/transaction_keeper.go | 2 +- .../transactions/renumerate/message_test.go | 2 +- .../transactions/renumerate/transaction.go | 12 +--- .../renumerate/transaction_keeper.go | 2 +- x/assets/transactions/revoke/message_test.go | 2 +- x/assets/transactions/revoke/transaction.go | 12 +--- .../transactions/revoke/transaction_keeper.go | 2 +- x/assets/transactions/send/message_test.go | 2 +- x/assets/transactions/send/transaction.go | 12 +--- .../transactions/send/transaction_keeper.go | 2 +- x/assets/transactions/unwrap/message_test.go | 2 +- x/assets/transactions/unwrap/transaction.go | 12 +--- .../transactions/unwrap/transaction_keeper.go | 4 +- x/assets/transactions/wrap/message_test.go | 2 +- x/assets/transactions/wrap/transaction.go | 12 +--- .../transactions/wrap/transaction_keeper.go | 4 +- .../queries/classification/query.go | 18 +----- .../queries/classifications/query.go | 17 +---- x/classifications/queries/prototype_test.go | 4 +- x/identities/queries/identities/query.go | 17 +---- x/identities/queries/identity/query.go | 18 +----- .../transactions/define/message_test.go | 2 +- .../transactions/define/transaction.go | 12 +--- .../transactions/deputize/message_test.go | 2 +- .../transactions/deputize/transaction.go | 12 +--- .../deputize/transaction_keeper.go | 2 +- .../transactions/issue/message_test.go | 2 +- .../transactions/issue/transaction.go | 12 +--- .../transactions/name/message_test.go | 2 +- x/identities/transactions/name/transaction.go | 12 +--- x/identities/transactions/prototype_test.go | 4 +- .../transactions/provision/message_test.go | 2 +- .../transactions/provision/transaction.go | 12 +--- .../provision/transaction_keeper.go | 2 +- .../transactions/quash/message_test.go | 2 +- .../transactions/quash/transaction.go | 12 +--- .../transactions/quash/transaction_keeper.go | 2 +- .../transactions/revoke/message_test.go | 2 +- .../transactions/revoke/transaction.go | 12 +--- .../transactions/revoke/transaction_keeper.go | 2 +- .../transactions/unprovision/message_test.go | 2 +- .../transactions/unprovision/transaction.go | 12 +--- .../unprovision/transaction_keeper.go | 2 +- .../transactions/update/message_test.go | 4 +- .../transactions/update/transaction.go | 12 +--- .../transactions/update/transaction_keeper.go | 2 +- x/maintainers/queries/maintainer/query.go | 18 +----- x/maintainers/queries/maintainers/query.go | 17 +---- x/maintainers/queries/prototype_test.go | 4 +- x/metas/queries/meta/query.go | 18 +----- x/metas/queries/metas/query.go | 17 +---- x/metas/queries/prototype_test.go | 4 +- x/metas/transactions/prototype_test.go | 4 +- x/metas/transactions/reveal/message_test.go | 2 +- x/metas/transactions/reveal/transaction.go | 12 +--- x/orders/queries/order/query.go | 18 +----- x/orders/queries/orders/query.go | 17 +---- x/orders/queries/prototype_test.go | 4 +- x/orders/transactions/cancel/message_test.go | 2 +- x/orders/transactions/cancel/transaction.go | 13 +--- .../transactions/cancel/transaction_keeper.go | 2 +- x/orders/transactions/define/message_test.go | 2 +- x/orders/transactions/define/transaction.go | 12 +--- .../transactions/deputize/message_test.go | 2 +- x/orders/transactions/deputize/transaction.go | 12 +--- .../deputize/transaction_keeper.go | 2 +- x/orders/transactions/get/message_test.go | 2 +- x/orders/transactions/get/transaction.go | 12 +--- .../transactions/immediate/message_test.go | 2 +- .../transactions/immediate/transaction.go | 12 +--- .../immediate/transaction_keeper.go | 2 +- x/orders/transactions/make/message_test.go | 2 +- x/orders/transactions/make/transaction.go | 12 +--- .../transactions/make/transaction_keeper.go | 2 +- x/orders/transactions/modify/message_test.go | 2 +- x/orders/transactions/modify/transaction.go | 12 +--- .../transactions/modify/transaction_keeper.go | 2 +- x/orders/transactions/prototype_test.go | 16 ++--- x/orders/transactions/put/message_test.go | 2 +- x/orders/transactions/put/transaction.go | 12 +--- .../transactions/put/transaction_keeper.go | 2 +- x/orders/transactions/revoke/message_test.go | 2 +- x/orders/transactions/revoke/transaction.go | 12 +--- x/orders/transactions/take/message_test.go | 2 +- x/orders/transactions/take/transaction.go | 12 +--- x/splits/queries/balances/query.go | 18 +----- x/splits/queries/prototype_test.go | 8 +-- x/splits/queries/split/query.go | 18 +----- x/splits/queries/splits/query.go | 18 +----- x/splits/queries/supply/query.go | 18 +----- 115 files changed, 187 insertions(+), 761 deletions(-) diff --git a/helpers/base/module.go b/helpers/base/module.go index 940726d0f..7a542900a 100644 --- a/helpers/base/module.go +++ b/helpers/base/module.go @@ -76,22 +76,14 @@ func (module module) RegisterRESTRoutes(context client.Context, router *mux.Rout router.HandleFunc("/"+module.Name()+"/parameters", module.parameterManagerPrototype().RESTQueryHandler(context)).Methods("GET") for _, query := range module.queriesPrototype().Get() { - router.HandleFunc("/"+module.Name()+"/"+query.GetName(), query.RESTQueryHandler(context)).Methods("GET") + router.HandleFunc(query.GetServicePath(), query.RESTQueryHandler(context)).Methods("GET") } for _, transaction := range module.transactionsPrototype().Get() { - router.HandleFunc("/"+module.Name()+"/"+transaction.GetName(), transaction.RESTRequestHandler(context)).Methods("POST") - } -} -func (module module) RegisterGRPCGatewayRoutes(context client.Context, serveMux *runtime.ServeMux) { - for _, query := range module.queriesPrototype().Get() { - query.RegisterGRPCGatewayRoute(context, serveMux) - } - - for _, transaction := range module.transactionsPrototype().Get() { - transaction.RegisterGRPCGatewayRoute(context, serveMux) + router.HandleFunc(transaction.GetServicePath(), transaction.RESTRequestHandler(context)).Methods("POST") } } +func (module module) RegisterGRPCGatewayRoutes(_ client.Context, _ *runtime.ServeMux) {} func (module module) GetTxCmd() *cobra.Command { rootTransactionCommand := &cobra.Command{ Use: module.name, diff --git a/helpers/base/queries.go b/helpers/base/queries.go index 4cb71a960..2f6c1e179 100644 --- a/helpers/base/queries.go +++ b/helpers/base/queries.go @@ -11,9 +11,9 @@ type queries struct { var _ helpers.Queries = (*queries)(nil) -func (queries queries) GetQuery(name string) helpers.Query { +func (queries queries) GetQuery(servicePath string) helpers.Query { for _, query := range queries.Get() { - if query.GetName() == name { + if query.GetServicePath() == servicePath { return query } } diff --git a/helpers/base/queries_test.go b/helpers/base/queries_test.go index c412da048..f9f4e8cbb 100644 --- a/helpers/base/queries_test.go +++ b/helpers/base/queries_test.go @@ -16,7 +16,7 @@ func TestQueries(t *testing.T) { Queries2 := NewQueries() // GetProperty - require.Equal(t, "", Queries1.GetQuery("").GetName()) + require.Equal(t, "", Queries1.GetQuery("").GetServicePath()) require.Equal(t, nil, Queries2.GetQuery("")) // GetAuxiliary diff --git a/helpers/base/query.go b/helpers/base/query.go index fbaf658dc..eafc70e3a 100644 --- a/helpers/base/query.go +++ b/helpers/base/query.go @@ -6,13 +6,12 @@ package base import ( "fmt" "github.com/AssetMantle/modules/utilities/rest" - "net/http" - "github.com/cosmos/cosmos-sdk/client" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" + "net/http" + "strings" abciTypes "github.com/cometbft/cometbft/abci/types" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" "golang.org/x/net/context" "google.golang.org/grpc" @@ -21,32 +20,27 @@ import ( ) type query struct { - name string - cliCommand helpers.CLICommand - moduleName string - queryKeeper helpers.QueryKeeper - requestPrototype func() helpers.QueryRequest - responsePrototype func() helpers.QueryResponse - keeperPrototype func() helpers.QueryKeeper - serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper) - grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error - queryHandler func(client.Context, helpers.QueryRequest) (helpers.QueryResponse, error) + serviceName string + cliCommand helpers.CLICommand + queryKeeper helpers.QueryKeeper + requestPrototype func() helpers.QueryRequest + responsePrototype func() helpers.QueryResponse + keeperPrototype func() helpers.QueryKeeper + serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper) } var _ helpers.Query = (*query)(nil) func (query query) RegisterService(configurator sdkModuleTypes.Configurator) { if query.queryKeeper == nil { - panic(fmt.Errorf("query keeper for query %s not initialized", query.name)) + panic(fmt.Errorf("query keeper for query %s not initialized", query.serviceName)) } query.serviceRegistrar(configurator.QueryServer(), query.queryKeeper) } -func (query query) RegisterGRPCGatewayRoute(context client.Context, serveMux *runtime.ServeMux) { - if err := query.grpcGatewayRegistrar(context, serveMux); err != nil { - panic(err) - } +func (query query) GetServicePath() string { + splits := strings.Split(query.serviceName, ".") + return "/" + splits[3] + "/" + splits[5] } -func (query query) GetName() string { return query.name } func (query query) Command() *cobra.Command { runE := func(command *cobra.Command, args []string) error { clientContext, err := client.GetClientTxContext(command) @@ -58,8 +52,8 @@ func (query query) Command() *cobra.Command { return err } - queryResponse, err := query.queryHandler(clientContext, queryRequest) - if err != nil { + queryResponse := query.responsePrototype() + if err := clientContext.Invoke(context.Background(), query.serviceName+"/Handle", queryRequest, queryResponse); err != nil { return err } @@ -81,11 +75,11 @@ func (query query) HandleQuery(context context.Context, requestQuery abciTypes.R return result.Encode() } -func (query query) RESTQueryHandler(context client.Context) http.HandlerFunc { +func (query query) RESTQueryHandler(Context client.Context) http.HandlerFunc { return func(responseWriter http.ResponseWriter, httpRequest *http.Request) { responseWriter.Header().Set("Content-Type", "application/json") - clientContext, ok := rest.ParseQueryHeightOrReturnBadRequest(responseWriter, context, httpRequest) + clientContext, ok := rest.ParseQueryHeightOrReturnBadRequest(responseWriter, Context, httpRequest) if !ok { return } @@ -99,13 +93,13 @@ func (query query) RESTQueryHandler(context client.Context) http.HandlerFunc { rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) } - response, err := query.queryHandler(clientContext, queryRequest) - if err != nil { + queryResponse := query.responsePrototype() + if err := clientContext.Invoke(context.Background(), query.serviceName+"/Handle", queryRequest, queryResponse); err != nil { rest.WriteErrorResponse(responseWriter, http.StatusInternalServerError, err.Error()) return } - rest.PostProcessResponse(responseWriter, clientContext, response) + rest.PostProcessResponse(responseWriter, clientContext, queryResponse) } } func (query query) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, auxiliaryKeepers ...interface{}) helpers.Query { @@ -113,16 +107,14 @@ func (query query) Initialize(mapper helpers.Mapper, parameterManager helpers.Pa return query } -func NewQuery(name string, short string, long string, moduleName string, requestPrototype func() helpers.QueryRequest, responsePrototype func() helpers.QueryResponse, keeperPrototype func() helpers.QueryKeeper, serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper), grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error, queryHandler func(client.Context, helpers.QueryRequest) (helpers.QueryResponse, error), flagList ...helpers.CLIFlag) helpers.Query { +func NewQuery(serviceName string, short string, long string, requestPrototype func() helpers.QueryRequest, responsePrototype func() helpers.QueryResponse, keeperPrototype func() helpers.QueryKeeper, serviceRegistrar func(grpc.ServiceRegistrar, helpers.QueryKeeper), flagList ...helpers.CLIFlag) helpers.Query { + splits := strings.Split(serviceName, ".") return query{ - name: name, - cliCommand: NewCLICommand(name, short, long, flagList), - moduleName: moduleName, - requestPrototype: requestPrototype, - responsePrototype: responsePrototype, - keeperPrototype: keeperPrototype, - serviceRegistrar: serviceRegistrar, - grpcGatewayRegistrar: grpcGatewayRegistrar, - queryHandler: queryHandler, + serviceName: serviceName, + cliCommand: NewCLICommand(splits[5], short, long, flagList), + requestPrototype: requestPrototype, + responsePrototype: responsePrototype, + keeperPrototype: keeperPrototype, + serviceRegistrar: serviceRegistrar, } } diff --git a/helpers/base/transaction.go b/helpers/base/transaction.go index d7e842f78..ae1bfc6f4 100644 --- a/helpers/base/transaction.go +++ b/helpers/base/transaction.go @@ -16,8 +16,8 @@ import ( codecTypes "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" + "strings" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" "google.golang.org/grpc" "net/http" @@ -25,19 +25,21 @@ import ( ) type transaction struct { - name string - cliCommand helpers.CLICommand - keeper helpers.TransactionKeeper - requestPrototype func() helpers.TransactionRequest - messagePrototype func() helpers.Message - keeperPrototype func() helpers.TransactionKeeper - serviceRegistrar func(grpc.ServiceRegistrar, helpers.TransactionKeeper) - grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error + serviceName string + cliCommand helpers.CLICommand + keeper helpers.TransactionKeeper + requestPrototype func() helpers.TransactionRequest + messagePrototype func() helpers.Message + keeperPrototype func() helpers.TransactionKeeper + serviceRegistrar func(grpc.ServiceRegistrar, helpers.TransactionKeeper) } var _ helpers.Transaction = (*transaction)(nil) -func (transaction transaction) GetName() string { return transaction.name } +func (transaction transaction) GetServicePath() string { + splits := strings.Split(transaction.serviceName, ".") + return "/" + splits[3] + "/" + splits[5] +} func (transaction transaction) Command() *cobra.Command { runE := func(command *cobra.Command, args []string) error { Context, err := client.GetClientTxContext(command) @@ -104,7 +106,6 @@ func (transaction transaction) RESTRequestHandler(context client.Context) http.H } } func (transaction transaction) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - transaction.messagePrototype().RegisterLegacyAminoCodec(legacyAmino) transaction.requestPrototype().RegisterLegacyAminoCodec(legacyAmino) } func (transaction transaction) RegisterInterfaces(interfaceRegistry codecTypes.InterfaceRegistry) { @@ -112,15 +113,10 @@ func (transaction transaction) RegisterInterfaces(interfaceRegistry codecTypes.I } func (transaction transaction) RegisterService(configurator sdkModuleTypes.Configurator) { if transaction.keeper == nil { - panic(fmt.Errorf("keeper for transaction %s is not initialized", transaction.name)) + panic(fmt.Errorf("keeper for transaction %s is not initialized", transaction.serviceName)) } transaction.serviceRegistrar(configurator.MsgServer(), transaction.keeper) } -func (transaction transaction) RegisterGRPCGatewayRoute(context client.Context, serveMux *runtime.ServeMux) { - if err := transaction.grpcGatewayRegistrar(context, serveMux); err != nil { - panic(err) - } -} func (transaction transaction) DecodeTransactionRequest(rawMessage json.RawMessage) (sdkTypes.Msg, error) { transactionRequest, err := transaction.requestPrototype().FromJSON(rawMessage) if err != nil { @@ -134,14 +130,14 @@ func (transaction transaction) InitializeKeeper(mapper helpers.Mapper, parameter return transaction } -func NewTransaction(name string, short string, long string, requestPrototype func() helpers.TransactionRequest, messagePrototype func() helpers.Message, keeperPrototype func() helpers.TransactionKeeper, serviceRegistrar func(grpc.ServiceRegistrar, helpers.TransactionKeeper), grpcGatewayRegistrar func(client.Context, *runtime.ServeMux) error, flagList ...helpers.CLIFlag) helpers.Transaction { +func NewTransaction(serviceName string, short string, long string, requestPrototype func() helpers.TransactionRequest, messagePrototype func() helpers.Message, keeperPrototype func() helpers.TransactionKeeper, serviceRegistrar func(grpc.ServiceRegistrar, helpers.TransactionKeeper), flagList ...helpers.CLIFlag) helpers.Transaction { + splits := strings.Split(serviceName, ".") return transaction{ - name: name, - cliCommand: NewCLICommand(name, short, long, flagList), - requestPrototype: requestPrototype, - messagePrototype: messagePrototype, - keeperPrototype: keeperPrototype, - serviceRegistrar: serviceRegistrar, - grpcGatewayRegistrar: grpcGatewayRegistrar, + serviceName: serviceName, + cliCommand: NewCLICommand(splits[5], short, long, flagList), + requestPrototype: requestPrototype, + messagePrototype: messagePrototype, + keeperPrototype: keeperPrototype, + serviceRegistrar: serviceRegistrar, } } diff --git a/helpers/base/transactions.go b/helpers/base/transactions.go index 665cc8247..0b47ba570 100644 --- a/helpers/base/transactions.go +++ b/helpers/base/transactions.go @@ -11,9 +11,9 @@ type transactions struct { var _ helpers.Transactions = (*transactions)(nil) -func (transactions transactions) GetTransaction(name string) helpers.Transaction { +func (transactions transactions) GetTransaction(servicePath string) helpers.Transaction { for _, transaction := range transactions.transactionList { - if transaction.GetName() == name { + if transaction.GetServicePath() == servicePath { return transaction } } diff --git a/helpers/base/transactions_test.go b/helpers/base/transactions_test.go index dec36533a..6c9d55416 100644 --- a/helpers/base/transactions_test.go +++ b/helpers/base/transactions_test.go @@ -17,7 +17,7 @@ func TestNewTransactions(t *testing.T) { // GetName require.Equal(t, nil, Transactions1.GetTransaction("")) - require.Equal(t, "", Transactions2.GetTransaction("").GetName()) + require.Equal(t, "", Transactions2.GetTransaction("").GetServicePath()) // GetAuxiliary require.Equal(t, []helpers.Transaction(nil), Transactions1.Get()) diff --git a/helpers/query.go b/helpers/query.go index 9f2bb2da8..d40f29eb5 100644 --- a/helpers/query.go +++ b/helpers/query.go @@ -10,16 +10,14 @@ import ( abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" ) type Query interface { - GetName() string + GetServicePath() string Command() *cobra.Command HandleQuery(context.Context, abciTypes.RequestQuery) ([]byte, error) RESTQueryHandler(client.Context) http.HandlerFunc RegisterService(module.Configurator) - RegisterGRPCGatewayRoute(client.Context, *runtime.ServeMux) Initialize(Mapper, ParameterManager, ...interface{}) Query } diff --git a/helpers/transaction.go b/helpers/transaction.go index 81495b01c..960b30eb3 100644 --- a/helpers/transaction.go +++ b/helpers/transaction.go @@ -13,19 +13,17 @@ import ( "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" ) type Transaction interface { - GetName() string + GetServicePath() string Command() *cobra.Command HandleMessage(context.Context, Message) (*sdkTypes.Result, error) RESTRequestHandler(client.Context) http.HandlerFunc RegisterLegacyAminoCodec(amino *codec.LegacyAmino) RegisterInterfaces(types.InterfaceRegistry) RegisterService(module.Configurator) - RegisterGRPCGatewayRoute(client.Context, *runtime.ServeMux) DecodeTransactionRequest(json.RawMessage) (sdkTypes.Msg, error) InitializeKeeper(Mapper, ParameterManager, ...interface{}) Transaction } diff --git a/x/assets/queries/asset/query.go b/x/assets/queries/asset/query.go index 36362c59d..5068b78af 100644 --- a/x/assets/queries/asset/query.go +++ b/x/assets/queries/asset/query.go @@ -4,28 +4,18 @@ package asset import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/assets/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.AssetID, ) diff --git a/x/assets/queries/assets/query.go b/x/assets/queries/assets/query.go index 632d34515..2544da2f6 100644 --- a/x/assets/queries/assets/query.go +++ b/x/assets/queries/assets/query.go @@ -4,28 +4,18 @@ package assets import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/assets/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.AssetID, helperConstants.Limit, diff --git a/x/assets/queries/prototype_test.go b/x/assets/queries/prototype_test.go index 84290c598..b49040341 100644 --- a/x/assets/queries/prototype_test.go +++ b/x/assets/queries/prototype_test.go @@ -17,11 +17,11 @@ func TestPrototype(t *testing.T) { getString string }{ - {"+ve", asset.Query.GetName(), "assets"}, + {"+ve", asset.Query.GetServicePath(), "assets"}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := Prototype(); !reflect.DeepEqual(got.GetQuery(tt.getString).GetName(), tt.want) { + if got := Prototype(); !reflect.DeepEqual(got.GetQuery(tt.getString).GetServicePath(), tt.want) { t.Errorf("Prototype() = %v, want %v", got, tt.want) } }) diff --git a/x/assets/transactions/burn/message_test.go b/x/assets/transactions/burn/message_test.go index 7178d55b3..b9260c5f4 100644 --- a/x/assets/transactions/burn/message_test.go +++ b/x/assets/transactions/burn/message_test.go @@ -132,7 +132,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress, fromID, testAssetID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress, fromID, testAssetID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/burn/transaction.go b/x/assets/transactions/burn/transaction.go index 79d5bfeef..bb91c052e 100644 --- a/x/assets/transactions/burn/transaction.go +++ b/x/assets/transactions/burn/transaction.go @@ -4,22 +4,15 @@ package burn import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.AssetID, diff --git a/x/assets/transactions/define/message_test.go b/x/assets/transactions/define/message_test.go index 06fcfd453..6aa990628 100644 --- a/x/assets/transactions/define/message_test.go +++ b/x/assets/transactions/define/message_test.go @@ -138,7 +138,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/define/transaction.go b/x/assets/transactions/define/transaction.go index 6242b9071..19e4243df 100644 --- a/x/assets/transactions/define/transaction.go +++ b/x/assets/transactions/define/transaction.go @@ -4,22 +4,15 @@ package define import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ImmutableMetaProperties, diff --git a/x/assets/transactions/define/transaction_keeper.go b/x/assets/transactions/define/transaction_keeper.go index bc3e4d797..966dfdd5c 100644 --- a/x/assets/transactions/define/transaction_keeper.go +++ b/x/assets/transactions/define/transaction_keeper.go @@ -29,7 +29,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/assets/transactions/deputize/message_test.go b/x/assets/transactions/deputize/message_test.go index 9eaf68fd9..08a0a3a3a 100644 --- a/x/assets/transactions/deputize/message_test.go +++ b/x/assets/transactions/deputize/message_test.go @@ -151,7 +151,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/deputize/transaction.go b/x/assets/transactions/deputize/transaction.go index 4d856611f..fe1360902 100644 --- a/x/assets/transactions/deputize/transaction.go +++ b/x/assets/transactions/deputize/transaction.go @@ -4,22 +4,15 @@ package deputize import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/assets/transactions/deputize/transaction_keeper.go b/x/assets/transactions/deputize/transaction_keeper.go index fa59c26be..bd4d0fe66 100644 --- a/x/assets/transactions/deputize/transaction_keeper.go +++ b/x/assets/transactions/deputize/transaction_keeper.go @@ -26,7 +26,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/assets/transactions/mint/message_test.go b/x/assets/transactions/mint/message_test.go index f6e2bf3e0..4719731ac 100644 --- a/x/assets/transactions/mint/message_test.go +++ b/x/assets/transactions/mint/message_test.go @@ -145,7 +145,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/mint/transaction.go b/x/assets/transactions/mint/transaction.go index c45800e1d..82f6a9627 100644 --- a/x/assets/transactions/mint/transaction.go +++ b/x/assets/transactions/mint/transaction.go @@ -4,22 +4,15 @@ package mint import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.ToIdentityID, constants.FromIdentityID, diff --git a/x/assets/transactions/mint/transaction_keeper.go b/x/assets/transactions/mint/transaction_keeper.go index 283062cd5..b94e282bb 100644 --- a/x/assets/transactions/mint/transaction_keeper.go +++ b/x/assets/transactions/mint/transaction_keeper.go @@ -53,7 +53,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa return nil, err } - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/assets/transactions/mutate/message_test.go b/x/assets/transactions/mutate/message_test.go index b0eae6851..ff3760108 100644 --- a/x/assets/transactions/mutate/message_test.go +++ b/x/assets/transactions/mutate/message_test.go @@ -135,7 +135,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/mutate/transaction.go b/x/assets/transactions/mutate/transaction.go index 6986e06ac..85abb1ea1 100644 --- a/x/assets/transactions/mutate/transaction.go +++ b/x/assets/transactions/mutate/transaction.go @@ -4,22 +4,15 @@ package mutate import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.AssetID, constants.FromIdentityID, diff --git a/x/assets/transactions/mutate/transaction_keeper.go b/x/assets/transactions/mutate/transaction_keeper.go index 4e0f1e2bf..24020e51c 100644 --- a/x/assets/transactions/mutate/transaction_keeper.go +++ b/x/assets/transactions/mutate/transaction_keeper.go @@ -33,7 +33,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/assets/transactions/renumerate/message_test.go b/x/assets/transactions/renumerate/message_test.go index a6912c4f3..605e4374b 100644 --- a/x/assets/transactions/renumerate/message_test.go +++ b/x/assets/transactions/renumerate/message_test.go @@ -127,7 +127,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, testAssetID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, testAssetID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/renumerate/transaction.go b/x/assets/transactions/renumerate/transaction.go index 565c21da7..d317f7d72 100644 --- a/x/assets/transactions/renumerate/transaction.go +++ b/x/assets/transactions/renumerate/transaction.go @@ -4,22 +4,15 @@ package renumerate import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.AssetID, diff --git a/x/assets/transactions/renumerate/transaction_keeper.go b/x/assets/transactions/renumerate/transaction_keeper.go index e8a94e64f..92dbdc690 100644 --- a/x/assets/transactions/renumerate/transaction_keeper.go +++ b/x/assets/transactions/renumerate/transaction_keeper.go @@ -40,7 +40,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa return nil, errorConstants.NotAuthorized.Wrapf("renumerate is not enabled") } - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/assets/transactions/revoke/message_test.go b/x/assets/transactions/revoke/message_test.go index 3143a184b..31ea42f2e 100644 --- a/x/assets/transactions/revoke/message_test.go +++ b/x/assets/transactions/revoke/message_test.go @@ -126,7 +126,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/revoke/transaction.go b/x/assets/transactions/revoke/transaction.go index c32599e72..639924c53 100644 --- a/x/assets/transactions/revoke/transaction.go +++ b/x/assets/transactions/revoke/transaction.go @@ -4,22 +4,15 @@ package revoke import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/assets/transactions/revoke/transaction_keeper.go b/x/assets/transactions/revoke/transaction_keeper.go index 318da9a39..a045b5961 100644 --- a/x/assets/transactions/revoke/transaction_keeper.go +++ b/x/assets/transactions/revoke/transaction_keeper.go @@ -25,7 +25,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/assets/transactions/send/message_test.go b/x/assets/transactions/send/message_test.go index f65db4d0e..281f5ba52 100644 --- a/x/assets/transactions/send/message_test.go +++ b/x/assets/transactions/send/message_test.go @@ -231,7 +231,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, assetID, testRate}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, fromID, assetID, testRate}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/send/transaction.go b/x/assets/transactions/send/transaction.go index 263c9308d..cde5d80c4 100644 --- a/x/assets/transactions/send/transaction.go +++ b/x/assets/transactions/send/transaction.go @@ -4,22 +4,15 @@ package send import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/assets/transactions/send/transaction_keeper.go b/x/assets/transactions/send/transaction_keeper.go index 44366d97e..ecea9200a 100644 --- a/x/assets/transactions/send/transaction_keeper.go +++ b/x/assets/transactions/send/transaction_keeper.go @@ -65,7 +65,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes // // Note: The errorConstants and propertyConstants are used for error handling and property checking respectively. func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(message.GetFromAddress(), message.FromID)); err != nil { + if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(message.GetSigners()[0], message.FromID)); err != nil { return nil, err } diff --git a/x/assets/transactions/unwrap/message_test.go b/x/assets/transactions/unwrap/message_test.go index 6d96f10d4..c7fca94e7 100644 --- a/x/assets/transactions/unwrap/message_test.go +++ b/x/assets/transactions/unwrap/message_test.go @@ -245,7 +245,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, coins}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, coins}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/unwrap/transaction.go b/x/assets/transactions/unwrap/transaction.go index b855276fb..bd994f30b 100644 --- a/x/assets/transactions/unwrap/transaction.go +++ b/x/assets/transactions/unwrap/transaction.go @@ -4,22 +4,15 @@ package unwrap import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.Coins, diff --git a/x/assets/transactions/unwrap/transaction_keeper.go b/x/assets/transactions/unwrap/transaction_keeper.go index bd8d0a0d4..9eb758f35 100644 --- a/x/assets/transactions/unwrap/transaction_keeper.go +++ b/x/assets/transactions/unwrap/transaction_keeper.go @@ -60,7 +60,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes // // 4. If the process completes successfully for all coins, it returns a new TransactionResponse object. func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(message.GetFromAddress(), message.FromID)); err != nil { + if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(message.GetSigners()[0], message.FromID)); err != nil { return nil, err } @@ -89,7 +89,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa return nil, err } - if err := transactionKeeper.bankKeeper.SendCoinsFromModuleToAccount(sdkTypes.UnwrapSDKContext(context), constants.ModuleName, message.GetFromAddress(), sdkTypes.NewCoins(coin)); err != nil { + if err := transactionKeeper.bankKeeper.SendCoinsFromModuleToAccount(sdkTypes.UnwrapSDKContext(context), constants.ModuleName, message.GetSigners()[0], sdkTypes.NewCoins(coin)); err != nil { return nil, err } } diff --git a/x/assets/transactions/wrap/message_test.go b/x/assets/transactions/wrap/message_test.go index f6938098e..539402089 100644 --- a/x/assets/transactions/wrap/message_test.go +++ b/x/assets/transactions/wrap/message_test.go @@ -248,7 +248,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), fromID, coins}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), fromID, coins}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/wrap/transaction.go b/x/assets/transactions/wrap/transaction.go index 0e2999331..1270b6513 100644 --- a/x/assets/transactions/wrap/transaction.go +++ b/x/assets/transactions/wrap/transaction.go @@ -4,22 +4,15 @@ package wrap import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.Coins, diff --git a/x/assets/transactions/wrap/transaction_keeper.go b/x/assets/transactions/wrap/transaction_keeper.go index 0d28120ab..00bd7e0e5 100644 --- a/x/assets/transactions/wrap/transaction_keeper.go +++ b/x/assets/transactions/wrap/transaction_keeper.go @@ -60,7 +60,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes // // 4. If the process completes successfully for all coins, it returns a new transaction response object. func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(message.GetFromAddress(), message.FromID)); err != nil { + if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(message.GetSigners()[0], message.FromID)); err != nil { return nil, err } @@ -89,7 +89,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa assets.Add(record.NewRecord(coinAsset)) } - if err := transactionKeeper.bankKeeper.SendCoinsFromAccountToModule(sdkTypes.UnwrapSDKContext(context), message.GetFromAddress(), constants.ModuleName, sdkTypes.NewCoins(coin)); err != nil { + if err := transactionKeeper.bankKeeper.SendCoinsFromAccountToModule(sdkTypes.UnwrapSDKContext(context), message.GetSigners()[0], constants.ModuleName, sdkTypes.NewCoins(coin)); err != nil { return nil, err } } diff --git a/x/classifications/queries/classification/query.go b/x/classifications/queries/classification/query.go index 06c593495..45ab05d13 100644 --- a/x/classifications/queries/classification/query.go +++ b/x/classifications/queries/classification/query.go @@ -4,28 +4,18 @@ package classification import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/classifications/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.ClassificationID, ) diff --git a/x/classifications/queries/classifications/query.go b/x/classifications/queries/classifications/query.go index 42bfc5bcf..f9cf5f0ef 100644 --- a/x/classifications/queries/classifications/query.go +++ b/x/classifications/queries/classifications/query.go @@ -4,26 +4,17 @@ package classifications import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/classifications/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, requestPrototype, responsePrototype, @@ -32,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.ClassificationID, helperConstants.Limit, diff --git a/x/classifications/queries/prototype_test.go b/x/classifications/queries/prototype_test.go index cdf7edc6c..7208b15ee 100644 --- a/x/classifications/queries/prototype_test.go +++ b/x/classifications/queries/prototype_test.go @@ -14,8 +14,8 @@ import ( func TestPrototype(t *testing.T) { require.Panics(t, func() { - require.Equal(t, Prototype().GetQuery("classification").GetName(), baseHelpers.NewQueries( + require.Equal(t, Prototype().GetQuery("classification").GetServicePath(), baseHelpers.NewQueries( classification.Query, - ).GetQuery("classification").GetName()) + ).GetQuery("classification").GetServicePath()) }) } diff --git a/x/identities/queries/identities/query.go b/x/identities/queries/identities/query.go index 5445fadb0..d5d95474d 100644 --- a/x/identities/queries/identities/query.go +++ b/x/identities/queries/identities/query.go @@ -1,26 +1,17 @@ package identities import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/identities/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, requestPrototype, responsePrototype, @@ -29,12 +20,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.IdentityID, helperConstants.Limit, diff --git a/x/identities/queries/identity/query.go b/x/identities/queries/identity/query.go index 592a565ef..1c4d5f778 100644 --- a/x/identities/queries/identity/query.go +++ b/x/identities/queries/identity/query.go @@ -4,28 +4,18 @@ package identity import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/identities/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.IdentityID, ) diff --git a/x/identities/transactions/define/message_test.go b/x/identities/transactions/define/message_test.go index e9d98178a..8ebebb987 100644 --- a/x/identities/transactions/define/message_test.go +++ b/x/identities/transactions/define/message_test.go @@ -218,7 +218,7 @@ func Test_message_Type(t *testing.T) { want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/define/transaction.go b/x/identities/transactions/define/transaction.go index 6242b9071..19e4243df 100644 --- a/x/identities/transactions/define/transaction.go +++ b/x/identities/transactions/define/transaction.go @@ -4,22 +4,15 @@ package define import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ImmutableMetaProperties, diff --git a/x/identities/transactions/deputize/message_test.go b/x/identities/transactions/deputize/message_test.go index b65f238b4..e49085e1a 100644 --- a/x/identities/transactions/deputize/message_test.go +++ b/x/identities/transactions/deputize/message_test.go @@ -158,7 +158,7 @@ func Test_message_Type(t *testing.T) { want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/deputize/transaction.go b/x/identities/transactions/deputize/transaction.go index 4ec5cb127..f1dc365cd 100644 --- a/x/identities/transactions/deputize/transaction.go +++ b/x/identities/transactions/deputize/transaction.go @@ -4,22 +4,15 @@ package deputize import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/identities/transactions/deputize/transaction_keeper.go b/x/identities/transactions/deputize/transaction_keeper.go index a964e4eb6..db249dfbf 100644 --- a/x/identities/transactions/deputize/transaction_keeper.go +++ b/x/identities/transactions/deputize/transaction_keeper.go @@ -27,7 +27,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if Mappable := transactionKeeper.mapper.NewCollection(context).Fetch(key.NewKey(message.FromID)).GetMappable(key.NewKey(message.FromID)); Mappable == nil { return nil, errorConstants.EntityNotFound.Wrapf("identity with ID %s not found", message.FromID.AsString()) diff --git a/x/identities/transactions/issue/message_test.go b/x/identities/transactions/issue/message_test.go index fd7bb91c6..ac25d0442 100644 --- a/x/identities/transactions/issue/message_test.go +++ b/x/identities/transactions/issue/message_test.go @@ -170,7 +170,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/issue/transaction.go b/x/identities/transactions/issue/transaction.go index 0b2fedde2..433e0aad1 100644 --- a/x/identities/transactions/issue/transaction.go +++ b/x/identities/transactions/issue/transaction.go @@ -4,22 +4,15 @@ package issue import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ClassificationID, diff --git a/x/identities/transactions/name/message_test.go b/x/identities/transactions/name/message_test.go index 3de51d2ad..a854b9cc8 100644 --- a/x/identities/transactions/name/message_test.go +++ b/x/identities/transactions/name/message_test.go @@ -124,7 +124,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testNubID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testNubID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/name/transaction.go b/x/identities/transactions/name/transaction.go index a360343a2..f0e7a434b 100644 --- a/x/identities/transactions/name/transaction.go +++ b/x/identities/transactions/name/transaction.go @@ -4,22 +4,15 @@ package name import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.Name, ) diff --git a/x/identities/transactions/prototype_test.go b/x/identities/transactions/prototype_test.go index df37b33d0..8b7ee0731 100644 --- a/x/identities/transactions/prototype_test.go +++ b/x/identities/transactions/prototype_test.go @@ -19,7 +19,7 @@ import ( ) func TestPrototype(t *testing.T) { - require.Equal(t, Prototype().GetTransaction("unprovision").GetName(), baseHelpers.NewTransactions( + require.Equal(t, Prototype().GetTransaction("unprovision").GetServicePath(), baseHelpers.NewTransactions( define.Transaction, deputize.Transaction, issue.Transaction, @@ -27,5 +27,5 @@ func TestPrototype(t *testing.T) { provision.Transaction, revoke.Transaction, unprovision.Transaction, - ).GetTransaction("unprovision").GetName()) + ).GetTransaction("unprovision").GetServicePath()) } diff --git a/x/identities/transactions/provision/message_test.go b/x/identities/transactions/provision/message_test.go index 851b72ec1..58b629032 100644 --- a/x/identities/transactions/provision/message_test.go +++ b/x/identities/transactions/provision/message_test.go @@ -139,7 +139,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/provision/transaction.go b/x/identities/transactions/provision/transaction.go index 2adc8ef9d..943152242 100644 --- a/x/identities/transactions/provision/transaction.go +++ b/x/identities/transactions/provision/transaction.go @@ -4,22 +4,15 @@ package provision import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.To, constants.IdentityID, diff --git a/x/identities/transactions/provision/transaction_keeper.go b/x/identities/transactions/provision/transaction_keeper.go index 8fa562199..6d8a6b6cc 100644 --- a/x/identities/transactions/provision/transaction_keeper.go +++ b/x/identities/transactions/provision/transaction_keeper.go @@ -43,7 +43,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa return nil, errorConstants.NotAuthorized.Wrapf("identity with ID %s has reached the maximum allowed number of provision-able addresses %d", message.IdentityID.AsString(), transactionKeeper.parameterManager.Fetch(context).GetParameter(constants.MaxProvisionAddressCountProperty.GetID()).GetMetaProperty().GetData().Get().(data.NumberData).Get()) } - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] toAddress, err := sdkTypes.AccAddressFromBech32(message.To) if err != nil { diff --git a/x/identities/transactions/quash/message_test.go b/x/identities/transactions/quash/message_test.go index f5d13b85e..5c7daba1b 100644 --- a/x/identities/transactions/quash/message_test.go +++ b/x/identities/transactions/quash/message_test.go @@ -136,7 +136,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testIdentityID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testIdentityID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/quash/transaction.go b/x/identities/transactions/quash/transaction.go index 3134d2a0b..bb558d772 100644 --- a/x/identities/transactions/quash/transaction.go +++ b/x/identities/transactions/quash/transaction.go @@ -4,22 +4,15 @@ package quash import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.IdentityID, diff --git a/x/identities/transactions/quash/transaction_keeper.go b/x/identities/transactions/quash/transaction_keeper.go index 7cb480a98..8a6b5bd02 100644 --- a/x/identities/transactions/quash/transaction_keeper.go +++ b/x/identities/transactions/quash/transaction_keeper.go @@ -42,7 +42,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa return nil, errorConstants.NotAuthorized.Wrapf("identity quashing is not enabled") } - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if Mappable := transactionKeeper.mapper.NewCollection(context).Fetch(key.NewKey(message.FromID)).GetMappable(key.NewKey(message.FromID)); Mappable == nil { return nil, errorConstants.EntityNotFound.Wrapf("identity with ID %s not found", message.FromID.AsString()) diff --git a/x/identities/transactions/revoke/message_test.go b/x/identities/transactions/revoke/message_test.go index efc44c85f..d3eca9b30 100644 --- a/x/identities/transactions/revoke/message_test.go +++ b/x/identities/transactions/revoke/message_test.go @@ -141,7 +141,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/revoke/transaction.go b/x/identities/transactions/revoke/transaction.go index c32599e72..639924c53 100644 --- a/x/identities/transactions/revoke/transaction.go +++ b/x/identities/transactions/revoke/transaction.go @@ -4,22 +4,15 @@ package revoke import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/identities/transactions/revoke/transaction_keeper.go b/x/identities/transactions/revoke/transaction_keeper.go index 4165cca5c..bab5b5005 100644 --- a/x/identities/transactions/revoke/transaction_keeper.go +++ b/x/identities/transactions/revoke/transaction_keeper.go @@ -26,7 +26,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if Mappable := transactionKeeper.mapper.NewCollection(context).Fetch(key.NewKey(message.FromID)).GetMappable(key.NewKey(message.FromID)); Mappable == nil { return nil, errorConstants.EntityNotFound.Wrapf("identity with ID %s not found", message.FromID.AsString()) diff --git a/x/identities/transactions/unprovision/message_test.go b/x/identities/transactions/unprovision/message_test.go index 7d1d2b148..7e02141d7 100644 --- a/x/identities/transactions/unprovision/message_test.go +++ b/x/identities/transactions/unprovision/message_test.go @@ -138,7 +138,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/unprovision/transaction.go b/x/identities/transactions/unprovision/transaction.go index 198474e64..5e7eddca9 100644 --- a/x/identities/transactions/unprovision/transaction.go +++ b/x/identities/transactions/unprovision/transaction.go @@ -4,22 +4,15 @@ package unprovision import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.To, constants.IdentityID, diff --git a/x/identities/transactions/unprovision/transaction_keeper.go b/x/identities/transactions/unprovision/transaction_keeper.go index d077a5353..c4d6cbae0 100644 --- a/x/identities/transactions/unprovision/transaction_keeper.go +++ b/x/identities/transactions/unprovision/transaction_keeper.go @@ -37,7 +37,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa } identity := mappable.GetIdentity(Mappable) - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] toAddress, err := sdkTypes.AccAddressFromBech32(message.To) if err != nil { diff --git a/x/identities/transactions/update/message_test.go b/x/identities/transactions/update/message_test.go index da6b724bd..d9705e52f 100644 --- a/x/identities/transactions/update/message_test.go +++ b/x/identities/transactions/update/message_test.go @@ -147,8 +147,8 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve with nil", fields{}, Transaction.GetName()}, - {"+ve", fields{testFrom.String(), testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties}, Transaction.GetName()}, + {"+ve with nil", fields{}, Transaction.GetServicePath()}, + {"+ve", fields{testFrom.String(), testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/transactions/update/transaction.go b/x/identities/transactions/update/transaction.go index 177ed2536..f62f639da 100644 --- a/x/identities/transactions/update/transaction.go +++ b/x/identities/transactions/update/transaction.go @@ -4,22 +4,15 @@ package update import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.IdentityID, constants.FromIdentityID, diff --git a/x/identities/transactions/update/transaction_keeper.go b/x/identities/transactions/update/transaction_keeper.go index db96d2430..205d08607 100644 --- a/x/identities/transactions/update/transaction_keeper.go +++ b/x/identities/transactions/update/transaction_keeper.go @@ -31,7 +31,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if Mappable := transactionKeeper.mapper.NewCollection(context).Fetch(key.NewKey(message.FromID)).GetMappable(key.NewKey(message.FromID)); Mappable == nil { return nil, errorConstants.EntityNotFound.Wrapf("identity with ID %s not found", message.FromID.AsString()) diff --git a/x/maintainers/queries/maintainer/query.go b/x/maintainers/queries/maintainer/query.go index df8de3d2e..ec3e951a1 100644 --- a/x/maintainers/queries/maintainer/query.go +++ b/x/maintainers/queries/maintainer/query.go @@ -4,28 +4,18 @@ package maintainer import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/maintainers/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.MaintainerID, ) diff --git a/x/maintainers/queries/maintainers/query.go b/x/maintainers/queries/maintainers/query.go index 1e3017809..a7abfc684 100644 --- a/x/maintainers/queries/maintainers/query.go +++ b/x/maintainers/queries/maintainers/query.go @@ -4,26 +4,17 @@ package maintainers import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/maintainers/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, requestPrototype, responsePrototype, @@ -32,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.MaintainerID, helperConstants.Limit, diff --git a/x/maintainers/queries/prototype_test.go b/x/maintainers/queries/prototype_test.go index 54ab8b1f6..52bebac4f 100644 --- a/x/maintainers/queries/prototype_test.go +++ b/x/maintainers/queries/prototype_test.go @@ -14,8 +14,8 @@ import ( func TestPrototype(t *testing.T) { require.Panics(t, func() { - require.Equal(t, Prototype().GetQuery("maintainer").GetName(), baseHelpers.NewQueries( + require.Equal(t, Prototype().GetQuery("maintainer").GetServicePath(), baseHelpers.NewQueries( maintainer.Query, - ).GetQuery("maintainer").GetName()) + ).GetQuery("maintainer").GetServicePath()) }) } diff --git a/x/metas/queries/meta/query.go b/x/metas/queries/meta/query.go index e2c59eee4..c812e6926 100644 --- a/x/metas/queries/meta/query.go +++ b/x/metas/queries/meta/query.go @@ -4,28 +4,18 @@ package meta import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/metas/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.DataID, ) diff --git a/x/metas/queries/metas/query.go b/x/metas/queries/metas/query.go index b3ced8977..94b831eff 100644 --- a/x/metas/queries/metas/query.go +++ b/x/metas/queries/metas/query.go @@ -4,26 +4,17 @@ package metas import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/metas/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, requestPrototype, responsePrototype, @@ -32,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.DataID, helperConstants.Limit, diff --git a/x/metas/queries/prototype_test.go b/x/metas/queries/prototype_test.go index 3b15a28e4..654e3a64b 100644 --- a/x/metas/queries/prototype_test.go +++ b/x/metas/queries/prototype_test.go @@ -13,7 +13,7 @@ import ( ) func TestPrototype(t *testing.T) { - require.Equal(t, Prototype().GetQuery("metas").GetName(), baseHelpers.NewQueries( + require.Equal(t, Prototype().GetQuery("metas").GetServicePath(), baseHelpers.NewQueries( meta.Query, - ).GetQuery("metas").GetName()) + ).GetQuery("metas").GetServicePath()) } diff --git a/x/metas/transactions/prototype_test.go b/x/metas/transactions/prototype_test.go index 12d33dfbc..da40651ef 100644 --- a/x/metas/transactions/prototype_test.go +++ b/x/metas/transactions/prototype_test.go @@ -13,7 +13,7 @@ import ( ) func TestPrototype(t *testing.T) { - require.Equal(t, Prototype().GetTransaction("reveal").GetName(), baseHelpers.NewTransactions( + require.Equal(t, Prototype().GetTransaction("reveal").GetServicePath(), baseHelpers.NewTransactions( reveal.Transaction, - ).GetTransaction("reveal").GetName()) + ).GetTransaction("reveal").GetServicePath()) } diff --git a/x/metas/transactions/reveal/message_test.go b/x/metas/transactions/reveal/message_test.go index 72f364fba..6add46ff5 100644 --- a/x/metas/transactions/reveal/message_test.go +++ b/x/metas/transactions/reveal/message_test.go @@ -22,7 +22,7 @@ func Test_Reveal_Message(t *testing.T) { testMessage := NewMessage(fromAccAddress, newData).(*Message) require.Equal(t, &Message{From: fromAccAddress.String(), Data: newData.ToAnyData().(*baseData.AnyData)}, testMessage) - require.Equal(t, Transaction.GetName(), testMessage.Type()) + require.Equal(t, Transaction.GetServicePath(), testMessage.Type()) require.Equal(t, nil, testMessage.ValidateBasic()) require.NotNil(t, (&Message{}).ValidateBasic()) require.Equal(t, []sdkTypes.AccAddress{fromAccAddress}, testMessage.GetSigners()) diff --git a/x/metas/transactions/reveal/transaction.go b/x/metas/transactions/reveal/transaction.go index b6b53e694..f2f2484cb 100644 --- a/x/metas/transactions/reveal/transaction.go +++ b/x/metas/transactions/reveal/transaction.go @@ -4,22 +4,15 @@ package reveal import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.Data, ) diff --git a/x/orders/queries/order/query.go b/x/orders/queries/order/query.go index 73f567b7f..c578424f0 100644 --- a/x/orders/queries/order/query.go +++ b/x/orders/queries/order/query.go @@ -4,28 +4,18 @@ package order import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/orders/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.OrderID, ) diff --git a/x/orders/queries/orders/query.go b/x/orders/queries/orders/query.go index 370feca35..42b3c099e 100644 --- a/x/orders/queries/orders/query.go +++ b/x/orders/queries/orders/query.go @@ -4,26 +4,17 @@ package orders import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/orders/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, requestPrototype, responsePrototype, @@ -32,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.OrderID, helperConstants.Limit, diff --git a/x/orders/queries/prototype_test.go b/x/orders/queries/prototype_test.go index 62ec1a898..d912ba57d 100644 --- a/x/orders/queries/prototype_test.go +++ b/x/orders/queries/prototype_test.go @@ -13,7 +13,7 @@ import ( ) func TestPrototype(t *testing.T) { - require.Equal(t, Prototype().GetQuery("orders").GetName(), baseHelpers.NewQueries( + require.Equal(t, Prototype().GetQuery("orders").GetServicePath(), baseHelpers.NewQueries( order.Query, - ).GetQuery("orders").GetName()) + ).GetQuery("orders").GetServicePath()) } diff --git a/x/orders/transactions/cancel/message_test.go b/x/orders/transactions/cancel/message_test.go index adbdae509..df12e5487 100644 --- a/x/orders/transactions/cancel/message_test.go +++ b/x/orders/transactions/cancel/message_test.go @@ -139,7 +139,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/cancel/transaction.go b/x/orders/transactions/cancel/transaction.go index 6ed7ae156..2b5a01955 100644 --- a/x/orders/transactions/cancel/transaction.go +++ b/x/orders/transactions/cancel/transaction.go @@ -4,22 +4,15 @@ package cancel import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,7 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, + constants.OrderID, constants.FromIdentityID, ) diff --git a/x/orders/transactions/cancel/transaction_keeper.go b/x/orders/transactions/cancel/transaction_keeper.go index 8ff2e6102..9dcd51fca 100644 --- a/x/orders/transactions/cancel/transaction_keeper.go +++ b/x/orders/transactions/cancel/transaction_keeper.go @@ -36,7 +36,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/orders/transactions/define/message_test.go b/x/orders/transactions/define/message_test.go index 94900b39a..2ec5866ef 100644 --- a/x/orders/transactions/define/message_test.go +++ b/x/orders/transactions/define/message_test.go @@ -126,7 +126,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/define/transaction.go b/x/orders/transactions/define/transaction.go index 6242b9071..19e4243df 100644 --- a/x/orders/transactions/define/transaction.go +++ b/x/orders/transactions/define/transaction.go @@ -4,22 +4,15 @@ package define import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ImmutableMetaProperties, diff --git a/x/orders/transactions/deputize/message_test.go b/x/orders/transactions/deputize/message_test.go index 71416a428..9ce9acb66 100644 --- a/x/orders/transactions/deputize/message_test.go +++ b/x/orders/transactions/deputize/message_test.go @@ -164,7 +164,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, true, true, true, true, true}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, true, true, true, true, true}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/deputize/transaction.go b/x/orders/transactions/deputize/transaction.go index ddae6b9fd..a89eda61d 100644 --- a/x/orders/transactions/deputize/transaction.go +++ b/x/orders/transactions/deputize/transaction.go @@ -4,22 +4,15 @@ package deputize import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/orders/transactions/deputize/transaction_keeper.go b/x/orders/transactions/deputize/transaction_keeper.go index 4ec96e902..5b5c11e59 100644 --- a/x/orders/transactions/deputize/transaction_keeper.go +++ b/x/orders/transactions/deputize/transaction_keeper.go @@ -26,7 +26,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/orders/transactions/get/message_test.go b/x/orders/transactions/get/message_test.go index c29b31031..a87890d77 100644 --- a/x/orders/transactions/get/message_test.go +++ b/x/orders/transactions/get/message_test.go @@ -116,7 +116,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/get/transaction.go b/x/orders/transactions/get/transaction.go index 7ff1d9dbf..c4b2ee7db 100644 --- a/x/orders/transactions/get/transaction.go +++ b/x/orders/transactions/get/transaction.go @@ -4,22 +4,15 @@ package get import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.OrderID, diff --git a/x/orders/transactions/immediate/message_test.go b/x/orders/transactions/immediate/message_test.go index b89a4a081..1b39d26db 100644 --- a/x/orders/transactions/immediate/message_test.go +++ b/x/orders/transactions/immediate/message_test.go @@ -150,7 +150,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/immediate/transaction.go b/x/orders/transactions/immediate/transaction.go index 637b17a73..4396d122c 100644 --- a/x/orders/transactions/immediate/transaction.go +++ b/x/orders/transactions/immediate/transaction.go @@ -4,22 +4,15 @@ package immediate import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ClassificationID, diff --git a/x/orders/transactions/immediate/transaction_keeper.go b/x/orders/transactions/immediate/transaction_keeper.go index 0c5c7893d..31fd2caf6 100644 --- a/x/orders/transactions/immediate/transaction_keeper.go +++ b/x/orders/transactions/immediate/transaction_keeper.go @@ -45,7 +45,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/orders/transactions/make/message_test.go b/x/orders/transactions/make/message_test.go index 1a8a59a51..4e5b0ab30 100644 --- a/x/orders/transactions/make/message_test.go +++ b/x/orders/transactions/make/message_test.go @@ -150,7 +150,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID.(*baseIDs.AssetID), takerAssetID.(*baseIDs.AssetID), expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID.(*baseIDs.AssetID), takerAssetID.(*baseIDs.AssetID), expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/make/transaction.go b/x/orders/transactions/make/transaction.go index 8b7bea24c..57c397280 100644 --- a/x/orders/transactions/make/transaction.go +++ b/x/orders/transactions/make/transaction.go @@ -4,22 +4,15 @@ package make import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.ClassificationID, constants.ExpiresIn, diff --git a/x/orders/transactions/make/transaction_keeper.go b/x/orders/transactions/make/transaction_keeper.go index a78bcbd84..a68d168bd 100644 --- a/x/orders/transactions/make/transaction_keeper.go +++ b/x/orders/transactions/make/transaction_keeper.go @@ -59,7 +59,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa // return nil, err } - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/orders/transactions/modify/message_test.go b/x/orders/transactions/modify/message_test.go index 49b5f08a0..63ad1df66 100644 --- a/x/orders/transactions/modify/message_test.go +++ b/x/orders/transactions/modify/message_test.go @@ -135,7 +135,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID, takerSplit, makerSplit, expiresInHeight, mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID, takerSplit, makerSplit, expiresInHeight, mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/modify/transaction.go b/x/orders/transactions/modify/transaction.go index d053218b9..f710e1448 100644 --- a/x/orders/transactions/modify/transaction.go +++ b/x/orders/transactions/modify/transaction.go @@ -4,22 +4,15 @@ package modify import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.OrderID, diff --git a/x/orders/transactions/modify/transaction_keeper.go b/x/orders/transactions/modify/transaction_keeper.go index a0c55fcb6..dfbde6ca5 100644 --- a/x/orders/transactions/modify/transaction_keeper.go +++ b/x/orders/transactions/modify/transaction_keeper.go @@ -42,7 +42,7 @@ func (transactionKeeper transactionKeeper) Transact(context context.Context, mes } func (transactionKeeper transactionKeeper) Handle(context context.Context, message *Message) (*TransactionResponse, error) { - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/orders/transactions/prototype_test.go b/x/orders/transactions/prototype_test.go index 246aea524..57a087fee 100644 --- a/x/orders/transactions/prototype_test.go +++ b/x/orders/transactions/prototype_test.go @@ -16,29 +16,29 @@ import ( ) func TestPrototype(t *testing.T) { - require.Equal(t, Prototype().GetTransaction("cancel").GetName(), baseHelpers.NewTransactions( + require.Equal(t, Prototype().GetTransaction("cancel").GetServicePath(), baseHelpers.NewTransactions( take.Transaction, cancel.Transaction, define.Transaction, make2.Transaction, - ).GetTransaction("cancel").GetName()) - require.Equal(t, Prototype().GetTransaction("define").GetName(), baseHelpers.NewTransactions( + ).GetTransaction("cancel").GetServicePath()) + require.Equal(t, Prototype().GetTransaction("define").GetServicePath(), baseHelpers.NewTransactions( take.Transaction, cancel.Transaction, define.Transaction, make2.Transaction, - ).GetTransaction("define").GetName()) - require.Equal(t, Prototype().GetTransaction("make").GetName(), baseHelpers.NewTransactions( + ).GetTransaction("define").GetServicePath()) + require.Equal(t, Prototype().GetTransaction("make").GetServicePath(), baseHelpers.NewTransactions( take.Transaction, cancel.Transaction, define.Transaction, make2.Transaction, - ).GetTransaction("make").GetName()) - require.Equal(t, Prototype().GetTransaction("take").GetName(), baseHelpers.NewTransactions( + ).GetTransaction("make").GetServicePath()) + require.Equal(t, Prototype().GetTransaction("take").GetServicePath(), baseHelpers.NewTransactions( take.Transaction, cancel.Transaction, define.Transaction, make2.Transaction, - ).GetTransaction("take").GetName()) + ).GetTransaction("take").GetServicePath()) } diff --git a/x/orders/transactions/put/message_test.go b/x/orders/transactions/put/message_test.go index 3b635a508..fefb17dd6 100644 --- a/x/orders/transactions/put/message_test.go +++ b/x/orders/transactions/put/message_test.go @@ -125,7 +125,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, makerAssetID, takerAssetID, makerSplit, takerSplit, expiresInHeight}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, makerAssetID, takerAssetID, makerSplit, takerSplit, expiresInHeight}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/put/transaction.go b/x/orders/transactions/put/transaction.go index f2658161d..abc5bd802 100644 --- a/x/orders/transactions/put/transaction.go +++ b/x/orders/transactions/put/transaction.go @@ -4,22 +4,15 @@ package put import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.MakerAssetID, diff --git a/x/orders/transactions/put/transaction_keeper.go b/x/orders/transactions/put/transaction_keeper.go index bb3bd12bc..d9bfb89b9 100644 --- a/x/orders/transactions/put/transaction_keeper.go +++ b/x/orders/transactions/put/transaction_keeper.go @@ -41,7 +41,7 @@ func (transactionKeeper transactionKeeper) Handle(context context.Context, messa return nil, errorConstants.NotAuthorized.Wrapf("put orders not enabled") } - fromAddress := message.GetFromAddress() + fromAddress := message.GetSigners()[0] if _, err := transactionKeeper.authenticateAuxiliary.GetKeeper().Help(context, authenticate.NewAuxiliaryRequest(fromAddress, message.FromID)); err != nil { return nil, err diff --git a/x/orders/transactions/revoke/message_test.go b/x/orders/transactions/revoke/message_test.go index f2efb0ca5..28ae06aef 100644 --- a/x/orders/transactions/revoke/message_test.go +++ b/x/orders/transactions/revoke/message_test.go @@ -118,7 +118,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testFromID, testClassificationID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, testFromID, testClassificationID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/revoke/transaction.go b/x/orders/transactions/revoke/transaction.go index c32599e72..639924c53 100644 --- a/x/orders/transactions/revoke/transaction.go +++ b/x/orders/transactions/revoke/transaction.go @@ -4,22 +4,15 @@ package revoke import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.ToIdentityID, diff --git a/x/orders/transactions/take/message_test.go b/x/orders/transactions/take/message_test.go index 1449d0f69..24b22d376 100644 --- a/x/orders/transactions/take/message_test.go +++ b/x/orders/transactions/take/message_test.go @@ -118,7 +118,7 @@ func Test_message_Type(t *testing.T) { fields fields want string }{ - {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, Transaction.GetName()}, + {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, Transaction.GetServicePath()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/transactions/take/transaction.go b/x/orders/transactions/take/transaction.go index 1fd419388..2f2f349ee 100644 --- a/x/orders/transactions/take/transaction.go +++ b/x/orders/transactions/take/transaction.go @@ -4,22 +4,15 @@ package take import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" ) -type dummy struct{} - var Transaction = baseHelpers.NewTransaction( - name.GetPackageName(dummy{}), + _Msg_serviceDesc.ServiceName, "", "", @@ -30,9 +23,6 @@ var Transaction = baseHelpers.NewTransaction( func(server grpc.ServiceRegistrar, keeper helpers.TransactionKeeper) { RegisterMsgServer(server, keeper.(transactionKeeper)) }, - func(clientCtx client.Context, mux *runtime.ServeMux) error { - return RegisterMsgHandlerClient(context.Background(), mux, NewMsgClient(clientCtx)) - }, constants.FromIdentityID, constants.TakerSplit, diff --git a/x/splits/queries/balances/query.go b/x/splits/queries/balances/query.go index 59fa62df4..55b50905b 100644 --- a/x/splits/queries/balances/query.go +++ b/x/splits/queries/balances/query.go @@ -4,28 +4,18 @@ package balances import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/splits/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.IdentityID, helperConstants.SplitID, diff --git a/x/splits/queries/prototype_test.go b/x/splits/queries/prototype_test.go index d20d6d72a..8ae25facc 100644 --- a/x/splits/queries/prototype_test.go +++ b/x/splits/queries/prototype_test.go @@ -15,13 +15,13 @@ import ( func TestPrototype(t *testing.T) { require.Panics(t, func() { - require.Equal(t, Prototype().GetQuery("splits").GetName(), baseHelpers.NewQueries( + require.Equal(t, Prototype().GetQuery("splits").GetServicePath(), baseHelpers.NewQueries( split.Query, balances.Query, - ).GetQuery("splits").GetName()) - require.Equal(t, Prototype().GetQuery("balances").GetName(), baseHelpers.NewQueries( + ).GetQuery("splits").GetServicePath()) + require.Equal(t, Prototype().GetQuery("balances").GetServicePath(), baseHelpers.NewQueries( split.Query, balances.Query, - ).GetQuery("balances").GetName()) + ).GetQuery("balances").GetServicePath()) }) } diff --git a/x/splits/queries/split/query.go b/x/splits/queries/split/query.go index aa0462905..70ffa80a0 100644 --- a/x/splits/queries/split/query.go +++ b/x/splits/queries/split/query.go @@ -4,28 +4,18 @@ package split import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/splits/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.SplitID, ) diff --git a/x/splits/queries/splits/query.go b/x/splits/queries/splits/query.go index 2cb6f9b9b..dec490a5a 100644 --- a/x/splits/queries/splits/query.go +++ b/x/splits/queries/splits/query.go @@ -4,28 +4,18 @@ package splits import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/splits/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.SplitID, helperConstants.Limit, diff --git a/x/splits/queries/supply/query.go b/x/splits/queries/supply/query.go index 08cd6dc47..44f0a97a9 100644 --- a/x/splits/queries/supply/query.go +++ b/x/splits/queries/supply/query.go @@ -4,28 +4,18 @@ package supply import ( - "context" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/grpc-ecosystem/grpc-gateway/runtime" "google.golang.org/grpc" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/utilities/name" - "github.com/AssetMantle/modules/x/splits/constants" ) -type dummy struct{} - var Query = baseHelpers.NewQuery( - name.GetPackageName(dummy{}), + _Query_serviceDesc.ServiceName, "", "", - constants.ModuleName, - requestPrototype, responsePrototype, keeperPrototype, @@ -33,12 +23,6 @@ var Query = baseHelpers.NewQuery( func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { RegisterQueryServer(server, QueryKeeper.(queryKeeper)) }, - func(clientContext client.Context, serveMux *runtime.ServeMux) error { - return RegisterQueryHandlerClient(context.Background(), serveMux, NewQueryClient(clientContext)) - }, - func(clientContext client.Context, request helpers.QueryRequest) (helpers.QueryResponse, error) { - return NewQueryClient(clientContext).Handle(context.Background(), request.(*QueryRequest)) - }, helperConstants.AssetID, ) From 56a0938334032e4f02ba846babcf662aa81a1a68 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Wed, 21 Aug 2024 17:46:32 +0530 Subject: [PATCH 29/64] code cleanup Signed-off-by: Deepanshu Tripathi --- helpers/cli_command.go | 1 - x/assets/transactions/burn/message_test.go | 77 ---------- x/assets/transactions/define/message_test.go | 74 --------- .../transactions/deputize/message_test.go | 85 ---------- x/assets/transactions/mint/message_test.go | 79 ---------- x/assets/transactions/mutate/message_test.go | 72 --------- .../transactions/renumerate/message_test.go | 68 -------- x/assets/transactions/revoke/message_test.go | 68 -------- x/assets/transactions/send/message_test.go | 84 ---------- x/assets/transactions/unwrap/message_test.go | 75 --------- x/assets/transactions/wrap/message_test.go | 47 ------ .../transactions/define/message_test.go | 145 ------------------ .../transactions/deputize/message_test.go | 86 ----------- .../transactions/issue/message_test.go | 81 ---------- .../transactions/name/message_test.go | 70 --------- .../transactions/provision/message_test.go | 71 --------- .../transactions/quash/message_test.go | 71 --------- .../transactions/revoke/message_test.go | 73 --------- .../transactions/unprovision/message_test.go | 71 --------- .../transactions/update/message_test.go | 78 ---------- x/metas/transactions/reveal/message_test.go | 3 - x/orders/transactions/cancel/message_test.go | 71 --------- x/orders/transactions/define/message_test.go | 74 --------- .../transactions/deputize/message_test.go | 85 ---------- x/orders/transactions/get/message_test.go | 68 -------- .../transactions/immediate/message_test.go | 88 ----------- x/orders/transactions/make/message_test.go | 88 ----------- x/orders/transactions/modify/message_test.go | 78 ---------- x/orders/transactions/put/message_test.go | 76 --------- x/orders/transactions/revoke/message_test.go | 70 --------- x/orders/transactions/take/message_test.go | 70 --------- 31 files changed, 2247 deletions(-) diff --git a/helpers/cli_command.go b/helpers/cli_command.go index 812121fd9..48c3bff70 100644 --- a/helpers/cli_command.go +++ b/helpers/cli_command.go @@ -14,7 +14,6 @@ type CLICommand interface { ReadInt(CLIFlag) int ReadBool(CLIFlag) bool ReadString(CLIFlag) string - //TODO see if it can be replaced with NewCommonTransactionRequestFromContext ReadCommonTransactionRequest(client.Context) CommonTransactionRequest CreateCommand(func(command *cobra.Command, args []string) error) *cobra.Command diff --git a/x/assets/transactions/burn/message_test.go b/x/assets/transactions/burn/message_test.go index b9260c5f4..f7cc73a2f 100644 --- a/x/assets/transactions/burn/message_test.go +++ b/x/assets/transactions/burn/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -29,26 +28,6 @@ var ( fromID = baseIDs.NewIdentityID(classificationID, immutables) ) -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, testAssetID)}, NewMessage(fromAccAddress, fromID, testAssetID).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -92,62 +71,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - type fields struct { - From sdkTypes.AccAddress - FromID ids.IdentityID - AssetID ids.AssetID - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress, fromID, testAssetID}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From.String(), - FromID: tt.fields.FromID.(*baseIDs.IdentityID), - AssetID: tt.fields.AssetID.(*baseIDs.AssetID), - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - type fields struct { - From sdkTypes.AccAddress - FromID ids.IdentityID - AssetID ids.AssetID - } - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress, fromID, testAssetID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From.String(), - FromID: tt.fields.FromID.(*baseIDs.IdentityID), - AssetID: tt.fields.AssetID.(*baseIDs.AssetID), - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { type fields struct { From sdkTypes.AccAddress diff --git a/x/assets/transactions/define/message_test.go b/x/assets/transactions/define/message_test.go index 6aa990628..24963779c 100644 --- a/x/assets/transactions/define/message_test.go +++ b/x/assets/transactions/define/message_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -42,26 +41,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties)}, NewMessage(fromAccAddress, fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -104,59 +83,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/assets/transactions/deputize/message_test.go b/x/assets/transactions/deputize/message_test.go index 08a0a3a3a..9e4c89009 100644 --- a/x/assets/transactions/deputize/message_test.go +++ b/x/assets/transactions/deputize/message_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -44,26 +43,6 @@ type fields struct { CanMutateMaintainer bool } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true).(*Message)}, NewMessage(fromAccAddress, fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -111,70 +90,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/assets/transactions/mint/message_test.go b/x/assets/transactions/mint/message_test.go index 4719731ac..d15413add 100644 --- a/x/assets/transactions/mint/message_test.go +++ b/x/assets/transactions/mint/message_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -44,26 +43,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties)}, NewMessage(fromAccAddress, fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -108,64 +87,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/assets/transactions/mutate/message_test.go b/x/assets/transactions/mutate/message_test.go index ff3760108..d9cca394c 100644 --- a/x/assets/transactions/mutate/message_test.go +++ b/x/assets/transactions/mutate/message_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -41,26 +40,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, testAssetID, mutableMetaProperties, mutableProperties)}, NewMessage(fromAccAddress, fromID, testAssetID, mutableMetaProperties, mutableProperties).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -102,57 +81,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/assets/transactions/renumerate/message_test.go b/x/assets/transactions/renumerate/message_test.go index 605e4374b..7739c1115 100644 --- a/x/assets/transactions/renumerate/message_test.go +++ b/x/assets/transactions/renumerate/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -37,26 +36,6 @@ type fields struct { AssetID *baseIDs.AssetID } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, testAssetID)}, NewMessage(fromAccAddress, fromID, testAssetID).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -96,53 +75,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, testAssetID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, testAssetID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/assets/transactions/revoke/message_test.go b/x/assets/transactions/revoke/message_test.go index 31ea42f2e..b07da0523 100644 --- a/x/assets/transactions/revoke/message_test.go +++ b/x/assets/transactions/revoke/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -37,26 +36,6 @@ type fields struct { ClassificationID *baseIDs.ClassificationID } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want helpers.Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, fromID, classificationID)}, NewMessage(fromAccAddress, fromID, fromID, classificationID).(*Message)}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -96,53 +75,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, classificationID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { name string diff --git a/x/assets/transactions/send/message_test.go b/x/assets/transactions/send/message_test.go index 281f5ba52..a9287168f 100644 --- a/x/assets/transactions/send/message_test.go +++ b/x/assets/transactions/send/message_test.go @@ -12,7 +12,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -119,26 +118,6 @@ func TestMessage_ValidateBasic(t *testing.T) { } } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg types.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, fromID, assetID, testRate)}, &Message{fromAccAddress.String(), fromID, fromID, assetID, testRate.String()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -186,69 +165,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - type fields struct { - From string - FromID *baseIDs.IdentityID - ToID *baseIDs.IdentityID - AssetID *baseIDs.AssetID - Value types.Int - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, assetID, testRate}, args{codec.GetLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value.String(), - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - type fields struct { - From string - FromID *baseIDs.IdentityID - ToID *baseIDs.IdentityID - AssetID *baseIDs.AssetID - Value types.Int - } - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, fromID, assetID, testRate}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value.String(), - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_NewMessage(t *testing.T) { type args struct { from types.AccAddress diff --git a/x/assets/transactions/unwrap/message_test.go b/x/assets/transactions/unwrap/message_test.go index c7fca94e7..79156cf65 100644 --- a/x/assets/transactions/unwrap/message_test.go +++ b/x/assets/transactions/unwrap/message_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cometbft/cometbft/crypto/ed25519" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "reflect" "testing" @@ -143,25 +142,6 @@ func TestMessage_ValidateBasic(t *testing.T) { }) } } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg helpers.Message - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, coins).(*Message)}, &Message{fromAccAddress.String(), fromID, coins}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} func Test_messagePrototype(t *testing.T) { tests := []struct { @@ -206,61 +186,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - type fields struct { - From string - FromID *baseIDs.IdentityID - Coins types.Coins - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, coins}, args{codec.GetLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - type fields struct { - From string - FromID *baseIDs.IdentityID - Coins types.Coins - } - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, coins}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_NewMessage(t *testing.T) { type args struct { from types.AccAddress diff --git a/x/assets/transactions/wrap/message_test.go b/x/assets/transactions/wrap/message_test.go index 539402089..6c2c47693 100644 --- a/x/assets/transactions/wrap/message_test.go +++ b/x/assets/transactions/wrap/message_test.go @@ -146,26 +146,6 @@ func TestMessage_ValidateBasic(t *testing.T) { } } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg helpers.Message - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{NewMessage(fromAccAddress, fromID, coins).(*Message)}, &Message{fromAccAddress.String(), fromID, coins}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -237,33 +217,6 @@ func Test_message_RegisterCodec(t *testing.T) { } } -func Test_message_Type(t *testing.T) { - type fields struct { - From string - FromID *baseIDs.IdentityID - Coins types.Coins - } - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), fromID, coins}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_NewMessage(t *testing.T) { type args struct { from types.AccAddress diff --git a/x/identities/transactions/define/message_test.go b/x/identities/transactions/define/message_test.go index 8ebebb987..3bd850047 100644 --- a/x/identities/transactions/define/message_test.go +++ b/x/identities/transactions/define/message_test.go @@ -11,7 +11,6 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -27,51 +26,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - fromID, err := baseIDs.PrototypeIdentityID().FromString("CBepOLnJFnKO9NEyZlSv7r80nKNZFFXRqHfnsObZ_KU=") - testFromID := fromID.(*baseIDs.IdentityID) - require.NoError(t, err) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - - immutableMetaPropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultImmutableMeta1:S|defaultImmutableMeta1") - require.Equal(t, nil, err) - immutableMetaProperties := immutableMetaPropertiesInterface.(*baseLists.PropertyList) - - immutablePropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultImmutable1:S|defaultImmutable1") - require.Equal(t, nil, err) - immutableProperties := immutablePropertiesInterface.(*baseLists.PropertyList) - - mutableMetaPropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultMutableMeta1:S|defaultMutableMeta1") - require.Equal(t, nil, err) - mutableMetaProperties := mutableMetaPropertiesInterface.(*baseLists.PropertyList) - - mutablePropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultMutable1:S|defaultMutable1") - require.Equal(t, nil, err) - mutableProperties := mutablePropertiesInterface.(*baseLists.PropertyList) - - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - - {"+ve", args{&Message{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}}, &Message{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}}, - {"+ve with nil", args{nil}, &Message{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -138,105 +92,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - fromID, err := baseIDs.PrototypeIdentityID().FromString("CBepOLnJFnKO9NEyZlSv7r80nKNZFFXRqHfnsObZ_KU=") - testFromID := fromID.(*baseIDs.IdentityID) - require.NoError(t, err) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - - immutableMetaPropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultImmutableMeta1:S|defaultImmutableMeta1") - require.Equal(t, nil, err) - immutableMetaProperties := immutableMetaPropertiesInterface.(*baseLists.PropertyList) - - immutablePropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultImmutable1:S|defaultImmutable1") - require.Equal(t, nil, err) - immutableProperties := immutablePropertiesInterface.(*baseLists.PropertyList) - - mutableMetaPropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultMutableMeta1:S|defaultMutableMeta1") - require.Equal(t, nil, err) - mutableMetaProperties := mutableMetaPropertiesInterface.(*baseLists.PropertyList) - - mutablePropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultMutable1:S|defaultMutable1") - require.Equal(t, nil, err) - mutableProperties := mutablePropertiesInterface.(*baseLists.PropertyList) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - - {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - fromID, err := baseIDs.PrototypeIdentityID().FromString("CBepOLnJFnKO9NEyZlSv7r80nKNZFFXRqHfnsObZ_KU=") - testFromID := fromID.(*baseIDs.IdentityID) - require.NoError(t, err) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - - immutableMetaPropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultImmutableMeta1:S|defaultImmutableMeta1") - require.Equal(t, nil, err) - immutableMetaProperties := immutableMetaPropertiesInterface.(*baseLists.PropertyList) - - immutablePropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultImmutable1:S|defaultImmutable1") - require.Equal(t, nil, err) - immutableProperties := immutablePropertiesInterface.(*baseLists.PropertyList) - - mutableMetaPropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultMutableMeta1:S|defaultMutableMeta1") - require.Equal(t, nil, err) - mutableMetaProperties := mutableMetaPropertiesInterface.(*baseLists.PropertyList) - - mutablePropertiesInterface, err := baseLists.NewPropertyList().FromMetaPropertiesString("defaultMutable1:S|defaultMutable1") - require.Equal(t, nil, err) - mutableProperties := mutablePropertiesInterface.(*baseLists.PropertyList) - - tests := []struct { - name string - fields fields - want string - }{ - - {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { fromID, err := baseIDs.PrototypeIdentityID().FromString("CBepOLnJFnKO9NEyZlSv7r80nKNZFFXRqHfnsObZ_KU=") testFromID := fromID.(*baseIDs.IdentityID) diff --git a/x/identities/transactions/deputize/message_test.go b/x/identities/transactions/deputize/message_test.go index e49085e1a..8ae0217b4 100644 --- a/x/identities/transactions/deputize/message_test.go +++ b/x/identities/transactions/deputize/message_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -49,28 +48,6 @@ func createTestInput(t *testing.T) (*baseIDs.IdentityID, *baseIDs.IdentityID, *b return testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID), fromAccAddress, maintainedProperties.(*baseLists.PropertyList) } -func Test_messageFromInterface(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - - {"+ve", args{&Message{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false}}, &Message{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -118,69 +95,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) - - tests := []struct { - name string - fields fields - want string - }{ - - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, false, false, false, false, false}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) diff --git a/x/identities/transactions/issue/message_test.go b/x/identities/transactions/issue/message_test.go index ac25d0442..1d5597506 100644 --- a/x/identities/transactions/issue/message_test.go +++ b/x/identities/transactions/issue/message_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -65,29 +64,6 @@ func createTestInput(t *testing.T) (*baseIDs.IdentityID, *baseIDs.Classification return testFromID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID), fromAddress, fromAccAddress, toAddress, toAccAddress, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList) } -func Test_messageFromInterface(t *testing.T) { - testFromID, testClassificationID, _, fromAccAddress, _, _, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties := createTestInput(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - - {"+ve", args{NewMessage(fromAccAddress, testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties)}, &Message{fromAccAddress.String(), testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}}, - {"+ve with nil", args{}, &Message{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -133,63 +109,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testFromID, testClassificationID, _, fromAccAddress, _, _, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties := createTestInput(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testFromID, testClassificationID, _, fromAccAddress, _, _, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties := createTestInput(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testFromID, testClassificationID, _, fromAccAddress, _, _, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties := createTestInput(t) diff --git a/x/identities/transactions/name/message_test.go b/x/identities/transactions/name/message_test.go index a854b9cc8..dd7ea8532 100644 --- a/x/identities/transactions/name/message_test.go +++ b/x/identities/transactions/name/message_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -31,28 +30,6 @@ func createTestInput(t *testing.T) (*baseIDs.StringID, string, sdkTypes.AccAddre return testNubID.(*baseIDs.StringID), fromAddress, fromAccAddress } -func Test_messageFromInterface(t *testing.T) { - testNubID, _, fromAccAddress := createTestInput(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{&Message{fromAccAddress.String(), testNubID}}, &Message{fromAccAddress.String(), testNubID}}, - {"+ve", args{nil}, &Message{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -92,53 +69,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testNubID, _, fromAccAddress := createTestInput(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testNubID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - tt.fields.From, - tt.fields.NubID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testNubID, _, fromAccAddress := createTestInput(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testNubID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - tt.fields.From, - tt.fields.NubID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testNubID, _, fromAccAddress := createTestInput(t) diff --git a/x/identities/transactions/provision/message_test.go b/x/identities/transactions/provision/message_test.go index 58b629032..1c71bb877 100644 --- a/x/identities/transactions/provision/message_test.go +++ b/x/identities/transactions/provision/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -45,27 +44,6 @@ func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, sdkTypes. return testIdentityID.(*baseIDs.IdentityID), fromAddress, fromAccAddress, toAddress, toAccAddress, testMessage } -func Test_messageFromInterface(t *testing.T) { - testIdentityID, _, fromAccAddress, _, toAccAddress, testMessage := createInputForMessage(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), toAccAddress.String(), testIdentityID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -106,55 +84,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testIdentityID, _, fromAccAddress, _, toAccAddress, _ := createInputForMessage(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testIdentityID, _, fromAccAddress, _, toAccAddress, _ := createInputForMessage(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testIdentityID, _, fromAccAddress, _, toAccAddress, _ := createInputForMessage(t) diff --git a/x/identities/transactions/quash/message_test.go b/x/identities/transactions/quash/message_test.go index 5c7daba1b..799f51961 100644 --- a/x/identities/transactions/quash/message_test.go +++ b/x/identities/transactions/quash/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -42,27 +41,6 @@ func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, *baseIDs.Identity return testIdentityID.(*baseIDs.IdentityID), testFromID.(*baseIDs.IdentityID), fromAccAddress, testMessage } -func Test_messageFromInterface(t *testing.T) { - testIdentityID, testFromID, fromAccAddress, testMessage := createInputForMessage(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testIdentityID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -103,55 +81,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testIdentityID, testFromID, fromAccAddress, _ := createInputForMessage(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testIdentityID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testIdentityID, testFromID, fromAccAddress, _ := createInputForMessage(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testIdentityID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testIdentityID, testFromID, fromAccAddress, _ := createInputForMessage(t) diff --git a/x/identities/transactions/revoke/message_test.go b/x/identities/transactions/revoke/message_test.go index d3eca9b30..25c6d2ebb 100644 --- a/x/identities/transactions/revoke/message_test.go +++ b/x/identities/transactions/revoke/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -45,27 +44,6 @@ func CreateTestInputForMessage(t *testing.T) (*baseIDs.IdentityID, *baseIDs.Iden return testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID), fromAccAddress, testMessage } -func Test_messageFromInterface(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, testMessage := CreateTestInputForMessage(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testToID, testClassificationID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -107,57 +85,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, _ := CreateTestInputForMessage(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, _ := CreateTestInputForMessage(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testFromID, testToID, testClassificationID, fromAccAddress, _ := CreateTestInputForMessage(t) diff --git a/x/identities/transactions/unprovision/message_test.go b/x/identities/transactions/unprovision/message_test.go index 7e02141d7..799534803 100644 --- a/x/identities/transactions/unprovision/message_test.go +++ b/x/identities/transactions/unprovision/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -44,27 +43,6 @@ func CreateTestInputForMessage(t *testing.T) (*baseIDs.IdentityID, sdkTypes.AccA return testIdentityID.(*baseIDs.IdentityID), fromAccAddress, toAccAddress, testMessage } -func Test_messageFromInterface(t *testing.T) { - testIdentityID, fromAccAddress, toAccAddress, testMessage := CreateTestInputForMessage(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), toAccAddress.String(), testIdentityID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -105,55 +83,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testIdentityID, fromAccAddress, toAccAddress, _ := CreateTestInputForMessage(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testIdentityID, fromAccAddress, toAccAddress, _ := CreateTestInputForMessage(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), toAccAddress.String(), testIdentityID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testIdentityID, fromAccAddress, toAccAddress, _ := CreateTestInputForMessage(t) diff --git a/x/identities/transactions/update/message_test.go b/x/identities/transactions/update/message_test.go index d9705e52f..defd6e341 100644 --- a/x/identities/transactions/update/message_test.go +++ b/x/identities/transactions/update/message_test.go @@ -15,7 +15,6 @@ import ( "github.com/AssetMantle/schema/properties" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -46,28 +45,6 @@ func createTestInputForMessage(t *testing.T) (types.AccAddress, *baseIDs.Identit return testFrom, testFromID.(*baseIDs.IdentityID), testIdentityID.(*baseIDs.IdentityID), testMutableMetaProperties.(*baseLists.PropertyList), testMutableProperties.(*baseLists.PropertyList) } -func Test_messageFromInterface(t *testing.T) { - testFrom, testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties := createTestInputForMessage(t) - type args struct { - msg types.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve with nil", args{}, &Message{}}, - {"+ve", args{&Message{testFrom.String(), testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties}}, &Message{testFrom.String(), testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -111,61 +88,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testFrom, testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties := createTestInputForMessage(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{testFrom.String(), testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testFrom, testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties := createTestInputForMessage(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve with nil", fields{}, Transaction.GetServicePath()}, - {"+ve", fields{testFrom.String(), testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testFrom, testFromID, testIdentityID, testMutableMetaProperties, testMutableProperties := createTestInputForMessage(t) diff --git a/x/metas/transactions/reveal/message_test.go b/x/metas/transactions/reveal/message_test.go index 6add46ff5..b3c1ca7ff 100644 --- a/x/metas/transactions/reveal/message_test.go +++ b/x/metas/transactions/reveal/message_test.go @@ -22,12 +22,9 @@ func Test_Reveal_Message(t *testing.T) { testMessage := NewMessage(fromAccAddress, newData).(*Message) require.Equal(t, &Message{From: fromAccAddress.String(), Data: newData.ToAnyData().(*baseData.AnyData)}, testMessage) - require.Equal(t, Transaction.GetServicePath(), testMessage.Type()) require.Equal(t, nil, testMessage.ValidateBasic()) require.NotNil(t, (&Message{}).ValidateBasic()) require.Equal(t, []sdkTypes.AccAddress{fromAccAddress}, testMessage.GetSigners()) - require.Equal(t, testMessage, messageFromInterface(testMessage)) - require.Equal(t, &Message{}, messageFromInterface(nil)) require.Equal(t, &Message{}, messagePrototype()) } diff --git a/x/orders/transactions/cancel/message_test.go b/x/orders/transactions/cancel/message_test.go index df12e5487..744c5d4be 100644 --- a/x/orders/transactions/cancel/message_test.go +++ b/x/orders/transactions/cancel/message_test.go @@ -13,7 +13,6 @@ import ( "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -45,27 +44,6 @@ func CreateTestInputForMessages(t *testing.T) (*baseIDs.OrderID, *baseIDs.Identi return testOrderID.(*baseIDs.OrderID), testFromID.(*baseIDs.IdentityID), fromAccAddress, testMessage } -func Test_messageFromInterface(t *testing.T) { - testOrderID, testFromID, fromAccAddress, testMessage := CreateTestInputForMessages(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testOrderID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -106,55 +84,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testOrderID, testFromID, fromAccAddress, _ := CreateTestInputForMessages(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testOrderID, testFromID, fromAccAddress, _ := CreateTestInputForMessages(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testOrderID, testFromID, fromAccAddress, _ := CreateTestInputForMessages(t) diff --git a/x/orders/transactions/define/message_test.go b/x/orders/transactions/define/message_test.go index 2ec5866ef..d3b35acb8 100644 --- a/x/orders/transactions/define/message_test.go +++ b/x/orders/transactions/define/message_test.go @@ -11,7 +11,6 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -30,26 +29,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -92,59 +71,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/deputize/message_test.go b/x/orders/transactions/deputize/message_test.go index 9ce9acb66..3498654ba 100644 --- a/x/orders/transactions/deputize/message_test.go +++ b/x/orders/transactions/deputize/message_test.go @@ -12,7 +12,6 @@ import ( "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -56,27 +55,6 @@ func CreateTestInputForMessage(t *testing.T) (*baseIDs.IdentityID, *baseIDs.Iden return testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID), fromAccAddress, maintainedProperties.(*base.PropertyList), testMessage } -func Test_messageFromInterface(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties, testMessage := CreateTestInputForMessage(t) - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, true, true, true, true, true}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -124,69 +102,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties, _ := CreateTestInputForMessage(t) - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - tt.fields.From, - tt.fields.FromID, - tt.fields.ToID, - tt.fields.ClassificationID, - tt.fields.MaintainedProperties, - tt.fields.CanMakeOrder, - tt.fields.CanCancelOrder, - tt.fields.CanAddMaintainer, - tt.fields.CanRemoveMaintainer, - tt.fields.CanMutateMaintainer, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties, _ := CreateTestInputForMessage(t) - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testToID, testClassificationID, maintainedProperties, true, true, true, true, true}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - tt.fields.From, - tt.fields.FromID, - tt.fields.ToID, - tt.fields.ClassificationID, - tt.fields.MaintainedProperties, - tt.fields.CanMakeOrder, - tt.fields.CanCancelOrder, - tt.fields.CanAddMaintainer, - tt.fields.CanRemoveMaintainer, - tt.fields.CanMutateMaintainer, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties, _ := CreateTestInputForMessage(t) diff --git a/x/orders/transactions/get/message_test.go b/x/orders/transactions/get/message_test.go index a87890d77..037b776b1 100644 --- a/x/orders/transactions/get/message_test.go +++ b/x/orders/transactions/get/message_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -26,26 +25,6 @@ type fields struct { OrderID *baseIDs.OrderID } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg types.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testOrderID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -85,53 +64,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/immediate/message_test.go b/x/orders/transactions/immediate/message_test.go index 1b39d26db..71b9ad337 100644 --- a/x/orders/transactions/immediate/message_test.go +++ b/x/orders/transactions/immediate/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/types" "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -40,26 +39,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, expiresInHeight, makerSplit.String(), takerSplit.String(), immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -109,73 +88,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit.String(), - TakerSplit: tt.fields.TakerSplit.String(), - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID, takerAssetID, expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit.String(), - TakerSplit: tt.fields.TakerSplit.String(), - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/make/message_test.go b/x/orders/transactions/make/message_test.go index 4e5b0ab30..64be27749 100644 --- a/x/orders/transactions/make/message_test.go +++ b/x/orders/transactions/make/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/types" "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -40,26 +39,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID.(*baseIDs.AssetID), takerAssetID.(*baseIDs.AssetID), expiresInHeight, makerSplit.String(), takerSplit.String(), immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -109,73 +88,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID.(*baseIDs.AssetID), takerAssetID.(*baseIDs.AssetID), expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit.String(), - TakerSplit: tt.fields.TakerSplit.String(), - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testClassificationID, testFromID, makerAssetID.(*baseIDs.AssetID), takerAssetID.(*baseIDs.AssetID), expiresInHeight, makerSplit, takerSplit, immutableMetaProperties.(*baseLists.PropertyList), immutableProperties.(*baseLists.PropertyList), mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit.String(), - TakerSplit: tt.fields.TakerSplit.String(), - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/modify/message_test.go b/x/orders/transactions/modify/message_test.go index 63ad1df66..3c2211c1f 100644 --- a/x/orders/transactions/modify/message_test.go +++ b/x/orders/transactions/modify/message_test.go @@ -13,7 +13,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/types" "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -35,26 +34,6 @@ type fields struct { MutableProperties *baseLists.PropertyList } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testOrderID, takerSplit.String(), makerSplit.String(), expiresInHeight, mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -99,63 +78,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID, takerSplit, makerSplit, expiresInHeight, mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - MakerSplit: tt.fields.MakerSplit.String(), - TakerSplit: tt.fields.TakerSplit.String(), - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testOrderID, takerSplit, makerSplit, expiresInHeight, mutableMetaProperties.(*baseLists.PropertyList), mutableProperties.(*baseLists.PropertyList)}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - MakerSplit: tt.fields.MakerSplit.String(), - TakerSplit: tt.fields.TakerSplit.String(), - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/put/message_test.go b/x/orders/transactions/put/message_test.go index fefb17dd6..c28633374 100644 --- a/x/orders/transactions/put/message_test.go +++ b/x/orders/transactions/put/message_test.go @@ -11,7 +11,6 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/types" "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -32,26 +31,6 @@ type fields struct { ExpiryHeight *base.Height } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg sdkTypes.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, makerAssetID, takerAssetID, makerSplit.String(), takerSplit.String(), expiresInHeight}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -90,61 +69,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, makerAssetID, takerAssetID, makerSplit, takerSplit, expiresInHeight}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - tt.fields.From, - tt.fields.FromID, - tt.fields.MakerAssetID, - tt.fields.TakerAssetID, - tt.fields.MakerSplit.String(), - tt.fields.TakerSplit.String(), - tt.fields.ExpiryHeight, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, makerAssetID, takerAssetID, makerSplit, takerSplit, expiresInHeight}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - tt.fields.From, - tt.fields.FromID, - tt.fields.MakerAssetID, - tt.fields.TakerAssetID, - tt.fields.MakerSplit.String(), - tt.fields.TakerSplit.String(), - tt.fields.ExpiryHeight, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/revoke/message_test.go b/x/orders/transactions/revoke/message_test.go index 28ae06aef..af3b61320 100644 --- a/x/orders/transactions/revoke/message_test.go +++ b/x/orders/transactions/revoke/message_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -26,26 +25,6 @@ type fields struct { ClassificationID *baseIDs.ClassificationID } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg types.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, testFromID, testClassificationID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -86,55 +65,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testFromID, testClassificationID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, testFromID, testClassificationID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { diff --git a/x/orders/transactions/take/message_test.go b/x/orders/transactions/take/message_test.go index 24b22d376..d9140c71d 100644 --- a/x/orders/transactions/take/message_test.go +++ b/x/orders/transactions/take/message_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -26,26 +25,6 @@ type fields struct { OrderID *baseIDs.OrderID } -func Test_messageFromInterface(t *testing.T) { - type args struct { - msg types.Msg - } - tests := []struct { - name string - args args - want *Message - }{ - {"+ve", args{testMessage}, &Message{fromAccAddress.String(), testFromID, takerSplit.String(), testOrderID}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := messageFromInterface(tt.args.msg); !reflect.DeepEqual(got, tt.want) { - t.Errorf("messageFromInterface() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_messagePrototype(t *testing.T) { tests := []struct { name string @@ -86,55 +65,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit.String(), - OrderID: tt.fields.OrderID, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - -func Test_message_Type(t *testing.T) { - - tests := []struct { - name string - fields fields - want string - }{ - {"+ve", fields{fromAccAddress.String(), testFromID, takerSplit, testOrderID}, Transaction.GetServicePath()}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - message := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit.String(), - OrderID: tt.fields.OrderID, - } - if got := message.Type(); got != tt.want { - t.Errorf("Type() = %v, want %v", got, tt.want) - } - }) - } -} - func Test_message_ValidateBasic(t *testing.T) { tests := []struct { From 5a9c76db373fde22d23b09cb689611ba187e568b Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 26 Aug 2024 18:16:21 +0530 Subject: [PATCH 30/64] feat(parameters): adding parameters query service proto Signed-off-by: Deepanshu Tripathi --- .../x/assets/queries/parameters/query_request.proto | 4 ++++ .../x/assets/queries/parameters/query_response.proto | 8 ++++++++ .../modules/x/assets/queries/parameters/service.proto | 9 +++++++++ .../queries/parameters/query_request.proto | 4 ++++ .../queries/parameters/query_response.proto | 8 ++++++++ .../x/classifications/queries/parameters/service.proto | 9 +++++++++ .../x/identities/queries/parameters/query_request.proto | 4 ++++ .../x/identities/queries/parameters/query_response.proto | 8 ++++++++ .../x/identities/queries/parameters/service.proto | 9 +++++++++ .../x/maintainers/queries/parameters/query_request.proto | 4 ++++ .../maintainers/queries/parameters/query_response.proto | 8 ++++++++ .../x/maintainers/queries/parameters/service.proto | 9 +++++++++ .../x/metas/queries/parameters/query_request.proto | 4 ++++ .../x/metas/queries/parameters/query_response.proto | 8 ++++++++ .../modules/x/metas/queries/parameters/service.proto | 9 +++++++++ .../x/orders/queries/parameters/query_request.proto | 4 ++++ .../x/orders/queries/parameters/query_response.proto | 8 ++++++++ .../modules/x/orders/queries/parameters/service.proto | 9 +++++++++ .../x/splits/queries/parameters/query_request.proto | 4 ++++ .../x/splits/queries/parameters/query_response.proto | 8 ++++++++ .../modules/x/splits/queries/parameters/service.proto | 9 +++++++++ 21 files changed, 147 insertions(+) create mode 100644 proto/AssetMantle/modules/x/assets/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/assets/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/assets/queries/parameters/service.proto create mode 100644 proto/AssetMantle/modules/x/classifications/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/classifications/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/classifications/queries/parameters/service.proto create mode 100644 proto/AssetMantle/modules/x/identities/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/identities/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/identities/queries/parameters/service.proto create mode 100644 proto/AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/maintainers/queries/parameters/service.proto create mode 100644 proto/AssetMantle/modules/x/metas/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/metas/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/metas/queries/parameters/service.proto create mode 100644 proto/AssetMantle/modules/x/orders/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/orders/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/orders/queries/parameters/service.proto create mode 100644 proto/AssetMantle/modules/x/splits/queries/parameters/query_request.proto create mode 100644 proto/AssetMantle/modules/x/splits/queries/parameters/query_response.proto create mode 100644 proto/AssetMantle/modules/x/splits/queries/parameters/service.proto diff --git a/proto/AssetMantle/modules/x/assets/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/assets/queries/parameters/query_request.proto new file mode 100644 index 000000000..e64e2a08d --- /dev/null +++ b/proto/AssetMantle/modules/x/assets/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.assets.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/assets/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/assets/queries/parameters/query_response.proto new file mode 100644 index 000000000..5f727d145 --- /dev/null +++ b/proto/AssetMantle/modules/x/assets/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.assets.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/assets/queries/parameters/service.proto b/proto/AssetMantle/modules/x/assets/queries/parameters/service.proto new file mode 100644 index 000000000..271962488 --- /dev/null +++ b/proto/AssetMantle/modules/x/assets/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.assets.queries.parameters; + +import "AssetMantle/modules/x/assets/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/assets/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/classifications/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/classifications/queries/parameters/query_request.proto new file mode 100644 index 000000000..6f9b52364 --- /dev/null +++ b/proto/AssetMantle/modules/x/classifications/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.classifications.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/classifications/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/classifications/queries/parameters/query_response.proto new file mode 100644 index 000000000..17a2a5b36 --- /dev/null +++ b/proto/AssetMantle/modules/x/classifications/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.classifications.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/classifications/queries/parameters/service.proto b/proto/AssetMantle/modules/x/classifications/queries/parameters/service.proto new file mode 100644 index 000000000..a2adc3e84 --- /dev/null +++ b/proto/AssetMantle/modules/x/classifications/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.classifications.queries.parameters; + +import "AssetMantle/modules/x/classifications/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/classifications/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/identities/queries/parameters/query_request.proto new file mode 100644 index 000000000..d6afe27f3 --- /dev/null +++ b/proto/AssetMantle/modules/x/identities/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.identities.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/identities/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/identities/queries/parameters/query_response.proto new file mode 100644 index 000000000..9e2a6158e --- /dev/null +++ b/proto/AssetMantle/modules/x/identities/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.identities.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/identities/queries/parameters/service.proto b/proto/AssetMantle/modules/x/identities/queries/parameters/service.proto new file mode 100644 index 000000000..635e01fcc --- /dev/null +++ b/proto/AssetMantle/modules/x/identities/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.identities.queries.parameters; + +import "AssetMantle/modules/x/identities/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/identities/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto new file mode 100644 index 000000000..9324de52e --- /dev/null +++ b/proto/AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.maintainers.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto new file mode 100644 index 000000000..08e4c90e1 --- /dev/null +++ b/proto/AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.maintainers.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/maintainers/queries/parameters/service.proto b/proto/AssetMantle/modules/x/maintainers/queries/parameters/service.proto new file mode 100644 index 000000000..2af0dbefe --- /dev/null +++ b/proto/AssetMantle/modules/x/maintainers/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.maintainers.queries.parameters; + +import "AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/metas/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/metas/queries/parameters/query_request.proto new file mode 100644 index 000000000..bbd5c01e3 --- /dev/null +++ b/proto/AssetMantle/modules/x/metas/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.metas.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/metas/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/metas/queries/parameters/query_response.proto new file mode 100644 index 000000000..8424b901c --- /dev/null +++ b/proto/AssetMantle/modules/x/metas/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.metas.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/metas/queries/parameters/service.proto b/proto/AssetMantle/modules/x/metas/queries/parameters/service.proto new file mode 100644 index 000000000..56609688a --- /dev/null +++ b/proto/AssetMantle/modules/x/metas/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.metas.queries.parameters; + +import "AssetMantle/modules/x/metas/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/metas/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/orders/queries/parameters/query_request.proto new file mode 100644 index 000000000..ecd340ee2 --- /dev/null +++ b/proto/AssetMantle/modules/x/orders/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.orders.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/orders/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/orders/queries/parameters/query_response.proto new file mode 100644 index 000000000..3c2087ba0 --- /dev/null +++ b/proto/AssetMantle/modules/x/orders/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.orders.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/orders/queries/parameters/service.proto b/proto/AssetMantle/modules/x/orders/queries/parameters/service.proto new file mode 100644 index 000000000..a49fbdf39 --- /dev/null +++ b/proto/AssetMantle/modules/x/orders/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.orders.queries.parameters; + +import "AssetMantle/modules/x/orders/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/orders/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/splits/queries/parameters/query_request.proto b/proto/AssetMantle/modules/x/splits/queries/parameters/query_request.proto new file mode 100644 index 000000000..0e886f7fd --- /dev/null +++ b/proto/AssetMantle/modules/x/splits/queries/parameters/query_request.proto @@ -0,0 +1,4 @@ +syntax = "proto3"; +package AssetMantle.modules.x.splits.queries.parameters; + +message QueryRequest {} \ No newline at end of file diff --git a/proto/AssetMantle/modules/x/splits/queries/parameters/query_response.proto b/proto/AssetMantle/modules/x/splits/queries/parameters/query_response.proto new file mode 100644 index 000000000..62884440a --- /dev/null +++ b/proto/AssetMantle/modules/x/splits/queries/parameters/query_response.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package AssetMantle.modules.x.splits.queries.parameters; + +import "AssetMantle/schema/lists/base/parameter_list.proto"; + +message QueryResponse { + AssetMantle.schema.lists.base.ParameterList parameter_list = 1; +} diff --git a/proto/AssetMantle/modules/x/splits/queries/parameters/service.proto b/proto/AssetMantle/modules/x/splits/queries/parameters/service.proto new file mode 100644 index 000000000..c426dd6db --- /dev/null +++ b/proto/AssetMantle/modules/x/splits/queries/parameters/service.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; +package AssetMantle.modules.x.splits.queries.parameters; + +import "AssetMantle/modules/x/splits/queries/parameters/query_request.proto"; +import "AssetMantle/modules/x/splits/queries/parameters/query_response.proto"; + +service Query { + rpc Handle(QueryRequest) returns (QueryResponse) {} +} \ No newline at end of file From b7b4b753fdb8f9ea8863ee46f41af9df107d384f Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 26 Aug 2024 18:16:46 +0530 Subject: [PATCH 31/64] feat(parameters): adding parameters query service proto Signed-off-by: Deepanshu Tripathi --- .../queries/parameters/query_request.pb.go | 272 ++++++++++++++ .../queries/parameters/query_response.pb.go | 337 +++++++++++++++++ x/assets/queries/parameters/service.pb.go | 135 +++++++ .../queries/parameters/query_request.pb.go | 273 ++++++++++++++ .../queries/parameters/query_response.pb.go | 338 ++++++++++++++++++ .../queries/parameters/service.pb.go | 135 +++++++ .../queries/parameters/query_request.pb.go | 273 ++++++++++++++ .../queries/parameters/query_response.pb.go | 338 ++++++++++++++++++ x/identities/queries/parameters/service.pb.go | 135 +++++++ .../queries/parameters/query_request.pb.go | 273 ++++++++++++++ .../queries/parameters/query_response.pb.go | 338 ++++++++++++++++++ .../queries/parameters/service.pb.go | 135 +++++++ .../queries/parameters/query_request.pb.go | 272 ++++++++++++++ .../queries/parameters/query_response.pb.go | 337 +++++++++++++++++ x/metas/queries/parameters/service.pb.go | 135 +++++++ .../queries/parameters/query_request.pb.go | 272 ++++++++++++++ .../queries/parameters/query_response.pb.go | 337 +++++++++++++++++ x/orders/queries/parameters/service.pb.go | 135 +++++++ .../queries/parameters/query_request.pb.go | 272 ++++++++++++++ .../queries/parameters/query_response.pb.go | 337 +++++++++++++++++ x/splits/queries/parameters/service.pb.go | 135 +++++++ 21 files changed, 5214 insertions(+) create mode 100644 x/assets/queries/parameters/query_request.pb.go create mode 100644 x/assets/queries/parameters/query_response.pb.go create mode 100644 x/assets/queries/parameters/service.pb.go create mode 100644 x/classifications/queries/parameters/query_request.pb.go create mode 100644 x/classifications/queries/parameters/query_response.pb.go create mode 100644 x/classifications/queries/parameters/service.pb.go create mode 100644 x/identities/queries/parameters/query_request.pb.go create mode 100644 x/identities/queries/parameters/query_response.pb.go create mode 100644 x/identities/queries/parameters/service.pb.go create mode 100644 x/maintainers/queries/parameters/query_request.pb.go create mode 100644 x/maintainers/queries/parameters/query_response.pb.go create mode 100644 x/maintainers/queries/parameters/service.pb.go create mode 100644 x/metas/queries/parameters/query_request.pb.go create mode 100644 x/metas/queries/parameters/query_response.pb.go create mode 100644 x/metas/queries/parameters/service.pb.go create mode 100644 x/orders/queries/parameters/query_request.pb.go create mode 100644 x/orders/queries/parameters/query_response.pb.go create mode 100644 x/orders/queries/parameters/service.pb.go create mode 100644 x/splits/queries/parameters/query_request.pb.go create mode 100644 x/splits/queries/parameters/query_response.pb.go create mode 100644 x/splits/queries/parameters/service.pb.go diff --git a/x/assets/queries/parameters/query_request.pb.go b/x/assets/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..b4642b192 --- /dev/null +++ b/x/assets/queries/parameters/query_request.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/assets/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_e5bc33246fe70812, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.assets.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/assets/queries/parameters/query_request.proto", fileDescriptor_e5bc33246fe70812) +} + +var fileDescriptor_e5bc33246fe70812 = []byte{ + // 271 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x76, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x4f, 0x04, 0x89, 0x16, 0xeb, 0x17, 0x96, 0xa6, 0x16, 0x65, 0xa6, 0x16, 0xeb, 0x17, + 0x24, 0x16, 0x25, 0xe6, 0xa6, 0x96, 0xa4, 0x16, 0x41, 0x84, 0x2a, 0xe3, 0x8b, 0x52, 0x0b, 0x4b, + 0x53, 0x8b, 0x4b, 0xf4, 0x0a, 0x8a, 0xf2, 0x4b, 0xf2, 0x85, 0xf4, 0x91, 0x0c, 0xd1, 0x83, 0x1a, + 0xa2, 0x57, 0xa1, 0x07, 0x31, 0x44, 0x0f, 0x6a, 0x88, 0x1e, 0xc2, 0x10, 0x25, 0x3e, 0x2e, 0x9e, + 0x40, 0x90, 0x39, 0x41, 0x10, 0x63, 0x9c, 0x1a, 0x98, 0x4f, 0x3c, 0x92, 0x63, 0xbc, 0xf0, 0x48, + 0x8e, 0xf1, 0xc1, 0x23, 0x39, 0xc6, 0x09, 0x8f, 0xe5, 0x18, 0x2e, 0x3c, 0x96, 0x63, 0xb8, 0xf1, + 0x58, 0x8e, 0x81, 0xcb, 0x38, 0x39, 0x3f, 0x57, 0x8f, 0x44, 0xf3, 0x9d, 0x04, 0x91, 0x4d, 0x0f, + 0x00, 0xb9, 0x31, 0x80, 0x31, 0xca, 0x2a, 0x3d, 0xb3, 0x24, 0xa3, 0x34, 0x49, 0x2f, 0x39, 0x3f, + 0x57, 0x9f, 0x44, 0x5f, 0x2f, 0x62, 0x62, 0x73, 0xf4, 0x8d, 0x70, 0x0c, 0x0c, 0x58, 0xc5, 0x84, + 0xe2, 0x57, 0x5f, 0xa8, 0x5b, 0x22, 0x20, 0x2e, 0x2c, 0xd6, 0x0b, 0x84, 0xba, 0x25, 0x00, 0xae, + 0xf5, 0x14, 0x8a, 0x8e, 0x18, 0xa8, 0x8e, 0x98, 0x88, 0x18, 0x88, 0x8e, 0x18, 0xa8, 0x8e, 0x18, + 0x84, 0x8e, 0x47, 0x4c, 0xd6, 0x24, 0xea, 0x88, 0x71, 0x0f, 0x70, 0xf2, 0x4d, 0x2d, 0x49, 0x4c, + 0x49, 0x2c, 0x49, 0x7c, 0xc5, 0x64, 0x82, 0xa4, 0xdb, 0xca, 0x0a, 0xaa, 0xdd, 0xca, 0x2a, 0xc2, + 0xca, 0x0a, 0x62, 0x80, 0x95, 0x15, 0xd4, 0x04, 0x2b, 0x2b, 0x84, 0x11, 0x49, 0x6c, 0xe0, 0xa8, + 0x34, 0x06, 0x04, 0x00, 0x00, 0xff, 0xff, 0x28, 0xa2, 0x12, 0x1e, 0x11, 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/assets/queries/parameters/query_response.pb.go b/x/assets/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..b9a1d6706 --- /dev/null +++ b/x/assets/queries/parameters/query_response.pb.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/assets/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_620c81f7bde9bff0, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.assets.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/assets/queries/parameters/query_response.proto", fileDescriptor_620c81f7bde9bff0) +} + +var fileDescriptor_620c81f7bde9bff0 = []byte{ + // 334 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xb1, 0x4b, 0xfb, 0x40, + 0x14, 0xc7, 0x9b, 0xfc, 0xa0, 0x43, 0x7e, 0xd4, 0xa1, 0x93, 0x38, 0x1c, 0xe2, 0xe4, 0x20, 0xef, + 0xa0, 0x75, 0x3a, 0xa7, 0x16, 0xc1, 0xc5, 0x40, 0x5a, 0x97, 0x20, 0x07, 0xe5, 0xda, 0x3e, 0x6c, + 0xa0, 0xe9, 0xc5, 0xbc, 0x2b, 0xd4, 0xd1, 0xff, 0xc0, 0xbf, 0xc1, 0xd1, 0xbf, 0x44, 0x9c, 0x3a, + 0x3a, 0x4a, 0xba, 0xf9, 0x57, 0x48, 0x7a, 0xa7, 0x49, 0xc6, 0x8e, 0x79, 0xe4, 0xf3, 0xf9, 0x7e, + 0xdf, 0xbd, 0xe0, 0x7a, 0x40, 0x84, 0x26, 0x54, 0x2b, 0xb3, 0x44, 0x9e, 0xea, 0xf9, 0x7a, 0x89, + 0xc4, 0x37, 0x5c, 0x95, 0x53, 0xe2, 0x8f, 0x6b, 0xcc, 0x13, 0x24, 0x9e, 0xa9, 0x5c, 0xa5, 0x68, + 0x30, 0xb7, 0xa3, 0xa7, 0x49, 0x8e, 0x94, 0xe9, 0x15, 0x21, 0x64, 0xb9, 0x36, 0xba, 0xcb, 0x6b, + 0x16, 0x70, 0x16, 0xd8, 0x80, 0xb5, 0x80, 0xb3, 0x40, 0x65, 0x39, 0xe9, 0xd5, 0x63, 0x69, 0xb6, + 0xc0, 0x54, 0xf1, 0x65, 0x42, 0x86, 0xf8, 0x54, 0x11, 0x56, 0x79, 0x93, 0x72, 0x68, 0x43, 0xce, + 0xe6, 0x41, 0x67, 0x54, 0x86, 0x8f, 0x5d, 0x76, 0xf7, 0x2e, 0x38, 0x6a, 0xfe, 0x78, 0xec, 0x9d, + 0x7a, 0xe7, 0xff, 0x7b, 0x17, 0x50, 0xaf, 0x63, 0xed, 0xb0, 0xb7, 0x43, 0x69, 0x87, 0xe8, 0x17, + 0xba, 0x4d, 0xc8, 0x8c, 0x3b, 0x59, 0xfd, 0x73, 0xf8, 0xfc, 0xef, 0xbd, 0x60, 0xde, 0xb6, 0x60, + 0xde, 0x57, 0xc1, 0xbc, 0x97, 0x1d, 0x6b, 0x6d, 0x77, 0xac, 0xf5, 0xb9, 0x63, 0xad, 0xa0, 0x3f, + 0xd3, 0x29, 0x1c, 0xb8, 0xe9, 0xb0, 0xdb, 0xe8, 0x1c, 0x95, 0x9b, 0x44, 0xde, 0xbd, 0x78, 0x48, + 0xcc, 0x62, 0x3d, 0x85, 0x99, 0x4e, 0xf9, 0x81, 0x17, 0x78, 0xf5, 0xdb, 0x83, 0x30, 0x1e, 0x8c, + 0xa2, 0x37, 0xbf, 0xf1, 0xec, 0xa1, 0x2b, 0x13, 0xdb, 0x8a, 0x04, 0x23, 0x57, 0xe6, 0x6f, 0x5d, + 0xfa, 0x68, 0x10, 0xd2, 0x11, 0x32, 0x96, 0x96, 0x90, 0x8e, 0x90, 0x15, 0x51, 0xf8, 0x57, 0x07, + 0x12, 0xf2, 0x26, 0x1a, 0x86, 0x68, 0xd4, 0x5c, 0x19, 0xf5, 0xed, 0x5f, 0xd6, 0x68, 0x21, 0x1c, + 0x2e, 0x44, 0x2c, 0x84, 0x15, 0x08, 0xe1, 0x0c, 0x42, 0x54, 0x8a, 0x69, 0x7b, 0x7f, 0xf0, 0xfe, + 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x6b, 0x8a, 0x13, 0x9a, 0x9d, 0x02, 0x00, 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/assets/queries/parameters/service.pb.go b/x/assets/queries/parameters/service.pb.go new file mode 100644 index 000000000..2de6f2a78 --- /dev/null +++ b/x/assets/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/assets/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/assets/queries/parameters/service.proto", fileDescriptor_d720f17bfda39b7b) +} + +var fileDescriptor_d720f17bfda39b7b = []byte{ + // 323 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xc0, 0x0e, 0xc1, 0xa9, 0x63, 0x87, 0x1b, 0x7c, 0x80, 0x3b, 0xb0, 0x4e, + 0x27, 0x15, 0x5a, 0x05, 0x5d, 0x02, 0xa9, 0x2e, 0x41, 0x0e, 0xe4, 0xda, 0x7e, 0x68, 0x20, 0xc9, + 0xa5, 0x77, 0x17, 0xa9, 0x8f, 0xe0, 0x26, 0xf8, 0x06, 0x8e, 0x3e, 0x89, 0x38, 0x75, 0x74, 0x94, + 0x64, 0xf3, 0x15, 0x5c, 0x24, 0xbd, 0xc3, 0xb4, 0x63, 0xba, 0x5e, 0xf8, 0xfd, 0xef, 0xff, 0xe5, + 0xbb, 0x60, 0x34, 0xd6, 0x1a, 0x4c, 0x28, 0x72, 0x93, 0x02, 0xcd, 0xe4, 0xa2, 0x4c, 0x41, 0xd3, + 0x15, 0x15, 0xcd, 0xa9, 0xa6, 0xcb, 0x12, 0x54, 0x02, 0x9a, 0x16, 0x42, 0x89, 0x0c, 0x0c, 0x28, + 0x4d, 0x35, 0xa8, 0xc7, 0x64, 0x0e, 0xa4, 0x50, 0xd2, 0xc8, 0x3e, 0xdd, 0xe2, 0xc4, 0x71, 0xb2, + 0x22, 0x96, 0x13, 0xc7, 0x49, 0xcb, 0x07, 0xe7, 0x5d, 0xef, 0x6b, 0x8e, 0x9e, 0xee, 0x14, 0x2c, + 0x4b, 0xd0, 0xc6, 0xde, 0x3a, 0xb8, 0xd8, 0x37, 0x44, 0x17, 0x32, 0xd7, 0xae, 0xfb, 0xf1, 0x2b, + 0x0a, 0x0e, 0xa6, 0xcd, 0x87, 0xfe, 0x33, 0x0a, 0x7a, 0x57, 0x22, 0x5f, 0xa4, 0xd0, 0x1f, 0x91, + 0x8e, 0x13, 0x91, 0x4d, 0xc4, 0xb5, 0xed, 0x37, 0x38, 0xdb, 0x97, 0xdb, 0x66, 0x47, 0xde, 0xe4, + 0xd7, 0xff, 0xa8, 0x30, 0x5a, 0x57, 0x18, 0x7d, 0x57, 0x18, 0xbd, 0xd4, 0xd8, 0x5b, 0xd7, 0xd8, + 0xfb, 0xaa, 0xb1, 0x17, 0x0c, 0xe7, 0x32, 0xeb, 0x9a, 0x3f, 0x39, 0xbc, 0xb1, 0x0b, 0x8b, 0x9a, + 0x99, 0x23, 0x74, 0xcb, 0xee, 0x13, 0xf3, 0x50, 0xce, 0xc8, 0x5c, 0x66, 0xb4, 0xe3, 0x6f, 0x7c, + 0xf3, 0x7b, 0xe3, 0x30, 0x1e, 0x4f, 0xa3, 0x77, 0x7f, 0x67, 0xef, 0xa1, 0xab, 0x11, 0xdb, 0x72, + 0x76, 0xa6, 0xa6, 0x46, 0xf4, 0x4f, 0x3f, 0x77, 0x04, 0x77, 0x82, 0xc7, 0xdc, 0x0a, 0xee, 0x04, + 0x6f, 0x45, 0xe5, 0x9f, 0x76, 0x14, 0xfc, 0x32, 0x9a, 0x84, 0x60, 0xc4, 0x42, 0x18, 0xf1, 0xe3, + 0x9f, 0x6c, 0x69, 0xc6, 0x1c, 0x67, 0x2c, 0x66, 0xcc, 0x06, 0x30, 0xe6, 0x12, 0x18, 0x6b, 0x23, + 0x66, 0xbd, 0xcd, 0xd3, 0x18, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x4b, 0x56, 0x33, 0x17, + 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.assets.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.assets.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.assets.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/assets/queries/parameters/service.proto", +} diff --git a/x/classifications/queries/parameters/query_request.pb.go b/x/classifications/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..73cc3e099 --- /dev/null +++ b/x/classifications/queries/parameters/query_request.pb.go @@ -0,0 +1,273 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/classifications/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_ff4255da0aa143e2, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.classifications.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/classifications/queries/parameters/query_request.proto", fileDescriptor_ff4255da0aa143e2) +} + +var fileDescriptor_ff4255da0aa143e2 = []byte{ + // 284 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xf2, 0x71, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0x4f, 0xce, 0x49, 0x2c, 0x2e, 0xce, 0x4c, 0xcb, 0x4c, 0x4e, 0x2c, 0xc9, 0xcc, 0xcf, + 0x2b, 0xd6, 0x2f, 0x2c, 0x4d, 0x2d, 0xca, 0x4c, 0x2d, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x4d, + 0x2d, 0x49, 0x2d, 0x82, 0x08, 0x55, 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0xe8, 0x15, + 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x59, 0x20, 0x99, 0xa6, 0x07, 0x35, 0x4d, 0xaf, 0x42, 0x0f, 0xcd, + 0x34, 0x3d, 0xa8, 0x69, 0x7a, 0x08, 0xd3, 0x94, 0xf8, 0xb8, 0x78, 0x02, 0x41, 0x06, 0x06, 0x41, + 0xcc, 0x73, 0xda, 0xc6, 0x7c, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, + 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x5c, 0x36, + 0xc9, 0xf9, 0xb9, 0x7a, 0xe4, 0x5a, 0xe4, 0x24, 0x88, 0x6c, 0x4d, 0x00, 0xc8, 0xd5, 0x01, 0x8c, + 0x51, 0xce, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe4, 0x06, 0xc8, + 0x22, 0x26, 0x36, 0x47, 0xdf, 0x08, 0xe7, 0xc0, 0x80, 0x55, 0x4c, 0x28, 0xc1, 0xe0, 0x0b, 0x75, + 0x5d, 0x84, 0x9e, 0x33, 0x9a, 0xeb, 0x02, 0xa1, 0xae, 0x0b, 0x80, 0x9b, 0x71, 0x0a, 0x45, 0x6b, + 0x0c, 0x54, 0x6b, 0x4c, 0x44, 0x0c, 0x9a, 0xd6, 0x18, 0xa8, 0xd6, 0x18, 0x84, 0xd6, 0x47, 0x4c, + 0x2e, 0xe4, 0x6a, 0x8d, 0x71, 0x0f, 0x70, 0xf2, 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x7c, + 0xc5, 0x64, 0x8b, 0x64, 0x8c, 0x95, 0x15, 0xd4, 0x1c, 0x2b, 0xab, 0x08, 0x2b, 0x2b, 0x34, 0x93, + 0xac, 0xac, 0xa0, 0x46, 0x59, 0x59, 0x21, 0xcc, 0x4a, 0x62, 0x03, 0xa7, 0x04, 0x63, 0x40, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xfa, 0xe1, 0x8e, 0x72, 0x59, 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/classifications/queries/parameters/query_response.pb.go b/x/classifications/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..bd5276a60 --- /dev/null +++ b/x/classifications/queries/parameters/query_response.pb.go @@ -0,0 +1,338 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/classifications/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_84d0e8b7cbb0d9b5, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.classifications.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/classifications/queries/parameters/query_response.proto", fileDescriptor_84d0e8b7cbb0d9b5) +} + +var fileDescriptor_84d0e8b7cbb0d9b5 = []byte{ + // 346 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0xbf, 0x4e, 0xc3, 0x30, + 0x10, 0x87, 0x9b, 0x20, 0x75, 0x08, 0x2a, 0x43, 0x27, 0xc4, 0x10, 0x21, 0x26, 0x06, 0x74, 0x96, + 0xca, 0x82, 0x2c, 0x18, 0xda, 0x22, 0xb1, 0x10, 0x29, 0x2d, 0x4b, 0x84, 0x2c, 0x55, 0x6e, 0x6a, + 0xa8, 0xa5, 0xa4, 0x0e, 0x39, 0x57, 0x2a, 0x6f, 0xc1, 0x33, 0x30, 0xf2, 0x02, 0xbc, 0x02, 0x62, + 0xea, 0xc8, 0x88, 0xd2, 0x8d, 0xa7, 0x40, 0x69, 0x0d, 0xf9, 0x33, 0x66, 0xf4, 0xc9, 0xbf, 0xef, + 0xbe, 0xf3, 0xd9, 0xf1, 0xfa, 0x88, 0x42, 0x7b, 0x7c, 0xa1, 0x23, 0x41, 0x62, 0x35, 0x5b, 0x46, + 0x02, 0xc9, 0x8a, 0x84, 0x11, 0x47, 0x94, 0x0f, 0x32, 0xe4, 0x5a, 0xaa, 0x05, 0x92, 0xa7, 0xa5, + 0x48, 0xa5, 0x40, 0x92, 0xf0, 0x94, 0xc7, 0x42, 0x8b, 0x74, 0x57, 0x7a, 0x9e, 0xa4, 0x02, 0x13, + 0xb5, 0x40, 0x01, 0x49, 0xaa, 0xb4, 0xea, 0x5e, 0x94, 0x70, 0x60, 0x70, 0xb0, 0x82, 0x1a, 0x0e, + 0x0c, 0x0e, 0x0a, 0xdc, 0x51, 0xaf, 0x2c, 0x82, 0xe1, 0x5c, 0xc4, 0x9c, 0x44, 0x12, 0x35, 0x92, + 0x29, 0x47, 0x51, 0x34, 0x9e, 0xe4, 0xc5, 0x5d, 0xb7, 0x93, 0x99, 0xd3, 0x19, 0xe5, 0x16, 0x63, + 0x23, 0xd1, 0xbd, 0x73, 0x0e, 0xaa, 0x17, 0x0f, 0xad, 0x63, 0xeb, 0x74, 0xbf, 0x77, 0x06, 0x65, + 0xaf, 0x1d, 0x1d, 0xb6, 0x74, 0xc8, 0xe9, 0xe0, 0xff, 0x85, 0x6e, 0x25, 0xea, 0x71, 0x27, 0x29, + 0x1f, 0x07, 0xef, 0x7b, 0x1f, 0x99, 0x6b, 0xad, 0x33, 0xd7, 0xfa, 0xce, 0x5c, 0xeb, 0x65, 0xe3, + 0xb6, 0xd6, 0x1b, 0xb7, 0xf5, 0xb5, 0x71, 0x5b, 0xce, 0x65, 0xa8, 0x62, 0x68, 0x3a, 0xf2, 0xa0, + 0x5b, 0x91, 0xf7, 0xf3, 0x91, 0x7c, 0xeb, 0x7e, 0xf8, 0x28, 0xf5, 0x7c, 0x39, 0x85, 0x50, 0xc5, + 0xa4, 0xe9, 0x72, 0x5e, 0xed, 0x76, 0xdf, 0x0b, 0x86, 0x23, 0xff, 0xcd, 0xae, 0x6c, 0xc4, 0x33, + 0x7a, 0x01, 0x0c, 0x6b, 0x7a, 0x23, 0xa3, 0xf7, 0xff, 0x12, 0xf8, 0x59, 0x89, 0x32, 0x13, 0x65, + 0x01, 0xab, 0x45, 0x99, 0x89, 0xb2, 0x22, 0x9a, 0xd9, 0xd7, 0x4d, 0xa3, 0xec, 0xc6, 0x1f, 0x78, + 0x42, 0xf3, 0x19, 0xd7, 0xfc, 0xc7, 0xbe, 0x2a, 0x61, 0x28, 0x35, 0x1c, 0x4a, 0x03, 0x4a, 0x6b, + 0x24, 0x4a, 0x0d, 0x8a, 0xd2, 0x82, 0x35, 0x6d, 0x6f, 0xbf, 0xc9, 0xf9, 0x6f, 0x00, 0x00, 0x00, + 0xff, 0xff, 0x6c, 0x7f, 0x56, 0xa4, 0xe5, 0x02, 0x00, 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/classifications/queries/parameters/service.pb.go b/x/classifications/queries/parameters/service.pb.go new file mode 100644 index 000000000..f92e3151d --- /dev/null +++ b/x/classifications/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/classifications/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/classifications/queries/parameters/service.proto", fileDescriptor_1bb312b6553bb004) +} + +var fileDescriptor_1bb312b6553bb004 = []byte{ + // 336 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0xd2, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0x07, 0xf0, 0x24, 0x62, 0x87, 0xe0, 0xd4, 0xb1, 0x43, 0x06, 0x3f, 0xc0, 0x1d, 0xe8, 0x22, + 0x87, 0x0e, 0x6d, 0xa5, 0x75, 0x30, 0x90, 0xea, 0x12, 0x24, 0x20, 0xd7, 0xf4, 0xa9, 0x07, 0x49, + 0xae, 0xbd, 0x77, 0x91, 0xfa, 0x2d, 0xdc, 0xdd, 0x04, 0x17, 0x37, 0xbf, 0x85, 0x38, 0x75, 0x74, + 0x94, 0x74, 0xf3, 0x53, 0x48, 0x9b, 0xc3, 0xb4, 0x19, 0xd3, 0x35, 0xe1, 0xff, 0xcb, 0xff, 0xbd, + 0x3c, 0x77, 0xd0, 0x45, 0x04, 0xed, 0xf3, 0x4c, 0x27, 0x40, 0x53, 0x39, 0xc9, 0x13, 0x40, 0x3a, + 0xa7, 0x71, 0xc2, 0x11, 0xc5, 0x9d, 0x88, 0xb9, 0x16, 0x32, 0x43, 0x3a, 0xcb, 0x41, 0x09, 0x40, + 0x3a, 0xe5, 0x8a, 0xa7, 0xa0, 0x41, 0x21, 0x45, 0x50, 0x8f, 0x22, 0x06, 0x32, 0x55, 0x52, 0xcb, + 0xf6, 0xc9, 0x86, 0x43, 0x8c, 0x43, 0xe6, 0xa4, 0xe6, 0x10, 0xe3, 0x90, 0xca, 0xe9, 0x5c, 0x36, + 0x6e, 0xb0, 0x7a, 0xf4, 0x74, 0xab, 0x60, 0x96, 0x03, 0xea, 0xb2, 0x47, 0xc7, 0xdf, 0x59, 0xc3, + 0xa9, 0xcc, 0xd0, 0x8c, 0x75, 0xf4, 0x66, 0xbb, 0xfb, 0xa3, 0xd5, 0x8b, 0xf6, 0x8b, 0xed, 0xb6, + 0x2e, 0x78, 0x36, 0x49, 0xa0, 0x3d, 0x20, 0x4d, 0x87, 0x25, 0x6b, 0xeb, 0xaa, 0x6c, 0xdc, 0x19, + 0xee, 0xec, 0x94, 0x5d, 0x0f, 0xad, 0xde, 0xc7, 0xde, 0x67, 0xe1, 0xd9, 0x8b, 0xc2, 0xb3, 0x7f, + 0x0a, 0xcf, 0x7e, 0x5e, 0x7a, 0xd6, 0x62, 0xe9, 0x59, 0xdf, 0x4b, 0xcf, 0x72, 0x4f, 0x63, 0x99, + 0x36, 0xfe, 0x50, 0xef, 0xe0, 0xba, 0xfc, 0xcd, 0xc1, 0x6a, 0x1d, 0x81, 0x7d, 0xd3, 0xbf, 0x17, + 0xfa, 0x21, 0x1f, 0x93, 0x58, 0xa6, 0xb4, 0xe9, 0xaa, 0x5f, 0x9d, 0x56, 0xd7, 0x0f, 0xfb, 0xa3, + 0xe0, 0xdd, 0xd9, 0x3a, 0x1b, 0xdf, 0x14, 0x0b, 0x49, 0xbf, 0x56, 0x6c, 0x64, 0x8a, 0x05, 0xff, + 0xc6, 0xd7, 0x56, 0x34, 0x32, 0xd1, 0x28, 0x8c, 0x6a, 0xd1, 0xc8, 0x44, 0xa3, 0x2a, 0x5a, 0x38, + 0xe7, 0x4d, 0xa3, 0xd1, 0x30, 0xe8, 0xf9, 0xa0, 0xf9, 0x84, 0x6b, 0xfe, 0xeb, 0x9c, 0x6d, 0x30, + 0x8c, 0x19, 0x87, 0xb1, 0x90, 0xb1, 0x9a, 0xc4, 0x98, 0xa1, 0x18, 0xab, 0xac, 0x71, 0x6b, 0x7d, + 0x62, 0xc7, 0x7f, 0x01, 0x00, 0x00, 0xff, 0xff, 0x39, 0x21, 0xd1, 0xbb, 0x83, 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.classifications.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.classifications.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.classifications.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/classifications/queries/parameters/service.proto", +} diff --git a/x/identities/queries/parameters/query_request.pb.go b/x/identities/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..2d38a96ca --- /dev/null +++ b/x/identities/queries/parameters/query_request.pb.go @@ -0,0 +1,273 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/identities/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_4c871cbdf1a0c549, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.identities.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/identities/queries/parameters/query_request.proto", fileDescriptor_4c871cbdf1a0c549) +} + +var fileDescriptor_4c871cbdf1a0c549 = []byte{ + // 275 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x72, 0x77, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4c, 0x49, 0xcd, 0x2b, 0xc9, 0x2c, 0xc9, 0x4c, 0x2d, 0xd6, 0x2f, 0x2c, 0x4d, + 0x2d, 0x02, 0xd1, 0x05, 0x89, 0x45, 0x89, 0xb9, 0xa9, 0x25, 0xa9, 0x45, 0x10, 0xa1, 0xca, 0xf8, + 0xa2, 0xd4, 0xc2, 0xd2, 0xd4, 0xe2, 0x12, 0xbd, 0x82, 0xa2, 0xfc, 0x92, 0x7c, 0x21, 0x63, 0x24, + 0x83, 0xf4, 0xa0, 0x06, 0xe9, 0x55, 0xe8, 0x21, 0x0c, 0xd2, 0x83, 0x1a, 0xa4, 0x87, 0x30, 0x48, + 0x89, 0x8f, 0x8b, 0x27, 0x10, 0x64, 0x56, 0x10, 0xc4, 0x28, 0xa7, 0x19, 0xcc, 0x27, 0x1e, 0xc9, + 0x31, 0x5e, 0x78, 0x24, 0xc7, 0xf8, 0xe0, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, + 0xcb, 0x31, 0xdc, 0x78, 0x2c, 0xc7, 0xc0, 0x65, 0x9e, 0x9c, 0x9f, 0xab, 0x47, 0x86, 0x1d, 0x4e, + 0x82, 0xc8, 0x36, 0x04, 0x80, 0xdc, 0x1a, 0xc0, 0x18, 0x65, 0x97, 0x9e, 0x59, 0x92, 0x51, 0x9a, + 0xa4, 0x97, 0x9c, 0x9f, 0xab, 0x4f, 0x46, 0x08, 0x2c, 0x62, 0x62, 0x73, 0xf4, 0x8d, 0xf0, 0x0c, + 0x0c, 0x58, 0xc5, 0x84, 0xe2, 0x6f, 0x5f, 0xa8, 0x9b, 0x22, 0xf4, 0x3c, 0x11, 0x6e, 0x0a, 0x84, + 0xba, 0x29, 0x00, 0xae, 0xfd, 0x14, 0x8a, 0xae, 0x18, 0xa8, 0xae, 0x98, 0x88, 0x18, 0x84, 0xae, + 0x18, 0xa8, 0xae, 0x18, 0x84, 0xae, 0x47, 0x4c, 0xf6, 0x64, 0xe8, 0x8a, 0x71, 0x0f, 0x70, 0xf2, + 0x4d, 0x2d, 0x49, 0x4c, 0x49, 0x2c, 0x49, 0x7c, 0xc5, 0x64, 0x81, 0x64, 0x82, 0x95, 0x15, 0xd4, + 0x08, 0x2b, 0xab, 0x08, 0x2b, 0x2b, 0x84, 0x21, 0x56, 0x56, 0x50, 0x53, 0xac, 0xac, 0x10, 0xc6, + 0x24, 0xb1, 0x81, 0xa3, 0xd9, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x09, 0x77, 0x98, 0x11, 0x31, + 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/identities/queries/parameters/query_response.pb.go b/x/identities/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..3f5e85eba --- /dev/null +++ b/x/identities/queries/parameters/query_response.pb.go @@ -0,0 +1,338 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/identities/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_4aeff1220f332df1, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.identities.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/identities/queries/parameters/query_response.proto", fileDescriptor_4aeff1220f332df1) +} + +var fileDescriptor_4aeff1220f332df1 = []byte{ + // 340 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xf3, 0x50, + 0x14, 0x86, 0x9b, 0x7c, 0xd0, 0x21, 0x1f, 0x75, 0xe8, 0x24, 0x0e, 0x41, 0x9c, 0x1c, 0xe4, 0x5c, + 0x68, 0x07, 0xe5, 0x0e, 0x4a, 0xbb, 0x68, 0xc1, 0x40, 0x5a, 0x97, 0x20, 0x81, 0x72, 0xdb, 0x1c, + 0xec, 0x85, 0xa6, 0x37, 0xe6, 0xdc, 0x42, 0xfd, 0x17, 0xae, 0xae, 0x8e, 0xfe, 0x12, 0x71, 0xea, + 0xe8, 0x28, 0xe9, 0xe6, 0xaf, 0x90, 0xb4, 0x57, 0x6f, 0xb2, 0x76, 0x0a, 0x39, 0xe4, 0x79, 0xde, + 0xf7, 0x70, 0xe2, 0xdd, 0xf4, 0x88, 0x50, 0x07, 0x62, 0xa1, 0xe7, 0xc8, 0x52, 0x95, 0x2c, 0xe7, + 0x48, 0x6c, 0xc5, 0x64, 0x82, 0x0b, 0x2d, 0xb5, 0x44, 0x62, 0x8f, 0x4b, 0xcc, 0xcb, 0x67, 0x26, + 0x72, 0x91, 0xa2, 0xc6, 0x7c, 0x37, 0x7a, 0x1a, 0xe7, 0x48, 0x99, 0x5a, 0x10, 0x42, 0x96, 0x2b, + 0xad, 0xda, 0xdd, 0x8a, 0x09, 0x8c, 0x09, 0x56, 0x60, 0x4d, 0x60, 0x4c, 0x60, 0x4d, 0x47, 0x9d, + 0x6a, 0x3c, 0x4d, 0x67, 0x98, 0x0a, 0x36, 0x97, 0xa4, 0x89, 0x4d, 0x04, 0xa1, 0xcd, 0x1c, 0x97, + 0xc3, 0x5d, 0xd0, 0x49, 0xe2, 0xb5, 0x86, 0x65, 0x81, 0x91, 0xc9, 0x6f, 0xdf, 0x79, 0x07, 0xf5, + 0x0f, 0x0f, 0x9d, 0x63, 0xe7, 0xf4, 0x7f, 0xe7, 0x0c, 0xaa, 0x95, 0x76, 0x76, 0xd8, 0xda, 0xa1, + 0xb4, 0x43, 0xf8, 0x0b, 0xdd, 0x4a, 0xd2, 0xa3, 0x56, 0x56, 0x7d, 0xed, 0xbf, 0xfc, 0x7b, 0x2f, + 0x7c, 0x67, 0x5d, 0xf8, 0xce, 0x57, 0xe1, 0x3b, 0xcf, 0x1b, 0xbf, 0xb1, 0xde, 0xf8, 0x8d, 0xcf, + 0x8d, 0xdf, 0xf0, 0xce, 0xa7, 0x2a, 0x85, 0x3d, 0xb6, 0xed, 0xb7, 0x6b, 0xbd, 0xc3, 0x72, 0x9b, + 0xd0, 0xb9, 0xbf, 0x7c, 0x90, 0x7a, 0xb6, 0x9c, 0xc0, 0x54, 0xa5, 0x6c, 0x8f, 0x6b, 0xbc, 0xba, + 0xcd, 0x5e, 0x10, 0x0d, 0x86, 0xe1, 0x9b, 0x5b, 0x3b, 0x41, 0x60, 0x4a, 0x45, 0x30, 0xb0, 0xa5, + 0x86, 0xa6, 0xd4, 0xdf, 0xea, 0xf4, 0x51, 0xa3, 0x62, 0x43, 0xc5, 0x51, 0x6c, 0xa9, 0xd8, 0x50, + 0xb1, 0xa5, 0x0a, 0xf7, 0x6a, 0x0f, 0x2a, 0xbe, 0x0e, 0xfb, 0x01, 0x6a, 0x91, 0x08, 0x2d, 0xbe, + 0xdd, 0x8b, 0x8a, 0x81, 0x73, 0xa3, 0xe0, 0x3c, 0xe2, 0xdc, 0x4a, 0x38, 0x37, 0x16, 0xce, 0xad, + 0x66, 0xd2, 0xdc, 0xfe, 0x08, 0xdd, 0x9f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xde, 0x48, 0xd6, 0x3b, + 0xbd, 0x02, 0x00, 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/identities/queries/parameters/service.pb.go b/x/identities/queries/parameters/service.pb.go new file mode 100644 index 000000000..3dae86c06 --- /dev/null +++ b/x/identities/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/identities/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/identities/queries/parameters/service.proto", fileDescriptor_899e37c996c98b07) +} + +var fileDescriptor_899e37c996c98b07 = []byte{ + // 328 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0x86, 0x93, 0x20, 0x3a, 0x44, 0x4c, 0x1d, 0x3b, 0x78, 0xe0, 0x00, 0xb6, 0x44, 0x07, 0x90, + 0x07, 0x50, 0xb2, 0xb4, 0x1d, 0x22, 0xa5, 0xb0, 0x44, 0xc8, 0x12, 0x72, 0x9b, 0x27, 0x88, 0xd4, + 0xc4, 0xad, 0xed, 0xa0, 0x72, 0x0b, 0x10, 0x23, 0x1b, 0x23, 0x27, 0x41, 0x4c, 0x1d, 0x19, 0x51, + 0xb2, 0x71, 0x0a, 0x94, 0xc6, 0xc2, 0xed, 0x9a, 0x4e, 0x91, 0x62, 0x7d, 0xdf, 0xfb, 0x7f, 0xfb, + 0xf9, 0x41, 0xa0, 0x14, 0xe8, 0x88, 0x17, 0x7a, 0x01, 0x24, 0x17, 0x69, 0xb9, 0x00, 0x45, 0xd6, + 0x24, 0x4b, 0xa1, 0xd0, 0x99, 0xce, 0x40, 0x91, 0x55, 0x09, 0xb2, 0xf9, 0x2e, 0xb9, 0xe4, 0x39, + 0x68, 0x90, 0x8a, 0x28, 0x90, 0x8f, 0xd9, 0x1c, 0xf0, 0x52, 0x0a, 0x2d, 0xfa, 0xc3, 0x1d, 0x05, + 0x36, 0x0a, 0xbc, 0xc6, 0x56, 0x81, 0x8d, 0x02, 0x5b, 0xc5, 0x60, 0xd4, 0x65, 0x6e, 0xf3, 0xeb, + 0xe9, 0x4e, 0xc2, 0xaa, 0x04, 0xa5, 0xdb, 0xe9, 0x83, 0xf1, 0x21, 0x22, 0xb5, 0x14, 0x85, 0x32, + 0x3d, 0xce, 0xde, 0x5c, 0xff, 0x78, 0xda, 0x1c, 0xf4, 0x5f, 0x5c, 0xbf, 0x37, 0xe6, 0x45, 0xba, + 0x80, 0x7e, 0x80, 0x3b, 0xb4, 0xc3, 0x5b, 0xcd, 0x75, 0x9b, 0x73, 0x10, 0x1e, 0xa2, 0x68, 0x13, + 0x9e, 0x3a, 0xe1, 0xeb, 0xd1, 0x67, 0x85, 0xdc, 0x4d, 0x85, 0xdc, 0x9f, 0x0a, 0xb9, 0xcf, 0x35, + 0x72, 0x36, 0x35, 0x72, 0xbe, 0x6b, 0xe4, 0xf8, 0xe7, 0x73, 0x91, 0x77, 0x99, 0x11, 0x9e, 0xdc, + 0xb4, 0x0f, 0x19, 0x37, 0xfd, 0x63, 0xf7, 0xf6, 0xf2, 0x3e, 0xd3, 0x0f, 0xe5, 0x0c, 0xcf, 0x45, + 0x4e, 0x3a, 0x5c, 0xeb, 0xbb, 0xd7, 0x0b, 0xa2, 0x64, 0x32, 0x8d, 0x3f, 0xbc, 0xbd, 0x9d, 0x88, + 0x4c, 0x9c, 0x04, 0x4f, 0x6c, 0x9c, 0xa9, 0x89, 0x13, 0xff, 0xe3, 0x5f, 0x7b, 0x14, 0x33, 0x14, + 0x4b, 0x98, 0xa5, 0x98, 0xa1, 0x98, 0xa5, 0x2a, 0xef, 0xaa, 0x03, 0xc5, 0x46, 0x71, 0x18, 0x81, + 0xe6, 0x29, 0xd7, 0xfc, 0xd7, 0xbb, 0xd8, 0x31, 0x50, 0x6a, 0x14, 0x94, 0x26, 0x94, 0x5a, 0x09, + 0xa5, 0xc6, 0x42, 0xa9, 0xd5, 0xcc, 0x7a, 0xdb, 0xd5, 0x19, 0xfe, 0x05, 0x00, 0x00, 0xff, 0xff, + 0xab, 0x23, 0x88, 0xac, 0x47, 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.identities.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.identities.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.identities.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/identities/queries/parameters/service.proto", +} diff --git a/x/maintainers/queries/parameters/query_request.pb.go b/x/maintainers/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..179a61610 --- /dev/null +++ b/x/maintainers/queries/parameters/query_request.pb.go @@ -0,0 +1,273 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_b36a0b42da9d73d2, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.maintainers.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/maintainers/queries/parameters/query_request.proto", fileDescriptor_b36a0b42da9d73d2) +} + +var fileDescriptor_b36a0b42da9d73d2 = []byte{ + // 277 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xf2, 0x70, 0x2c, 0x2e, 0x4e, + 0x2d, 0xf1, 0x4d, 0xcc, 0x2b, 0xc9, 0x49, 0xd5, 0xcf, 0xcd, 0x4f, 0x29, 0xcd, 0x49, 0x2d, 0xd6, + 0xaf, 0xd0, 0xcf, 0x4d, 0xcc, 0xcc, 0x2b, 0x49, 0xcc, 0xcc, 0x4b, 0x2d, 0x2a, 0xd6, 0x2f, 0x2c, + 0x4d, 0x2d, 0xca, 0x4c, 0x2d, 0xd6, 0x2f, 0x48, 0x2c, 0x4a, 0xcc, 0x4d, 0x2d, 0x81, 0x09, 0x55, + 0xc6, 0x17, 0xa5, 0x16, 0x96, 0xa6, 0x16, 0x97, 0xe8, 0x15, 0x14, 0xe5, 0x97, 0xe4, 0x0b, 0x99, + 0x20, 0x99, 0xa4, 0x07, 0x35, 0x49, 0xaf, 0x42, 0x0f, 0xc9, 0x24, 0x3d, 0xa8, 0x49, 0x7a, 0x08, + 0x93, 0x94, 0xf8, 0xb8, 0x78, 0x02, 0x41, 0x86, 0x05, 0x41, 0xcc, 0x72, 0x9a, 0xc7, 0x7c, 0xe2, + 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, + 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x5c, 0x16, 0xc9, 0xf9, 0xb9, 0x7a, 0xe4, 0x58, + 0xe2, 0x24, 0x88, 0x6c, 0x45, 0x00, 0xc8, 0xb5, 0x01, 0x8c, 0x51, 0xf6, 0xe9, 0x99, 0x25, 0x19, + 0xa5, 0x49, 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0xe4, 0x04, 0xc2, 0x22, 0x26, 0x36, 0x47, 0xdf, 0x08, + 0xdf, 0xc0, 0x80, 0x55, 0x4c, 0x28, 0x5e, 0xf7, 0x85, 0xba, 0x2a, 0x42, 0xcf, 0x17, 0xc9, 0x55, + 0x81, 0x50, 0x57, 0x05, 0xc0, 0xf5, 0x9f, 0x42, 0xd1, 0x16, 0x03, 0xd5, 0x16, 0x13, 0x11, 0x83, + 0xa4, 0x2d, 0x06, 0xaa, 0x2d, 0x06, 0xa1, 0xed, 0x11, 0x93, 0x03, 0x39, 0xda, 0x62, 0xdc, 0x03, + 0x9c, 0x7c, 0x53, 0x4b, 0x12, 0x53, 0x12, 0x4b, 0x12, 0x5f, 0x31, 0x59, 0x22, 0x19, 0x61, 0x65, + 0x05, 0x35, 0xc3, 0xca, 0x2a, 0xc2, 0xca, 0x0a, 0xc9, 0x14, 0x2b, 0x2b, 0xa8, 0x31, 0x56, 0x56, + 0x08, 0x73, 0x92, 0xd8, 0xc0, 0xb1, 0x6d, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0x3f, 0xb6, 0x5a, + 0x9d, 0x39, 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/maintainers/queries/parameters/query_response.pb.go b/x/maintainers/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..f56874c80 --- /dev/null +++ b/x/maintainers/queries/parameters/query_response.pb.go @@ -0,0 +1,338 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_59b5887fbbb5c9f6, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.maintainers.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/maintainers/queries/parameters/query_response.proto", fileDescriptor_59b5887fbbb5c9f6) +} + +var fileDescriptor_59b5887fbbb5c9f6 = []byte{ + // 337 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x92, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0x80, 0x9b, 0x08, 0x1d, 0x22, 0x75, 0xe8, 0x24, 0x0e, 0x41, 0x9c, 0x1c, 0xe4, 0x1d, 0x54, + 0x07, 0xbd, 0x45, 0xdb, 0x45, 0x04, 0x03, 0x69, 0x5d, 0x82, 0x04, 0xca, 0xb5, 0x7d, 0xd8, 0x40, + 0x2f, 0x17, 0xf3, 0xae, 0x50, 0xff, 0x85, 0xff, 0x40, 0x70, 0xf4, 0x97, 0x88, 0x53, 0x47, 0x47, + 0x49, 0x37, 0x7f, 0x85, 0xa4, 0xbd, 0x9a, 0xcb, 0xda, 0x31, 0x47, 0xbe, 0xef, 0xbe, 0xc7, 0x3b, + 0xef, 0xae, 0x4b, 0x84, 0x3a, 0x10, 0xa9, 0x9e, 0x21, 0x93, 0x6a, 0x32, 0x9f, 0x21, 0xb1, 0x05, + 0x93, 0x22, 0x49, 0xb5, 0x48, 0x52, 0xcc, 0x89, 0x3d, 0xcf, 0x31, 0x4f, 0x90, 0x58, 0x26, 0x72, + 0x21, 0x51, 0x6f, 0x8f, 0x5e, 0x86, 0x39, 0x52, 0xa6, 0x52, 0x42, 0xc8, 0x72, 0xa5, 0x55, 0xfb, + 0xc2, 0x52, 0x81, 0x51, 0xc1, 0x02, 0x2c, 0x15, 0x18, 0x15, 0x54, 0xaa, 0xa3, 0x8e, 0x1d, 0x40, + 0xe3, 0x29, 0x4a, 0xc1, 0x66, 0x09, 0x69, 0x62, 0x23, 0x41, 0x58, 0x5d, 0x3a, 0x2c, 0x0f, 0x37, + 0x37, 0x9d, 0x4c, 0xbc, 0x56, 0xbf, 0x2c, 0x18, 0x98, 0x80, 0xf6, 0x83, 0x77, 0x50, 0xff, 0xf1, + 0xd0, 0x39, 0x76, 0x4e, 0xf7, 0x3b, 0x67, 0x60, 0x37, 0x6d, 0xec, 0xb0, 0xb6, 0x43, 0x69, 0x87, + 0x70, 0x0b, 0xdd, 0x27, 0xa4, 0x07, 0xad, 0xcc, 0xfe, 0xec, 0xbd, 0xed, 0x7d, 0x16, 0xbe, 0xb3, + 0x2c, 0x7c, 0xe7, 0xa7, 0xf0, 0x9d, 0xd7, 0x95, 0xdf, 0x58, 0xae, 0xfc, 0xc6, 0xf7, 0xca, 0x6f, + 0x78, 0x97, 0x63, 0x25, 0x61, 0x97, 0x71, 0x7b, 0xed, 0x5a, 0x78, 0x58, 0x8e, 0x13, 0x3a, 0x8f, + 0xd7, 0x4f, 0x89, 0x9e, 0xce, 0x47, 0x30, 0x56, 0x92, 0xed, 0xb2, 0x90, 0x77, 0xb7, 0xd9, 0x0d, + 0xa2, 0xa0, 0x1f, 0x7e, 0xb8, 0xb5, 0x2d, 0x04, 0x26, 0x2b, 0x82, 0xc0, 0xca, 0xea, 0x9b, 0xac, + 0xff, 0xe9, 0xe9, 0xab, 0x86, 0xc5, 0x06, 0x8b, 0xa3, 0xd8, 0xc2, 0x62, 0x83, 0xc5, 0x15, 0x56, + 0xb8, 0x37, 0xbb, 0x60, 0xf1, 0x6d, 0xd8, 0x0b, 0x50, 0x8b, 0x89, 0xd0, 0xe2, 0xd7, 0xbd, 0xb2, + 0x14, 0x9c, 0x1b, 0x07, 0xe7, 0x11, 0xe7, 0x96, 0x85, 0x73, 0xa3, 0xe1, 0xbc, 0xf2, 0x8c, 0x9a, + 0xeb, 0xe7, 0x70, 0xfe, 0x17, 0x00, 0x00, 0xff, 0xff, 0xe0, 0x40, 0x68, 0x17, 0xc5, 0x02, 0x00, + 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/maintainers/queries/parameters/service.pb.go b/x/maintainers/queries/parameters/service.pb.go new file mode 100644 index 000000000..88fe45abd --- /dev/null +++ b/x/maintainers/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/maintainers/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/maintainers/queries/parameters/service.proto", fileDescriptor_704b067079f061fa) +} + +var fileDescriptor_704b067079f061fa = []byte{ + // 331 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x92, 0xb1, 0x4e, 0xf3, 0x30, + 0x10, 0xc7, 0xe3, 0x7c, 0xfa, 0x3a, 0x44, 0x4c, 0x1d, 0x3b, 0x78, 0xe0, 0x01, 0x6c, 0x09, 0x18, + 0xc0, 0x0b, 0x34, 0x0c, 0x94, 0xc1, 0x52, 0x0a, 0x4b, 0x84, 0x2c, 0x21, 0xb7, 0x3d, 0x41, 0xa4, + 0x26, 0x6e, 0x6d, 0x07, 0x95, 0xb7, 0x40, 0x62, 0x62, 0x60, 0x61, 0xe4, 0x49, 0x10, 0x53, 0x47, + 0x46, 0x94, 0x6e, 0x3c, 0x05, 0x4a, 0x63, 0x51, 0x77, 0x4d, 0xd7, 0xb3, 0x7e, 0xbf, 0xfb, 0xdf, + 0xf9, 0xa2, 0xb8, 0x6f, 0x0c, 0x58, 0x2e, 0x0b, 0x3b, 0x05, 0x9a, 0xab, 0x49, 0x39, 0x05, 0x43, + 0x17, 0x34, 0x97, 0x59, 0x61, 0x65, 0x56, 0x80, 0x36, 0x74, 0x5e, 0x82, 0xce, 0xc0, 0xd0, 0x99, + 0xd4, 0x32, 0x07, 0x5b, 0x97, 0x0c, 0xe8, 0x87, 0x6c, 0x0c, 0x64, 0xa6, 0x95, 0x55, 0xdd, 0x23, + 0xcf, 0x41, 0x9c, 0x83, 0x2c, 0x88, 0xe7, 0x20, 0xce, 0x41, 0x36, 0x8e, 0xde, 0xa0, 0x55, 0xe7, + 0xba, 0xf4, 0x78, 0xab, 0x61, 0x5e, 0x82, 0xb1, 0x4d, 0xff, 0xde, 0xe5, 0x4e, 0x26, 0x33, 0x53, + 0x85, 0x71, 0xa3, 0x1c, 0xbc, 0xa2, 0xe8, 0xff, 0xb0, 0x7e, 0xe8, 0x3e, 0xa3, 0xa8, 0x33, 0x90, + 0xc5, 0x64, 0x0a, 0xdd, 0x98, 0xb4, 0x19, 0x90, 0xac, 0x3d, 0x57, 0x4d, 0xd2, 0xde, 0xf9, 0x4e, + 0x8e, 0x26, 0xe3, 0x7e, 0x10, 0xbf, 0xfc, 0xfb, 0xa8, 0x30, 0x5a, 0x56, 0x18, 0x7d, 0x57, 0x18, + 0x3d, 0xad, 0x70, 0xb0, 0x5c, 0xe1, 0xe0, 0x6b, 0x85, 0x83, 0xe8, 0x78, 0xac, 0xf2, 0x56, 0x4d, + 0xe2, 0xbd, 0xeb, 0xe6, 0x3b, 0x93, 0x7a, 0x05, 0x09, 0xba, 0x39, 0xbd, 0xcb, 0xec, 0x7d, 0x39, + 0x22, 0x63, 0x95, 0xd3, 0x36, 0xab, 0x7d, 0x0b, 0x3b, 0x7d, 0x9e, 0xf2, 0x61, 0xf2, 0x1e, 0x6e, + 0x9d, 0x06, 0x77, 0x81, 0x52, 0xc2, 0xbd, 0x40, 0x43, 0x17, 0x28, 0xf9, 0xe3, 0x3f, 0xb7, 0x30, + 0xe1, 0x30, 0x91, 0x0a, 0x0f, 0x13, 0x0e, 0x13, 0x1b, 0xac, 0x0a, 0xcf, 0xda, 0x60, 0xe2, 0x22, + 0x89, 0x39, 0x58, 0x39, 0x91, 0x56, 0xfe, 0x84, 0x27, 0x9e, 0x82, 0x31, 0xe7, 0x60, 0x2c, 0x65, + 0xcc, 0xb3, 0x30, 0xe6, 0x34, 0x8c, 0x6d, 0x3c, 0xa3, 0xce, 0xfa, 0x84, 0x0e, 0x7f, 0x03, 0x00, + 0x00, 0xff, 0xff, 0xef, 0x5f, 0xa7, 0xa7, 0x53, 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.maintainers.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.maintainers.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.maintainers.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/maintainers/queries/parameters/service.proto", +} diff --git a/x/metas/queries/parameters/query_request.pb.go b/x/metas/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..fe4205d24 --- /dev/null +++ b/x/metas/queries/parameters/query_request.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/metas/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a4aa1936e6a1ea67, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.metas.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/metas/queries/parameters/query_request.proto", fileDescriptor_a4aa1936e6a1ea67) +} + +var fileDescriptor_a4aa1936e6a1ea67 = []byte{ + // 267 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd1, 0xb1, 0x4a, 0x03, 0x31, + 0x1c, 0xc7, 0xf1, 0x5e, 0x86, 0x0e, 0x87, 0x08, 0xfa, 0x00, 0x19, 0x7c, 0x80, 0x04, 0xec, 0xe4, + 0x7f, 0xeb, 0x2d, 0x4e, 0x81, 0x9c, 0xd3, 0x21, 0x01, 0x49, 0xdb, 0x3f, 0x5a, 0x68, 0x4c, 0x9b, + 0xe4, 0xa0, 0xbe, 0x85, 0xcf, 0xe0, 0xe8, 0x93, 0x88, 0x53, 0x47, 0x47, 0xb9, 0xdb, 0x7c, 0x04, + 0x27, 0xb9, 0x34, 0x78, 0xd7, 0xf1, 0xd6, 0x84, 0xef, 0x87, 0x5f, 0x48, 0x5e, 0xcc, 0xbd, 0xc7, + 0x20, 0xf4, 0x73, 0xd8, 0x20, 0x37, 0x76, 0x55, 0x6f, 0xd0, 0xf3, 0x3d, 0x37, 0x18, 0xb4, 0xe7, + 0xbb, 0x1a, 0xdd, 0x1a, 0x3d, 0xdf, 0x6a, 0xa7, 0x0d, 0x06, 0x74, 0xc7, 0xa3, 0x97, 0x07, 0x87, + 0xbb, 0x1a, 0x7d, 0x60, 0x5b, 0x67, 0x83, 0xbd, 0x64, 0x03, 0x83, 0x25, 0x83, 0xed, 0x59, 0x34, + 0x58, 0x32, 0x58, 0x6f, 0x5c, 0x9d, 0xe7, 0x67, 0x65, 0xc7, 0xdc, 0x1d, 0x95, 0xe2, 0x97, 0x7c, + 0x34, 0x34, 0x3b, 0x34, 0x34, 0xfb, 0x6e, 0x68, 0xf6, 0xda, 0xd2, 0xc9, 0xa1, 0xa5, 0x93, 0xaf, + 0x96, 0x4e, 0xf2, 0xeb, 0xa5, 0x35, 0x23, 0xf9, 0xe2, 0x62, 0x88, 0xcb, 0x6e, 0xa1, 0xcc, 0xee, + 0x6f, 0x1e, 0xd7, 0xe1, 0xa9, 0x5e, 0xb0, 0xa5, 0x35, 0x7c, 0xdc, 0x93, 0xdf, 0xc8, 0x74, 0x2e, + 0x2a, 0x51, 0xca, 0x77, 0x72, 0xb2, 0x44, 0xa4, 0x25, 0x15, 0x13, 0x71, 0x49, 0x99, 0x96, 0xc8, + 0xff, 0xf2, 0xf3, 0x24, 0x50, 0x29, 0x50, 0x95, 0x8a, 0x81, 0x4a, 0x81, 0xea, 0x83, 0x86, 0xc0, + 0xb8, 0x40, 0xdd, 0xca, 0xa2, 0xbb, 0x5b, 0xe9, 0xa0, 0x7f, 0xc8, 0x6c, 0x10, 0x03, 0xa4, 0x1a, + 0xa0, 0x02, 0x88, 0x3d, 0x40, 0x02, 0x00, 0x7a, 0x61, 0x31, 0x8d, 0x7f, 0x38, 0xfb, 0x0b, 0x00, + 0x00, 0xff, 0xff, 0x06, 0x4b, 0x1a, 0x74, 0x09, 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/metas/queries/parameters/query_response.pb.go b/x/metas/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..680ff223a --- /dev/null +++ b/x/metas/queries/parameters/query_response.pb.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/metas/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_228dc148ba4f4466, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.metas.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/metas/queries/parameters/query_response.proto", fileDescriptor_228dc148ba4f4466) +} + +var fileDescriptor_228dc148ba4f4466 = []byte{ + // 330 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0xb1, 0x4e, 0xeb, 0x30, + 0x14, 0x86, 0x9b, 0x0c, 0x1d, 0x72, 0xd5, 0x3b, 0x74, 0x42, 0x0c, 0x11, 0x62, 0x62, 0x40, 0xc7, + 0x52, 0x3b, 0xe1, 0xad, 0x65, 0x60, 0x21, 0x52, 0x5a, 0x96, 0x08, 0x59, 0xaa, 0xdc, 0xf6, 0x88, + 0x46, 0xaa, 0xeb, 0x90, 0xe3, 0x4a, 0xe5, 0x2d, 0x78, 0x06, 0x46, 0x9e, 0x04, 0x31, 0x75, 0x64, + 0x44, 0xe9, 0xc6, 0x2b, 0xb0, 0xa0, 0xb8, 0x86, 0x24, 0x63, 0xc6, 0x9c, 0xf8, 0xfb, 0xfe, 0xff, + 0xd8, 0xc1, 0xf5, 0x88, 0x08, 0x4d, 0x24, 0x37, 0x66, 0x8d, 0x4c, 0xe9, 0xe5, 0x76, 0x8d, 0xc4, + 0x76, 0x4c, 0xa1, 0x91, 0xc4, 0x1e, 0xb7, 0x98, 0xa7, 0x48, 0x2c, 0x93, 0xb9, 0x54, 0x68, 0x30, + 0x3f, 0x8e, 0x9e, 0x66, 0x39, 0x52, 0xa6, 0x37, 0x84, 0x90, 0xe5, 0xda, 0xe8, 0x3e, 0xd4, 0x24, + 0xe0, 0x24, 0xb0, 0x03, 0x2b, 0x01, 0x27, 0x81, 0x4a, 0x72, 0x3a, 0xa8, 0x87, 0xd2, 0x62, 0x85, + 0x4a, 0xb2, 0x75, 0x4a, 0x86, 0xd8, 0x5c, 0x12, 0x56, 0x71, 0xb3, 0x72, 0x78, 0xcc, 0x38, 0x5f, + 0x06, 0xbd, 0x49, 0x99, 0x3d, 0x75, 0xd1, 0xfd, 0xbb, 0xe0, 0x7f, 0xf3, 0xe0, 0x89, 0x77, 0xe6, + 0x5d, 0xfc, 0x1b, 0x5c, 0x36, 0xda, 0x1c, 0xed, 0x60, 0xed, 0x50, 0xda, 0x21, 0xfe, 0x85, 0x6e, + 0x53, 0x32, 0xd3, 0x5e, 0x56, 0xff, 0x1c, 0x7f, 0xfb, 0x6f, 0x45, 0xe8, 0xed, 0x8b, 0xd0, 0xfb, + 0x2c, 0x42, 0xef, 0xf9, 0x10, 0x76, 0xf6, 0x87, 0xb0, 0xf3, 0x71, 0x08, 0x3b, 0xc1, 0x60, 0xa1, + 0x55, 0xcb, 0x45, 0xc7, 0xfd, 0x46, 0xe5, 0xb8, 0x5c, 0x24, 0xf6, 0xee, 0xaf, 0x1e, 0x52, 0xb3, + 0xda, 0xce, 0x61, 0xa1, 0x15, 0x6b, 0x77, 0xfd, 0x2f, 0x7e, 0x77, 0x14, 0x25, 0xd1, 0x24, 0x7e, + 0xf5, 0x1b, 0x55, 0x22, 0x57, 0x25, 0x81, 0xc8, 0x56, 0x99, 0xb8, 0x2a, 0x7f, 0xbb, 0xd2, 0x7b, + 0x03, 0x10, 0x0e, 0x10, 0x89, 0xb0, 0x80, 0x70, 0x80, 0xa8, 0x80, 0xc2, 0xe7, 0xed, 0x00, 0x71, + 0x13, 0x8f, 0xcb, 0x7f, 0x4b, 0x69, 0xe4, 0x97, 0x3f, 0xac, 0xc1, 0x9c, 0x3b, 0x9a, 0xf3, 0x84, + 0x73, 0xcb, 0x73, 0xee, 0x04, 0x9c, 0x57, 0x86, 0x79, 0xd7, 0x3e, 0xf5, 0xf0, 0x27, 0x00, 0x00, + 0xff, 0xff, 0xbc, 0xda, 0x7e, 0x00, 0x95, 0x02, 0x00, 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/metas/queries/parameters/service.pb.go b/x/metas/queries/parameters/service.pb.go new file mode 100644 index 000000000..e0ea3736f --- /dev/null +++ b/x/metas/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/metas/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/metas/queries/parameters/service.proto", fileDescriptor_9108a8da77f2a61f) +} + +var fileDescriptor_9108a8da77f2a61f = []byte{ + // 321 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0xb1, 0x4e, 0xeb, 0x30, + 0x14, 0x06, 0xe0, 0x38, 0xd2, 0xed, 0x10, 0xdd, 0xa9, 0x63, 0x07, 0x0f, 0x3c, 0x80, 0x2d, 0xb5, + 0x13, 0x56, 0x19, 0x1a, 0x06, 0x58, 0x22, 0xa5, 0xb0, 0x44, 0xc8, 0x12, 0x72, 0xdb, 0x23, 0xa8, + 0x94, 0xc4, 0xa9, 0xed, 0xa0, 0xf2, 0x04, 0xac, 0xf0, 0x0a, 0x8c, 0x3c, 0x09, 0x62, 0xea, 0xc8, + 0x88, 0x92, 0x8d, 0x9d, 0x1d, 0xc5, 0xb1, 0x48, 0x3b, 0xa6, 0x6b, 0x8e, 0xbe, 0xff, 0xfc, 0x27, + 0x49, 0x30, 0x9d, 0x69, 0x0d, 0x26, 0x12, 0xb9, 0x49, 0x81, 0x66, 0x72, 0x55, 0xa6, 0xa0, 0xe9, + 0x96, 0x66, 0x60, 0x84, 0xa6, 0x9b, 0x12, 0xd4, 0x1a, 0x34, 0x2d, 0x84, 0x12, 0x19, 0x18, 0x50, + 0x9a, 0x6a, 0x50, 0x0f, 0xeb, 0x25, 0x90, 0x42, 0x49, 0x23, 0x87, 0x64, 0x4f, 0x13, 0xa7, 0xc9, + 0x96, 0x58, 0x4d, 0x9c, 0x26, 0x9d, 0x1e, 0x85, 0x3d, 0xb7, 0x35, 0x8f, 0x1e, 0x6f, 0x15, 0x6c, + 0x4a, 0xd0, 0xa6, 0xdd, 0x39, 0x3a, 0x3f, 0x32, 0x43, 0x17, 0x32, 0xd7, 0xae, 0xf8, 0xf8, 0x05, + 0x05, 0xff, 0xe6, 0xcd, 0x60, 0xf8, 0x84, 0x82, 0xc1, 0xa5, 0xc8, 0x57, 0x29, 0x0c, 0xa7, 0x3d, + 0xcf, 0x21, 0x36, 0xe1, 0xaa, 0x6d, 0x37, 0x3a, 0x3b, 0x52, 0xb7, 0xbd, 0x4e, 0xbc, 0xf0, 0xc7, + 0x7f, 0xaf, 0x30, 0xda, 0x55, 0x18, 0x7d, 0x55, 0x18, 0x3d, 0xd7, 0xd8, 0xdb, 0xd5, 0xd8, 0xfb, + 0xac, 0xb1, 0x17, 0x8c, 0x97, 0x32, 0xeb, 0x19, 0x1f, 0xfe, 0xbf, 0x6e, 0x3f, 0x55, 0xdc, 0x1c, + 0x1c, 0xa3, 0x9b, 0xd3, 0xbb, 0xb5, 0xb9, 0x2f, 0x17, 0x64, 0x29, 0x33, 0xda, 0xef, 0x15, 0xbe, + 0xfa, 0x83, 0x59, 0x94, 0x44, 0xf3, 0xf8, 0xcd, 0x3f, 0x28, 0x11, 0xb9, 0x12, 0x09, 0x89, 0x6c, + 0x89, 0xb9, 0x2b, 0x11, 0xff, 0xc9, 0x8f, 0x03, 0xc0, 0x1d, 0xe0, 0x09, 0xb7, 0x80, 0x3b, 0xc0, + 0x3b, 0x50, 0xf9, 0xac, 0x1f, 0xe0, 0x17, 0x71, 0xd8, 0xcc, 0x56, 0xc2, 0x88, 0x6f, 0x7f, 0xb2, + 0x87, 0x19, 0x73, 0x9a, 0xb1, 0x84, 0x31, 0xeb, 0x19, 0x73, 0x01, 0x8c, 0x75, 0x09, 0x8b, 0x81, + 0xfd, 0x25, 0x26, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x64, 0xc4, 0x78, 0xfa, 0x0b, 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.metas.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.metas.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.metas.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/metas/queries/parameters/service.proto", +} diff --git a/x/orders/queries/parameters/query_request.pb.go b/x/orders/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..00cf0c1c7 --- /dev/null +++ b/x/orders/queries/parameters/query_request.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/orders/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_9c73f95e4468983c, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.orders.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/orders/queries/parameters/query_request.proto", fileDescriptor_9c73f95e4468983c) +} + +var fileDescriptor_9c73f95e4468983c = []byte{ + // 271 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd1, 0x31, 0x4e, 0xc3, 0x30, + 0x14, 0xc6, 0xf1, 0x26, 0x48, 0x1d, 0x22, 0x84, 0x04, 0x07, 0xf0, 0xc0, 0x01, 0x9e, 0x87, 0x32, + 0x3d, 0xa6, 0x86, 0x81, 0x29, 0xaa, 0xc3, 0x14, 0x21, 0x4b, 0xc8, 0x6d, 0x9e, 0xa0, 0x52, 0x83, + 0x5b, 0xdb, 0x91, 0xca, 0xc6, 0x11, 0x38, 0x03, 0x23, 0x27, 0x41, 0x4c, 0x1d, 0x19, 0x51, 0xb2, + 0x71, 0x0a, 0x54, 0x6c, 0x48, 0x3a, 0x66, 0xb5, 0xf4, 0xff, 0xe9, 0x7b, 0x72, 0x72, 0x35, 0xb5, + 0x96, 0x5c, 0xa6, 0x1e, 0xdd, 0x8a, 0x78, 0xa5, 0xcb, 0x7a, 0x45, 0x96, 0x6f, 0xb9, 0x36, 0x25, + 0x19, 0xcb, 0x37, 0x35, 0x99, 0x25, 0x59, 0xbe, 0x56, 0x46, 0x55, 0xe4, 0xfe, 0x9e, 0x9e, 0xee, + 0x0c, 0x6d, 0x6a, 0xb2, 0x0e, 0xd6, 0x46, 0x3b, 0x7d, 0xc6, 0x7b, 0x08, 0x04, 0x04, 0xb6, 0xe0, + 0x11, 0x08, 0x08, 0x74, 0xc8, 0xf9, 0x49, 0x72, 0x9c, 0xef, 0x9d, 0x1b, 0xcf, 0xa4, 0xcf, 0x47, + 0xef, 0x0d, 0x8b, 0x76, 0x0d, 0x8b, 0xbe, 0x1a, 0x16, 0xbd, 0xb4, 0x6c, 0xb4, 0x6b, 0xd9, 0xe8, + 0xb3, 0x65, 0xa3, 0x64, 0xb2, 0xd0, 0x15, 0x0c, 0xf4, 0xd3, 0xd3, 0xbe, 0x2e, 0xf6, 0x1b, 0x45, + 0x74, 0x8b, 0xf7, 0x4b, 0xf7, 0x50, 0xcf, 0x61, 0xa1, 0x2b, 0x3e, 0xf0, 0xea, 0xd7, 0x78, 0x3c, + 0xcd, 0x8a, 0x59, 0x2e, 0xde, 0xe2, 0x83, 0x5b, 0xb3, 0xb0, 0xa5, 0x80, 0x99, 0xdf, 0x92, 0x87, + 0x2d, 0xe2, 0x3f, 0xfd, 0x38, 0x28, 0x64, 0x28, 0x64, 0x21, 0x7d, 0x21, 0x43, 0x21, 0xbb, 0xa2, + 0x89, 0x2f, 0x07, 0x16, 0xf2, 0x5a, 0xa4, 0x19, 0x39, 0x55, 0x2a, 0xa7, 0xbe, 0xe3, 0x8b, 0x5e, + 0x8d, 0x18, 0x72, 0xc4, 0x02, 0xd1, 0x03, 0x88, 0x41, 0x40, 0xec, 0x88, 0xf9, 0xf8, 0xf7, 0x2b, + 0x27, 0x3f, 0x01, 0x00, 0x00, 0xff, 0xff, 0xd2, 0xe5, 0xb1, 0x26, 0x11, 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orders/queries/parameters/query_response.pb.go b/x/orders/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..67a2b63bc --- /dev/null +++ b/x/orders/queries/parameters/query_response.pb.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/orders/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_c0d47f2da339925b, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.orders.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/orders/queries/parameters/query_response.proto", fileDescriptor_c0d47f2da339925b) +} + +var fileDescriptor_c0d47f2da339925b = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc7, 0x9b, 0x08, 0x1d, 0x22, 0x75, 0xe8, 0x24, 0x0e, 0x41, 0x9c, 0x1c, 0xe4, 0x1d, 0xb4, + 0x4e, 0xe7, 0xd4, 0x22, 0xb8, 0x18, 0x9a, 0xd6, 0x25, 0x48, 0xa0, 0x5c, 0x9b, 0x87, 0x0d, 0x34, + 0xbd, 0x98, 0x77, 0x85, 0x3a, 0xfa, 0x0d, 0xfc, 0x0c, 0x8e, 0x7e, 0x12, 0x71, 0xea, 0xe8, 0x28, + 0xe9, 0xe6, 0xa7, 0x90, 0xf4, 0xae, 0x26, 0x19, 0x33, 0xe6, 0x91, 0xdf, 0xef, 0xff, 0x7f, 0xf7, + 0x9c, 0xdb, 0x01, 0x11, 0x2a, 0x4f, 0xac, 0xd4, 0x12, 0x59, 0x22, 0xa3, 0xf5, 0x12, 0x89, 0x6d, + 0x98, 0xcc, 0x22, 0xcc, 0x88, 0x3d, 0xaf, 0x31, 0x8b, 0x91, 0x58, 0x2a, 0x32, 0x91, 0xa0, 0x3a, + 0x8c, 0x5e, 0xa6, 0x19, 0x52, 0x2a, 0x57, 0x84, 0x90, 0x66, 0x52, 0xc9, 0x2e, 0xab, 0x58, 0xc0, + 0x58, 0x60, 0x03, 0xda, 0x02, 0xc6, 0x02, 0xa5, 0xe5, 0xac, 0x57, 0x8d, 0xa5, 0xf9, 0x02, 0x13, + 0xc1, 0x96, 0x31, 0x29, 0x62, 0x33, 0x41, 0x58, 0xe6, 0x4d, 0x8b, 0xa1, 0x0e, 0xb9, 0x88, 0x9c, + 0xce, 0xb8, 0x08, 0x9f, 0x98, 0xec, 0xee, 0x83, 0x73, 0x52, 0xff, 0xf1, 0xd4, 0x3a, 0xb7, 0x2e, + 0x8f, 0x7b, 0x57, 0x50, 0xad, 0xa3, 0xed, 0xb0, 0xb7, 0x43, 0x61, 0x07, 0xff, 0x00, 0xdd, 0xc7, + 0xa4, 0x26, 0x9d, 0xb4, 0xfa, 0x39, 0x7c, 0x3d, 0xfa, 0xcc, 0x5d, 0x6b, 0x9b, 0xbb, 0xd6, 0x4f, + 0xee, 0x5a, 0x6f, 0x3b, 0xb7, 0xb5, 0xdd, 0xb9, 0xad, 0xef, 0x9d, 0xdb, 0x72, 0xfa, 0x73, 0x99, + 0x40, 0xc3, 0x4d, 0x87, 0xdd, 0x5a, 0x67, 0xbf, 0xd8, 0xc4, 0xb7, 0x1e, 0xf9, 0x53, 0xac, 0x16, + 0xeb, 0x19, 0xcc, 0x65, 0xc2, 0x1a, 0x5e, 0xe0, 0xdd, 0x6e, 0x0f, 0xbc, 0x60, 0x34, 0xf6, 0x3f, + 0xec, 0xda, 0xb3, 0x7b, 0xa6, 0x4c, 0x00, 0x23, 0x5d, 0x66, 0x6c, 0xca, 0xfc, 0xaf, 0x4b, 0x5f, + 0x35, 0x22, 0x34, 0x44, 0x18, 0x84, 0x9a, 0x08, 0x0d, 0x11, 0x96, 0x44, 0x6e, 0xdf, 0x34, 0x24, + 0xc2, 0x3b, 0x7f, 0xe8, 0xa1, 0x12, 0x91, 0x50, 0xe2, 0xd7, 0xbe, 0xae, 0xd0, 0x9c, 0x1b, 0x9c, + 0xf3, 0x80, 0x73, 0x2d, 0xe0, 0xdc, 0x18, 0x38, 0x2f, 0x15, 0xb3, 0xf6, 0xfe, 0xe0, 0xfd, 0xbf, + 0x00, 0x00, 0x00, 0xff, 0xff, 0xd2, 0x0f, 0xe6, 0x48, 0x9d, 0x02, 0x00, 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/orders/queries/parameters/service.pb.go b/x/orders/queries/parameters/service.pb.go new file mode 100644 index 000000000..4ca70c8ff --- /dev/null +++ b/x/orders/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/orders/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/orders/queries/parameters/service.proto", fileDescriptor_b0ac58a27116a57a) +} + +var fileDescriptor_b0ac58a27116a57a = []byte{ + // 324 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0xb1, 0x4a, 0xc3, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xc0, 0x0e, 0xc1, 0xa9, 0x63, 0x87, 0x1b, 0x7c, 0x80, 0x3b, 0xb0, 0x4e, + 0x27, 0x15, 0x5a, 0x05, 0x5d, 0x42, 0x53, 0x5d, 0x82, 0x1c, 0xc8, 0xb5, 0xf9, 0xd0, 0x42, 0x93, + 0x4b, 0xef, 0x2e, 0x52, 0x1f, 0xc1, 0x4d, 0xf0, 0x0d, 0x1c, 0x7d, 0x12, 0x71, 0xea, 0xe8, 0x28, + 0xc9, 0xe6, 0x2b, 0xb8, 0x48, 0x7a, 0x87, 0x69, 0xc7, 0x74, 0xbd, 0xf0, 0xfb, 0xdf, 0xff, 0xcb, + 0x77, 0xc1, 0x60, 0xa8, 0x35, 0x98, 0x50, 0x64, 0x66, 0x01, 0x34, 0x95, 0x49, 0xb1, 0x00, 0x4d, + 0x57, 0x54, 0xaa, 0x04, 0x94, 0xa6, 0xcb, 0x02, 0xd4, 0x1c, 0x34, 0xcd, 0x85, 0x12, 0x29, 0x98, + 0xfa, 0x48, 0x83, 0x7a, 0x9c, 0xcf, 0x80, 0xe4, 0x4a, 0x1a, 0xd9, 0xa5, 0x5b, 0x9c, 0x38, 0x4e, + 0x56, 0xc4, 0x72, 0xe2, 0x38, 0x69, 0x78, 0xef, 0xbc, 0xed, 0x7d, 0xf5, 0xd1, 0xd3, 0x9d, 0x82, + 0x65, 0x01, 0xda, 0xd8, 0x5b, 0x7b, 0x17, 0xfb, 0x86, 0xe8, 0x5c, 0x66, 0xda, 0x75, 0x3f, 0x7e, + 0x45, 0xc1, 0xc1, 0xa4, 0xfe, 0xd0, 0x7d, 0x46, 0x41, 0xe7, 0x4a, 0x64, 0xc9, 0x02, 0xba, 0x03, + 0xd2, 0x72, 0x22, 0xb2, 0x89, 0xb8, 0xb6, 0xfd, 0x7a, 0x67, 0xfb, 0x72, 0xdb, 0xec, 0xc8, 0x1b, + 0xfd, 0xfa, 0x1f, 0x25, 0x46, 0xeb, 0x12, 0xa3, 0xef, 0x12, 0xa3, 0x97, 0x0a, 0x7b, 0xeb, 0x0a, + 0x7b, 0x5f, 0x15, 0xf6, 0x82, 0xfe, 0x4c, 0xa6, 0x6d, 0xf3, 0x47, 0x87, 0x37, 0x76, 0x61, 0x51, + 0x3d, 0x73, 0x84, 0x6e, 0xd9, 0xfd, 0xdc, 0x3c, 0x14, 0x53, 0x32, 0x93, 0x29, 0x6d, 0xf9, 0x1b, + 0xdf, 0xfc, 0xce, 0x30, 0x8c, 0xc7, 0x93, 0xe8, 0xdd, 0xdf, 0xd9, 0x7b, 0xe8, 0x6a, 0xc4, 0x64, + 0x6c, 0x6b, 0x4c, 0x5c, 0x8d, 0xe8, 0x9f, 0x7e, 0xee, 0x08, 0xee, 0x04, 0x8f, 0xb9, 0x15, 0xdc, + 0x09, 0xde, 0x88, 0xd2, 0x3f, 0x6d, 0x29, 0xf8, 0x65, 0x34, 0x0a, 0xc1, 0x88, 0x44, 0x18, 0xf1, + 0xe3, 0x9f, 0x6c, 0x69, 0xc6, 0x1c, 0x67, 0x2c, 0x66, 0xcc, 0x06, 0x30, 0xe6, 0x12, 0x18, 0x6b, + 0x22, 0xa6, 0x9d, 0xcd, 0xd3, 0xe8, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0xfd, 0x72, 0x76, 0x8f, + 0x17, 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.orders.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.orders.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.orders.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/orders/queries/parameters/service.proto", +} diff --git a/x/splits/queries/parameters/query_request.pb.go b/x/splits/queries/parameters/query_request.pb.go new file mode 100644 index 000000000..5a1dfe940 --- /dev/null +++ b/x/splits/queries/parameters/query_request.pb.go @@ -0,0 +1,272 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/splits/queries/parameters/query_request.proto + +package parameters + +import ( + fmt "fmt" + 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 + +type QueryRequest struct { +} + +func (m *QueryRequest) Reset() { *m = QueryRequest{} } +func (m *QueryRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRequest) ProtoMessage() {} +func (*QueryRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_a5f308e7e8a3b4c0, []int{0} +} +func (m *QueryRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRequest.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 *QueryRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRequest.Merge(m, src) +} +func (m *QueryRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRequest proto.InternalMessageInfo + +func init() { + proto.RegisterType((*QueryRequest)(nil), "AssetMantle.modules.x.splits.queries.parameters.QueryRequest") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/splits/queries/parameters/query_request.proto", fileDescriptor_a5f308e7e8a3b4c0) +} + +var fileDescriptor_a5f308e7e8a3b4c0 = []byte{ + // 272 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0xd1, 0xb1, 0x4a, 0xc4, 0x30, + 0x1c, 0xc7, 0xf1, 0xb6, 0xc2, 0x0d, 0x45, 0x04, 0x7d, 0x80, 0x0c, 0x3e, 0x40, 0x32, 0x9c, 0xd3, + 0xdf, 0xe9, 0xea, 0xe0, 0x54, 0x48, 0xbd, 0xa5, 0x48, 0x40, 0x72, 0x77, 0x7f, 0xb4, 0xd0, 0x9a, + 0x5e, 0x92, 0xc2, 0xb9, 0xf9, 0x08, 0x3e, 0x83, 0xa3, 0x4f, 0x22, 0x4e, 0x37, 0x3a, 0x4a, 0xbb, + 0xf9, 0x14, 0x72, 0x26, 0x5c, 0xdb, 0xb1, 0x6b, 0xe0, 0xfb, 0xe1, 0xf7, 0x27, 0xf1, 0xcd, 0xc2, + 0x18, 0xb4, 0xa9, 0x7c, 0xb6, 0x25, 0xb2, 0x4a, 0x6d, 0x9a, 0x12, 0x0d, 0xdb, 0x31, 0x53, 0x97, + 0x85, 0x35, 0x6c, 0xdb, 0xa0, 0x2e, 0xd0, 0xb0, 0x5a, 0x6a, 0x59, 0xa1, 0x45, 0xed, 0x9e, 0x5e, + 0x1e, 0x34, 0x6e, 0x1b, 0x34, 0x96, 0xd6, 0x5a, 0x59, 0x75, 0xc1, 0x06, 0x08, 0xf5, 0x08, 0xdd, + 0x51, 0x87, 0x50, 0x8f, 0xd0, 0x1e, 0xb9, 0x3c, 0x8b, 0x4f, 0xb3, 0x83, 0x73, 0xe7, 0x98, 0xe4, + 0xf5, 0xe4, 0xb3, 0x25, 0xe1, 0xbe, 0x25, 0xe1, 0x4f, 0x4b, 0xc2, 0xb7, 0x8e, 0x04, 0xfb, 0x8e, + 0x04, 0xdf, 0x1d, 0x09, 0xe2, 0xf9, 0x5a, 0x55, 0x74, 0xa2, 0x9f, 0x9c, 0x0f, 0x75, 0x7e, 0xd8, + 0xc8, 0xc3, 0x7b, 0x78, 0x2c, 0xec, 0x53, 0xb3, 0xa2, 0x6b, 0x55, 0xb1, 0x89, 0x57, 0xbf, 0x47, + 0xb3, 0x45, 0x9a, 0x2f, 0x33, 0xfe, 0x11, 0x8d, 0x6e, 0x4d, 0xfd, 0x96, 0x9c, 0x2e, 0xdd, 0x96, + 0xcc, 0x6f, 0xe1, 0xc7, 0xf4, 0x6b, 0x54, 0x08, 0x5f, 0x88, 0x5c, 0xb8, 0x42, 0xf8, 0x42, 0xf4, + 0x45, 0x1b, 0x5d, 0x4f, 0x2c, 0xc4, 0x2d, 0x4f, 0x52, 0xb4, 0x72, 0x23, 0xad, 0xfc, 0x8d, 0xae, + 0x06, 0x35, 0x80, 0xcf, 0x01, 0x72, 0x00, 0x07, 0x00, 0x78, 0x01, 0xa0, 0x27, 0x56, 0xb3, 0xff, + 0xaf, 0x9c, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x94, 0x2b, 0x54, 0x48, 0x11, 0x02, 0x00, 0x00, +} + +func (m *QueryRequest) 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 *QueryRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintQueryRequest(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryRequest(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovQueryRequest(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryRequest(x uint64) (n int) { + return sovQueryRequest(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryRequest) 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 ErrIntOverflowQueryRequest + } + 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: QueryRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQueryRequest(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryRequest + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryRequest(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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrIntOverflowQueryRequest + } + 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, ErrInvalidLengthQueryRequest + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryRequest + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryRequest + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryRequest = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryRequest = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryRequest = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/splits/queries/parameters/query_response.pb.go b/x/splits/queries/parameters/query_response.pb.go new file mode 100644 index 000000000..1c0d1c67a --- /dev/null +++ b/x/splits/queries/parameters/query_response.pb.go @@ -0,0 +1,337 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/splits/queries/parameters/query_response.proto + +package parameters + +import ( + fmt "fmt" + base "github.com/AssetMantle/schema/lists/base" + 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 + +type QueryResponse struct { + ParameterList *base.ParameterList `protobuf:"bytes,1,opt,name=parameter_list,json=parameterList,proto3" json:"parameter_list,omitempty"` +} + +func (m *QueryResponse) Reset() { *m = QueryResponse{} } +func (m *QueryResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResponse) ProtoMessage() {} +func (*QueryResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6a41cc553798a56c, []int{0} +} +func (m *QueryResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResponse.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 *QueryResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResponse.Merge(m, src) +} +func (m *QueryResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResponse proto.InternalMessageInfo + +func (m *QueryResponse) GetParameterList() *base.ParameterList { + if m != nil { + return m.ParameterList + } + return nil +} + +func init() { + proto.RegisterType((*QueryResponse)(nil), "AssetMantle.modules.x.splits.queries.parameters.QueryResponse") +} + +func init() { + proto.RegisterFile("AssetMantle/modules/x/splits/queries/parameters/query_response.proto", fileDescriptor_6a41cc553798a56c) +} + +var fileDescriptor_6a41cc553798a56c = []byte{ + // 333 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x91, 0x31, 0x4b, 0xc3, 0x40, + 0x14, 0xc7, 0x9b, 0x08, 0x1d, 0x22, 0x75, 0xe8, 0x24, 0x0e, 0x41, 0x9c, 0x1c, 0xe4, 0x1d, 0xb4, + 0x4e, 0xe7, 0xd4, 0x22, 0xb8, 0x18, 0x48, 0xdb, 0x25, 0xc8, 0x41, 0xb9, 0xb6, 0x0f, 0x1b, 0x48, + 0x7a, 0x31, 0xef, 0x0a, 0x75, 0xf4, 0x1b, 0xf8, 0x19, 0x1c, 0xfd, 0x24, 0xe2, 0xd4, 0xd1, 0x51, + 0xd2, 0xcd, 0x4f, 0x21, 0xe9, 0x9d, 0x26, 0x19, 0x3b, 0xe6, 0x91, 0xdf, 0xef, 0xff, 0x7f, 0xf7, + 0xbc, 0xdb, 0x01, 0x11, 0xea, 0x40, 0xae, 0x74, 0x82, 0x2c, 0x55, 0x8b, 0x75, 0x82, 0xc4, 0x36, + 0x8c, 0xb2, 0x24, 0xd6, 0xc4, 0x9e, 0xd6, 0x98, 0xc7, 0x48, 0x2c, 0x93, 0xb9, 0x4c, 0x51, 0x63, + 0x6e, 0x46, 0xcf, 0xd3, 0x1c, 0x29, 0x53, 0x2b, 0x42, 0xc8, 0x72, 0xa5, 0x55, 0x97, 0xd5, 0x2c, + 0x60, 0x2d, 0xb0, 0x01, 0x63, 0x01, 0x6b, 0x81, 0xca, 0x72, 0xd6, 0xab, 0xc7, 0xd2, 0x7c, 0x89, + 0xa9, 0x64, 0x49, 0x4c, 0x9a, 0xd8, 0x4c, 0x12, 0x56, 0x79, 0xd3, 0x72, 0x68, 0x42, 0x2e, 0x16, + 0x5e, 0x67, 0x54, 0x86, 0x8f, 0x6d, 0x76, 0x77, 0xe2, 0x9d, 0x34, 0x7f, 0x3c, 0x75, 0xce, 0x9d, + 0xcb, 0xe3, 0xde, 0x15, 0xd4, 0xeb, 0x18, 0x3b, 0xec, 0xed, 0x50, 0xda, 0x21, 0xfc, 0x83, 0xee, + 0x63, 0xd2, 0xe3, 0x4e, 0x56, 0xff, 0x1c, 0xbe, 0x1c, 0x7d, 0x14, 0xbe, 0xb3, 0x2d, 0x7c, 0xe7, + 0xbb, 0xf0, 0x9d, 0xd7, 0x9d, 0xdf, 0xda, 0xee, 0xfc, 0xd6, 0xd7, 0xce, 0x6f, 0x79, 0xfd, 0xb9, + 0x4a, 0xe1, 0xc0, 0x4d, 0x87, 0xdd, 0x46, 0xe7, 0xb0, 0xdc, 0x24, 0x74, 0x1e, 0xf8, 0x63, 0xac, + 0x97, 0xeb, 0x19, 0xcc, 0x55, 0xca, 0x0e, 0xbc, 0xc0, 0x9b, 0xdb, 0x1e, 0x04, 0xd1, 0x64, 0x14, + 0xbe, 0xbb, 0x8d, 0x67, 0x0f, 0x6c, 0x99, 0x08, 0x26, 0xa6, 0xcc, 0xc8, 0x96, 0xf9, 0x5f, 0x97, + 0x3e, 0x1b, 0x84, 0xb0, 0x84, 0x88, 0x84, 0x21, 0x84, 0x25, 0x44, 0x45, 0x14, 0xee, 0xcd, 0x81, + 0x84, 0xb8, 0x0b, 0x87, 0x01, 0x6a, 0xb9, 0x90, 0x5a, 0xfe, 0xb8, 0xd7, 0x35, 0x9a, 0x73, 0x8b, + 0x73, 0x1e, 0x71, 0x6e, 0x04, 0x9c, 0x5b, 0x03, 0xe7, 0x95, 0x62, 0xd6, 0xde, 0x1f, 0xbc, 0xff, + 0x1b, 0x00, 0x00, 0xff, 0xff, 0x39, 0x8d, 0x2e, 0xb6, 0x9d, 0x02, 0x00, 0x00, +} + +func (m *QueryResponse) 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 *QueryResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ParameterList != nil { + { + size, err := m.ParameterList.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQueryResponse(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQueryResponse(dAtA []byte, offset int, v uint64) int { + offset -= sovQueryResponse(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ParameterList != nil { + l = m.ParameterList.Size() + n += 1 + l + sovQueryResponse(uint64(l)) + } + return n +} + +func sovQueryResponse(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQueryResponse(x uint64) (n int) { + return sovQueryResponse(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryResponse) 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 ErrIntOverflowQueryResponse + } + 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: QueryResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ParameterList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQueryResponse + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQueryResponse + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQueryResponse + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ParameterList == nil { + m.ParameterList = &base.ParameterList{} + } + if err := m.ParameterList.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQueryResponse(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQueryResponse + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQueryResponse(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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrIntOverflowQueryResponse + } + 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, ErrInvalidLengthQueryResponse + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQueryResponse + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQueryResponse + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQueryResponse = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQueryResponse = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQueryResponse = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/splits/queries/parameters/service.pb.go b/x/splits/queries/parameters/service.pb.go new file mode 100644 index 000000000..8ea3b0bc8 --- /dev/null +++ b/x/splits/queries/parameters/service.pb.go @@ -0,0 +1,135 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: AssetMantle/modules/x/splits/queries/parameters/service.proto + +package parameters + +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" + math "math" +) + +// 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 + +func init() { + proto.RegisterFile("AssetMantle/modules/x/splits/queries/parameters/service.proto", fileDescriptor_9b6cc8022dd588ef) +} + +var fileDescriptor_9b6cc8022dd588ef = []byte{ + // 326 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0xd2, 0x31, 0x4b, 0xf3, 0x40, + 0x18, 0x07, 0xf0, 0x5c, 0xe0, 0xed, 0x10, 0xde, 0xa9, 0x63, 0x87, 0x1b, 0xfc, 0x00, 0x77, 0x60, + 0x9d, 0x4e, 0x2a, 0xb4, 0x0a, 0xba, 0x04, 0x52, 0xbb, 0x04, 0x39, 0x90, 0x6b, 0xfb, 0xa0, 0x81, + 0x24, 0x97, 0xde, 0x5d, 0xa4, 0x7e, 0x04, 0x37, 0xc1, 0x6f, 0xe0, 0xe8, 0x27, 0x11, 0xa7, 0x8e, + 0x8e, 0x92, 0x6c, 0x7e, 0x05, 0x17, 0x49, 0xef, 0x30, 0xed, 0x98, 0xae, 0x09, 0xbf, 0xff, 0xf3, + 0x7f, 0xf2, 0x24, 0x18, 0x8d, 0xb5, 0x06, 0x13, 0x8a, 0xdc, 0xa4, 0x40, 0x33, 0xb9, 0x2c, 0x53, + 0xd0, 0x74, 0x4d, 0x75, 0x91, 0x26, 0x46, 0xd3, 0x55, 0x09, 0x2a, 0x01, 0x4d, 0x0b, 0xa1, 0x44, + 0x06, 0x06, 0x94, 0xa6, 0x1a, 0xd4, 0x43, 0xb2, 0x00, 0x52, 0x28, 0x69, 0x64, 0x9f, 0xee, 0x70, + 0xe2, 0x38, 0x59, 0x13, 0xcb, 0x89, 0xe3, 0xa4, 0xe5, 0x83, 0xf3, 0xae, 0xf3, 0x9a, 0x47, 0x8f, + 0xb7, 0x0a, 0x56, 0x25, 0x68, 0x63, 0xa7, 0x0e, 0x2e, 0x0e, 0x0d, 0xd1, 0x85, 0xcc, 0xb5, 0xeb, + 0x7e, 0xfc, 0x82, 0x82, 0x7f, 0xd3, 0xe6, 0x45, 0xff, 0x09, 0x05, 0xbd, 0x2b, 0x91, 0x2f, 0x53, + 0xe8, 0x8f, 0x48, 0xc7, 0x8d, 0xc8, 0x36, 0xe2, 0xda, 0xf6, 0x1b, 0x9c, 0x1d, 0xca, 0x6d, 0xb3, + 0x23, 0x6f, 0xf2, 0xe3, 0xbf, 0x57, 0x18, 0x6d, 0x2a, 0x8c, 0xbe, 0x2a, 0x8c, 0x9e, 0x6b, 0xec, + 0x6d, 0x6a, 0xec, 0x7d, 0xd6, 0xd8, 0x0b, 0x86, 0x0b, 0x99, 0x75, 0xcd, 0x9f, 0xfc, 0x9f, 0xd9, + 0x83, 0x45, 0xcd, 0xce, 0x11, 0xba, 0x61, 0x77, 0x89, 0xb9, 0x2f, 0xe7, 0x64, 0x21, 0x33, 0xda, + 0xf1, 0x33, 0xbe, 0xfa, 0xbd, 0x71, 0x18, 0xcf, 0xa6, 0xd1, 0x9b, 0xbf, 0x77, 0xf7, 0xd0, 0xd5, + 0x88, 0xc9, 0xcc, 0xd6, 0x98, 0xba, 0x1a, 0xd1, 0x1f, 0xfd, 0xd8, 0x13, 0xdc, 0x09, 0x1e, 0x73, + 0x2b, 0xb8, 0x13, 0xbc, 0x15, 0x95, 0x7f, 0xda, 0x51, 0xf0, 0xcb, 0x68, 0x12, 0x82, 0x11, 0x4b, + 0x61, 0xc4, 0xb7, 0x7f, 0xb2, 0xa3, 0x19, 0x73, 0x9c, 0xb1, 0x98, 0x31, 0x1b, 0xc0, 0x98, 0x4b, + 0x60, 0xac, 0x8d, 0x98, 0xf7, 0xb6, 0xbf, 0xc6, 0xf0, 0x37, 0x00, 0x00, 0xff, 0xff, 0x99, 0x53, + 0x92, 0x98, 0x17, 0x03, 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 { + Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Handle(ctx context.Context, in *QueryRequest, opts ...grpc.CallOption) (*QueryResponse, error) { + out := new(QueryResponse) + err := c.cc.Invoke(ctx, "/AssetMantle.modules.x.splits.queries.parameters.Query/Handle", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + Handle(context.Context, *QueryRequest) (*QueryResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Handle(ctx context.Context, req *QueryRequest) (*QueryResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Handle not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Handle_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Handle(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/AssetMantle.modules.x.splits.queries.parameters.Query/Handle", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Handle(ctx, req.(*QueryRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "AssetMantle.modules.x.splits.queries.parameters.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Handle", + Handler: _Query_Handle_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "AssetMantle/modules/x/splits/queries/parameters/service.proto", +} From c4942451553e85bf7e355953e5490902805fe117 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 26 Aug 2024 18:32:48 +0530 Subject: [PATCH 32/64] feat(parameters): adding parameters query Signed-off-by: Deepanshu Tripathi --- x/assets/queries/parameters/query.go | 21 +++++++++ x/assets/queries/parameters/query_keeper.go | 31 +++++++++++++ x/assets/queries/parameters/query_request.go | 45 +++++++++++++++++++ x/assets/queries/parameters/query_response.go | 29 ++++++++++++ x/assets/queries/prototype.go | 2 + x/classifications/queries/parameters/query.go | 21 +++++++++ .../queries/parameters/query_keeper.go | 31 +++++++++++++ .../queries/parameters/query_request.go | 45 +++++++++++++++++++ .../queries/parameters/query_response.go | 29 ++++++++++++ x/classifications/queries/prototype.go | 2 + x/identities/queries/parameters/query.go | 21 +++++++++ .../queries/parameters/query_keeper.go | 31 +++++++++++++ .../queries/parameters/query_request.go | 45 +++++++++++++++++++ .../queries/parameters/query_response.go | 29 ++++++++++++ x/identities/queries/prototype.go | 2 + x/maintainers/queries/parameters/query.go | 21 +++++++++ .../queries/parameters/query_keeper.go | 31 +++++++++++++ .../queries/parameters/query_request.go | 45 +++++++++++++++++++ .../queries/parameters/query_response.go | 29 ++++++++++++ x/maintainers/queries/prototype.go | 2 + x/metas/queries/parameters/query.go | 21 +++++++++ x/metas/queries/parameters/query_keeper.go | 31 +++++++++++++ x/metas/queries/parameters/query_request.go | 45 +++++++++++++++++++ x/metas/queries/parameters/query_response.go | 29 ++++++++++++ x/metas/queries/prototype.go | 2 + x/orders/queries/parameters/query.go | 21 +++++++++ x/orders/queries/parameters/query_keeper.go | 31 +++++++++++++ x/orders/queries/parameters/query_request.go | 45 +++++++++++++++++++ x/orders/queries/parameters/query_response.go | 29 ++++++++++++ x/orders/queries/prototype.go | 2 + x/splits/queries/parameters/query.go | 21 +++++++++ x/splits/queries/parameters/query_keeper.go | 31 +++++++++++++ x/splits/queries/parameters/query_request.go | 45 +++++++++++++++++++ x/splits/queries/parameters/query_response.go | 29 ++++++++++++ x/splits/queries/prototype.go | 2 + 35 files changed, 896 insertions(+) create mode 100644 x/assets/queries/parameters/query.go create mode 100644 x/assets/queries/parameters/query_keeper.go create mode 100644 x/assets/queries/parameters/query_request.go create mode 100644 x/assets/queries/parameters/query_response.go create mode 100644 x/classifications/queries/parameters/query.go create mode 100644 x/classifications/queries/parameters/query_keeper.go create mode 100644 x/classifications/queries/parameters/query_request.go create mode 100644 x/classifications/queries/parameters/query_response.go create mode 100644 x/identities/queries/parameters/query.go create mode 100644 x/identities/queries/parameters/query_keeper.go create mode 100644 x/identities/queries/parameters/query_request.go create mode 100644 x/identities/queries/parameters/query_response.go create mode 100644 x/maintainers/queries/parameters/query.go create mode 100644 x/maintainers/queries/parameters/query_keeper.go create mode 100644 x/maintainers/queries/parameters/query_request.go create mode 100644 x/maintainers/queries/parameters/query_response.go create mode 100644 x/metas/queries/parameters/query.go create mode 100644 x/metas/queries/parameters/query_keeper.go create mode 100644 x/metas/queries/parameters/query_request.go create mode 100644 x/metas/queries/parameters/query_response.go create mode 100644 x/orders/queries/parameters/query.go create mode 100644 x/orders/queries/parameters/query_keeper.go create mode 100644 x/orders/queries/parameters/query_request.go create mode 100644 x/orders/queries/parameters/query_response.go create mode 100644 x/splits/queries/parameters/query.go create mode 100644 x/splits/queries/parameters/query_keeper.go create mode 100644 x/splits/queries/parameters/query_request.go create mode 100644 x/splits/queries/parameters/query_response.go diff --git a/x/assets/queries/parameters/query.go b/x/assets/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/assets/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/assets/queries/parameters/query_keeper.go b/x/assets/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/assets/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/assets/queries/parameters/query_request.go b/x/assets/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/assets/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/assets/queries/parameters/query_response.go b/x/assets/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/assets/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/assets/queries/prototype.go b/x/assets/queries/prototype.go index f3e015ca7..aa9b8254e 100644 --- a/x/assets/queries/prototype.go +++ b/x/assets/queries/prototype.go @@ -8,11 +8,13 @@ import ( baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/assets/queries/asset" "github.com/AssetMantle/modules/x/assets/queries/assets" + "github.com/AssetMantle/modules/x/assets/queries/parameters" ) func Prototype() helpers.Queries { return baseHelpers.NewQueries( asset.Query, assets.Query, + parameters.Query, ) } diff --git a/x/classifications/queries/parameters/query.go b/x/classifications/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/classifications/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/classifications/queries/parameters/query_keeper.go b/x/classifications/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/classifications/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/classifications/queries/parameters/query_request.go b/x/classifications/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/classifications/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/classifications/queries/parameters/query_response.go b/x/classifications/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/classifications/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/classifications/queries/prototype.go b/x/classifications/queries/prototype.go index 39b3be48c..83e8ac392 100644 --- a/x/classifications/queries/prototype.go +++ b/x/classifications/queries/prototype.go @@ -8,11 +8,13 @@ import ( baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/classifications/queries/classification" "github.com/AssetMantle/modules/x/classifications/queries/classifications" + "github.com/AssetMantle/modules/x/classifications/queries/parameters" ) func Prototype() helpers.Queries { return baseHelpers.NewQueries( classification.Query, classifications.Query, + parameters.Query, ) } diff --git a/x/identities/queries/parameters/query.go b/x/identities/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/identities/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/identities/queries/parameters/query_keeper.go b/x/identities/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/identities/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/identities/queries/parameters/query_request.go b/x/identities/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/identities/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/identities/queries/parameters/query_response.go b/x/identities/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/identities/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/identities/queries/prototype.go b/x/identities/queries/prototype.go index ee32b32e0..1cc87a727 100644 --- a/x/identities/queries/prototype.go +++ b/x/identities/queries/prototype.go @@ -8,11 +8,13 @@ import ( baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/identities/queries/identities" "github.com/AssetMantle/modules/x/identities/queries/identity" + "github.com/AssetMantle/modules/x/identities/queries/parameters" ) func Prototype() helpers.Queries { return baseHelpers.NewQueries( identity.Query, identities.Query, + parameters.Query, ) } diff --git a/x/maintainers/queries/parameters/query.go b/x/maintainers/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/maintainers/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/maintainers/queries/parameters/query_keeper.go b/x/maintainers/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/maintainers/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/maintainers/queries/parameters/query_request.go b/x/maintainers/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/maintainers/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/maintainers/queries/parameters/query_response.go b/x/maintainers/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/maintainers/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/maintainers/queries/prototype.go b/x/maintainers/queries/prototype.go index dde99b17d..25fa018ea 100644 --- a/x/maintainers/queries/prototype.go +++ b/x/maintainers/queries/prototype.go @@ -8,11 +8,13 @@ import ( baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/maintainers/queries/maintainer" "github.com/AssetMantle/modules/x/maintainers/queries/maintainers" + "github.com/AssetMantle/modules/x/maintainers/queries/parameters" ) func Prototype() helpers.Queries { return baseHelpers.NewQueries( maintainer.Query, maintainers.Query, + parameters.Query, ) } diff --git a/x/metas/queries/parameters/query.go b/x/metas/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/metas/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/metas/queries/parameters/query_keeper.go b/x/metas/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/metas/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/metas/queries/parameters/query_request.go b/x/metas/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/metas/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/metas/queries/parameters/query_response.go b/x/metas/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/metas/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/metas/queries/prototype.go b/x/metas/queries/prototype.go index 199c5f521..599c92589 100644 --- a/x/metas/queries/prototype.go +++ b/x/metas/queries/prototype.go @@ -8,11 +8,13 @@ import ( baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/metas/queries/meta" "github.com/AssetMantle/modules/x/metas/queries/metas" + "github.com/AssetMantle/modules/x/metas/queries/parameters" ) func Prototype() helpers.Queries { return baseHelpers.NewQueries( meta.Query, metas.Query, + parameters.Query, ) } diff --git a/x/orders/queries/parameters/query.go b/x/orders/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/orders/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/orders/queries/parameters/query_keeper.go b/x/orders/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/orders/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/orders/queries/parameters/query_request.go b/x/orders/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/orders/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/orders/queries/parameters/query_response.go b/x/orders/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/orders/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/orders/queries/prototype.go b/x/orders/queries/prototype.go index 2c47a4b4b..f9485c223 100644 --- a/x/orders/queries/prototype.go +++ b/x/orders/queries/prototype.go @@ -8,11 +8,13 @@ import ( baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/orders/queries/order" "github.com/AssetMantle/modules/x/orders/queries/orders" + "github.com/AssetMantle/modules/x/orders/queries/parameters" ) func Prototype() helpers.Queries { return baseHelpers.NewQueries( order.Query, orders.Query, + parameters.Query, ) } diff --git a/x/splits/queries/parameters/query.go b/x/splits/queries/parameters/query.go new file mode 100644 index 000000000..cfe5be8fe --- /dev/null +++ b/x/splits/queries/parameters/query.go @@ -0,0 +1,21 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "google.golang.org/grpc" +) + +var Query = baseHelpers.NewQuery( + _Query_serviceDesc.ServiceName, + "", + "", + + requestPrototype, + responsePrototype, + keeperPrototype, + + func(server grpc.ServiceRegistrar, QueryKeeper helpers.QueryKeeper) { + RegisterQueryServer(server, QueryKeeper.(queryKeeper)) + }, +) diff --git a/x/splits/queries/parameters/query_keeper.go b/x/splits/queries/parameters/query_keeper.go new file mode 100644 index 000000000..5fcb2eb2d --- /dev/null +++ b/x/splits/queries/parameters/query_keeper.go @@ -0,0 +1,31 @@ +package parameters + +import ( + "context" + "github.com/AssetMantle/modules/helpers" +) + +type queryKeeper struct { + parameterManager helpers.ParameterManager +} + +var _ helpers.QueryKeeper = (*queryKeeper)(nil) + +func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { + queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + return queryResponse, err +} +func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { + if err := queryRequest.Validate(); err != nil { + return nil, err + } + return newQueryResponse(queryKeeper.parameterManager.Fetch(context).Get()), nil +} +func (queryKeeper queryKeeper) Initialize(_ helpers.Mapper, parameterManager helpers.ParameterManager, _ []interface{}) helpers.Keeper { + queryKeeper.parameterManager = parameterManager + return queryKeeper +} + +func keeperPrototype() helpers.QueryKeeper { + return queryKeeper{} +} diff --git a/x/splits/queries/parameters/query_request.go b/x/splits/queries/parameters/query_request.go new file mode 100644 index 000000000..72c870310 --- /dev/null +++ b/x/splits/queries/parameters/query_request.go @@ -0,0 +1,45 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/cosmos-sdk/client" + "net/http" +) + +var _ helpers.QueryRequest = (*QueryRequest)(nil) + +func (queryRequest *QueryRequest) Validate() error { + return nil +} + +func (queryRequest *QueryRequest) FromCLI(_ helpers.CLICommand, _ client.Context) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.QueryRequest, error) { + return requestPrototype(), nil +} + +func (queryRequest *QueryRequest) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryRequest) +} + +func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { + return nil, err + } + + return queryRequest, nil +} +func requestPrototype() helpers.QueryRequest { + return &QueryRequest{} +} +func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { + switch value := request.(type) { + case *QueryRequest: + return value + default: + return &QueryRequest{} + } +} diff --git a/x/splits/queries/parameters/query_response.go b/x/splits/queries/parameters/query_response.go new file mode 100644 index 000000000..4d34b8543 --- /dev/null +++ b/x/splits/queries/parameters/query_response.go @@ -0,0 +1,29 @@ +package parameters + +import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" +) + +var _ helpers.QueryResponse = (*QueryResponse)(nil) + +func (queryResponse *QueryResponse) Encode() ([]byte, error) { + return base.CodecPrototype().MarshalJSON(queryResponse) +} +func (queryResponse *QueryResponse) Decode(bytes []byte) (helpers.QueryResponse, error) { + if err := base.CodecPrototype().UnmarshalJSON(bytes, queryResponse); err != nil { + return nil, err + } + + return queryResponse, nil +} +func responsePrototype() helpers.QueryResponse { + return &QueryResponse{} +} +func newQueryResponse(parameterList lists.ParameterList) *QueryResponse { + return &QueryResponse{ + ParameterList: parameterList.(*baseLists.ParameterList), + } +} diff --git a/x/splits/queries/prototype.go b/x/splits/queries/prototype.go index 4e21ca61f..75518940e 100644 --- a/x/splits/queries/prototype.go +++ b/x/splits/queries/prototype.go @@ -7,6 +7,7 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/splits/queries/balances" + "github.com/AssetMantle/modules/x/splits/queries/parameters" "github.com/AssetMantle/modules/x/splits/queries/split" "github.com/AssetMantle/modules/x/splits/queries/splits" "github.com/AssetMantle/modules/x/splits/queries/supply" @@ -18,5 +19,6 @@ func Prototype() helpers.Queries { split.Query, splits.Query, supply.Query, + parameters.Query, ) } From 4d78e4babef019346ad924d475584924e1406e3a Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 26 Aug 2024 18:34:17 +0530 Subject: [PATCH 33/64] refactor(parameterManager): removing rest&cli query handling logic Signed-off-by: Deepanshu Tripathi --- helpers/base/module.go | 2 -- helpers/base/parameter_manager.go | 24 +---------------------- helpers/parameter_manager.go | 4 ---- x/assets/parameters/prototype.go | 3 +-- x/classifications/parameters/prototype.go | 3 +-- x/identities/parameters/prototype.go | 3 +-- x/maintainers/parameters/prototype.go | 3 +-- x/metas/parameters/prototype.go | 3 +-- x/orders/parameters/prototype.go | 3 +-- x/splits/parameters/prototype.go | 3 +-- 10 files changed, 8 insertions(+), 43 deletions(-) diff --git a/helpers/base/module.go b/helpers/base/module.go index 7a542900a..35b4082a4 100644 --- a/helpers/base/module.go +++ b/helpers/base/module.go @@ -73,8 +73,6 @@ func (module module) ValidateGenesis(jsonCodec sdkCodec.JSONCodec, _ client.TxEn return genesisState.ValidateBasic(module.parameterManagerPrototype()) } func (module module) RegisterRESTRoutes(context client.Context, router *mux.Router) { - router.HandleFunc("/"+module.Name()+"/parameters", module.parameterManagerPrototype().RESTQueryHandler(context)).Methods("GET") - for _, query := range module.queriesPrototype().Get() { router.HandleFunc(query.GetServicePath(), query.RESTQueryHandler(context)).Methods("GET") } diff --git a/helpers/base/parameter_manager.go b/helpers/base/parameter_manager.go index 1c840a534..8b6e0123b 100644 --- a/helpers/base/parameter_manager.go +++ b/helpers/base/parameter_manager.go @@ -5,14 +5,10 @@ package base import ( "fmt" - "github.com/AssetMantle/modules/utilities/rest" - "net/http" - "github.com/AssetMantle/schema/ids" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/parameters" - "github.com/cosmos/cosmos-sdk/client" sdkTypes "github.com/cosmos/cosmos-sdk/types" paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" @@ -22,7 +18,6 @@ import ( ) type parameterManager struct { - moduleName string validatableParameters []helpers.ValidatableParameter paramsSubspace paramsTypes.Subspace } @@ -93,30 +88,13 @@ func (parameterManager parameterManager) ParamSetPairs() paramsTypes.ParamSetPai func (parameterManager parameterManager) GetKeyTable() paramsTypes.KeyTable { return paramsTypes.NewKeyTable().RegisterParamSet(parameterManager) } -func (parameterManager parameterManager) RESTQueryHandler(clientContext client.Context) http.HandlerFunc { - return func(responseWriter http.ResponseWriter, request *http.Request) { - clientContext, ok := rest.ParseQueryHeightOrReturnBadRequest(responseWriter, clientContext, request) - if !ok { - return - } - - responseBytes, height, err := clientContext.QueryWithData(fmt.Sprintf("custom/%s/parameters", parameterManager.moduleName), nil) - if rest.CheckInternalServerError(responseWriter, err) { - return - } - - clientContext = clientContext.WithHeight(height) - rest.PostProcessResponse(responseWriter, clientContext, responseBytes) - } -} func (parameterManager parameterManager) Initialize(subspace paramsTypes.Subspace) helpers.ParameterManager { parameterManager.paramsSubspace = subspace return parameterManager } -func NewParameterManager(moduleName string, validatableParameters ...helpers.ValidatableParameter) helpers.ParameterManager { +func NewParameterManager(validatableParameters ...helpers.ValidatableParameter) helpers.ParameterManager { return parameterManager{ - moduleName: moduleName, validatableParameters: validatableParameters, } } diff --git a/helpers/parameter_manager.go b/helpers/parameter_manager.go index 21f1c21d2..4aaddfb14 100644 --- a/helpers/parameter_manager.go +++ b/helpers/parameter_manager.go @@ -5,12 +5,9 @@ package helpers import ( "context" - "net/http" - "github.com/AssetMantle/schema/ids" "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/parameters" - "github.com/cosmos/cosmos-sdk/client" paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" ) @@ -24,6 +21,5 @@ type ParameterManager interface { Set(context.Context, lists.ParameterList) ParameterManager GetKeyTable() paramsTypes.KeyTable - RESTQueryHandler(client.Context) http.HandlerFunc Initialize(paramsTypes.Subspace) ParameterManager } diff --git a/x/assets/parameters/prototype.go b/x/assets/parameters/prototype.go index cb53e1c69..6d4977d0f 100644 --- a/x/assets/parameters/prototype.go +++ b/x/assets/parameters/prototype.go @@ -6,7 +6,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/assets/constants" "github.com/AssetMantle/modules/x/assets/parameters/burn_enabled" "github.com/AssetMantle/modules/x/assets/parameters/mint_enabled" "github.com/AssetMantle/modules/x/assets/parameters/renumerate_enabled" @@ -15,5 +14,5 @@ import ( ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, burn_enabled.ValidatableParameter, mint_enabled.ValidatableParameter, renumerate_enabled.ValidatableParameter, unwrap_allowed_coins.ValidatableParameter, wrap_allowed_coins.ValidatableParameter) + return baseHelpers.NewParameterManager(burn_enabled.ValidatableParameter, mint_enabled.ValidatableParameter, renumerate_enabled.ValidatableParameter, unwrap_allowed_coins.ValidatableParameter, wrap_allowed_coins.ValidatableParameter) } diff --git a/x/classifications/parameters/prototype.go b/x/classifications/parameters/prototype.go index 602962e46..046a15895 100644 --- a/x/classifications/parameters/prototype.go +++ b/x/classifications/parameters/prototype.go @@ -6,12 +6,11 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/classifications/constants" "github.com/AssetMantle/modules/x/classifications/parameters/bond_rate" "github.com/AssetMantle/modules/x/classifications/parameters/define_enabled" "github.com/AssetMantle/modules/x/classifications/parameters/max_property_count" ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, bond_rate.ValidatableParameter, define_enabled.ValidatableParameter, max_property_count.ValidatableParameter) + return baseHelpers.NewParameterManager(bond_rate.ValidatableParameter, define_enabled.ValidatableParameter, max_property_count.ValidatableParameter) } diff --git a/x/identities/parameters/prototype.go b/x/identities/parameters/prototype.go index 4a09561ab..428e0edf5 100644 --- a/x/identities/parameters/prototype.go +++ b/x/identities/parameters/prototype.go @@ -6,12 +6,11 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/identities/constants" "github.com/AssetMantle/modules/x/identities/parameters/issue_enabled" "github.com/AssetMantle/modules/x/identities/parameters/max_provision_address_count" "github.com/AssetMantle/modules/x/identities/parameters/quash_enabled" ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, issue_enabled.ValidatableParameter, max_provision_address_count.ValidatableParameter, quash_enabled.ValidatableParameter) + return baseHelpers.NewParameterManager(issue_enabled.ValidatableParameter, max_provision_address_count.ValidatableParameter, quash_enabled.ValidatableParameter) } diff --git a/x/maintainers/parameters/prototype.go b/x/maintainers/parameters/prototype.go index 8dcdc24cd..d52f7e79d 100644 --- a/x/maintainers/parameters/prototype.go +++ b/x/maintainers/parameters/prototype.go @@ -6,10 +6,9 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/maintainers/constants" "github.com/AssetMantle/modules/x/maintainers/parameters/deputize_allowed" ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, deputize_allowed.ValidatableParameter) + return baseHelpers.NewParameterManager(deputize_allowed.ValidatableParameter) } diff --git a/x/metas/parameters/prototype.go b/x/metas/parameters/prototype.go index 9f103dbcd..dc7447a1a 100644 --- a/x/metas/parameters/prototype.go +++ b/x/metas/parameters/prototype.go @@ -6,10 +6,9 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/metas/constants" "github.com/AssetMantle/modules/x/metas/parameters/reveal_enabled" ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, reveal_enabled.ValidatableParameter) + return baseHelpers.NewParameterManager(reveal_enabled.ValidatableParameter) } diff --git a/x/orders/parameters/prototype.go b/x/orders/parameters/prototype.go index 6f0cb4540..f69f7a5c1 100644 --- a/x/orders/parameters/prototype.go +++ b/x/orders/parameters/prototype.go @@ -6,11 +6,10 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/orders/constants" "github.com/AssetMantle/modules/x/orders/parameters/max_order_life" "github.com/AssetMantle/modules/x/orders/parameters/put_enabled" ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, max_order_life.ValidatableParameter, put_enabled.ValidatableParameter) + return baseHelpers.NewParameterManager(max_order_life.ValidatableParameter, put_enabled.ValidatableParameter) } diff --git a/x/splits/parameters/prototype.go b/x/splits/parameters/prototype.go index de19fddfc..c5ace5a78 100644 --- a/x/splits/parameters/prototype.go +++ b/x/splits/parameters/prototype.go @@ -6,10 +6,9 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/splits/constants" "github.com/AssetMantle/modules/x/splits/parameters/transfer_enabled" ) func Prototype() helpers.ParameterManager { - return baseHelpers.NewParameterManager(constants.ModuleName, transfer_enabled.ValidatableParameter) + return baseHelpers.NewParameterManager(transfer_enabled.ValidatableParameter) } From e0f81fd6b24ce3b202c46f8a32fe05589c3c07ed Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 26 Aug 2024 19:10:56 +0530 Subject: [PATCH 34/64] code cleanup Signed-off-by: Deepanshu Tripathi --- x/assets/queries/asset/query_keeper.go | 2 +- x/assets/queries/asset/query_request.go | 9 +-------- x/assets/queries/asset/query_request_test.go | 2 +- x/assets/queries/assets/query_keeper.go | 2 +- x/assets/queries/assets/query_request.go | 9 +-------- x/assets/queries/parameters/query_keeper.go | 2 +- x/assets/queries/parameters/query_request.go | 8 -------- x/classifications/queries/classification/query_keeper.go | 2 +- .../queries/classification/query_request.go | 8 -------- .../queries/classifications/query_keeper.go | 2 +- .../queries/classifications/query_request.go | 9 +-------- x/classifications/queries/parameters/query_keeper.go | 2 +- x/classifications/queries/parameters/query_request.go | 8 -------- x/identities/queries/identities/query_keeper.go | 2 +- x/identities/queries/identities/query_request.go | 9 +-------- x/identities/queries/identity/query_keeper.go | 2 +- x/identities/queries/identity/query_request.go | 9 +-------- x/identities/queries/parameters/query_keeper.go | 2 +- x/identities/queries/parameters/query_request.go | 8 -------- x/maintainers/queries/maintainer/query_keeper.go | 2 +- x/maintainers/queries/maintainer/query_request.go | 9 --------- x/maintainers/queries/maintainer/query_request_test.go | 2 +- x/maintainers/queries/maintainers/query_keeper.go | 2 +- x/maintainers/queries/maintainers/query_request.go | 9 --------- x/maintainers/queries/parameters/query_keeper.go | 2 +- x/maintainers/queries/parameters/query_request.go | 8 -------- x/metas/queries/meta/query_keeper.go | 2 +- x/metas/queries/meta/query_keeper_test.go | 2 +- x/metas/queries/meta/query_request.go | 9 +-------- x/metas/queries/meta/query_request_test.go | 2 +- x/metas/queries/metas/query_keeper.go | 2 +- x/metas/queries/metas/query_request.go | 9 +-------- x/metas/queries/parameters/query_keeper.go | 2 +- x/metas/queries/parameters/query_request.go | 8 -------- x/orders/queries/order/query_keeper.go | 2 +- x/orders/queries/order/query_request.go | 9 +-------- x/orders/queries/order/query_request_test.go | 2 +- x/orders/queries/orders/query_keeper.go | 2 +- x/orders/queries/orders/query_request.go | 9 +-------- x/orders/queries/parameters/query_keeper.go | 2 +- x/orders/queries/parameters/query_request.go | 8 -------- x/splits/queries/balances/query_keeper.go | 2 +- x/splits/queries/balances/query_request.go | 9 +-------- x/splits/queries/balances/query_request_test.go | 2 +- x/splits/queries/parameters/query_keeper.go | 2 +- x/splits/queries/parameters/query_request.go | 8 -------- x/splits/queries/split/query_keeper.go | 2 +- x/splits/queries/split/query_request.go | 9 +-------- x/splits/queries/split/query_request_test.go | 2 +- x/splits/queries/splits/query_keeper.go | 2 +- x/splits/queries/splits/query_request.go | 9 +-------- x/splits/queries/supply/query_keeper.go | 2 +- x/splits/queries/supply/query_request.go | 9 +-------- x/splits/queries/supply/query_request_test.go | 2 +- 54 files changed, 44 insertions(+), 217 deletions(-) diff --git a/x/assets/queries/asset/query_keeper.go b/x/assets/queries/asset/query_keeper.go index 18f3585b0..0b41001d4 100644 --- a/x/assets/queries/asset/query_keeper.go +++ b/x/assets/queries/asset/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/assets/queries/asset/query_request.go b/x/assets/queries/asset/query_request.go index 25d623a5a..09cae61ea 100644 --- a/x/assets/queries/asset/query_request.go +++ b/x/assets/queries/asset/query_request.go @@ -63,14 +63,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(assetID ids.AssetID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(assetID).(*key.Key)} } diff --git a/x/assets/queries/asset/query_request_test.go b/x/assets/queries/asset/query_request_test.go index 5a60dd3fe..fe95a0660 100644 --- a/x/assets/queries/asset/query_request_test.go +++ b/x/assets/queries/asset/query_request_test.go @@ -63,7 +63,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) diff --git a/x/assets/queries/assets/query_keeper.go b/x/assets/queries/assets/query_keeper.go index 67e954caa..138de305d 100644 --- a/x/assets/queries/assets/query_keeper.go +++ b/x/assets/queries/assets/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/assets/queries/assets/query_request.go b/x/assets/queries/assets/query_request.go index 27d80e3bb..18641aff8 100644 --- a/x/assets/queries/assets/query_request.go +++ b/x/assets/queries/assets/query_request.go @@ -82,14 +82,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(assetID ids.AssetID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(assetID).(*key.Key), Limit: limit} } diff --git a/x/assets/queries/parameters/query_keeper.go b/x/assets/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/assets/queries/parameters/query_keeper.go +++ b/x/assets/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/assets/queries/parameters/query_request.go b/x/assets/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/assets/queries/parameters/query_request.go +++ b/x/assets/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/classifications/queries/classification/query_keeper.go b/x/classifications/queries/classification/query_keeper.go index edf37f41f..d49eecdfb 100644 --- a/x/classifications/queries/classification/query_keeper.go +++ b/x/classifications/queries/classification/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/classifications/queries/classification/query_request.go b/x/classifications/queries/classification/query_request.go index 944bc8f77..4ff45bff0 100644 --- a/x/classifications/queries/classification/query_request.go +++ b/x/classifications/queries/classification/query_request.go @@ -62,14 +62,6 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} func newQueryRequest(classificationID ids.ClassificationID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(classificationID).(*key.Key)} } diff --git a/x/classifications/queries/classifications/query_keeper.go b/x/classifications/queries/classifications/query_keeper.go index d05b5b58b..ed1a78b08 100644 --- a/x/classifications/queries/classifications/query_keeper.go +++ b/x/classifications/queries/classifications/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/classifications/queries/classifications/query_request.go b/x/classifications/queries/classifications/query_request.go index ba39d9949..ea434c935 100644 --- a/x/classifications/queries/classifications/query_request.go +++ b/x/classifications/queries/classifications/query_request.go @@ -81,14 +81,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(classificationID ids.ClassificationID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(classificationID).(*key.Key), Limit: limit} } diff --git a/x/classifications/queries/parameters/query_keeper.go b/x/classifications/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/classifications/queries/parameters/query_keeper.go +++ b/x/classifications/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/classifications/queries/parameters/query_request.go b/x/classifications/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/classifications/queries/parameters/query_request.go +++ b/x/classifications/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/identities/queries/identities/query_keeper.go b/x/identities/queries/identities/query_keeper.go index 35de5c225..3966b71db 100644 --- a/x/identities/queries/identities/query_keeper.go +++ b/x/identities/queries/identities/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/identities/queries/identities/query_request.go b/x/identities/queries/identities/query_request.go index 00f10e1d9..a3fefb942 100644 --- a/x/identities/queries/identities/query_request.go +++ b/x/identities/queries/identities/query_request.go @@ -80,14 +80,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(identityID ids.IdentityID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(identityID).(*key.Key), Limit: limit} } diff --git a/x/identities/queries/identity/query_keeper.go b/x/identities/queries/identity/query_keeper.go index 1e6ca171d..d52b8f54c 100644 --- a/x/identities/queries/identity/query_keeper.go +++ b/x/identities/queries/identity/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/identities/queries/identity/query_request.go b/x/identities/queries/identity/query_request.go index ca7588a91..878bcaf17 100644 --- a/x/identities/queries/identity/query_request.go +++ b/x/identities/queries/identity/query_request.go @@ -62,14 +62,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(identityID ids.IdentityID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(identityID).(*key.Key)} } diff --git a/x/identities/queries/parameters/query_keeper.go b/x/identities/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/identities/queries/parameters/query_keeper.go +++ b/x/identities/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/identities/queries/parameters/query_request.go b/x/identities/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/identities/queries/parameters/query_request.go +++ b/x/identities/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/maintainers/queries/maintainer/query_keeper.go b/x/maintainers/queries/maintainer/query_keeper.go index 6db6151ba..b60b54fcb 100644 --- a/x/maintainers/queries/maintainer/query_keeper.go +++ b/x/maintainers/queries/maintainer/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/maintainers/queries/maintainer/query_request.go b/x/maintainers/queries/maintainer/query_request.go index b3fea771a..5e38be26e 100644 --- a/x/maintainers/queries/maintainer/query_request.go +++ b/x/maintainers/queries/maintainer/query_request.go @@ -67,15 +67,6 @@ func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} - func newQueryRequest(maintainerID ids.MaintainerID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(maintainerID).(*key.Key)} } diff --git a/x/maintainers/queries/maintainer/query_request_test.go b/x/maintainers/queries/maintainer/query_request_test.go index 106e6a94f..bc11eb621 100644 --- a/x/maintainers/queries/maintainer/query_request_test.go +++ b/x/maintainers/queries/maintainer/query_request_test.go @@ -61,7 +61,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) diff --git a/x/maintainers/queries/maintainers/query_keeper.go b/x/maintainers/queries/maintainers/query_keeper.go index 6bd48a10f..3a77f7225 100644 --- a/x/maintainers/queries/maintainers/query_keeper.go +++ b/x/maintainers/queries/maintainers/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/maintainers/queries/maintainers/query_request.go b/x/maintainers/queries/maintainers/query_request.go index 00575bd3e..6dd7ed0a1 100644 --- a/x/maintainers/queries/maintainers/query_request.go +++ b/x/maintainers/queries/maintainers/query_request.go @@ -86,15 +86,6 @@ func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} - func newQueryRequest(maintainerID ids.MaintainerID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(maintainerID).(*key.Key), Limit: limit} } diff --git a/x/maintainers/queries/parameters/query_keeper.go b/x/maintainers/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/maintainers/queries/parameters/query_keeper.go +++ b/x/maintainers/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/maintainers/queries/parameters/query_request.go b/x/maintainers/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/maintainers/queries/parameters/query_request.go +++ b/x/maintainers/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/metas/queries/meta/query_keeper.go b/x/metas/queries/meta/query_keeper.go index 9fa15aaac..6b5ce9749 100644 --- a/x/metas/queries/meta/query_keeper.go +++ b/x/metas/queries/meta/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/metas/queries/meta/query_keeper_test.go b/x/metas/queries/meta/query_keeper_test.go index d89459fd3..335788a96 100644 --- a/x/metas/queries/meta/query_keeper_test.go +++ b/x/metas/queries/meta/query_keeper_test.go @@ -129,7 +129,7 @@ func Test_queryKeeper_Enquire(t *testing.T) { want helpers.QueryResponse wantErr bool }{ - {"+ve", fields{Mapper}, args{Context.Context(), newQueryRequest(testDataID)}, newQueryResponse(keepers.MetaKeeper.(queryKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Fetch(queryRequestFromInterface(newQueryRequest(testDataID)).Key).FetchRecord(queryRequestFromInterface(newQueryRequest(testDataID)).Key)), false}, + {"+ve", fields{Mapper}, args{Context.Context(), newQueryRequest(testDataID)}, newQueryResponse(keepers.MetaKeeper.(queryKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Fetch(newQueryRequest(testDataID).(*QueryRequest).Key).FetchRecord(newQueryRequest(testDataID).(*QueryRequest).Key)), false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/metas/queries/meta/query_request.go b/x/metas/queries/meta/query_request.go index e0c0ff7e0..4f619dbdf 100644 --- a/x/metas/queries/meta/query_request.go +++ b/x/metas/queries/meta/query_request.go @@ -62,14 +62,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(dataID ids.DataID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(dataID).(*key.Key)} } diff --git a/x/metas/queries/meta/query_request_test.go b/x/metas/queries/meta/query_request_test.go index 2386183ea..9995be8e0 100644 --- a/x/metas/queries/meta/query_request_test.go +++ b/x/metas/queries/meta/query_request_test.go @@ -59,7 +59,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) diff --git a/x/metas/queries/metas/query_keeper.go b/x/metas/queries/metas/query_keeper.go index 40c2e0f2b..ad7c4ca27 100644 --- a/x/metas/queries/metas/query_keeper.go +++ b/x/metas/queries/metas/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/metas/queries/metas/query_request.go b/x/metas/queries/metas/query_request.go index 60c4a5ed4..fa7ab33d8 100644 --- a/x/metas/queries/metas/query_request.go +++ b/x/metas/queries/metas/query_request.go @@ -81,14 +81,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(dataID ids.DataID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(dataID).(*key.Key), Limit: limit} } diff --git a/x/metas/queries/parameters/query_keeper.go b/x/metas/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/metas/queries/parameters/query_keeper.go +++ b/x/metas/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/metas/queries/parameters/query_request.go b/x/metas/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/metas/queries/parameters/query_request.go +++ b/x/metas/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/orders/queries/order/query_keeper.go b/x/orders/queries/order/query_keeper.go index f5f5faacf..d9f8f7045 100644 --- a/x/orders/queries/order/query_keeper.go +++ b/x/orders/queries/order/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/orders/queries/order/query_request.go b/x/orders/queries/order/query_request.go index 0ed7f12a2..b1e18c65e 100644 --- a/x/orders/queries/order/query_request.go +++ b/x/orders/queries/order/query_request.go @@ -62,14 +62,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(orderID ids.OrderID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(orderID).(*key.Key)} } diff --git a/x/orders/queries/order/query_request_test.go b/x/orders/queries/order/query_request_test.go index 6fb8bca87..bc599faee 100644 --- a/x/orders/queries/order/query_request_test.go +++ b/x/orders/queries/order/query_request_test.go @@ -68,7 +68,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) diff --git a/x/orders/queries/orders/query_keeper.go b/x/orders/queries/orders/query_keeper.go index 5dc2e54f6..b6a486cde 100644 --- a/x/orders/queries/orders/query_keeper.go +++ b/x/orders/queries/orders/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/orders/queries/orders/query_request.go b/x/orders/queries/orders/query_request.go index ead45b15e..6a683d9fb 100644 --- a/x/orders/queries/orders/query_request.go +++ b/x/orders/queries/orders/query_request.go @@ -81,14 +81,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(orderID ids.OrderID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(orderID).(*key.Key), Limit: limit} } diff --git a/x/orders/queries/parameters/query_keeper.go b/x/orders/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/orders/queries/parameters/query_keeper.go +++ b/x/orders/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/orders/queries/parameters/query_request.go b/x/orders/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/orders/queries/parameters/query_request.go +++ b/x/orders/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/splits/queries/balances/query_keeper.go b/x/splits/queries/balances/query_keeper.go index 9fffa3698..6d3b3c9da 100644 --- a/x/splits/queries/balances/query_keeper.go +++ b/x/splits/queries/balances/query_keeper.go @@ -17,7 +17,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/splits/queries/balances/query_request.go b/x/splits/queries/balances/query_request.go index 0b4cbe6ba..733350b94 100644 --- a/x/splits/queries/balances/query_request.go +++ b/x/splits/queries/balances/query_request.go @@ -76,14 +76,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(identityID ids.IdentityID) helpers.QueryRequest { return &QueryRequest{IdentityID: identityID.(*baseIDs.IdentityID)} } diff --git a/x/splits/queries/balances/query_request_test.go b/x/splits/queries/balances/query_request_test.go index 3baab58a7..7bca4476a 100644 --- a/x/splits/queries/balances/query_request_test.go +++ b/x/splits/queries/balances/query_request_test.go @@ -55,7 +55,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) diff --git a/x/splits/queries/parameters/query_keeper.go b/x/splits/queries/parameters/query_keeper.go index 5fcb2eb2d..5ff196b53 100644 --- a/x/splits/queries/parameters/query_keeper.go +++ b/x/splits/queries/parameters/query_keeper.go @@ -12,7 +12,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/splits/queries/parameters/query_request.go b/x/splits/queries/parameters/query_request.go index 72c870310..e0a6ac388 100644 --- a/x/splits/queries/parameters/query_request.go +++ b/x/splits/queries/parameters/query_request.go @@ -35,11 +35,3 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} diff --git a/x/splits/queries/split/query_keeper.go b/x/splits/queries/split/query_keeper.go index 2d430163a..ec41f3fbc 100644 --- a/x/splits/queries/split/query_keeper.go +++ b/x/splits/queries/split/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/splits/queries/split/query_request.go b/x/splits/queries/split/query_request.go index e56e9c7ca..277cdd117 100644 --- a/x/splits/queries/split/query_request.go +++ b/x/splits/queries/split/query_request.go @@ -63,14 +63,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(splitID ids.SplitID) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(splitID).(*key.Key)} } diff --git a/x/splits/queries/split/query_request_test.go b/x/splits/queries/split/query_request_test.go index 17ddf7e39..44ab82f77 100644 --- a/x/splits/queries/split/query_request_test.go +++ b/x/splits/queries/split/query_request_test.go @@ -66,7 +66,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) diff --git a/x/splits/queries/splits/query_keeper.go b/x/splits/queries/splits/query_keeper.go index 51a3b3f03..18415174f 100644 --- a/x/splits/queries/splits/query_keeper.go +++ b/x/splits/queries/splits/query_keeper.go @@ -16,7 +16,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/splits/queries/splits/query_request.go b/x/splits/queries/splits/query_request.go index 975287afb..876f20f2c 100644 --- a/x/splits/queries/splits/query_request.go +++ b/x/splits/queries/splits/query_request.go @@ -82,14 +82,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(splitID ids.SplitID, limit int32) helpers.QueryRequest { return &QueryRequest{Key: key.NewKey(splitID).(*key.Key), Limit: limit} } diff --git a/x/splits/queries/supply/query_keeper.go b/x/splits/queries/supply/query_keeper.go index efc254803..dff136756 100644 --- a/x/splits/queries/supply/query_keeper.go +++ b/x/splits/queries/supply/query_keeper.go @@ -17,7 +17,7 @@ type queryKeeper struct { var _ helpers.QueryKeeper = (*queryKeeper)(nil) func (queryKeeper queryKeeper) Enquire(context context.Context, queryRequest helpers.QueryRequest) (helpers.QueryResponse, error) { - queryResponse, err := queryKeeper.Handle(context, queryRequestFromInterface(queryRequest)) + queryResponse, err := queryKeeper.Handle(context, queryRequest.(*QueryRequest)) return queryResponse, err } func (queryKeeper queryKeeper) Handle(context context.Context, queryRequest *QueryRequest) (*QueryResponse, error) { diff --git a/x/splits/queries/supply/query_request.go b/x/splits/queries/supply/query_request.go index 7a8511b15..8a4cad26f 100644 --- a/x/splits/queries/supply/query_request.go +++ b/x/splits/queries/supply/query_request.go @@ -60,14 +60,7 @@ func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, er func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } -func queryRequestFromInterface(request helpers.QueryRequest) *QueryRequest { - switch value := request.(type) { - case *QueryRequest: - return value - default: - return &QueryRequest{} - } -} + func newQueryRequest(assetID ids.AssetID) helpers.QueryRequest { return &QueryRequest{AssetID: assetID.(*baseIDs.AssetID)} } diff --git a/x/splits/queries/supply/query_request_test.go b/x/splits/queries/supply/query_request_test.go index 503926bcd..2da88492c 100644 --- a/x/splits/queries/supply/query_request_test.go +++ b/x/splits/queries/supply/query_request_test.go @@ -56,7 +56,7 @@ func Test_queryRequestFromInterface(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := queryRequestFromInterface(tt.args.request); !reflect.DeepEqual(got, tt.want) { + if got := tt.args.request.(*QueryRequest); !reflect.DeepEqual(got, tt.want) { t.Errorf("queryRequestFromInterface() = %v, want %v", got, tt.want) } }) From 1658367e40ed4b644f809d600ac40c57300b9070 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 26 Aug 2024 19:11:37 +0530 Subject: [PATCH 35/64] refactor(parameterManager): removing rest&cli query handling logic Signed-off-by: Deepanshu Tripathi --- x/assets/parameters/prototype_test.go | 3 +-- x/classifications/parameters/prototype_test.go | 3 +-- x/identities/parameters/prototype_test.go | 3 +-- x/maintainers/parameters/prototype_test.go | 3 +-- x/metas/parameters/prototype_test.go | 3 +-- x/orders/parameters/prototype_test.go | 3 +-- x/splits/parameters/prototype_test.go | 3 +-- 7 files changed, 7 insertions(+), 14 deletions(-) diff --git a/x/assets/parameters/prototype_test.go b/x/assets/parameters/prototype_test.go index 22ec8ce67..68b0ca640 100644 --- a/x/assets/parameters/prototype_test.go +++ b/x/assets/parameters/prototype_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/assets/constants" "github.com/AssetMantle/modules/x/assets/parameters/burn_enabled" "github.com/AssetMantle/modules/x/assets/parameters/mint_enabled" "github.com/AssetMantle/modules/x/assets/parameters/renumerate_enabled" @@ -21,7 +20,7 @@ func TestPrototype(t *testing.T) { want helpers.ParameterManager wantError error }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, burn_enabled.ValidatableParameter, mint_enabled.ValidatableParameter, renumerate_enabled.ValidatableParameter), nil}, + {"+ve", baseHelpers.NewParameterManager(burn_enabled.ValidatableParameter, mint_enabled.ValidatableParameter, renumerate_enabled.ValidatableParameter), nil}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/classifications/parameters/prototype_test.go b/x/classifications/parameters/prototype_test.go index 6e2fa705b..9aae7870b 100644 --- a/x/classifications/parameters/prototype_test.go +++ b/x/classifications/parameters/prototype_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/classifications/constants" "github.com/AssetMantle/modules/x/classifications/parameters/bond_rate" "github.com/AssetMantle/modules/x/classifications/parameters/max_property_count" ) @@ -20,7 +19,7 @@ func TestPrototype(t *testing.T) { want helpers.ParameterManager wantError error }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, bond_rate.ValidatableParameter, max_property_count.ValidatableParameter), nil}, + {"+ve", baseHelpers.NewParameterManager(bond_rate.ValidatableParameter, max_property_count.ValidatableParameter), nil}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/identities/parameters/prototype_test.go b/x/identities/parameters/prototype_test.go index a4075975d..031efad01 100644 --- a/x/identities/parameters/prototype_test.go +++ b/x/identities/parameters/prototype_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/identities/constants" "github.com/AssetMantle/modules/x/identities/parameters/max_provision_address_count" ) @@ -19,7 +18,7 @@ func TestPrototype(t *testing.T) { want helpers.ParameterManager }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, max_provision_address_count.ValidatableParameter)}, + {"+ve", baseHelpers.NewParameterManager(max_provision_address_count.ValidatableParameter)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/maintainers/parameters/prototype_test.go b/x/maintainers/parameters/prototype_test.go index 42d9528e1..40c949dc6 100644 --- a/x/maintainers/parameters/prototype_test.go +++ b/x/maintainers/parameters/prototype_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/maintainers/constants" "github.com/AssetMantle/modules/x/maintainers/parameters/deputize_allowed" ) @@ -18,7 +17,7 @@ func TestPrototype(t *testing.T) { name string want helpers.ParameterManager }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, deputize_allowed.ValidatableParameter)}, + {"+ve", baseHelpers.NewParameterManager(deputize_allowed.ValidatableParameter)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/metas/parameters/prototype_test.go b/x/metas/parameters/prototype_test.go index 164040a45..69e965d4a 100644 --- a/x/metas/parameters/prototype_test.go +++ b/x/metas/parameters/prototype_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/metas/constants" "github.com/AssetMantle/modules/x/metas/parameters/reveal_enabled" ) @@ -18,7 +17,7 @@ func TestPrototype(t *testing.T) { name string want helpers.ParameterManager }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, reveal_enabled.ValidatableParameter)}, + {"+ve", baseHelpers.NewParameterManager(reveal_enabled.ValidatableParameter)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/orders/parameters/prototype_test.go b/x/orders/parameters/prototype_test.go index 3fab7f444..3a6bc1efa 100644 --- a/x/orders/parameters/prototype_test.go +++ b/x/orders/parameters/prototype_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/orders/constants" "github.com/AssetMantle/modules/x/orders/parameters/max_order_life" ) @@ -18,7 +17,7 @@ func TestPrototype(t *testing.T) { name string want helpers.ParameterManager }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, max_order_life.ValidatableParameter)}, + {"+ve", baseHelpers.NewParameterManager(max_order_life.ValidatableParameter)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/splits/parameters/prototype_test.go b/x/splits/parameters/prototype_test.go index 394a2f8ed..36c5813d6 100644 --- a/x/splits/parameters/prototype_test.go +++ b/x/splits/parameters/prototype_test.go @@ -10,7 +10,6 @@ import ( "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/assets/parameters/wrap_allowed_coins" - "github.com/AssetMantle/modules/x/splits/constants" ) func TestPrototype(t *testing.T) { @@ -18,7 +17,7 @@ func TestPrototype(t *testing.T) { name string want helpers.ParameterManager }{ - {"+ve", baseHelpers.NewParameterManager(constants.ModuleName, wrap_allowed_coins.ValidatableParameter)}, + {"+ve", baseHelpers.NewParameterManager(wrap_allowed_coins.ValidatableParameter)}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 36dda9182618ee4758b734fbf54cc2876de19fc6 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Tue, 27 Aug 2024 18:00:27 +0530 Subject: [PATCH 36/64] feat: defining GRPCRequest interface Signed-off-by: Deepanshu Tripathi --- helpers/{request.go => grpc_request.go} | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) rename helpers/{request.go => grpc_request.go} (58%) diff --git a/helpers/request.go b/helpers/grpc_request.go similarity index 58% rename from helpers/request.go rename to helpers/grpc_request.go index 9a5b88ed3..31a204255 100644 --- a/helpers/request.go +++ b/helpers/grpc_request.go @@ -3,6 +3,9 @@ package helpers -type Request interface { - Validate() error +import "github.com/cosmos/gogoproto/proto" + +type GRPCRequest interface { + proto.Message + Request } From f788d432f6a63982a00b0196b0eba5d5cd797659 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Thu, 29 Aug 2024 14:15:35 +0530 Subject: [PATCH 37/64] refactor(common transaction request): replacing complex types with string for simplicity Signed-off-by: Deepanshu Tripathi --- helpers/base/common_transaction_request.go | 60 +++++++++++++++------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/helpers/base/common_transaction_request.go b/helpers/base/common_transaction_request.go index ab909f496..68574cc00 100644 --- a/helpers/base/common_transaction_request.go +++ b/helpers/base/common_transaction_request.go @@ -11,17 +11,17 @@ import ( ) type commonTransactionRequest struct { - From string `json:"from"` - Memo string `json:"memo"` - TimeoutHeight uint64 `json:"timeout_height"` - AccountNumber uint64 `json:"account_number"` - Sequence uint64 `json:"sequence"` - ChainID string `json:"chain_id"` - Gas string `json:"gas"` - Fees sdkTypes.Coins `json:"fees"` - GasPrices sdkTypes.DecCoins `json:"gas_prices"` - Simulate bool `json:"simulate"` - GasAdjustment string `json:"gas_adjustment"` + From string `json:"from"` + Memo string `json:"memo"` + TimeoutHeight uint64 `json:"timeout_height"` + AccountNumber uint64 `json:"account_number"` + Sequence uint64 `json:"sequence"` + ChainID string `json:"chain_id"` + Gas string `json:"gas"` + Fees string `json:"fees"` + GasPrices string `json:"gas_prices"` + Simulate bool `json:"simulate"` + GasAdjustment string `json:"gas_adjustment"` } var _ helpers.CommonTransactionRequest = commonTransactionRequest{} @@ -53,7 +53,12 @@ func (commonTransactionRequest commonTransactionRequest) GetTimeoutHeight() uint return commonTransactionRequest.TimeoutHeight } func (commonTransactionRequest commonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { - return commonTransactionRequest.GasPrices + decCoins, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices) + if err != nil { + panic(err) + } + + return decCoins } func (commonTransactionRequest commonTransactionRequest) IsSimulated() bool { return commonTransactionRequest.Simulate @@ -69,21 +74,34 @@ func (commonTransactionRequest commonTransactionRequest) SetChainID(chainIDStrin return commonTransactionRequest } func (commonTransactionRequest commonTransactionRequest) GetFees() sdkTypes.Coins { - return commonTransactionRequest.Fees + coins, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees) + if err != nil { + panic(err) + } + + return coins } func (commonTransactionRequest commonTransactionRequest) Validate() error { if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) } + if _, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices); err != nil { + return fmt.Errorf("invalid gas prices %s", commonTransactionRequest.GasPrices) + } + + if _, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees); err != nil { + return fmt.Errorf("invalid fees %s", commonTransactionRequest.Fees) + } + if !commonTransactionRequest.Simulate { if len(commonTransactionRequest.ChainID) == 0 { return fmt.Errorf("chain-id required but not specified") } - if !commonTransactionRequest.Fees.IsZero() && !commonTransactionRequest.GasPrices.IsZero() { + if !commonTransactionRequest.GetFees().IsZero() && !commonTransactionRequest.GetGasPrices().IsZero() { return fmt.Errorf("cannot provide both fees and gas prices") } - if !commonTransactionRequest.Fees.IsValid() && !commonTransactionRequest.GasPrices.IsValid() { + if !commonTransactionRequest.GetFees().IsValid() && !commonTransactionRequest.GetGasPrices().IsValid() { return fmt.Errorf("invalid fees or gas prices provided") } } @@ -102,13 +120,13 @@ func (commonTransactionRequest commonTransactionRequest) ValidateBasic(responseW return true } -func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees sdkTypes.Coins, gasPrices sdkTypes.DecCoins, simulate bool) helpers.CommonTransactionRequest { +func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees, gasPrices string, simulate bool) helpers.CommonTransactionRequest { return commonTransactionRequest{ From: strings.TrimSpace(from), Memo: strings.TrimSpace(memo), ChainID: strings.TrimSpace(chainID), - Fees: fees, - GasPrices: gasPrices, + Fees: strings.TrimSpace(fees), + GasPrices: strings.TrimSpace(gasPrices), Gas: strings.TrimSpace(gas), GasAdjustment: strings.TrimSpace(gasAdjustment), AccountNumber: accountNumber, @@ -122,5 +140,9 @@ func PrototypeCommonTransactionRequest() helpers.CommonTransactionRequest { } func NewCommonTransactionRequestFromContext(context client.Context) helpers.CommonTransactionRequest { - return NewCommonTransactionRequest(context.From, "", context.ChainID, "", "", uint64(context.Height), 0, 0, sdkTypes.Coins{}, sdkTypes.DecCoins{}, context.Simulate) + return commonTransactionRequest{ + From: context.FromAddress.String(), + ChainID: context.ChainID, + Simulate: context.Simulate, + } } From 2505e43330e4d26bd9401fcbb21395430d72efc8 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Thu, 29 Aug 2024 14:46:05 +0530 Subject: [PATCH 38/64] refactor(common transaction request): following naming convention Signed-off-by: Deepanshu Tripathi --- helpers/base/common_transaction_request.go | 54 +++++++++++----------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/helpers/base/common_transaction_request.go b/helpers/base/common_transaction_request.go index 68574cc00..a24e46b65 100644 --- a/helpers/base/common_transaction_request.go +++ b/helpers/base/common_transaction_request.go @@ -10,49 +10,49 @@ import ( "strings" ) -type commonTransactionRequest struct { +type CommonTransactionRequest struct { From string `json:"from"` Memo string `json:"memo"` - TimeoutHeight uint64 `json:"timeout_height"` - AccountNumber uint64 `json:"account_number"` + TimeoutHeight uint64 `json:"timeoutHeight"` + AccountNumber uint64 `json:"accountNumber"` Sequence uint64 `json:"sequence"` - ChainID string `json:"chain_id"` + ChainID string `json:"chainID"` Gas string `json:"gas"` Fees string `json:"fees"` - GasPrices string `json:"gas_prices"` + GasPrices string `json:"gasPrices"` Simulate bool `json:"simulate"` - GasAdjustment string `json:"gas_adjustment"` + GasAdjustment string `json:"gasAdjustment"` } -var _ helpers.CommonTransactionRequest = commonTransactionRequest{} +var _ helpers.CommonTransactionRequest = CommonTransactionRequest{} -func (commonTransactionRequest commonTransactionRequest) SetFrom(from string) helpers.CommonTransactionRequest { +func (commonTransactionRequest CommonTransactionRequest) SetFrom(from string) helpers.CommonTransactionRequest { commonTransactionRequest.From = from return commonTransactionRequest } -func (commonTransactionRequest commonTransactionRequest) SetAccountNumber(accountNumber uint64) helpers.CommonTransactionRequest { +func (commonTransactionRequest CommonTransactionRequest) SetAccountNumber(accountNumber uint64) helpers.CommonTransactionRequest { commonTransactionRequest.AccountNumber = accountNumber return commonTransactionRequest } -func (commonTransactionRequest commonTransactionRequest) GetAccountNumber() uint64 { +func (commonTransactionRequest CommonTransactionRequest) GetAccountNumber() uint64 { return commonTransactionRequest.AccountNumber } -func (commonTransactionRequest commonTransactionRequest) GetGas() string { +func (commonTransactionRequest CommonTransactionRequest) GetGas() string { return commonTransactionRequest.Gas } -func (commonTransactionRequest commonTransactionRequest) GetGasAdjustment() string { +func (commonTransactionRequest CommonTransactionRequest) GetGasAdjustment() string { return commonTransactionRequest.GasAdjustment } -func (commonTransactionRequest commonTransactionRequest) GetMemo() string { +func (commonTransactionRequest CommonTransactionRequest) GetMemo() string { return commonTransactionRequest.Memo } -func (commonTransactionRequest commonTransactionRequest) GetSequence() uint64 { +func (commonTransactionRequest CommonTransactionRequest) GetSequence() uint64 { return commonTransactionRequest.Sequence } -func (commonTransactionRequest commonTransactionRequest) GetTimeoutHeight() uint64 { +func (commonTransactionRequest CommonTransactionRequest) GetTimeoutHeight() uint64 { return commonTransactionRequest.TimeoutHeight } -func (commonTransactionRequest commonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { +func (commonTransactionRequest CommonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { decCoins, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices) if err != nil { panic(err) @@ -60,20 +60,20 @@ func (commonTransactionRequest commonTransactionRequest) GetGasPrices() sdkTypes return decCoins } -func (commonTransactionRequest commonTransactionRequest) IsSimulated() bool { +func (commonTransactionRequest CommonTransactionRequest) IsSimulated() bool { return commonTransactionRequest.Simulate } -func (commonTransactionRequest commonTransactionRequest) GetFrom() string { +func (commonTransactionRequest CommonTransactionRequest) GetFrom() string { return commonTransactionRequest.From } -func (commonTransactionRequest commonTransactionRequest) GetChainID() string { +func (commonTransactionRequest CommonTransactionRequest) GetChainID() string { return commonTransactionRequest.ChainID } -func (commonTransactionRequest commonTransactionRequest) SetChainID(chainIDString string) helpers.CommonTransactionRequest { +func (commonTransactionRequest CommonTransactionRequest) SetChainID(chainIDString string) helpers.CommonTransactionRequest { commonTransactionRequest.ChainID = chainIDString return commonTransactionRequest } -func (commonTransactionRequest commonTransactionRequest) GetFees() sdkTypes.Coins { +func (commonTransactionRequest CommonTransactionRequest) GetFees() sdkTypes.Coins { coins, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees) if err != nil { panic(err) @@ -81,7 +81,7 @@ func (commonTransactionRequest commonTransactionRequest) GetFees() sdkTypes.Coin return coins } -func (commonTransactionRequest commonTransactionRequest) Validate() error { +func (commonTransactionRequest CommonTransactionRequest) Validate() error { if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) } @@ -108,10 +108,10 @@ func (commonTransactionRequest commonTransactionRequest) Validate() error { return nil } -func (commonTransactionRequest commonTransactionRequest) Sanitize() helpers.CommonTransactionRequest { +func (commonTransactionRequest CommonTransactionRequest) Sanitize() helpers.CommonTransactionRequest { return NewCommonTransactionRequest(commonTransactionRequest.From, commonTransactionRequest.Memo, commonTransactionRequest.ChainID, commonTransactionRequest.Gas, commonTransactionRequest.GasAdjustment, commonTransactionRequest.AccountNumber, commonTransactionRequest.TimeoutHeight, commonTransactionRequest.Sequence, commonTransactionRequest.Fees, commonTransactionRequest.GasPrices, commonTransactionRequest.Simulate) } -func (commonTransactionRequest commonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { +func (commonTransactionRequest CommonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { if err := commonTransactionRequest.Validate(); err != nil { rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) return false @@ -121,7 +121,7 @@ func (commonTransactionRequest commonTransactionRequest) ValidateBasic(responseW } func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees, gasPrices string, simulate bool) helpers.CommonTransactionRequest { - return commonTransactionRequest{ + return CommonTransactionRequest{ From: strings.TrimSpace(from), Memo: strings.TrimSpace(memo), ChainID: strings.TrimSpace(chainID), @@ -136,11 +136,11 @@ func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, } } func PrototypeCommonTransactionRequest() helpers.CommonTransactionRequest { - return &commonTransactionRequest{} + return &CommonTransactionRequest{} } func NewCommonTransactionRequestFromContext(context client.Context) helpers.CommonTransactionRequest { - return commonTransactionRequest{ + return CommonTransactionRequest{ From: context.FromAddress.String(), ChainID: context.ChainID, Simulate: context.Simulate, From c6a5f779c1294b278c157d75e263ce1c32c83ece Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Thu, 29 Aug 2024 15:42:10 +0530 Subject: [PATCH 39/64] refactor(common transaction request): from interface to struct Signed-off-by: Deepanshu Tripathi --- helpers/base/amino_codec.go | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 helpers/base/amino_codec.go diff --git a/helpers/base/amino_codec.go b/helpers/base/amino_codec.go deleted file mode 100644 index 95eafccdb..000000000 --- a/helpers/base/amino_codec.go +++ /dev/null @@ -1,10 +0,0 @@ -package base - -import ( - "github.com/AssetMantle/schema/codec/utilities" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" -) - -func RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - utilities.RegisterModuleConcrete(legacyAmino, commonTransactionRequest{}) -} From 3a2833b038d5ca0713193fdbddd1be00d0cb0cee Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:45:43 +0530 Subject: [PATCH 40/64] chore: import formatting Signed-off-by: Deepanshu Tripathi --- helpers/base/validatable_parameter.go | 3 +-- helpers/base/wasm_message.go | 1 - x/assets/transactions/burn/transaction_response.go | 3 +-- x/assets/transactions/define/transaction_response.go | 3 +-- x/assets/transactions/deputize/transaction_response.go | 3 +-- x/assets/transactions/mint/transaction_response.go | 3 +-- x/assets/transactions/mutate/transaction_response.go | 3 +-- x/assets/transactions/renumerate/transaction_response.go | 3 +-- x/assets/transactions/revoke/transaction_response.go | 3 +-- x/assets/transactions/send/transaction_response.go | 3 +-- x/assets/transactions/unwrap/transaction_response.go | 3 +-- x/assets/transactions/wrap/transaction_response.go | 3 +-- x/identities/transactions/define/transaction_response.go | 3 +-- x/identities/transactions/deputize/transaction_response.go | 3 +-- x/identities/transactions/issue/transaction_response.go | 3 +-- x/identities/transactions/name/transaction_response.go | 3 +-- x/identities/transactions/provision/transaction_response.go | 3 +-- x/identities/transactions/quash/transaction_response.go | 3 +-- x/identities/transactions/revoke/transaction_response.go | 3 +-- x/identities/transactions/unprovision/transaction_response.go | 3 +-- x/identities/transactions/update/transaction_response.go | 3 +-- x/metas/transactions/reveal/transaction_response.go | 3 +-- x/orders/transactions/cancel/transaction_response.go | 3 +-- x/orders/transactions/define/transaction_response.go | 3 +-- x/orders/transactions/deputize/transaction_response.go | 3 +-- x/orders/transactions/get/transaction_response.go | 3 +-- x/orders/transactions/immediate/transaction_response.go | 3 +-- x/orders/transactions/make/transaction_response.go | 3 +-- x/orders/transactions/modify/transaction_response.go | 3 +-- x/orders/transactions/put/transaction_response.go | 3 +-- x/orders/transactions/revoke/transaction_response.go | 3 +-- x/orders/transactions/take/transaction_response.go | 3 +-- 32 files changed, 31 insertions(+), 63 deletions(-) diff --git a/helpers/base/validatable_parameter.go b/helpers/base/validatable_parameter.go index 4f99ee11c..f287d83b6 100644 --- a/helpers/base/validatable_parameter.go +++ b/helpers/base/validatable_parameter.go @@ -1,10 +1,9 @@ package base import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/parameters" - - "github.com/AssetMantle/modules/helpers" ) type validatableParameter struct { diff --git a/helpers/base/wasm_message.go b/helpers/base/wasm_message.go index 68031b345..cc1fd40d9 100644 --- a/helpers/base/wasm_message.go +++ b/helpers/base/wasm_message.go @@ -5,7 +5,6 @@ package base import ( "encoding/json" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/assets/transactions/burn/transaction_response.go b/x/assets/transactions/burn/transaction_response.go index b269d2181..efdc2534e 100644 --- a/x/assets/transactions/burn/transaction_response.go +++ b/x/assets/transactions/burn/transaction_response.go @@ -4,9 +4,8 @@ package burn import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/define/transaction_response.go b/x/assets/transactions/define/transaction_response.go index 967e6fe64..f6ca39134 100644 --- a/x/assets/transactions/define/transaction_response.go +++ b/x/assets/transactions/define/transaction_response.go @@ -4,11 +4,10 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/deputize/transaction_response.go b/x/assets/transactions/deputize/transaction_response.go index 8642b0b49..1af3c6455 100644 --- a/x/assets/transactions/deputize/transaction_response.go +++ b/x/assets/transactions/deputize/transaction_response.go @@ -4,9 +4,8 @@ package deputize import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/mint/transaction_response.go b/x/assets/transactions/mint/transaction_response.go index 4bc62f2d4..e652e1499 100644 --- a/x/assets/transactions/mint/transaction_response.go +++ b/x/assets/transactions/mint/transaction_response.go @@ -4,11 +4,10 @@ package mint import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/mutate/transaction_response.go b/x/assets/transactions/mutate/transaction_response.go index c41a27426..cba850907 100644 --- a/x/assets/transactions/mutate/transaction_response.go +++ b/x/assets/transactions/mutate/transaction_response.go @@ -4,9 +4,8 @@ package mutate import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/renumerate/transaction_response.go b/x/assets/transactions/renumerate/transaction_response.go index 54df55808..b1371aed2 100644 --- a/x/assets/transactions/renumerate/transaction_response.go +++ b/x/assets/transactions/renumerate/transaction_response.go @@ -4,9 +4,8 @@ package renumerate import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/revoke/transaction_response.go b/x/assets/transactions/revoke/transaction_response.go index 53eebfc72..272941180 100644 --- a/x/assets/transactions/revoke/transaction_response.go +++ b/x/assets/transactions/revoke/transaction_response.go @@ -4,9 +4,8 @@ package revoke import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/send/transaction_response.go b/x/assets/transactions/send/transaction_response.go index 251ff9b5c..1cf371f2f 100644 --- a/x/assets/transactions/send/transaction_response.go +++ b/x/assets/transactions/send/transaction_response.go @@ -4,9 +4,8 @@ package send import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/unwrap/transaction_response.go b/x/assets/transactions/unwrap/transaction_response.go index b1090862f..6e1187835 100644 --- a/x/assets/transactions/unwrap/transaction_response.go +++ b/x/assets/transactions/unwrap/transaction_response.go @@ -4,9 +4,8 @@ package unwrap import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/assets/transactions/wrap/transaction_response.go b/x/assets/transactions/wrap/transaction_response.go index ddac0e69c..43ae7add5 100644 --- a/x/assets/transactions/wrap/transaction_response.go +++ b/x/assets/transactions/wrap/transaction_response.go @@ -4,9 +4,8 @@ package wrap import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/define/transaction_response.go b/x/identities/transactions/define/transaction_response.go index 967e6fe64..f6ca39134 100644 --- a/x/identities/transactions/define/transaction_response.go +++ b/x/identities/transactions/define/transaction_response.go @@ -4,11 +4,10 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/deputize/transaction_response.go b/x/identities/transactions/deputize/transaction_response.go index 8642b0b49..1af3c6455 100644 --- a/x/identities/transactions/deputize/transaction_response.go +++ b/x/identities/transactions/deputize/transaction_response.go @@ -4,9 +4,8 @@ package deputize import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/issue/transaction_response.go b/x/identities/transactions/issue/transaction_response.go index cab246b7f..86df9c7d6 100644 --- a/x/identities/transactions/issue/transaction_response.go +++ b/x/identities/transactions/issue/transaction_response.go @@ -4,11 +4,10 @@ package issue import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/name/transaction_response.go b/x/identities/transactions/name/transaction_response.go index a25d43961..2e027e814 100644 --- a/x/identities/transactions/name/transaction_response.go +++ b/x/identities/transactions/name/transaction_response.go @@ -4,11 +4,10 @@ package name import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/provision/transaction_response.go b/x/identities/transactions/provision/transaction_response.go index 02b905726..c29c67c66 100644 --- a/x/identities/transactions/provision/transaction_response.go +++ b/x/identities/transactions/provision/transaction_response.go @@ -4,9 +4,8 @@ package provision import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/quash/transaction_response.go b/x/identities/transactions/quash/transaction_response.go index 9ca640132..41457dad8 100644 --- a/x/identities/transactions/quash/transaction_response.go +++ b/x/identities/transactions/quash/transaction_response.go @@ -4,9 +4,8 @@ package quash import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/revoke/transaction_response.go b/x/identities/transactions/revoke/transaction_response.go index 53eebfc72..272941180 100644 --- a/x/identities/transactions/revoke/transaction_response.go +++ b/x/identities/transactions/revoke/transaction_response.go @@ -4,9 +4,8 @@ package revoke import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/unprovision/transaction_response.go b/x/identities/transactions/unprovision/transaction_response.go index 6259467bc..70dbe26a4 100644 --- a/x/identities/transactions/unprovision/transaction_response.go +++ b/x/identities/transactions/unprovision/transaction_response.go @@ -4,9 +4,8 @@ package unprovision import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/identities/transactions/update/transaction_response.go b/x/identities/transactions/update/transaction_response.go index 14c3b21ee..8e7c751f1 100644 --- a/x/identities/transactions/update/transaction_response.go +++ b/x/identities/transactions/update/transaction_response.go @@ -4,9 +4,8 @@ package update import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/metas/transactions/reveal/transaction_response.go b/x/metas/transactions/reveal/transaction_response.go index 69806b91f..bb0763e31 100644 --- a/x/metas/transactions/reveal/transaction_response.go +++ b/x/metas/transactions/reveal/transaction_response.go @@ -4,9 +4,8 @@ package reveal import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/cancel/transaction_response.go b/x/orders/transactions/cancel/transaction_response.go index 6c9cd7d00..6d28d27ee 100644 --- a/x/orders/transactions/cancel/transaction_response.go +++ b/x/orders/transactions/cancel/transaction_response.go @@ -4,9 +4,8 @@ package cancel import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/define/transaction_response.go b/x/orders/transactions/define/transaction_response.go index 967e6fe64..f6ca39134 100644 --- a/x/orders/transactions/define/transaction_response.go +++ b/x/orders/transactions/define/transaction_response.go @@ -4,11 +4,10 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/deputize/transaction_response.go b/x/orders/transactions/deputize/transaction_response.go index 8642b0b49..1af3c6455 100644 --- a/x/orders/transactions/deputize/transaction_response.go +++ b/x/orders/transactions/deputize/transaction_response.go @@ -4,9 +4,8 @@ package deputize import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/get/transaction_response.go b/x/orders/transactions/get/transaction_response.go index 11e7acdbd..ca085c64d 100644 --- a/x/orders/transactions/get/transaction_response.go +++ b/x/orders/transactions/get/transaction_response.go @@ -4,9 +4,8 @@ package get import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/immediate/transaction_response.go b/x/orders/transactions/immediate/transaction_response.go index 2516ae53d..28614e8e8 100644 --- a/x/orders/transactions/immediate/transaction_response.go +++ b/x/orders/transactions/immediate/transaction_response.go @@ -4,9 +4,8 @@ package immediate import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/make/transaction_response.go b/x/orders/transactions/make/transaction_response.go index 0f646fcce..34767a9c1 100644 --- a/x/orders/transactions/make/transaction_response.go +++ b/x/orders/transactions/make/transaction_response.go @@ -4,11 +4,10 @@ package make import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/modify/transaction_response.go b/x/orders/transactions/modify/transaction_response.go index 83f6ab745..cf6e8bd50 100644 --- a/x/orders/transactions/modify/transaction_response.go +++ b/x/orders/transactions/modify/transaction_response.go @@ -4,9 +4,8 @@ package modify import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/put/transaction_response.go b/x/orders/transactions/put/transaction_response.go index 0092d1f2b..4c491f30b 100644 --- a/x/orders/transactions/put/transaction_response.go +++ b/x/orders/transactions/put/transaction_response.go @@ -4,11 +4,10 @@ package put import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/revoke/transaction_response.go b/x/orders/transactions/revoke/transaction_response.go index 53eebfc72..272941180 100644 --- a/x/orders/transactions/revoke/transaction_response.go +++ b/x/orders/transactions/revoke/transaction_response.go @@ -4,9 +4,8 @@ package revoke import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) diff --git a/x/orders/transactions/take/transaction_response.go b/x/orders/transactions/take/transaction_response.go index 2ac97e257..bec83749a 100644 --- a/x/orders/transactions/take/transaction_response.go +++ b/x/orders/transactions/take/transaction_response.go @@ -4,9 +4,8 @@ package take import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.TransactionResponse = (*TransactionResponse)(nil) From 6b30a6b548988d6f7f8938e8f9c35a5ae8d8adab Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:47:30 +0530 Subject: [PATCH 41/64] refactor: making common transaction request public Signed-off-by: Deepanshu Tripathi --- .../burn/transaction_request_test.go | 3 +-- .../define/transaction_request_test.go | 8 ++++---- .../deputize/transaction_request_test.go | 3 +-- .../mint/transaction_request_test.go | 3 +-- .../mutate/transaction_request_test.go | 3 +-- .../renumerate/transaction_request_test.go | 3 +-- .../revoke/transaction_request_test.go | 3 +-- .../send/transaction_request_test.go | 2 +- .../unwrap/transaction_request_test.go | 3 +-- .../wrap/transaction_request_test.go | 2 +- .../define/transaction_request_test.go | 14 +++++++------- .../deputize/transaction_request_test.go | 16 ++++++++-------- .../issue/transaction_request_test.go | 4 ++-- .../name/transaction_request_test.go | 2 +- .../provision/transaction_request_test.go | 2 +- .../quash/transaction_request_test.go | 2 +- .../revoke/transaction_request_test.go | 2 +- .../unprovision/transaction_request_test.go | 2 +- .../update/transaction_request_test.go | 4 ++-- .../reveal/transaction_request_test.go | 8 ++++---- .../cancel/transaction_request_test.go | 2 +- .../define/transaction_request_test.go | 2 +- .../deputize/transaction_request_test.go | 2 +- .../transactions/get/transaction_request_test.go | 2 +- .../immediate/transaction_request_test.go | 2 +- .../make/transaction_request_test.go | 2 +- .../modify/transaction_request_test.go | 2 +- .../transactions/put/transaction_request_test.go | 2 +- .../revoke/transaction_request_test.go | 2 +- .../take/transaction_request_test.go | 2 +- 30 files changed, 51 insertions(+), 58 deletions(-) diff --git a/x/assets/transactions/burn/transaction_request_test.go b/x/assets/transactions/burn/transaction_request_test.go index 2d089c677..3e38710a1 100644 --- a/x/assets/transactions/burn/transaction_request_test.go +++ b/x/assets/transactions/burn/transaction_request_test.go @@ -11,7 +11,6 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -22,7 +21,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/assets/transactions/define/transaction_request_test.go b/x/assets/transactions/define/transaction_request_test.go index 5e6d8dab7..c648cf477 100644 --- a/x/assets/transactions/define/transaction_request_test.go +++ b/x/assets/transactions/define/transaction_request_test.go @@ -10,11 +10,11 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" "reflect" "testing" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -25,7 +25,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() immutableMetaPropertiesString = "testImmutableMeta1:S|immutableMeta" immutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testImmutableMeta1"), baseData.NewStringData("immutableMeta"))) immutablePropertiesString = "testImmutable1:S|immutable" @@ -253,14 +253,14 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { MutableProperties string } type args struct { - legacyAmino *codec.LegacyAmino + legacyAmino *sdkCodec.LegacyAmino } tests := []struct { name string fields fields args args }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, + {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{sdkCodec.NewLegacyAmino()}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { diff --git a/x/assets/transactions/deputize/transaction_request_test.go b/x/assets/transactions/deputize/transaction_request_test.go index 141b432fe..465c16f57 100644 --- a/x/assets/transactions/deputize/transaction_request_test.go +++ b/x/assets/transactions/deputize/transaction_request_test.go @@ -14,7 +14,6 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -25,7 +24,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() mutableMetaPropertiesString = "testMutableMeta1:S|mutableMeta" mutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testMutableMeta1"), baseData.NewStringData("mutableMeta"))) ) diff --git a/x/assets/transactions/mint/transaction_request_test.go b/x/assets/transactions/mint/transaction_request_test.go index 37483177a..fa1111bde 100644 --- a/x/assets/transactions/mint/transaction_request_test.go +++ b/x/assets/transactions/mint/transaction_request_test.go @@ -14,7 +14,6 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -25,7 +24,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() immutableMetaPropertiesString = "testImmutableMeta1:S|immutableMeta" immutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testImmutableMeta1"), baseData.NewStringData("immutableMeta"))) immutablePropertiesString = "testImmutable1:S|immutable" diff --git a/x/assets/transactions/mutate/transaction_request_test.go b/x/assets/transactions/mutate/transaction_request_test.go index 07edbaad4..2fac005e9 100644 --- a/x/assets/transactions/mutate/transaction_request_test.go +++ b/x/assets/transactions/mutate/transaction_request_test.go @@ -14,7 +14,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -25,7 +24,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() mutableMetaPropertiesString = "testMutableMeta1:S|mutableMeta" mutableMetaProperties1 = baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("testMutableMeta1"), baseData.NewStringData("mutableMeta"))) mutablePropertiesString = "testMutable1:S|mutable" diff --git a/x/assets/transactions/renumerate/transaction_request_test.go b/x/assets/transactions/renumerate/transaction_request_test.go index 051313f6f..5f0cdab69 100644 --- a/x/assets/transactions/renumerate/transaction_request_test.go +++ b/x/assets/transactions/renumerate/transaction_request_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -21,7 +20,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/assets/transactions/revoke/transaction_request_test.go b/x/assets/transactions/revoke/transaction_request_test.go index 1c8604ad7..9474c1f73 100644 --- a/x/assets/transactions/revoke/transaction_request_test.go +++ b/x/assets/transactions/revoke/transaction_request_test.go @@ -10,7 +10,6 @@ import ( "testing" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" @@ -21,7 +20,7 @@ import ( ) var ( - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/assets/transactions/send/transaction_request_test.go b/x/assets/transactions/send/transaction_request_test.go index 02036837e..7fed43a68 100644 --- a/x/assets/transactions/send/transaction_request_test.go +++ b/x/assets/transactions/send/transaction_request_test.go @@ -24,7 +24,7 @@ import ( var ( fromAccAddress, _ = types.AccAddressFromBech32(fromAddress.String()) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() fromID = baseIDs.PrototypeIdentityID().(*baseIDs.IdentityID) testRate = types.OneInt() ) diff --git a/x/assets/transactions/unwrap/transaction_request_test.go b/x/assets/transactions/unwrap/transaction_request_test.go index 1021f14f7..3d52fe4e5 100644 --- a/x/assets/transactions/unwrap/transaction_request_test.go +++ b/x/assets/transactions/unwrap/transaction_request_test.go @@ -18,7 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" "github.com/stretchr/testify/require" "reflect" @@ -28,7 +27,7 @@ import ( var ( fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) classificationID = baseIDs.NewClassificationID(immutables, mutables) diff --git a/x/assets/transactions/wrap/transaction_request_test.go b/x/assets/transactions/wrap/transaction_request_test.go index 12aad2d5c..13173a9c5 100644 --- a/x/assets/transactions/wrap/transaction_request_test.go +++ b/x/assets/transactions/wrap/transaction_request_test.go @@ -29,7 +29,7 @@ import ( var ( fromAddress = "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" fromAccAddress, _ = types.AccAddressFromBech32(fromAddress) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() immutables = baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) mutables = baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) classificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) diff --git a/x/identities/transactions/define/transaction_request_test.go b/x/identities/transactions/define/transaction_request_test.go index 7e904beaf..ceda56ad9 100644 --- a/x/identities/transactions/define/transaction_request_test.go +++ b/x/identities/transactions/define/transaction_request_test.go @@ -30,7 +30,7 @@ func Test_newTransactionRequest(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type args struct { commonTransactionRequest helpers.CommonTransactionRequest fromID string @@ -77,7 +77,7 @@ func Test_transactionRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.FromIdentityID, constants.ImmutableMetaProperties, constants.ImmutableProperties, constants.MutableMetaProperties, constants.MutableProperties}) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string @@ -128,7 +128,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}) type fields struct { @@ -179,7 +179,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string @@ -231,7 +231,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() testIdentity := baseIDs.NewIdentityID(baseIDs.NewClassificationID(baseQualified.NewImmutables(immutableProperties), baseQualified.NewMutables(mutableProperties)), baseQualified.NewImmutables(immutableProperties)) @@ -280,7 +280,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string @@ -320,7 +320,7 @@ func Test_transactionRequest_Validate(t *testing.T) { mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" mutablePropertiesString := "defaultMutable1:S|defaultMutable1" fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string diff --git a/x/identities/transactions/deputize/transaction_request_test.go b/x/identities/transactions/deputize/transaction_request_test.go index f2b0bf687..2b588553f 100644 --- a/x/identities/transactions/deputize/transaction_request_test.go +++ b/x/identities/transactions/deputize/transaction_request_test.go @@ -21,7 +21,7 @@ func Test_newTransactionRequest(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress).SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress).SetFrom(fromAddress) type args struct { commonTransactionRequest helpers.CommonTransactionRequest fromID string @@ -93,9 +93,9 @@ func Test_transactionRequest_FromCLI(t *testing.T) { wantErr bool }{ {"+ve", - fields{commonTransactionRequest: baseHelpers.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, + fields{commonTransactionRequest: helpers.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, args{cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())}, - transactionRequest{CommonTransactionRequest: baseHelpers.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, + transactionRequest{CommonTransactionRequest: helpers.PrototypeCommonTransactionRequest(), FromID: "", ToID: "", ClassificationID: "", MaintainedProperties: "", CanIssueIdentity: false, CanQuashIdentity: false, CanAddMaintainer: false, CanRemoveMaintainer: false, CanMutateMaintainer: false}, false, }} for _, tt := range tests { @@ -124,7 +124,7 @@ func Test_transactionRequest_FromJSON(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) jsonMessage, _ := json.Marshal(newTransactionRequest(commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false)) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -180,7 +180,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string @@ -225,7 +225,7 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { testFromID, testToID, testClassificationID, fromAccAddress, maintainedProperties := createTestInput(t) - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string @@ -271,7 +271,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string @@ -317,7 +317,7 @@ func Test_transactionRequest_Validate(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) type fields struct { commonTransactionRequest helpers.CommonTransactionRequest FromID string diff --git a/x/identities/transactions/issue/transaction_request_test.go b/x/identities/transactions/issue/transaction_request_test.go index ecc9b4a04..1809b1392 100644 --- a/x/identities/transactions/issue/transaction_request_test.go +++ b/x/identities/transactions/issue/transaction_request_test.go @@ -60,7 +60,7 @@ func createTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom toAccAddress, err = sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, toAddress, toAccAddress, commonTransactionRequest } @@ -337,7 +337,7 @@ func Test_transactionRequest_RegisterCodec(t *testing.T) { func Test_transactionRequest_Validate(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) - commonTransactionRequest1 := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest1 := helpers.PrototypeCommonTransactionRequest() type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/identities/transactions/name/transaction_request_test.go b/x/identities/transactions/name/transaction_request_test.go index 39c5fbf45..f96157a64 100644 --- a/x/identities/transactions/name/transaction_request_test.go +++ b/x/identities/transactions/name/transaction_request_test.go @@ -29,7 +29,7 @@ func CreateTestInputForRequest(t *testing.T) (*codec.LegacyAmino, helpers.CLICom fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), fromAddress, fromAccAddress, commonTransactionRequest } diff --git a/x/identities/transactions/provision/transaction_request_test.go b/x/identities/transactions/provision/transaction_request_test.go index 316a6d15c..27a8df25f 100644 --- a/x/identities/transactions/provision/transaction_request_test.go +++ b/x/identities/transactions/provision/transaction_request_test.go @@ -30,7 +30,7 @@ func createTestInput(t *testing.T) (helpers.CommonTransactionRequest, string, *b testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID) } diff --git a/x/identities/transactions/quash/transaction_request_test.go b/x/identities/transactions/quash/transaction_request_test.go index 95dd923a8..f4464ae18 100644 --- a/x/identities/transactions/quash/transaction_request_test.go +++ b/x/identities/transactions/quash/transaction_request_test.go @@ -30,7 +30,7 @@ func createTestInput(t *testing.T) (helpers.CommonTransactionRequest, string, *b testClassificationID := baseIDs.NewClassificationID(immutables, mutables) testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID) } diff --git a/x/identities/transactions/revoke/transaction_request_test.go b/x/identities/transactions/revoke/transaction_request_test.go index 57d3de46c..cba75346d 100644 --- a/x/identities/transactions/revoke/transaction_request_test.go +++ b/x/identities/transactions/revoke/transaction_request_test.go @@ -32,7 +32,7 @@ func createTestInput(t *testing.T) (helpers.CommonTransactionRequest, string, *b testFromID := baseIDs.NewIdentityID(testClassificationID, immutables) testToID := baseIDs.NewIdentityID(testClassificationID, immutables) fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) testToAddress := "cosmos1vx8knpllrj7n963p9ttd80w47kpacrhuts497x" return commonTransactionRequest, testToAddress, testFromID.(*baseIDs.IdentityID), testToID.(*baseIDs.IdentityID), testClassificationID.(*baseIDs.ClassificationID) } diff --git a/x/identities/transactions/unprovision/transaction_request_test.go b/x/identities/transactions/unprovision/transaction_request_test.go index 031f44430..480f102de 100644 --- a/x/identities/transactions/unprovision/transaction_request_test.go +++ b/x/identities/transactions/unprovision/transaction_request_test.go @@ -38,7 +38,7 @@ func createInputForMessage(t *testing.T) (*baseIDs.IdentityID, string, types.Acc toAccAddress, err := types.AccAddressFromBech32(toAddress) require.Nil(t, err) - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() testMessage := NewMessage(fromAccAddress, toAccAddress, testIdentityID) diff --git a/x/identities/transactions/update/transaction_request_test.go b/x/identities/transactions/update/transaction_request_test.go index e4b79304c..f789b9076 100644 --- a/x/identities/transactions/update/transaction_request_test.go +++ b/x/identities/transactions/update/transaction_request_test.go @@ -41,7 +41,7 @@ func createTestInput(t *testing.T) (*codec.LegacyAmino, helpers.CLICommand, clie fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) require.Nil(t, err) - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() return legacyAmino, cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype()), mutableMetaPropertiesString, mutablePropertiesString, mutableMetaProperties, mutableProperties, fromAddress, fromAccAddress, commonTransactionRequest } @@ -190,7 +190,7 @@ func Test_transactionRequest_GetBaseReq(t *testing.T) { fields fields want helpers.CommonTransactionRequest }{ - {"+ve", fields{}, baseHelpers.PrototypeCommonTransactionRequest()}, + {"+ve", fields{}, helpers.PrototypeCommonTransactionRequest()}, {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, commonTransactionRequest}, } for _, tt := range tests { diff --git a/x/metas/transactions/reveal/transaction_request_test.go b/x/metas/transactions/reveal/transaction_request_test.go index ce706330a..19f56cd65 100644 --- a/x/metas/transactions/reveal/transaction_request_test.go +++ b/x/metas/transactions/reveal/transaction_request_test.go @@ -21,7 +21,7 @@ func Test_Reveal_Request(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" data := "S|newData" - commonTransactionRequest := baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() testTransactionRequest := newTransactionRequest(commonTransactionRequest, data) require.Equal(t, transactionRequest{CommonTransactionRequest: commonTransactionRequest, Data: data}, testTransactionRequest) @@ -29,7 +29,7 @@ func Test_Reveal_Request(t *testing.T) { requestFromCLI, err := transactionRequest{}.FromCLI(cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())) require.Equal(t, nil, err) - require.Equal(t, transactionRequest{CommonTransactionRequest: baseHelpers.PrototypeCommonTransactionRequest(), Data: ""}, requestFromCLI) + require.Equal(t, transactionRequest{CommonTransactionRequest: helpers.PrototypeCommonTransactionRequest(), Data: ""}, requestFromCLI) jsonMessage, _ := json.Marshal(testTransactionRequest) transactionRequestUnmarshalled, err := transactionRequest{}.FromJSON(jsonMessage) @@ -44,11 +44,11 @@ func Test_Reveal_Request(t *testing.T) { require.Nil(t, err) - msg2, err := newTransactionRequest(baseHelpers.PrototypeCommonTransactionRequest(), data).MakeMsg() + msg2, err := newTransactionRequest(helpers.PrototypeCommonTransactionRequest(), data).MakeMsg() require.NotNil(t, err) require.Nil(t, msg2) - msg2, err = newTransactionRequest(baseHelpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress), "randomString").MakeMsg() + msg2, err = newTransactionRequest(helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress), "randomString").MakeMsg() require.NotNil(t, err) require.Nil(t, msg2) diff --git a/x/orders/transactions/cancel/transaction_request_test.go b/x/orders/transactions/cancel/transaction_request_test.go index 7f1eb7ed8..c765ba66f 100644 --- a/x/orders/transactions/cancel/transaction_request_test.go +++ b/x/orders/transactions/cancel/transaction_request_test.go @@ -36,7 +36,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables) testOrderID1 = baseIDs.PrototypeOrderID() - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/orders/transactions/define/transaction_request_test.go b/x/orders/transactions/define/transaction_request_test.go index fb003cccd..403679a67 100644 --- a/x/orders/transactions/define/transaction_request_test.go +++ b/x/orders/transactions/define/transaction_request_test.go @@ -44,7 +44,7 @@ var ( mutables = base.NewMutables(mutableProperties) testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/orders/transactions/deputize/transaction_request_test.go b/x/orders/transactions/deputize/transaction_request_test.go index 55411df88..a4a26c151 100644 --- a/x/orders/transactions/deputize/transaction_request_test.go +++ b/x/orders/transactions/deputize/transaction_request_test.go @@ -36,7 +36,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables) maintainedPropertyString = "maintainedProperty:S|maintainedProperty" maintainedProperties, _ = base.NewPropertyList().FromMetaPropertiesString(maintainedPropertyString) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/orders/transactions/get/transaction_request_test.go b/x/orders/transactions/get/transaction_request_test.go index a2f9e20a4..656aede4f 100644 --- a/x/orders/transactions/get/transaction_request_test.go +++ b/x/orders/transactions/get/transaction_request_test.go @@ -35,7 +35,7 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() takerSplit = types.NewInt(60) ) diff --git a/x/orders/transactions/immediate/transaction_request_test.go b/x/orders/transactions/immediate/transaction_request_test.go index 432122b34..0c585f5c0 100644 --- a/x/orders/transactions/immediate/transaction_request_test.go +++ b/x/orders/transactions/immediate/transaction_request_test.go @@ -43,7 +43,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("MakerAssetID").GetCoinAssetID().(*baseIDs.AssetID) takerAssetID = baseDocuments.NewCoinAsset("TakerAssetId").GetCoinAssetID().(*baseIDs.AssetID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = types.NewInt(60) takerSplit = types.NewInt(60) diff --git a/x/orders/transactions/make/transaction_request_test.go b/x/orders/transactions/make/transaction_request_test.go index 8e38afd2c..99c72d675 100644 --- a/x/orders/transactions/make/transaction_request_test.go +++ b/x/orders/transactions/make/transaction_request_test.go @@ -43,7 +43,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("makerAssetID").GetCoinAssetID() takerAssetID = baseDocuments.NewCoinAsset("takerAssetID").GetCoinAssetID() - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = sdkTypes.NewInt(60) takerSplit = sdkTypes.NewInt(60) diff --git a/x/orders/transactions/modify/transaction_request_test.go b/x/orders/transactions/modify/transaction_request_test.go index 062bdd34b..4ea99a267 100644 --- a/x/orders/transactions/modify/transaction_request_test.go +++ b/x/orders/transactions/modify/transaction_request_test.go @@ -42,7 +42,7 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() expiresIn = int64(60) makerSplit = types.NewInt(60) takerSplit = types.NewInt(60) diff --git a/x/orders/transactions/put/transaction_request_test.go b/x/orders/transactions/put/transaction_request_test.go index 4961654bc..5cadcf1a1 100644 --- a/x/orders/transactions/put/transaction_request_test.go +++ b/x/orders/transactions/put/transaction_request_test.go @@ -43,7 +43,7 @@ var ( testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) makerAssetID = baseDocuments.NewCoinAsset("makerAssetID").GetCoinAssetID().(*baseIDs.AssetID) takerAssetID = baseDocuments.NewCoinAsset("takerAssetID").GetCoinAssetID().(*baseIDs.AssetID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() expiryHeight = int64(60) makerSplit = sdkTypes.NewInt(60) takerSplit = sdkTypes.NewInt(60) diff --git a/x/orders/transactions/revoke/transaction_request_test.go b/x/orders/transactions/revoke/transaction_request_test.go index d82673c5a..503a2d991 100644 --- a/x/orders/transactions/revoke/transaction_request_test.go +++ b/x/orders/transactions/revoke/transaction_request_test.go @@ -34,7 +34,7 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables).(*baseIDs.ClassificationID) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() ) func Test_newTransactionRequest(t *testing.T) { diff --git a/x/orders/transactions/take/transaction_request_test.go b/x/orders/transactions/take/transaction_request_test.go index 6acd81cf4..3781534bf 100644 --- a/x/orders/transactions/take/transaction_request_test.go +++ b/x/orders/transactions/take/transaction_request_test.go @@ -35,7 +35,7 @@ var ( testClassificationID = baseIDs.NewClassificationID(immutables, mutables) testFromID = baseIDs.NewIdentityID(testClassificationID, immutables).(*baseIDs.IdentityID) testOrderID = baseIDs.NewOrderID(testClassificationID, immutables).(*baseIDs.OrderID) - commonTransactionRequest = baseHelpers.PrototypeCommonTransactionRequest() + commonTransactionRequest = helpers.PrototypeCommonTransactionRequest() takerSplit = types.NewInt(60) ) From 362514f501134ff85b4c4119551661695ec99a41 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:51:53 +0530 Subject: [PATCH 42/64] feat(transaction_request): adding fromHTTPRequest method Signed-off-by: Deepanshu Tripathi --- helpers/transaction_request.go | 4 ++-- x/assets/transactions/burn/transaction_request.go | 15 +++++++++++---- .../transactions/define/transaction_request.go | 15 +++++++++++---- .../transactions/deputize/transaction_request.go | 15 +++++++++++---- x/assets/transactions/mint/transaction_request.go | 15 +++++++++++---- .../transactions/mutate/transaction_request.go | 15 +++++++++++---- .../renumerate/transaction_request.go | 15 +++++++++++---- .../transactions/revoke/transaction_request.go | 15 +++++++++++---- x/assets/transactions/send/transaction_request.go | 15 +++++++++++---- .../transactions/unwrap/transaction_request.go | 15 +++++++++++---- x/assets/transactions/wrap/transaction_request.go | 11 +++++++++-- .../transactions/define/transaction_request.go | 11 +++++++++-- .../transactions/deputize/transaction_request.go | 11 +++++++++-- .../transactions/issue/transaction_request.go | 11 +++++++++-- .../transactions/name/transaction_request.go | 11 +++++++++-- .../transactions/provision/transaction_request.go | 11 +++++++++-- .../transactions/quash/transaction_request.go | 11 +++++++++-- .../transactions/revoke/transaction_request.go | 11 +++++++++-- .../unprovision/transaction_request.go | 11 +++++++++-- .../transactions/update/transaction_request.go | 11 +++++++++-- .../transactions/reveal/transaction_request.go | 11 +++++++++-- .../transactions/cancel/transaction_request.go | 11 +++++++++-- .../transactions/define/transaction_request.go | 11 +++++++++-- .../transactions/deputize/transaction_request.go | 11 +++++++++-- x/orders/transactions/get/transaction_request.go | 11 +++++++++-- .../transactions/immediate/transaction_request.go | 11 +++++++++-- x/orders/transactions/make/transaction_request.go | 11 +++++++++-- .../transactions/modify/transaction_request.go | 11 +++++++++-- x/orders/transactions/put/transaction_request.go | 11 +++++++++-- .../transactions/revoke/transaction_request.go | 11 +++++++++-- x/orders/transactions/take/transaction_request.go | 11 +++++++++-- 31 files changed, 290 insertions(+), 80 deletions(-) diff --git a/helpers/transaction_request.go b/helpers/transaction_request.go index 2e1fba270..9a959d893 100644 --- a/helpers/transaction_request.go +++ b/helpers/transaction_request.go @@ -4,17 +4,17 @@ package helpers import ( - "encoding/json" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "net/http" ) type TransactionRequest interface { GetCommonTransactionRequest() CommonTransactionRequest FromCLI(CLICommand, client.Context) (TransactionRequest, error) - FromJSON(json.RawMessage) (TransactionRequest, error) + FromHTTPRequest(*http.Request) (TransactionRequest, error) MakeMsg() (sdkTypes.Msg, error) RegisterLegacyAminoCodec(*codec.LegacyAmino) Request diff --git a/x/assets/transactions/burn/transaction_request.go b/x/assets/transactions/burn/transaction_request.go index 40687cbc9..61efab024 100644 --- a/x/assets/transactions/burn/transaction_request.go +++ b/x/assets/transactions/burn/transaction_request.go @@ -9,8 +9,10 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.AssetID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -82,7 +89,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { assetID.(ids.AssetID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/define/transaction_request.go b/x/assets/transactions/define/transaction_request.go index 1e260b9cf..22b6febc4 100644 --- a/x/assets/transactions/define/transaction_request.go +++ b/x/assets/transactions/define/transaction_request.go @@ -10,8 +10,10 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -57,8 +59,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -109,7 +116,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/deputize/transaction_request.go b/x/assets/transactions/deputize/transaction_request.go index b88696ab4..0aa25e61b 100644 --- a/x/assets/transactions/deputize/transaction_request.go +++ b/x/assets/transactions/deputize/transaction_request.go @@ -10,8 +10,10 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -67,8 +69,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadBool(constants.CanMutateMaintainer), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -117,7 +124,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { transactionRequest.CanMutateMaintainer, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/mint/transaction_request.go b/x/assets/transactions/mint/transaction_request.go index e251a03a1..37486c74e 100644 --- a/x/assets/transactions/mint/transaction_request.go +++ b/x/assets/transactions/mint/transaction_request.go @@ -10,8 +10,10 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -61,8 +63,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -125,7 +132,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/mutate/transaction_request.go b/x/assets/transactions/mutate/transaction_request.go index ac6163386..8c2008de8 100644 --- a/x/assets/transactions/mutate/transaction_request.go +++ b/x/assets/transactions/mutate/transaction_request.go @@ -10,8 +10,10 @@ import ( baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -55,8 +57,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -100,7 +107,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/renumerate/transaction_request.go b/x/assets/transactions/renumerate/transaction_request.go index 5fc1b75fa..34a08d6d6 100644 --- a/x/assets/transactions/renumerate/transaction_request.go +++ b/x/assets/transactions/renumerate/transaction_request.go @@ -9,8 +9,10 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.AssetID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -82,7 +89,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { assetID.(ids.AssetID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/revoke/transaction_request.go b/x/assets/transactions/revoke/transaction_request.go index 930b98575..572868d51 100644 --- a/x/assets/transactions/revoke/transaction_request.go +++ b/x/assets/transactions/revoke/transaction_request.go @@ -9,8 +9,10 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -52,8 +54,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.ClassificationID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -90,7 +97,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { classificationID.(ids.ClassificationID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/send/transaction_request.go b/x/assets/transactions/send/transaction_request.go index 91f7b580d..01ffd4e1b 100644 --- a/x/assets/transactions/send/transaction_request.go +++ b/x/assets/transactions/send/transaction_request.go @@ -9,8 +9,10 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -54,8 +56,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.Value), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -98,7 +105,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { value, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/unwrap/transaction_request.go b/x/assets/transactions/unwrap/transaction_request.go index 233be8e58..725d1f906 100644 --- a/x/assets/transactions/unwrap/transaction_request.go +++ b/x/assets/transactions/unwrap/transaction_request.go @@ -9,8 +9,10 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" + sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.Coins), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } @@ -82,7 +89,7 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { coins, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { +func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) } func requestPrototype() helpers.TransactionRequest { diff --git a/x/assets/transactions/wrap/transaction_request.go b/x/assets/transactions/wrap/transaction_request.go index e061ac56d..5755d59af 100644 --- a/x/assets/transactions/wrap/transaction_request.go +++ b/x/assets/transactions/wrap/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.Coins), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/define/transaction_request.go b/x/identities/transactions/define/transaction_request.go index fbd18ab39..a3c7f1c8d 100644 --- a/x/identities/transactions/define/transaction_request.go +++ b/x/identities/transactions/define/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -57,8 +59,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/deputize/transaction_request.go b/x/identities/transactions/deputize/transaction_request.go index e3c7f09d3..f1dad2501 100644 --- a/x/identities/transactions/deputize/transaction_request.go +++ b/x/identities/transactions/deputize/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -65,8 +67,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadBool(constants.CanMutateMaintainer), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/issue/transaction_request.go b/x/identities/transactions/issue/transaction_request.go index 991d958e2..a28e60c01 100644 --- a/x/identities/transactions/issue/transaction_request.go +++ b/x/identities/transactions/issue/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -59,8 +61,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/name/transaction_request.go b/x/identities/transactions/name/transaction_request.go index 368124b6c..a3ed1ea6c 100644 --- a/x/identities/transactions/name/transaction_request.go +++ b/x/identities/transactions/name/transaction_request.go @@ -10,6 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -47,8 +49,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.Name), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/provision/transaction_request.go b/x/identities/transactions/provision/transaction_request.go index b5e7f0eee..1671463ca 100644 --- a/x/identities/transactions/provision/transaction_request.go +++ b/x/identities/transactions/provision/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.IdentityID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/quash/transaction_request.go b/x/identities/transactions/quash/transaction_request.go index 5e4345791..6964d11bc 100644 --- a/x/identities/transactions/quash/transaction_request.go +++ b/x/identities/transactions/quash/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.IdentityID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/revoke/transaction_request.go b/x/identities/transactions/revoke/transaction_request.go index 01953c715..635033967 100644 --- a/x/identities/transactions/revoke/transaction_request.go +++ b/x/identities/transactions/revoke/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -52,8 +54,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.ClassificationID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/unprovision/transaction_request.go b/x/identities/transactions/unprovision/transaction_request.go index 8edcfa140..386c5d855 100644 --- a/x/identities/transactions/unprovision/transaction_request.go +++ b/x/identities/transactions/unprovision/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.IdentityID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/identities/transactions/update/transaction_request.go b/x/identities/transactions/update/transaction_request.go index 359c542f5..c15a54de9 100644 --- a/x/identities/transactions/update/transaction_request.go +++ b/x/identities/transactions/update/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -55,8 +57,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/metas/transactions/reveal/transaction_request.go b/x/metas/transactions/reveal/transaction_request.go index 84cb17226..ca55ee454 100644 --- a/x/metas/transactions/reveal/transaction_request.go +++ b/x/metas/transactions/reveal/transaction_request.go @@ -10,6 +10,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -47,8 +49,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.Data), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/cancel/transaction_request.go b/x/orders/transactions/cancel/transaction_request.go index cd969b8f7..c95716869 100644 --- a/x/orders/transactions/cancel/transaction_request.go +++ b/x/orders/transactions/cancel/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.OrderID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/define/transaction_request.go b/x/orders/transactions/define/transaction_request.go index 57f132472..b2ca125ef 100644 --- a/x/orders/transactions/define/transaction_request.go +++ b/x/orders/transactions/define/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -57,8 +59,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/deputize/transaction_request.go b/x/orders/transactions/deputize/transaction_request.go index 1abb28a13..c0bc33e71 100644 --- a/x/orders/transactions/deputize/transaction_request.go +++ b/x/orders/transactions/deputize/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -65,8 +67,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadBool(constants.CanMutateMaintainer), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/get/transaction_request.go b/x/orders/transactions/get/transaction_request.go index f6aeba30e..ede97c851 100644 --- a/x/orders/transactions/get/transaction_request.go +++ b/x/orders/transactions/get/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -50,8 +52,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.OrderID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/immediate/transaction_request.go b/x/orders/transactions/immediate/transaction_request.go index 2ab6af629..76323db81 100644 --- a/x/orders/transactions/immediate/transaction_request.go +++ b/x/orders/transactions/immediate/transaction_request.go @@ -13,6 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -72,8 +74,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/make/transaction_request.go b/x/orders/transactions/make/transaction_request.go index 4f3d66757..ef11b14f9 100644 --- a/x/orders/transactions/make/transaction_request.go +++ b/x/orders/transactions/make/transaction_request.go @@ -13,6 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -72,8 +74,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/modify/transaction_request.go b/x/orders/transactions/modify/transaction_request.go index 0435796d6..925194515 100644 --- a/x/orders/transactions/modify/transaction_request.go +++ b/x/orders/transactions/modify/transaction_request.go @@ -13,6 +13,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -62,8 +64,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.MutableProperties), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/put/transaction_request.go b/x/orders/transactions/put/transaction_request.go index 9e104eb49..410b52725 100644 --- a/x/orders/transactions/put/transaction_request.go +++ b/x/orders/transactions/put/transaction_request.go @@ -12,6 +12,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -59,8 +61,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadInt64(constants.ExpiryHeight), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/revoke/transaction_request.go b/x/orders/transactions/revoke/transaction_request.go index 569ff20bc..30227e20a 100644 --- a/x/orders/transactions/revoke/transaction_request.go +++ b/x/orders/transactions/revoke/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -52,8 +54,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.ClassificationID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } diff --git a/x/orders/transactions/take/transaction_request.go b/x/orders/transactions/take/transaction_request.go index 37f97a91d..282059c74 100644 --- a/x/orders/transactions/take/transaction_request.go +++ b/x/orders/transactions/take/transaction_request.go @@ -11,6 +11,8 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" + "io" + "net/http" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" @@ -52,8 +54,13 @@ func (transactionRequest transactionRequest) FromCLI(cliCommand helpers.CLIComma cliCommand.ReadString(constants.OrderID), ), nil } -func (transactionRequest transactionRequest) FromJSON(rawMessage json.RawMessage) (helpers.TransactionRequest, error) { - if err := json.Unmarshal(rawMessage, &transactionRequest); err != nil { +func (transactionRequest transactionRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.TransactionRequest, error) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + return nil, err + } + + if err := json.Unmarshal(body, &transactionRequest); err != nil { return nil, err } From a4142b753cabe6eae81b157e3d46ace53ee3f9ca Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:52:54 +0530 Subject: [PATCH 43/64] merge changes Signed-off-by: Deepanshu Tripathi --- .../burn/transaction_keeper_test.go | 529 +++++++++++++----- .../define/transaction_keeper_test.go | 339 ++++++----- .../deputize/transaction_keeper_test.go | 337 ++++++----- .../mint/transaction_keeper_test.go | 468 +++++++++++----- .../mutate/transaction_keeper_test.go | 311 +++++++--- .../renumerate/transaction_keeper_test.go | 428 +++++++++----- .../revoke/transaction_keeper_test.go | 311 +++++----- .../send/transaction_keeper_test.go | 53 +- .../unwrap/transaction_keeper_test.go | 39 +- .../wrap/transaction_keeper_test.go | 8 +- 10 files changed, 1854 insertions(+), 969 deletions(-) diff --git a/x/assets/transactions/burn/transaction_keeper_test.go b/x/assets/transactions/burn/transaction_keeper_test.go index 9c6adaf8e..e235f9e49 100644 --- a/x/assets/transactions/burn/transaction_keeper_test.go +++ b/x/assets/transactions/burn/transaction_keeper_test.go @@ -5,197 +5,434 @@ package burn import ( "context" - "fmt" - "github.com/AssetMantle/modules/x/assets/record" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" + recordassets "github.com/AssetMantle/modules/x/assets/record" + "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" + "github.com/AssetMantle/modules/x/metas/auxiliaries/supplement" + baseDocuments "github.com/AssetMantle/schema/documents/base" + "github.com/AssetMantle/schema/ids" + "github.com/AssetMantle/schema/parameters/base" + constantProperties "github.com/AssetMantle/schema/properties/constants" + baseQualified "github.com/AssetMantle/schema/qualified/base" + baseType "github.com/AssetMantle/schema/types/base" + "github.com/cometbft/cometbft/crypto/ed25519" storeTypes "github.com/cosmos/cosmos-sdk/store/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" + "math/rand" "reflect" "testing" baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" - baseQualified "github.com/AssetMantle/schema/qualified/base" tendermintDB "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" sdkTypes "github.com/cosmos/cosmos-sdk/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" + baseProp "github.com/AssetMantle/modules/simulation/schema/types/base" "github.com/AssetMantle/modules/x/assets/mapper" "github.com/AssetMantle/modules/x/assets/parameters" - "github.com/AssetMantle/modules/x/splits/auxiliaries/renumerate" ) -var ( - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - purgeAuxiliary helpers.Auxiliary - supplementAuxiliary helpers.Auxiliary - unbondAuxiliary helpers.Auxiliary -) +type MockAuxiliary struct { + mock.Mock +} + +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) + +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) +} + +type MockAuxiliaryKeeper struct { + mock.Mock +} + +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) -type TestKeepers struct { - BurnKeeper helpers.TransactionKeeper +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) +} +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() - - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - ParamsKeeper := paramsKeeper.NewKeeper( - codec, - legacyAmino, - paramsStoreKey, - paramsTransientStoreKeys, +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) + +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) + + randomInteger int64 = 100 + randomSeed int64 = 99 + + immutablesMesaMock = baseQualified.NewImmutables(baseProp.GenerateRandomPropertyList(rand.New(rand.NewSource(randomSeed)))) + + burnHeightMesaPropList = baseProp.GenerateRandomPropertyList(rand.New(rand.NewSource(randomSeed))) + burnHeightMesaMutables = baseQualified.NewMutables(burnHeightMesaPropList).GetMutablePropertyList().Add( + baseProperties.NewMesaProperty(constantProperties.BurnHeightProperty.GetKey(), baseData.NewHeightData(baseType.NewHeight(randomInteger))), + baseProperties.NewMesaProperty(constantProperties.BondAmountProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) + burnHeightAssetMesaMutables = baseQualified.NewMutables(burnHeightMesaMutables) + burnHeightMesaAsset = baseDocuments.NewAsset(baseIDs.NewClassificationID(immutablesMesaMock, burnHeightAssetMesaMutables), immutablesMesaMock, burnHeightAssetMesaMutables) + burnHeightMesaAssetID = baseIDs.NewAssetID(burnHeightMesaAsset.GetClassificationID(), burnHeightMesaAsset.GetImmutables()).(*baseIDs.AssetID) - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) + supplyMesaPropList = baseProp.GenerateRandomPropertyList(rand.New(rand.NewSource(randomSeed))) + supplyMesaMutables = baseQualified.NewMutables(supplyMesaPropList).GetMutablePropertyList().Add( + baseProperties.NewMesaProperty(constantProperties.SupplyProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), + ) + supplyAssetMesaMutables = baseQualified.NewMutables(supplyMesaMutables) + supplyMesaAsset = baseDocuments.NewAsset(baseIDs.NewClassificationID(immutablesMesaMock, supplyAssetMesaMutables), immutablesMesaMock, supplyAssetMesaMutables) + supplyMesaAssetID = baseIDs.NewAssetID(supplyMesaAsset.GetClassificationID(), supplyMesaAsset.GetImmutables()).(*baseIDs.AssetID) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) + burnHeightMetaPropList = baseProp.GenerateRandomPropertyList(rand.New(rand.NewSource(randomSeed))) + burnHeightMetaMutables = baseQualified.NewMutables(burnHeightMetaPropList).GetMutablePropertyList().Add( + baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), + baseProperties.NewMetaProperty(constantProperties.BondAmountProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), + baseProperties.NewMetaProperty(constantProperties.BurnHeightProperty.GetKey(), baseData.NewHeightData(baseType.NewHeight(randomInteger))), + ) - authenticateAuxiliary = renumerate.Auxiliary.Initialize(Mapper, parameterManager) - authorizeAuxiliary = renumerate.Auxiliary.Initialize(Mapper, parameterManager) - purgeAuxiliary = renumerate.Auxiliary.Initialize(Mapper, parameterManager) - supplementAuxiliary = renumerate.Auxiliary.Initialize(Mapper, parameterManager) - unbondAuxiliary = renumerate.Auxiliary.Initialize(Mapper, parameterManager) + supplyMetaPropList = baseProp.GenerateRandomPropertyList(rand.New(rand.NewSource(randomSeed))) + supplyMetaMutables = baseQualified.NewMutables(supplyMetaPropList).GetMutablePropertyList().Add( + baseProperties.NewMetaProperty(constantProperties.SupplyProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), + ) - keepers := TestKeepers{ - BurnKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } + mutableMetaMock = baseProp.GenerateRandomPropertyList(rand.New(rand.NewSource(randomSeed))) + BurnEnableMetaMutables = baseQualified.NewMutables(mutableMetaMock).GetMutablePropertyList().Add( + baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), + baseProperties.NewMetaProperty(constantProperties.BondAmountProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), + ) + BurnEnabledAssetMetaMutable = baseQualified.NewMutables(BurnEnableMetaMutables) + asset = baseDocuments.NewAsset(baseIDs.NewClassificationID(immutables, BurnEnabledAssetMetaMutable), immutables, BurnEnabledAssetMetaMutable) + assetID = baseIDs.NewAssetID(asset.GetClassificationID(), asset.GetImmutables()).(*baseIDs.AssetID) - return Context, keepers, Mapper, parameterManager -} + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) - } -} + authorizeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authorizeAuxiliary = new(MockAuxiliary) + _ = authorizeAuxiliary.On("GetKeeper").Return(authorizeAuxiliaryKeeper) -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - purgeAuxiliary helpers.Auxiliary - supplementAuxiliary helpers.Auxiliary - unbondAuxiliary helpers.Auxiliary - } - type args struct { - mapper helpers.Mapper - in1 helpers.ParameterManager - auxiliaries []interface{} - } - tests := []struct { - name string - fields fields - args args - want helpers.Keeper - }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, purgeAuxiliary, supplementAuxiliary, unbondAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, supplementAuxiliary, nil, nil}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - tt.fields.mapper, - tt.fields.parameterManager, - tt.fields.authenticateAuxiliary, - tt.fields.authorizeAuxiliary, - tt.fields.purgeAuxiliary, - tt.fields.supplementAuxiliary, - tt.fields.unbondAuxiliary, - } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.in1, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) - } - }) - } + purgeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + purgeAuxiliary = new(MockAuxiliary) + _ = purgeAuxiliary.On("GetKeeper").Return(purgeAuxiliaryKeeper) + + supplementAuxiliaryKeeper = new(MockAuxiliaryKeeper) + supplementAuxiliary = new(MockAuxiliary) + _ = supplementAuxiliary.On("GetKeeper").Return(supplementAuxiliaryKeeper) + + unbondAuxiliaryKeeper = new(MockAuxiliaryKeeper) + unbondAuxiliary = new(MockAuxiliary) + _ = unbondAuxiliary.On("GetKeeper").Return(unbondAuxiliaryKeeper) + + codec = baseHelpers.TestCodec() + + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + ParamsKeeper = paramsKeeper.NewKeeper(codec, codec.GetLegacyAmino(), paramsStoreKey, paramsTransientStoreKeys) + + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + Context = setContext() + + parameterManager = parameters.Prototype().Initialize(ParamsKeeper.Subspace(constants.ModuleName).WithKeyTable(parameters.Prototype().GetKeyTable())). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.WrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))) + + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), parameterManager, authenticateAuxiliary, authorizeAuxiliary, purgeAuxiliary, supplementAuxiliary, unbondAuxiliary} +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Transact1(t *testing.T) { - Context, keepers, Mapper, parameterManager := createTestInput(t) - immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")))) - mutables := baseQualified.NewMutables(baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData()))) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - testAssetID := baseIDs.NewAssetID(classificationID, immutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.BurnKeeper.(transactionKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(record.NewRecord(testAsset)) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - purgeAuxiliary helpers.Auxiliary - supplementAuxiliary helpers.Auxiliary - unbondAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { type args struct { - context context.Context - message helpers.Message + from sdkTypes.AccAddress + fromID ids.IdentityID + assetID ids.AssetID + value int } tests := []struct { name string - fields fields args args - want helpers.TransactionResponse - wantErr bool + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, purgeAuxiliary, supplementAuxiliary, unbondAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, testAssetID).(*Message)}, newTransactionResponse(), false}, - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, purgeAuxiliary, supplementAuxiliary, unbondAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, baseIDs.PrototypeAssetID()).(*Message)}, newTransactionResponse(), false}, + { + name: "BurnPropertyDisabled", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: assetID, + }, + setup: func() { + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(false))))) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + want: nil, + wantErr: errorConstants.NotAuthorized, + }, + { + name: "BurnTransactionKeeperSuccess", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: assetID, + }, + setup: func() { + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))) + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(asset)) + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + purgeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + unbondAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + want: newTransactionResponse(), + wantErr: nil, + }, + { + name: "AuthenticationFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: assetID, + }, + setup: func() { + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "AuthorizationFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: assetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(asset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(genesisAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.NotAuthorized).Once() + }, + want: nil, + wantErr: errorConstants.NotAuthorized, + }, + { + name: "BurnAssetEntityNotFound", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: baseIDs.PrototypeAssetID(), + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(asset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(genesisAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + want: nil, + wantErr: errorConstants.EntityNotFound, + }, + { + name: "BurnHeightSupplementAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: burnHeightMesaAssetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(burnHeightMesaAsset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "BurnHeightMetaDataError", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: burnHeightMesaAssetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(burnHeightMesaAsset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(burnHeightMetaMutables), nil).Once() + + }, + want: nil, + wantErr: errorConstants.NotAuthorized, + }, + { + name: "BurnHeightPropertyNotRevealed", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: burnHeightMesaAssetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(burnHeightMesaAsset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(mutableMetaMock), nil).Once() + + }, + want: nil, + wantErr: errorConstants.MetaDataError, + }, + { + name: "SupplyPropertySupplementAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: supplyMesaAssetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(supplyMesaAsset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "SupplyMetaPropertyAuxiliaryResponseSuccess", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: supplyMesaAssetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(supplyMesaAsset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(supplyMetaMutables), nil).Once() + purgeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + + }, + want: nil, + wantErr: errorConstants.MetaDataError, + }, + { + name: "AssetsWithoutSupplyCannotBeBurnedMetaError", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: supplyMesaAssetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(supplyMesaAsset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(mutableMetaMock), nil).Once() + + }, + want: nil, + wantErr: errorConstants.MetaDataError, + }, + { + name: "PurgeAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: assetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(asset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + purgeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "unbondAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: assetID, + }, + setup: func() { + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(asset)) + authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(genesisAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), nil).Once() + purgeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + unbondAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - authorizeAuxiliary: tt.fields.authorizeAuxiliary, - purgeAuxiliary: tt.fields.purgeAuxiliary, - supplementAuxiliary: tt.fields.supplementAuxiliary, - unbondAuxiliary: tt.fields.unbondAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return + tt.setup() + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.assetID).(helpers.Message)) + + if (err != nil) && !tt.wantErr.Is(err) { + t.Errorf("unexpected error: %v", err) } + if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + t.Error("unexpected response") } }) } diff --git a/x/assets/transactions/define/transaction_keeper_test.go b/x/assets/transactions/define/transaction_keeper_test.go index 3630a4d4c..6073bf89d 100644 --- a/x/assets/transactions/define/transaction_keeper_test.go +++ b/x/assets/transactions/define/transaction_keeper_test.go @@ -5,187 +5,242 @@ package define import ( "context" - "fmt" - "github.com/AssetMantle/modules/x/assets/record" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" + "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" + "github.com/AssetMantle/modules/x/maintainers/auxiliaries/super" + "github.com/AssetMantle/schema/ids" + "github.com/AssetMantle/schema/lists" + baseQualified "github.com/AssetMantle/schema/qualified/base" + "github.com/cometbft/cometbft/crypto/ed25519" storeTypes "github.com/cosmos/cosmos-sdk/store/types" - "reflect" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" + "math/rand" "testing" - baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" - baseProperties "github.com/AssetMantle/schema/properties/base" - baseQualified "github.com/AssetMantle/schema/qualified/base" tendermintDB "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" sdkTypes "github.com/cosmos/cosmos-sdk/types" - paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/stretchr/testify/require" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" + dataHelper "github.com/AssetMantle/modules/simulation/schema/types/base" "github.com/AssetMantle/modules/x/assets/mapper" - "github.com/AssetMantle/modules/x/assets/parameters" + permissionHelper "github.com/AssetMantle/modules/x/assets/utilities" "github.com/AssetMantle/modules/x/classifications/auxiliaries/define" - "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" - "github.com/AssetMantle/modules/x/maintainers/auxiliaries/super" ) -var ( - defineAuxiliary helpers.Auxiliary - superAuxiliary helpers.Auxiliary - authenticateAuxiliary helpers.Auxiliary -) - -type TestKeepers struct { - BurnKeeper helpers.TransactionKeeper +type MockAuxiliary struct { + mock.Mock } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() - - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - PramsKeeper := paramsKeeper.NewKeeper( - codec, - legacyAmino, - paramsStoreKey, - paramsTransientStoreKeys, - ) - parameterManager := parameters.Prototype().Initialize(PramsKeeper.Subspace("test")) - - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) +} - defineAuxiliary = define.Auxiliary.Initialize(Mapper, parameterManager) - superAuxiliary = super.Auxiliary.Initialize(Mapper, parameterManager) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) +type MockAuxiliaryKeeper struct { + mock.Mock +} - keepers := TestKeepers{ - BurnKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) - return Context, keepers, Mapper, parameterManager +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) } - -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) - } +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) } -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - defineAuxiliary helpers.Auxiliary - superAuxiliary helpers.Auxiliary - authenticateAuxiliary helpers.Auxiliary - } - type args struct { - mapper helpers.Mapper - in1 helpers.ParameterManager - auxiliaries []interface{} - } - tests := []struct { - name string - fields fields - args args - want helpers.Keeper - }{ - {"+ve", fields{Mapper, defineAuxiliary, superAuxiliary, authenticateAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, defineAuxiliary, superAuxiliary, authenticateAuxiliary}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - defineAuxiliary: tt.fields.defineAuxiliary, - superAuxiliary: tt.fields.superAuxiliary, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.in1, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) - } - }) +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) + +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) + + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) + + defineAuxiliaryKeeper = new(MockAuxiliaryKeeper) + defineAuxiliaryKeeperFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = defineAuxiliaryKeeper.On("Help", mock.Anything, define.NewAuxiliaryRequest(defineAuxiliaryKeeperFailureAddress, baseQualified.NewImmutables(baseLists.NewPropertyList()), baseQualified.NewMutables(baseLists.NewPropertyList()))).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = defineAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(define.NewAuxiliaryResponse(baseIDs.PrototypeClassificationID()), nil) + defineAuxiliary = new(MockAuxiliary) + _ = defineAuxiliary.On("GetKeeper").Return(defineAuxiliaryKeeper) + + superAuxiliaryKeeper = new(MockAuxiliaryKeeper) + superAuxiliaryMutablesFailure = dataHelper.GenerateRandomMetaPropertyListWithoutData(rand.New(rand.NewSource(99))) + _ = superAuxiliaryKeeper.On("Help", mock.Anything, super.NewAuxiliaryRequest(baseIDs.PrototypeClassificationID(), baseIDs.PrototypeIdentityID(), baseQualified.NewMutables(superAuxiliaryMutablesFailure), permissionHelper.SetModulePermissions(true, true, true)...)).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = superAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + superAuxiliary = new(MockAuxiliary) + _ = superAuxiliary.On("GetKeeper").Return(superAuxiliaryKeeper) + + codec = baseHelpers.TestCodec() + + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + Context = setContext() + + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), + defineAuxiliary, + superAuxiliary, + authenticateAuxiliary, } +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Transact(t *testing.T) { - Context, keepers, Mapper, _ := createTestInput(t) - immutablePropertiesLists := baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutableMetaPropertiesLists := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutables := baseQualified.NewImmutables(immutableMetaPropertiesLists) - mutablePropertiesLists := baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutableMetaPropertiesLists := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutables := baseQualified.NewMutables(mutableMetaPropertiesLists) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - // testAssetID := baseIDs.NewAssetID(classificationID, immutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.BurnKeeper.(transactionKeeper).mapper.NewCollection(Context.Context()).Add(record.NewRecord(testAsset)) - - type fields struct { - mapper helpers.Mapper - defineAuxiliary helpers.Auxiliary - superAuxiliary helpers.Auxiliary - authenticateAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { type args struct { - context context.Context - message helpers.Message + from sdkTypes.AccAddress + fromID ids.IdentityID + immutableMetaProps lists.PropertyList + immutableProps lists.PropertyList + mutableMetaProps lists.PropertyList + mutableProps lists.PropertyList } + tests := []struct { name string - fields fields args args - want helpers.TransactionResponse - wantErr bool + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, defineAuxiliary, superAuxiliary, authenticateAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, immutableMetaPropertiesLists, immutablePropertiesLists, mutableMetaPropertiesLists, mutablePropertiesLists).(*Message)}, newTransactionResponse(nil), false}, + { + name: "DefineTransactionKeeperSuccess", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + immutableMetaProps: baseLists.NewPropertyList(), + immutableProps: baseLists.NewPropertyList(), + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func() { + }, + want: newTransactionResponse(baseIDs.PrototypeClassificationID()), + wantErr: nil, + }, + { + name: "AuthenticationFailure", + args: args{ + from: authenticateAuxiliaryFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + immutableMetaProps: baseLists.NewPropertyList(), + immutableProps: baseLists.NewPropertyList(), + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "DefineAuxiliaryFailure", + args: args{ + from: defineAuxiliaryKeeperFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + immutableMetaProps: baseLists.NewPropertyList(), + immutableProps: baseLists.NewPropertyList(), + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func() { + + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "SuperAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + immutableMetaProps: baseLists.NewPropertyList(), + immutableProps: baseLists.NewPropertyList(), + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: superAuxiliaryMutablesFailure, + }, + setup: func() { + + }, + want: nil, + wantErr: errorConstants.MockError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - defineAuxiliary: tt.fields.defineAuxiliary, - superAuxiliary: tt.fields.superAuxiliary, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + tt.setup() + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.immutableMetaProps.(lists.PropertyList), + tt.args.immutableProps.(lists.PropertyList), + tt.args.mutableMetaProps.(lists.PropertyList), + tt.args.mutableProps.(lists.PropertyList)).(helpers.Message)) + + if tt.wantErr != nil { + require.Error(t, err) + require.Equal(t, tt.wantErr, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) } }) } diff --git a/x/assets/transactions/deputize/transaction_keeper_test.go b/x/assets/transactions/deputize/transaction_keeper_test.go index 202c608e7..5e36069ae 100644 --- a/x/assets/transactions/deputize/transaction_keeper_test.go +++ b/x/assets/transactions/deputize/transaction_keeper_test.go @@ -5,180 +5,255 @@ package deputize import ( "context" - "fmt" - "github.com/AssetMantle/modules/x/assets/record" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - "reflect" - "testing" - + baseHelpers "github.com/AssetMantle/modules/helpers/base" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" + "github.com/AssetMantle/modules/x/assets/mapper" + "github.com/AssetMantle/modules/x/assets/parameters" + permissionHelper "github.com/AssetMantle/modules/x/assets/utilities" + "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" + "github.com/AssetMantle/modules/x/maintainers/auxiliaries/deputize" baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" + "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" + "github.com/AssetMantle/schema/parameters/base" baseProperties "github.com/AssetMantle/schema/properties/base" - baseQualified "github.com/AssetMantle/schema/qualified/base" + constantProperties "github.com/AssetMantle/schema/properties/constants" tendermintDB "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/crypto/ed25519" "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" + storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" + "reflect" + "testing" "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/assets/mapper" - "github.com/AssetMantle/modules/x/assets/parameters" - "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" - "github.com/AssetMantle/modules/x/maintainers/auxiliaries/deputize" ) -var ( - authenticateAuxiliary helpers.Auxiliary - deputizeAuxiliary helpers.Auxiliary -) +type MockAuxiliary struct { + mock.Mock +} + +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) -type TestKeepers struct { - DeputizeKeeper helpers.TransactionKeeper +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() - - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - ParamsKeeper := paramsKeeper.NewKeeper( - codec, - legacyAmino, - paramsStoreKey, - paramsTransientStoreKeys, - ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) +type MockAuxiliaryKeeper struct { + mock.Mock +} - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) +} +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) +} - deputizeAuxiliary = deputize.Auxiliary.Initialize(Mapper, parameterManager) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) - keepers := TestKeepers{ - DeputizeKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) - return Context, keepers, Mapper, parameterManager -} + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) - } + deputizeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + _ = deputizeAuxiliaryKeeper.On("Help", mock.Anything, deputize.NewAuxiliaryRequest(baseIDs.PrototypeIdentityID(), baseIDs.PrototypeIdentityID(), baseIDs.PrototypeClassificationID(), baseLists.NewPropertyList(), true, true, true, permissionHelper.SetModulePermissions(false, true, true)...)).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = deputizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + deputizeAuxiliary = new(MockAuxiliary) + _ = deputizeAuxiliary.On("GetKeeper").Return(deputizeAuxiliaryKeeper) + + codec = baseHelpers.TestCodec() + + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + ParamsKeeper = paramsKeeper.NewKeeper(codec, codec.GetLegacyAmino(), paramsStoreKey, paramsTransientStoreKeys) + + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + Context = setContext() + + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + parameterManager = parameters.Prototype().Initialize(ParamsKeeper.Subspace(constants.ModuleName).WithKeyTable(parameters.Prototype().GetKeyTable())). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.WrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))) + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), parameterManager, authenticateAuxiliary, deputizeAuxiliary} +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - deputizeAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { + type args struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - auxiliaries []interface{} + from sdkTypes.AccAddress + fromID ids.IdentityID + toID ids.IdentityID + canMintAsset bool + canRenumerateAsset bool + canBurnAsset bool + canAddMaintainer bool + CanRemoveMaintainer bool + CanMutateMaintainer bool } + tests := []struct { - name string - fields fields - args args - want helpers.Keeper + name string + args args + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, deputizeAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, parameterManager, authenticateAuxiliary, deputizeAuxiliary}}, + { + name: "DeputizeTransactionKeeperSuccess", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + canMintAsset: true, + canRenumerateAsset: true, + canBurnAsset: true, + canAddMaintainer: true, + CanRemoveMaintainer: true, + CanMutateMaintainer: true, + }, + setup: func() { + }, + want: newTransactionResponse(), + wantErr: nil, + }, + { + name: "AuthenticationFailure", + args: args{ + from: authenticateAuxiliaryFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + canMintAsset: true, + canRenumerateAsset: true, + canBurnAsset: true, + canAddMaintainer: true, + CanRemoveMaintainer: true, + CanMutateMaintainer: true, + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "DeputizeAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + canMintAsset: false, + canRenumerateAsset: true, + canBurnAsset: true, + canAddMaintainer: true, + CanRemoveMaintainer: true, + CanMutateMaintainer: true, + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.MockError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - deputizeAuxiliary: tt.fields.deputizeAuxiliary, - } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.parameterManager, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) + tt.setup() + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.toID, + baseIDs.PrototypeClassificationID(), + baseLists.NewPropertyList(), + tt.args.canMintAsset, + tt.args.canRenumerateAsset, + tt.args.canBurnAsset, + tt.args.canAddMaintainer, + tt.args.CanRemoveMaintainer, + tt.args.CanMutateMaintainer).(helpers.Message)) + + if tt.wantErr != nil { + require.Error(t, err) + require.Equal(t, tt.wantErr, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) } }) } } -func Test_transactionKeeper_Transact(t *testing.T) { - Context, keepers, Mapper, parameterManager := createTestInput(t) - immutableProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutables := baseQualified.NewImmutables(immutableProperties) - mutableProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutables := baseQualified.NewMutables(mutableProperties) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.DeputizeKeeper.(transactionKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(record.NewRecord(testAsset)) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - deputizeAuxiliary helpers.Auxiliary - } - type args struct { - context context.Context - message helpers.Message - } +func Test_keeperPrototype(t *testing.T) { tests := []struct { - name string - fields fields - args args - want helpers.TransactionResponse - wantErr bool + name string + want helpers.TransactionKeeper }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, deputizeAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, fromID, classificationID, mutableProperties, true, true, true, true, true, true).(*Message)}, newTransactionResponse(), false}, + {"+ve", transactionKeeper{}}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - deputizeAuxiliary: tt.fields.deputizeAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { + t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) } }) } diff --git a/x/assets/transactions/mint/transaction_keeper_test.go b/x/assets/transactions/mint/transaction_keeper_test.go index 54991a4ff..798424b9a 100644 --- a/x/assets/transactions/mint/transaction_keeper_test.go +++ b/x/assets/transactions/mint/transaction_keeper_test.go @@ -7,198 +7,376 @@ import ( "context" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + baseProp "github.com/AssetMantle/modules/simulation/schema/types/base" + "github.com/AssetMantle/modules/x/assets/constants" + "github.com/AssetMantle/modules/x/assets/key" "github.com/AssetMantle/modules/x/assets/mapper" "github.com/AssetMantle/modules/x/assets/parameters" - "github.com/AssetMantle/modules/x/assets/record" - "github.com/AssetMantle/modules/x/classifications/auxiliaries/bond" - "github.com/AssetMantle/modules/x/classifications/auxiliaries/conform" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" - "github.com/AssetMantle/modules/x/maintainers/auxiliaries/authorize" - "github.com/AssetMantle/modules/x/splits/auxiliaries/mint" + "github.com/AssetMantle/modules/x/orders/record" baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" + baseDocuments "github.com/AssetMantle/schema/documents/base" + "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" + "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" + "github.com/AssetMantle/schema/parameters/base" baseProperties "github.com/AssetMantle/schema/properties/base" + constantProperties "github.com/AssetMantle/schema/properties/constants" baseQualified "github.com/AssetMantle/schema/qualified/base" tendermintDB "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/crypto/ed25519" "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/stretchr/testify/require" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" + "math/rand" "reflect" "testing" ) -var ( - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - bondAuxiliary helpers.Auxiliary - conformAuxiliary helpers.Auxiliary - mintAuxiliary helpers.Auxiliary -) +type MockAuxiliary struct { + mock.Mock +} + +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) + +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) +} -type TestKeepers struct { - MintKeeper helpers.TransactionKeeper +type MockAuxiliaryKeeper struct { + mock.Mock } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - ParamsKeeper := paramsKeeper.NewKeeper( +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) +} +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) +} + +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) + +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) + randomSeed int64 = 99 + randomInt int64 = 1 + randomMetaProperty = baseProp.GenerateRandomMetaProperty(rand.New(rand.NewSource(randomSeed))) + randomBondMetaProperty = baseProperties.NewMetaProperty(baseIDs.NewStringID(""), baseData.NewNumberData(sdkTypes.NewInt(randomInt))) + + newMutables = baseQualified.NewMutables(baseLists.NewPropertyList()) + asset = baseDocuments.NewAsset(baseIDs.NewClassificationID(immutables, newMutables), immutables, newMutables) + assetID = baseIDs.NewAssetID(asset.GetClassificationID(), asset.GetImmutables()).(*baseIDs.AssetID) + + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) + + authorizeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authorizeAuxiliary = new(MockAuxiliary) + _ = authorizeAuxiliary.On("GetKeeper").Return(authorizeAuxiliaryKeeper) + + mintAuxiliaryKeeper = new(MockAuxiliaryKeeper) + mintAuxiliary = new(MockAuxiliary) + _ = mintAuxiliary.On("GetKeeper").Return(mintAuxiliaryKeeper) + + bondAuxiliaryKeeper = new(MockAuxiliaryKeeper) + bondAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + bondAuxiliary = new(MockAuxiliary) + _ = bondAuxiliary.On("GetKeeper").Return(bondAuxiliaryKeeper) + + conformAuxiliaryKeeper = new(MockAuxiliaryKeeper) + conformAuxiliary = new(MockAuxiliary) + _ = conformAuxiliary.On("GetKeeper").Return(conformAuxiliaryKeeper) + + codec = baseHelpers.TestCodec() + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + ParamsKeeper = paramsKeeper.NewKeeper( codec, - legacyAmino, + codec.GetLegacyAmino(), paramsStoreKey, paramsTransientStoreKeys, ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) - authorizeAuxiliary = authorize.Auxiliary.Initialize(Mapper, parameterManager) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) - bondAuxiliary = bond.Auxiliary.Initialize(Mapper, parameterManager) - conformAuxiliary = conform.Auxiliary.Initialize(Mapper, parameterManager) - mintAuxiliary = mint.Auxiliary.Initialize(Mapper, parameterManager) + Context = setContext() - keepers := TestKeepers{ - MintKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) - return Context, keepers, Mapper, parameterManager -} + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + parameterManager = parameters.Prototype().Initialize(ParamsKeeper.Subspace(constants.ModuleName).WithKeyTable(parameters.Prototype().GetKeyTable())). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.WrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))) -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) + TransactionKeeper = transactionKeeper{ + mapper: mapper.Prototype().Initialize(moduleStoreKey), + parameterManager: parameterManager, + authenticateAuxiliary: authenticateAuxiliary, + authorizeAuxiliary: authorizeAuxiliary, + bondAuxiliary: bondAuxiliary, + conformAuxiliary: conformAuxiliary, + mintAuxiliary: mintAuxiliary, } +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -// func Test_transactionKeeper_Initialize(t *testing.T) { -// _, _, mapper, parameterManager := createTestInput(t) -// type fields struct { -// mapper helpers.Mapper -// parameterManager helpers.ParameterManager -// conformAuxiliary helpers.Auxiliary -// mintAuxiliary helpers.Auxiliary -// authenticateAuxiliary helpers.Auxiliary -// authorizeAuxiliary helpers.Auxiliary -// } -// type args struct { -// mapper helpers.Mapper -// parameterManager helpers.ParameterManager -// auxiliaries []interface{} -// } -// tests := []struct { -// name string -// fields fields -// args args -// want helpers.Keeper -// }{ -// {"+ve", fields{Mapper, Parameters, conformAuxiliary, mintAuxiliary, authenticateAuxiliary, authorizeAuxiliary}, args{Mapper, Parameters, []interface{}{}}, transactionKeeper{Mapper, Parameters, conformAuxiliary, mintAuxiliary, authenticateAuxiliary, authorizeAuxiliary}}, -// } -// for _, tt := range tests { -// t.Run(tt.name, func(t *testing.T) { -// transactionKeeper := transactionKeeper{ -// mapper: tt.fields.mapper, -// parameterManager: tt.fields.parameterManager, -// conformAuxiliary: tt.fields.conformAuxiliary, -// mintAuxiliary: tt.fields.mintAuxiliary, -// authenticateAuxiliary: tt.fields.authenticateAuxiliary, -// authorizeAuxiliary: tt.fields.authorizeAuxiliary, -// } -// if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.parameterManager, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { -// t.Errorf("Initialize() = %v, want %v", got, tt.want) -// } -// }) -// } -// } - -func Test_transactionKeeper_Transact(t *testing.T) { - Context, keepers, Mapper, parameterManager := createTestInput(t) - immutableProperties := baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutableMetaProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutables := baseQualified.NewImmutables(immutableMetaProperties) - mutableProperties := baseLists.NewPropertyList(baseProperties.NewMesaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutableMetaProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutables := baseQualified.NewMutables(mutableMetaProperties) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.MintKeeper.(transactionKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(record.NewRecord(testAsset)) - - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - bondAuxiliary helpers.Auxiliary - conformAuxiliary helpers.Auxiliary - mintAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { + type args struct { - context context.Context - message helpers.Message + from sdkTypes.AccAddress + fromID ids.IdentityID + toID ids.IdentityID + classificationID ids.ClassificationID + immutableProps lists.PropertyList + mutableProps lists.PropertyList } tests := []struct { name string - fields fields args args - want helpers.TransactionResponse - wantErr bool + setup func(*testing.T) + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, bondAuxiliary, conformAuxiliary, mintAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties).(*Message)}, newTransactionResponse(nil), false}, - {"+ve Entity Already Exists", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, bondAuxiliary, conformAuxiliary, mintAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties).(*Message)}, newTransactionResponse(nil), false}, + { + name: "MintTransactionKeeperSuccess", + args: args{ + from: bondAuxiliaryFailureAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: asset.GetClassificationID(), + immutableProps: asset.GetImmutables().GetImmutablePropertyList(), + mutableProps: baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.BondAmountProperty.GetID().GetKey(), baseData.NewNumberData(sdkTypes.NewInt(1)))), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + mintAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + bondAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + want: newTransactionResponse(assetID), + wantErr: nil, + }, + { + name: "MintPropertyNotEnabled", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func(t *testing.T) { + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(false))))) + }, + wantErr: errorConstants.NotAuthorized, + }, + { + name: "AuthorizationFailure", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func(t *testing.T) { + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))) + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + wantErr: errorConstants.MockError, + }, + { + name: "AuthenticationFailure", + args: args{ + from: authenticateAuxiliaryFailureAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + wantErr: errorConstants.MockError, + }, + { + name: "EntityAlreadyExistsError", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(randomMetaProperty), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func(t *testing.T) { + assetID := baseIDs.NewAssetID(baseIDs.PrototypeClassificationID(), baseQualified.NewImmutables(baseLists.NewPropertyList(randomMetaProperty))) + assets := TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Fetch(key.NewKey(assetID)) + assets.Add(record.NewRecord( + baseDocuments.NewOrder(baseIDs.PrototypeClassificationID(), + baseQualified.NewImmutables(baseLists.NewPropertyList(randomMetaProperty)), + baseQualified.NewMutables(baseLists.NewPropertyList())))) + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + + }, + wantErr: errorConstants.EntityAlreadyExists, + }, + { + name: "ConformAuxiliaryFailure", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + + }, + wantErr: errorConstants.MockError, + }, + { + name: "AssetSupplyNegativeIncorrectFormatError", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.SupplyProperty.GetID().GetKey(), baseData.NewNumberData(sdkTypes.NewInt(-1)))), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + + }, + wantErr: errorConstants.IncorrectFormat, + }, + { + name: "MintAuxiliaryFailure", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + mintAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + + }, + wantErr: errorConstants.MockError, + }, + { + name: "BondAuxiliaryFailure", + args: args{ + from: bondAuxiliaryFailureAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.BondAmountProperty.GetID().GetKey(), baseData.NewNumberData(sdkTypes.NewInt(1)))), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + mintAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + bondAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "BondAmountPropertyMetaDataError", + args: args{ + from: genesisAddress, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + immutableProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(randomBondMetaProperty), + }, + setup: func(t *testing.T) { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + mintAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + wantErr: errorConstants.MetaDataError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - authorizeAuxiliary: tt.fields.authorizeAuxiliary, - bondAuxiliary: tt.fields.bondAuxiliary, - conformAuxiliary: tt.fields.conformAuxiliary, - mintAuxiliary: tt.fields.mintAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return + + tt.setup(t) + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), NewMessage( + tt.args.from, + baseIDs.PrototypeIdentityID(), + tt.args.toID, + tt.args.classificationID, + tt.args.immutableProps, + baseLists.NewPropertyList(), + tt.args.mutableProps, + baseLists.NewPropertyList(), + ).(helpers.Message)) + + if (err != nil) && !tt.wantErr.Is(err) { + t.Errorf("unexpected error: %v", err) } + if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + t.Error("unexpected response") } }) } diff --git a/x/assets/transactions/mutate/transaction_keeper_test.go b/x/assets/transactions/mutate/transaction_keeper_test.go index 3f62e4e61..ed6a6de20 100644 --- a/x/assets/transactions/mutate/transaction_keeper_test.go +++ b/x/assets/transactions/mutate/transaction_keeper_test.go @@ -4,110 +4,267 @@ package mutate import ( - "fmt" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - "reflect" - "testing" - - tendermintDB "github.com/cometbft/cometbft-db" - "github.com/cometbft/cometbft/libs/log" - protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/cosmos-sdk/store" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/stretchr/testify/require" - + "context" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" "github.com/AssetMantle/modules/x/assets/mapper" - "github.com/AssetMantle/modules/x/assets/parameters" + recordassets "github.com/AssetMantle/modules/x/assets/record" "github.com/AssetMantle/modules/x/classifications/auxiliaries/conform" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/x/maintainers/auxiliaries/maintain" + baseDocuments "github.com/AssetMantle/schema/documents/base" + "github.com/AssetMantle/schema/ids" + baseIDs "github.com/AssetMantle/schema/ids/base" + "github.com/AssetMantle/schema/lists" + baseLists "github.com/AssetMantle/schema/lists/base" + baseQualified "github.com/AssetMantle/schema/qualified/base" + tendermintDB "github.com/cometbft/cometbft-db" + "github.com/cometbft/cometbft/crypto/ed25519" + "github.com/cometbft/cometbft/libs/log" + protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" + "github.com/cosmos/cosmos-sdk/store" + storeTypes "github.com/cosmos/cosmos-sdk/store/types" + sdkTypes "github.com/cosmos/cosmos-sdk/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" + "reflect" + "testing" ) -var ( - authenticateAuxiliary helpers.Auxiliary - maintainAuxiliary helpers.Auxiliary - conformAuxiliary helpers.Auxiliary -) +type MockAuxiliary struct { + mock.Mock +} -type TestKeepers struct { - MutateKeeper helpers.TransactionKeeper +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) + +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - // var legacyAmino = codec.NewLegacyAmino() - // schemaCodec.RegisterLegacyAminoCodec(legacyAmino) - // std.RegisterLegacyAminoCodec(legacyAmino) - // legacyAmino.Seal() - codec := baseHelpers.CodecPrototype() - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - ParamsKeeper := paramsKeeper.NewKeeper( - codec.GetProtoCodec(), - codec.GetLegacyAmino(), - paramsStoreKey, - paramsTransientStoreKeys, - ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) +type MockAuxiliaryKeeper struct { + mock.Mock +} - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) - context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) +} +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) +} + +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) + +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) + + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) + + maintainFailureClassificationID = testAsset.GetClassificationID() + maintainAuxiliaryKeeper = new(MockAuxiliaryKeeper) + maintainFailureID = baseIDs.NewIdentityID(classificationID, immutables) + maintainAuxiliary = new(MockAuxiliary) + _ = maintainAuxiliary.On("GetKeeper").Return(maintainAuxiliaryKeeper) + + conformAuxiliaryKeeper = new(MockAuxiliaryKeeper) + conformAuxiliary = new(MockAuxiliary) + _ = conformAuxiliary.On("GetKeeper").Return(conformAuxiliaryKeeper) + + testAsset = baseDocuments.NewAsset(baseIDs.NewClassificationID(immutables, mutables), baseQualified.NewImmutables(baseLists.NewPropertyList()), baseQualified.NewMutables(baseLists.NewPropertyList())) + testNewAssetID = baseIDs.NewAssetID(testAsset.GetClassificationID(), testAsset.GetImmutables()).(*baseIDs.AssetID) + + codec = baseHelpers.TestCodec() + + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) - maintainAuxiliary = maintain.Auxiliary.Initialize(Mapper, parameterManager) - conformAuxiliary = conform.Auxiliary.Initialize(Mapper, parameterManager) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) + Context = setContext() - keepers := TestKeepers{ - MutateKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), + authenticateAuxiliary, + maintainAuxiliary, + conformAuxiliary, } +) - return context, keepers, Mapper, parameterManager +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - authenticateAuxiliary helpers.Auxiliary - maintainAuxiliary helpers.Auxiliary - conformAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { type args struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - auxiliaries []interface{} + from sdkTypes.AccAddress + fromID ids.IdentityID + assetID ids.AssetID + mutableMetaProps lists.PropertyList + mutableProps lists.PropertyList } + tests := []struct { - name string - fields fields - args args - want helpers.Keeper + name string + args args + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, authenticateAuxiliary, maintainAuxiliary, conformAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, authenticateAuxiliary, maintainAuxiliary, conformAuxiliary}}, + { + "MutateTransactionKeeeperSuccess", + args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + func() { + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + maintainAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + newTransactionResponse(), + nil, + }, + { + "MutateValidAsset", + args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + func() { + conformAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + maintainAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + }, + newTransactionResponse(), + nil, + }, + { + "EntityNotFoundError", + args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: baseIDs.PrototypeAssetID(), + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + func() {}, + nil, + errorConstants.EntityNotFound, + }, + { + "AuthenticateAuxiliaryFailure", + args{ + from: authenticateAuxiliaryFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: baseIDs.PrototypeAssetID(), + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + func() {}, + nil, + errorConstants.MockError, + }, + { + "MaintainAuxiliaryFailure", + args{ + from: genesisAddress, + fromID: maintainFailureID, + assetID: testNewAssetID, + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + func() { + maintainAuxiliaryKeeper.On("Help", mock.Anything, maintain.NewAuxiliaryRequest(maintainFailureClassificationID, maintainFailureID, baseQualified.NewMutables(baseLists.NewPropertyList()))).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + }, + nil, + errorConstants.MockError, + }, + { + "ConformAuxiliaryFailure", + args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + mutableMetaProps: baseLists.NewPropertyList(), + mutableProps: baseLists.NewPropertyList(), + }, + func() { + maintainAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + conformAuxiliaryKeeper.On("Help", mock.Anything, conform.NewAuxiliaryRequest(testAsset.GetClassificationID(), testAsset.GetImmutables(), baseQualified.NewMutables(baseLists.NewPropertyList()))).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + }, + nil, + errorConstants.MockError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - maintainAuxiliary: tt.fields.maintainAuxiliary, - conformAuxiliary: tt.fields.conformAuxiliary, + tt.setup() + + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(testAsset)) + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.assetID, + tt.args.mutableMetaProps.(lists.PropertyList), + tt.args.mutableProps.(lists.PropertyList)).(helpers.Message), + ) + + if (tt.wantErr != nil && !tt.wantErr.Is(err)) || (tt.wantErr == nil && err != nil) { + t.Errorf("unexpected error: %v", err) } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.parameterManager, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) + + if !reflect.DeepEqual(got, tt.want) { + t.Error("unexpected response") } }) } diff --git a/x/assets/transactions/renumerate/transaction_keeper_test.go b/x/assets/transactions/renumerate/transaction_keeper_test.go index 397f59d6c..839f45b05 100644 --- a/x/assets/transactions/renumerate/transaction_keeper_test.go +++ b/x/assets/transactions/renumerate/transaction_keeper_test.go @@ -5,16 +5,35 @@ package renumerate import ( "context" - "fmt" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" + recordassets "github.com/AssetMantle/modules/x/assets/record" + "github.com/AssetMantle/modules/x/metas/auxiliaries/supplement" + baseDocuments "github.com/AssetMantle/schema/documents/base" + "github.com/AssetMantle/schema/ids" + "github.com/AssetMantle/schema/parameters/base" + constantProperties "github.com/AssetMantle/schema/properties/constants" + "github.com/cometbft/cometbft/crypto/ed25519" storeTypes "github.com/cosmos/cosmos-sdk/store/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/x/assets/mapper" + "github.com/AssetMantle/modules/x/assets/parameters" + "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" - "github.com/AssetMantle/schema/properties" + baseMetaProp "github.com/AssetMantle/schema/properties/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" tendermintDB "github.com/cometbft/cometbft-db" @@ -23,177 +42,294 @@ import ( "github.com/cosmos/cosmos-sdk/store" sdkTypes "github.com/cosmos/cosmos-sdk/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" - "github.com/stretchr/testify/require" +) - "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/assets/mapper" - "github.com/AssetMantle/modules/x/assets/parameters" - "github.com/AssetMantle/modules/x/assets/record" - "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" - "github.com/AssetMantle/modules/x/maintainers/auxiliaries/authorize" - "github.com/AssetMantle/modules/x/metas/auxiliaries/supplement" - "github.com/AssetMantle/modules/x/splits/auxiliaries/renumerate" +type MockAuxiliary struct { + mock.Mock +} + +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) + +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) +} + +type MockAuxiliaryKeeper struct { + mock.Mock +} + +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) + +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) +} +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) +} + +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 ) var ( - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - renumerateAuxiliary helpers.Auxiliary - supplementAuxiliary helpers.Auxiliary -) + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) -type TestKeepers struct { - RenumerateKeeper helpers.TransactionKeeper -} + randomInteger int64 = 100 + randomNegativeInteger int64 = -1 + + SupplyNotRevealedProperty = baseMetaProp.NewMesaProperty(constantProperties.SupplyProperty.GetID().GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomNegativeInteger))) + NegativeSupplyProperty = baseMetaProp.NewMetaProperty(constantProperties.SupplyProperty.GetID().GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomNegativeInteger))) -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() - - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - ParamsKeeper := paramsKeeper.NewKeeper( - codec, - legacyAmino, - paramsStoreKey, - paramsTransientStoreKeys, + propList = baseQualified.NewMutables(mutableMetaProperties).GetMutablePropertyList().Add( + baseProperties.NewMesaProperty(constantProperties.SupplyProperty.GetKey(), baseData.NewNumberData(sdkTypes.NewInt(randomInteger))), ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) + newMutables = baseQualified.NewMutables(propList) + testNewAsset = baseDocuments.NewAsset(baseIDs.NewClassificationID(immutables, newMutables), immutables, newMutables) + testNewAssetID = baseIDs.NewAssetID(testNewAsset.GetClassificationID(), testNewAsset.GetImmutables()).(*baseIDs.AssetID) - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) + authorizeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authorizeAuxiliaryFailureClassificationID = baseIDs.NewIdentityID(testNewAsset.GetClassificationID(), immutables) + authorizeAuxiliary = new(MockAuxiliary) + _ = authorizeAuxiliary.On("GetKeeper").Return(authorizeAuxiliaryKeeper) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) - authorizeAuxiliary = authorize.Auxiliary.Initialize(Mapper, parameterManager) - renumerateAuxiliary = renumerate.Auxiliary.Initialize(Mapper, parameterManager) - supplementAuxiliary = supplement.Auxiliary.Initialize(Mapper, parameterManager) + renumerateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + renumerateAuxiliary = new(MockAuxiliary) + _ = renumerateAuxiliary.On("GetKeeper").Return(renumerateAuxiliaryKeeper) - keepers := TestKeepers{ - RenumerateKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } + supplementAuxiliaryKeeper = new(MockAuxiliaryKeeper) + supplementAuxiliary = new(MockAuxiliary) + _ = supplementAuxiliary.On("GetKeeper").Return(supplementAuxiliaryKeeper) - return Context, keepers, Mapper, parameterManager -} + codec = baseHelpers.TestCodec() -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) - } -} + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + ParamsKeeper = paramsKeeper.NewKeeper(codec, codec.GetLegacyAmino(), paramsStoreKey, paramsTransientStoreKeys) -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - renumerateAuxiliary helpers.Auxiliary - supplementAuxiliary helpers.Auxiliary - } - type args struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - auxiliaries []interface{} - } - tests := []struct { - name string - fields fields - args args - want helpers.Keeper - }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, renumerateAuxiliary, supplementAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, parameterManager, authenticateAuxiliary, renumerateAuxiliary, supplementAuxiliary, authenticateAuxiliary}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - renumerateAuxiliary: tt.fields.renumerateAuxiliary, - supplementAuxiliary: tt.fields.supplementAuxiliary, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.parameterManager, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) - } - }) + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + Context = setContext() + + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + parameterManager = parameters.Prototype().Initialize(ParamsKeeper.Subspace(constants.ModuleName).WithKeyTable(parameters.Prototype().GetKeyTable())). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.WrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))) + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), + parameterManager, + authenticateAuxiliary, + authorizeAuxiliary, + renumerateAuxiliary, + supplementAuxiliary, } +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Transact(t *testing.T) { - Context, keepers, Mapper, parameterManager := createTestInput(t) - immutableProperties := baseLists.NewPropertyList([]properties.Property{baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData")), baseProperties.NewMetaProperty(baseIDs.NewStringID("supply"), baseData.NewDecData(sdkTypes.NewDec(1)))}...) - immutables := baseQualified.NewImmutables(immutableProperties) - mutableProperties := baseLists.NewPropertyList([]properties.Property{baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())}...) - mutables := baseQualified.NewMutables(mutableProperties) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - testAssetID := baseIDs.NewAssetID(classificationID, immutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.RenumerateKeeper.(transactionKeeper).mapper.NewCollection(Context.Context()).Add(record.NewRecord(testAsset)) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - authorizeAuxiliary helpers.Auxiliary - renumerateAuxiliary helpers.Auxiliary - supplementAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { type args struct { - context context.Context - message helpers.Message + from sdkTypes.AccAddress + fromID ids.IdentityID + assetID ids.AssetID + denom string } + tests := []struct { name string - fields fields args args - want helpers.TransactionResponse - wantErr bool + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, renumerateAuxiliary, supplementAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, testAssetID).(*Message)}, newTransactionResponse(), false}, - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, authorizeAuxiliary, renumerateAuxiliary, supplementAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, baseIDs.PrototypeAssetID()).(*Message)}, newTransactionResponse(), false}, + { + name: "RenumerateTransactionKeeperSuccess", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + denom: Denom, + }, + setup: func() { + renumerateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList(constantProperties.SupplyProperty)), nil).Once() + }, + want: newTransactionResponse(), + wantErr: nil, + }, + { + name: "RenumeratePropertyDisabled", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + denom: Denom, + }, + setup: func() { + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(false))))) + }, + want: nil, + wantErr: errorConstants.NotAuthorized, + }, + { + name: "AuthenticationFailure", + args: args{ + from: authenticateAuxiliaryFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: baseIDs.PrototypeAssetID(), + denom: Denom, + }, + setup: func() { + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))) + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "EntityNotFoundFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: baseIDs.PrototypeAssetID(), + denom: Denom, + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.EntityNotFound, + }, + { + name: "AuthorizeAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: authorizeAuxiliaryFailureClassificationID, + assetID: testNewAssetID, + denom: Denom, + }, + setup: func() { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "SupplementAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + }, + setup: func() { + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "SupplyNotRevealedError", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + }, + setup: func() { + renumerateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList(SupplyNotRevealedProperty)), nil).Once() + }, + want: nil, + wantErr: errorConstants.MetaDataError, + }, + { + name: "NegativeSupplyFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + }, + setup: func() { + renumerateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList(NegativeSupplyProperty)), nil).Once() + }, + want: nil, + wantErr: errorConstants.MetaDataError, + }, + { + name: "RenumerateAuxiliaryFailure", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + assetID: testNewAssetID, + }, + setup: func() { + renumerateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() + authorizeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil).Once() + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList(constantProperties.SupplyProperty)), nil).Once() + }, + want: nil, + wantErr: errorConstants.MockError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - authorizeAuxiliary: tt.fields.authorizeAuxiliary, - renumerateAuxiliary: tt.fields.renumerateAuxiliary, - supplementAuxiliary: tt.fields.supplementAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return + tt.setup() + + TransactionKeeper.mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(recordassets.NewRecord(testNewAsset)) + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.assetID).(helpers.Message)) + + if (err != nil) && !tt.wantErr.Is(err) { + t.Errorf("unexpected error: %v", err) } + if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + t.Error("unexpected response") } }) } diff --git a/x/assets/transactions/revoke/transaction_keeper_test.go b/x/assets/transactions/revoke/transaction_keeper_test.go index 041b5ddcb..e52cd096a 100644 --- a/x/assets/transactions/revoke/transaction_keeper_test.go +++ b/x/assets/transactions/revoke/transaction_keeper_test.go @@ -5,179 +5,218 @@ package revoke import ( "context" - "fmt" - "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/assets/mapper" - "github.com/AssetMantle/modules/x/assets/parameters" - "github.com/AssetMantle/modules/x/assets/record" + errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/assets/constants" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/x/maintainers/auxiliaries/revoke" + "github.com/AssetMantle/schema/ids" + "github.com/AssetMantle/schema/parameters/base" + constantProperties "github.com/AssetMantle/schema/properties/constants" + "github.com/cometbft/cometbft/crypto/ed25519" + storeTypes "github.com/cosmos/cosmos-sdk/store/types" + authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" + authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" + bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" + bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" + paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/stretchr/testify/mock" + "testing" + baseData "github.com/AssetMantle/schema/data/base" - "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" - baseQualified "github.com/AssetMantle/schema/qualified/base" tendermintDB "github.com/cometbft/cometbft-db" "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" "github.com/stretchr/testify/require" - "reflect" - "testing" -) -var ( - authenticateAuxiliary helpers.Auxiliary - revokeAuxiliary helpers.Auxiliary + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/x/assets/mapper" + "github.com/AssetMantle/modules/x/assets/parameters" + "github.com/AssetMantle/modules/x/classifications/auxiliaries/define" ) -type TestKeepers struct { - RevokeKeeper helpers.TransactionKeeper +type MockAuxiliary struct { + mock.Mock } -func createTestInput(t *testing.T) (sdkTypes.Context, TestKeepers, helpers.Mapper, helpers.ParameterManager) { - var legacyAmino = baseHelpers.CodecPrototype().GetLegacyAmino() - - storeKey := sdkTypes.NewKVStoreKey("test") - paramsStoreKey := sdkTypes.NewKVStoreKey("testParams") - paramsTransientStoreKeys := sdkTypes.NewTransientStoreKey("testParamsTransient") - Mapper := mapper.Prototype().Initialize(storeKey) - codec := baseHelpers.TestCodec() - ParamsKeeper := paramsKeeper.NewKeeper( - codec, - legacyAmino, - paramsStoreKey, - paramsTransientStoreKeys, - ) - parameterManager := parameters.Prototype().Initialize(ParamsKeeper.Subspace("test")) - - memDB := tendermintDB.NewMemDB() - commitMultiStore := store.NewCommitMultiStore(memDB) - commitMultiStore.MountStoreWithDB(storeKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) - commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) - err := commitMultiStore.LoadLatestVersion() - require.Nil(t, err) +var _ helpers.Auxiliary = (*MockAuxiliary)(nil) - Context := sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ - ChainID: "test", - }, false, log.NewNopLogger()) +func (mockAuxiliary *MockAuxiliary) GetName() string { panic(mockAuxiliary) } +func (mockAuxiliary *MockAuxiliary) GetKeeper() helpers.AuxiliaryKeeper { + args := mockAuxiliary.Called() + return args.Get(0).(helpers.AuxiliaryKeeper) +} +func (mockAuxiliary *MockAuxiliary) Initialize(_ helpers.Mapper, _ helpers.ParameterManager, _ ...interface{}) helpers.Auxiliary { + panic(mockAuxiliary) +} - revokeAuxiliary = revoke.Auxiliary.Initialize(Mapper, parameterManager) - authenticateAuxiliary = authenticate.Auxiliary.Initialize(Mapper, parameterManager) +type MockAuxiliaryKeeper struct { + mock.Mock +} - keepers := TestKeepers{ - RevokeKeeper: keeperPrototype().Initialize(Mapper, parameterManager, []interface{}{}).(helpers.TransactionKeeper), - } +var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) - return Context, keepers, Mapper, parameterManager +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) + return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) } - -func Test_keeperPrototype(t *testing.T) { - tests := []struct { - name string - want helpers.TransactionKeeper - }{ - {"+ve", transactionKeeper{}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - if got := keeperPrototype(); !reflect.DeepEqual(got, tt.want) { - t.Errorf("keeperPrototype() = %v, want %v", got, tt.want) - } - }) - } +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) + return args.Get(0).(helpers.Keeper) } -func Test_transactionKeeper_Initialize(t *testing.T) { - _, _, Mapper, parameterManager := createTestInput(t) - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - revokeAuxiliary helpers.Auxiliary - } - type args struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - auxiliaries []interface{} - } - tests := []struct { - name string - fields fields - args args - want helpers.Keeper - }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, revokeAuxiliary}, args{Mapper, parameterManager, []interface{}{}}, transactionKeeper{Mapper, parameterManager, authenticateAuxiliary, revokeAuxiliary}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - revokeAuxiliary: tt.fields.revokeAuxiliary, - } - if got := transactionKeeper.Initialize(tt.args.mapper, tt.args.parameterManager, tt.args.auxiliaries); !reflect.DeepEqual(fmt.Sprint(got), fmt.Sprint(tt.want)) { - t.Errorf("Initialize() = %v, want %v", got, tt.want) - } - }) +const ( + TestMinterModuleName = "testMinter" + Denom = "stake" + ChainID = "testChain" + GenesisSupply = 1000000000000 +) + +var ( + moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) + + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) + authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) + + revokeAuxiliaryKeeper = new(MockAuxiliaryKeeper) + revokeAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + revokeAuxiliaryKeeperFailureID = baseIDs.NewIdentityID(baseIDs.NewClassificationID(immutables, mutables), immutables) + _ = revokeAuxiliaryKeeper.On("Help", mock.Anything, revoke.NewAuxiliaryRequest(revokeAuxiliaryKeeperFailureID, baseIDs.PrototypeIdentityID(), baseIDs.PrototypeClassificationID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) + _ = revokeAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(define.NewAuxiliaryResponse(baseIDs.PrototypeClassificationID()), nil) + revokeAuxiliary = new(MockAuxiliary) + _ = revokeAuxiliary.On("GetKeeper").Return(revokeAuxiliaryKeeper) + + codec = baseHelpers.TestCodec() + + paramsStoreKey = sdkTypes.NewKVStoreKey(paramsTypes.StoreKey) + paramsTransientStoreKeys = sdkTypes.NewTransientStoreKey(paramsTypes.TStoreKey) + ParamsKeeper = paramsKeeper.NewKeeper(codec, codec.GetLegacyAmino(), paramsStoreKey, paramsTransientStoreKeys) + + authStoreKey = sdkTypes.NewKVStoreKey(authTypes.StoreKey) + moduleAccountPermissions = map[string][]string{TestMinterModuleName: {authTypes.Minter}, constants.ModuleName: nil} + AuthKeeper = authKeeper.NewAccountKeeper(codec, authStoreKey, authTypes.ProtoBaseAccount, moduleAccountPermissions, sdkTypes.GetConfig().GetBech32AccountAddrPrefix(), authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + bankStoreKey = sdkTypes.NewKVStoreKey(bankTypes.StoreKey) + blacklistedAddresses = map[string]bool{authTypes.NewModuleAddress(TestMinterModuleName).String(): false, authTypes.NewModuleAddress(constants.ModuleName).String(): false} + BankKeeper = bankKeeper.NewBaseKeeper(codec, bankStoreKey, AuthKeeper, blacklistedAddresses, authTypes.NewModuleAddress(govTypes.ModuleName).String()) + + Context = setContext() + + coinSupply = sdkTypes.NewCoins(sdkTypes.NewCoin(Denom, sdkTypes.NewInt(GenesisSupply))) + _ = BankKeeper.MintCoins(Context, TestMinterModuleName, coinSupply) + + genesisAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) + _ = BankKeeper.SendCoinsFromModuleToAccount(Context, TestMinterModuleName, genesisAddress, coinSupply) + + parameterManager = parameters.Prototype().Initialize(ParamsKeeper.Subspace(constants.ModuleName).WithKeyTable(parameters.Prototype().GetKeyTable())). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.WrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.BurnEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.MintEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.RenumerateEnabledProperty.GetKey(), baseData.NewBooleanData(true))))). + Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(Denom)))))) + TransactionKeeper = transactionKeeper{mapper.Prototype().Initialize(moduleStoreKey), + parameterManager, + authenticateAuxiliary, + revokeAuxiliary, } +) + +func setContext() sdkTypes.Context { + memDB := tendermintDB.NewMemDB() + commitMultiStore := store.NewCommitMultiStore(memDB) + commitMultiStore.MountStoreWithDB(moduleStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(authStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(bankStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsStoreKey, storeTypes.StoreTypeIAVL, memDB) + commitMultiStore.MountStoreWithDB(paramsTransientStoreKeys, storeTypes.StoreTypeTransient, memDB) + _ = commitMultiStore.LoadLatestVersion() + return sdkTypes.NewContext(commitMultiStore, protoTendermintTypes.Header{ChainID: ChainID}, false, log.NewNopLogger()) } -func Test_transactionKeeper_Transact(t *testing.T) { - Context, keepers, Mapper, parameterManager := createTestInput(t) - immutableProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("ID1"), baseData.NewStringData("ImmutableData"))) - immutables := baseQualified.NewImmutables(immutableProperties) - mutableProperties := baseLists.NewPropertyList(baseProperties.NewMetaProperty(baseIDs.NewStringID("authentication"), baseData.NewListData())) - mutables := baseQualified.NewMutables(mutableProperties) - classificationID := baseIDs.NewClassificationID(immutables, mutables) - testAsset := base.NewAsset(classificationID, immutables, mutables) - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - fromID := baseIDs.NewIdentityID(classificationID, immutables) - keepers.RevokeKeeper.(transactionKeeper).mapper.NewCollection(sdkTypes.WrapSDKContext(Context)).Add(record.NewRecord(testAsset)) - - type fields struct { - mapper helpers.Mapper - parameterManager helpers.ParameterManager - authenticateAuxiliary helpers.Auxiliary - revokeAuxiliary helpers.Auxiliary - } +func TestTransactionKeeperTransact(t *testing.T) { type args struct { - context context.Context - message helpers.Message + from sdkTypes.AccAddress + fromID ids.IdentityID + toID ids.IdentityID + classificationID ids.ClassificationID } + tests := []struct { name string - fields fields args args - want helpers.TransactionResponse - wantErr bool + setup func() + want *TransactionResponse + wantErr helpers.Error }{ - {"+ve", fields{Mapper, parameterManager, authenticateAuxiliary, revokeAuxiliary}, args{Context.Context(), NewMessage(fromAccAddress, fromID, fromID, classificationID).(*Message)}, newTransactionResponse(), false}, + { + name: "RevokeTransactionKeeperSuccess", + args: args{ + from: genesisAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + }, + setup: func() { + }, + want: newTransactionResponse(), + wantErr: nil, + }, + { + name: "AuthenticationFailure", + args: args{ + from: authenticateAuxiliaryFailureAddress, + fromID: baseIDs.PrototypeIdentityID(), + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + }, + setup: func() { + }, + want: nil, + wantErr: errorConstants.MockError, + }, + { + name: "RevokeAuxiliaryFailure", + args: args{ + from: revokeAuxiliaryFailureAddress, + fromID: revokeAuxiliaryKeeperFailureID, + toID: baseIDs.PrototypeIdentityID(), + classificationID: baseIDs.PrototypeClassificationID(), + }, + setup: func() { + + }, + want: nil, + wantErr: errorConstants.MockError, + }, } + for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - transactionKeeper := transactionKeeper{ - mapper: tt.fields.mapper, - parameterManager: tt.fields.parameterManager, - authenticateAuxiliary: tt.fields.authenticateAuxiliary, - revokeAuxiliary: tt.fields.revokeAuxiliary, - } - got, err := transactionKeeper.Transact(tt.args.context, tt.args.message) - if (err != nil) != tt.wantErr { - t.Errorf("Transact() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Transact() got = %v, want %v", got, tt.want) + tt.setup() + + got, err := TransactionKeeper.Transact(sdkTypes.WrapSDKContext(Context), + NewMessage(tt.args.from, + tt.args.fromID, + tt.args.toID, + tt.args.classificationID).(helpers.Message)) + + if tt.wantErr != nil { + require.Error(t, err) + require.Equal(t, tt.wantErr, err) + } else { + require.NoError(t, err) + require.Equal(t, tt.want, got) } }) } diff --git a/x/assets/transactions/send/transaction_keeper_test.go b/x/assets/transactions/send/transaction_keeper_test.go index 718661e1c..418d8335d 100644 --- a/x/assets/transactions/send/transaction_keeper_test.go +++ b/x/assets/transactions/send/transaction_keeper_test.go @@ -64,12 +64,12 @@ type MockAuxiliaryKeeper struct { var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) -func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, request helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { - args := mockAuxiliaryKeeper.Called(context, request) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) } -func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(m2 helpers.Mapper, manager helpers.ParameterManager, i []interface{}) helpers.Keeper { - args := mockAuxiliaryKeeper.Called(m2, manager, i) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) return args.Get(0).(helpers.Keeper) } @@ -83,7 +83,6 @@ var ( randomMetaPropertyGenerator = func() properties.MetaProperty { return baseProperties.NewMetaProperty(baseIDs.NewStringID(random.GenerateUniqueIdentifier()), baseData.NewStringData(random.GenerateUniqueIdentifier())) } - randomAssetGenerator = func(withImmutable, withMutable properties.Property) documents.Asset { immutables := baseQualified.NewImmutables(baseLists.NewPropertyList(withImmutable, randomMetaPropertyGenerator(), randomMetaPropertyGenerator(), randomMetaPropertyGenerator())) mutables := baseQualified.NewMutables(baseLists.NewPropertyList(withMutable, randomMetaPropertyGenerator(), randomMetaPropertyGenerator(), randomMetaPropertyGenerator())) @@ -110,35 +109,34 @@ var ( authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) + + supplementAuxiliaryKeeper = new(MockAuxiliaryKeeper) + supplementAuxiliaryFailureAsset = randomAssetGenerator( + baseProperties.NewMesaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(0))), + nil, + ) + supplementAuxiliaryFailureAssetID = baseIDs.NewAssetID(supplementAuxiliaryFailureAsset.GetClassificationID(), supplementAuxiliaryFailureAsset.GetImmutables()).(*baseIDs.AssetID) - authenticateAuxiliary = new(MockAuxiliary) - _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) + mesaLockAsset = randomAssetGenerator(baseProperties.NewMesaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(1))), nil) + mesaLockAssetID = baseIDs.NewAssetID(mesaLockAsset.GetClassificationID(), mesaLockAsset.GetImmutables()).(*baseIDs.AssetID) + _ = supplementAuxiliaryKeeper.On("Help", mock.Anything, supplement.NewAuxiliaryRequest(mesaLockAsset.GetProperty(constantProperties.LockHeightProperty.GetID()))).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(1))))), nil) - supplementAuxiliaryKeeper = new(MockAuxiliaryKeeper) - - supplementAuxiliaryFailureAsset = randomAssetGenerator(baseProperties.NewMetaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(0))).ScrubData(), nil) - supplementAuxiliaryFailureAssetID = baseIDs.NewAssetID(supplementAuxiliaryFailureAsset.GetClassificationID(), supplementAuxiliaryFailureAsset.GetImmutables()).(*baseIDs.AssetID) - _ = supplementAuxiliaryKeeper.On("Help", mock.Anything, supplement.NewAuxiliaryRequest(supplementAuxiliaryFailureAsset.GetProperty(constantProperties.LockHeightProperty.GetID()))).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) - mesaLockAsset = randomAssetGenerator(baseProperties.NewMesaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(1))), nil) - mesaLockAssetID = baseIDs.NewAssetID(mesaLockAsset.GetClassificationID(), mesaLockAsset.GetImmutables()).(*baseIDs.AssetID) - _ = supplementAuxiliaryKeeper.On("Help", mock.Anything, supplement.NewAuxiliaryRequest(mesaLockAsset.GetProperty(constantProperties.LockHeightProperty.GetID()))).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList(baseProperties.NewMetaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(1))))), nil) - unrevealedLockAsset = randomAssetGenerator(baseProperties.NewMesaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(2))), nil) - unrevealedLockAssetID = baseIDs.NewAssetID(unrevealedLockAsset.GetClassificationID(), unrevealedLockAsset.GetImmutables()).(*baseIDs.AssetID) - _ = supplementAuxiliaryKeeper.On("Help", mock.Anything, supplement.NewAuxiliaryRequest(unrevealedLockAsset.GetProperty(constantProperties.LockHeightProperty.GetID()))).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList()), nil) - _ = supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + unrevealedLockAsset = randomAssetGenerator(baseProperties.NewMesaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(2))), nil) + unrevealedLockAssetID = baseIDs.NewAssetID(unrevealedLockAsset.GetClassificationID(), unrevealedLockAsset.GetImmutables()).(*baseIDs.AssetID) + _ = supplementAuxiliaryKeeper.On("Help", mock.Anything, supplement.NewAuxiliaryRequest(unrevealedLockAsset.GetProperty(constantProperties.LockHeightProperty.GetID()))).Return(supplement.NewAuxiliaryResponse(baseLists.NewPropertyList()), nil) supplementAuxiliaryAuxiliary = new(MockAuxiliary) _ = supplementAuxiliaryAuxiliary.On("GetKeeper").Return(supplementAuxiliaryKeeper) - transferAuxiliaryKeeper = new(MockAuxiliaryKeeper) - + transferAuxiliaryKeeper = new(MockAuxiliaryKeeper) transferAuxiliaryFailureAsset = randomAssetGenerator(baseProperties.NewMetaProperty(constantProperties.LockHeightProperty.GetKey(), baseData.NewHeightData(baseTypes.NewHeight(0))), nil) transferAuxiliaryFailureAssetID = baseIDs.NewAssetID(transferAuxiliaryFailureAsset.GetClassificationID(), transferAuxiliaryFailureAsset.GetImmutables()).(*baseIDs.AssetID) _ = transferAuxiliaryKeeper.On("Help", mock.Anything, transfer.NewAuxiliaryRequest(baseIDs.PrototypeIdentityID(), baseIDs.PrototypeIdentityID(), transferAuxiliaryFailureAssetID, sdkTypes.NewInt(1))).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) _ = transferAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) - - transferAuxiliaryAuxiliary = new(MockAuxiliary) - _ = transferAuxiliaryAuxiliary.On("GetKeeper").Return(transferAuxiliaryKeeper) + transferAuxiliaryAuxiliary = new(MockAuxiliary) + _ = transferAuxiliaryAuxiliary.On("GetKeeper").Return(transferAuxiliaryKeeper) codec = baseHelpers.TestCodec() @@ -258,19 +256,20 @@ func TestTransactionKeeperTransact(t *testing.T) { "sendAssetWithUnrevealedLock", args{fromAddress, unrevealedLockAssetID, 1}, func() { - }, nil, errorConstants.MetaDataError, }, { "supplementAuxiliaryFailure", - args{fromAddress, supplementAuxiliaryFailureAssetID, 1}, + args{fromAddress, supplementAuxiliaryFailureAssetID, 0}, func() { + supplementAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError).Once() }, nil, errorConstants.MockError, - }, { + }, + { "transferAuxiliaryFailure", args{fromAddress, transferAuxiliaryFailureAssetID, 1}, func() { diff --git a/x/assets/transactions/unwrap/transaction_keeper_test.go b/x/assets/transactions/unwrap/transaction_keeper_test.go index fb4dce300..918874d04 100644 --- a/x/assets/transactions/unwrap/transaction_keeper_test.go +++ b/x/assets/transactions/unwrap/transaction_keeper_test.go @@ -5,11 +5,8 @@ package unwrap import ( "context" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" - "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/utilities/random" "github.com/AssetMantle/modules/x/assets/constants" @@ -31,12 +28,14 @@ import ( "github.com/cometbft/cometbft/libs/log" protoTendermintTypes "github.com/cometbft/cometbft/proto/tendermint/types" "github.com/cosmos/cosmos-sdk/store" + storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkErrors "github.com/cosmos/cosmos-sdk/types/errors" authKeeper "github.com/cosmos/cosmos-sdk/x/auth/keeper" authTypes "github.com/cosmos/cosmos-sdk/x/auth/types" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" bankTypes "github.com/cosmos/cosmos-sdk/x/bank/types" + govTypes "github.com/cosmos/cosmos-sdk/x/gov/types" paramsKeeper "github.com/cosmos/cosmos-sdk/x/params/keeper" paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" "github.com/stretchr/testify/mock" @@ -67,12 +66,12 @@ type MockAuxiliaryKeeper struct { var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) -func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, request helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { - args := mockAuxiliaryKeeper.Called(context, request) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) } -func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(m2 helpers.Mapper, manager helpers.ParameterManager, i []interface{}) helpers.Keeper { - args := mockAuxiliaryKeeper.Called(m2, manager, i) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) return args.Get(0).(helpers.Keeper) } @@ -86,21 +85,21 @@ const ( var ( moduleStoreKey = sdkTypes.NewKVStoreKey(constants.ModuleName) + newCollectionFaliure = "notfound" + authenticateAuxiliaryKeeper = new(MockAuxiliaryKeeper) authenticateAuxiliaryFailureAddress = sdkTypes.AccAddress(ed25519.GenPrivKey().PubKey().Address()) _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, authenticate.NewAuxiliaryRequest(authenticateAuxiliaryFailureAddress, baseIDs.PrototypeIdentityID())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) _ = authenticateAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) + authenticateAuxiliary = new(MockAuxiliary) + _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) - burnAuxiliaryKeeper = new(MockAuxiliaryKeeper) burnAuxiliaryFailureDenom = "burn" + burnAuxiliaryKeeper = new(MockAuxiliaryKeeper) _ = burnAuxiliaryKeeper.On("Help", mock.Anything, burn.NewAuxiliaryRequest(baseIDs.PrototypeIdentityID(), baseDocuments.NewCoinAsset(burnAuxiliaryFailureDenom).GetCoinAssetID(), sdkTypes.OneInt())).Return(new(helpers.AuxiliaryResponse), errorConstants.MockError) _ = burnAuxiliaryKeeper.On("Help", mock.Anything, mock.Anything).Return(new(helpers.AuxiliaryResponse), nil) - - authenticateAuxiliary = new(MockAuxiliary) - _ = authenticateAuxiliary.On("GetKeeper").Return(authenticateAuxiliaryKeeper) - - burnAuxiliary = new(MockAuxiliary) - _ = burnAuxiliary.On("GetKeeper").Return(burnAuxiliaryKeeper) + burnAuxiliary = new(MockAuxiliary) + _ = burnAuxiliary.On("GetKeeper").Return(burnAuxiliaryKeeper) codec = baseHelpers.TestCodec() @@ -225,6 +224,16 @@ func TestTransactionKeeperTransact(t *testing.T) { nil, errorConstants.NotAuthorized, }, + { + "EntityNotFound", + args{genesisAddress, burnAuxiliaryFailureDenom, 1}, + func() { + TransactionKeeper.parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(burnAuxiliaryFailureDenom)))))) + parameterManager.Set(sdkTypes.WrapSDKContext(Context), baseLists.NewParameterList(base.NewParameter(baseProperties.NewMetaProperty(constantProperties.UnwrapAllowedCoinsProperty.GetKey(), baseData.NewListData(baseData.NewStringData(newCollectionFaliure), baseData.NewStringData(burnAuxiliaryFailureDenom)))))) + }, + nil, + errorConstants.EntityNotFound, + }, { "burnAuxiliaryFailure", args{genesisAddress, burnAuxiliaryFailureDenom, 1}, diff --git a/x/assets/transactions/wrap/transaction_keeper_test.go b/x/assets/transactions/wrap/transaction_keeper_test.go index 7299ff76f..05ce634ce 100644 --- a/x/assets/transactions/wrap/transaction_keeper_test.go +++ b/x/assets/transactions/wrap/transaction_keeper_test.go @@ -65,12 +65,12 @@ type MockAuxiliaryKeeper struct { var _ helpers.AuxiliaryKeeper = (*MockAuxiliaryKeeper)(nil) -func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, request helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { - args := mockAuxiliaryKeeper.Called(context, request) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Help(context context.Context, auxiliaryRequest helpers.AuxiliaryRequest) (helpers.AuxiliaryResponse, error) { + args := mockAuxiliaryKeeper.Called(context, auxiliaryRequest) return args.Get(0).(helpers.AuxiliaryResponse), args.Error(1) } -func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(m2 helpers.Mapper, manager helpers.ParameterManager, i []interface{}) helpers.Keeper { - args := mockAuxiliaryKeeper.Called(m2, manager, i) +func (mockAuxiliaryKeeper *MockAuxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, i []interface{}) helpers.Keeper { + args := mockAuxiliaryKeeper.Called(mapper, parameterManager, i) return args.Get(0).(helpers.Keeper) } From 69a4402d8b6c2b4f244e85d530bada89fbfa15a3 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:53:52 +0530 Subject: [PATCH 44/64] chore: import formatting Signed-off-by: Deepanshu Tripathi --- x/assets/transactions/burn/transaction.go | 3 +-- x/assets/transactions/burn/transaction_keeper.go | 1 - x/assets/transactions/define/transaction.go | 3 +-- x/assets/transactions/define/transaction_keeper.go | 1 - x/assets/transactions/deputize/transaction.go | 3 +-- x/assets/transactions/deputize/transaction_keeper.go | 1 - x/assets/transactions/mint/transaction.go | 3 +-- x/assets/transactions/mint/transaction_keeper.go | 1 - x/assets/transactions/mutate/transaction.go | 3 +-- x/assets/transactions/mutate/transaction_keeper.go | 3 +-- x/assets/transactions/renumerate/transaction.go | 3 +-- x/assets/transactions/renumerate/transaction_keeper.go | 3 +-- x/assets/transactions/revoke/transaction.go | 3 +-- x/assets/transactions/revoke/transaction_keeper.go | 1 - x/assets/transactions/send/transaction.go | 3 +-- x/assets/transactions/unwrap/transaction.go | 3 +-- x/assets/transactions/unwrap/transaction_keeper.go | 1 - x/assets/transactions/wrap/transaction.go | 3 +-- x/identities/transactions/define/transaction.go | 3 +-- x/identities/transactions/define/transaction_keeper.go | 1 - x/identities/transactions/deputize/transaction.go | 3 +-- x/identities/transactions/deputize/transaction_keeper.go | 3 +-- x/identities/transactions/issue/transaction.go | 3 +-- x/identities/transactions/issue/transaction_keeper.go | 1 - x/identities/transactions/name/transaction.go | 3 +-- x/identities/transactions/name/transaction_keeper.go | 1 - x/identities/transactions/provision/transaction.go | 3 +-- x/identities/transactions/provision/transaction_keeper.go | 1 - x/identities/transactions/quash/transaction.go | 3 +-- x/identities/transactions/quash/transaction_keeper.go | 1 - x/identities/transactions/revoke/transaction.go | 3 +-- x/identities/transactions/revoke/transaction_keeper.go | 3 +-- x/identities/transactions/unprovision/transaction.go | 3 +-- x/identities/transactions/unprovision/transaction_keeper.go | 1 - x/identities/transactions/update/transaction.go | 3 +-- x/identities/transactions/update/transaction_keeper.go | 3 +-- x/metas/transactions/reveal/transaction.go | 3 +-- x/metas/transactions/reveal/transaction_keeper.go | 1 - x/orders/transactions/cancel/transaction.go | 3 +-- x/orders/transactions/cancel/transaction_keeper.go | 3 +-- x/orders/transactions/define/transaction.go | 3 +-- x/orders/transactions/define/transaction_keeper.go | 1 - x/orders/transactions/deputize/transaction.go | 3 +-- x/orders/transactions/deputize/transaction_keeper.go | 1 - x/orders/transactions/get/transaction.go | 3 +-- x/orders/transactions/get/transaction_keeper.go | 1 - x/orders/transactions/immediate/transaction.go | 3 +-- x/orders/transactions/immediate/transaction_keeper.go | 1 - x/orders/transactions/make/transaction.go | 3 +-- x/orders/transactions/make/transaction_keeper.go | 1 - x/orders/transactions/modify/transaction.go | 3 +-- x/orders/transactions/modify/transaction_keeper.go | 1 - x/orders/transactions/put/transaction.go | 3 +-- x/orders/transactions/put/transaction_keeper.go | 1 - x/orders/transactions/revoke/transaction.go | 3 +-- x/orders/transactions/revoke/transaction_keeper.go | 1 - x/orders/transactions/take/transaction.go | 3 +-- x/orders/transactions/take/transaction_keeper.go | 1 - 58 files changed, 36 insertions(+), 94 deletions(-) diff --git a/x/assets/transactions/burn/transaction.go b/x/assets/transactions/burn/transaction.go index bb91c052e..5ef26e1a4 100644 --- a/x/assets/transactions/burn/transaction.go +++ b/x/assets/transactions/burn/transaction.go @@ -4,11 +4,10 @@ package burn import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/burn/transaction_keeper.go b/x/assets/transactions/burn/transaction_keeper.go index e57e146a5..48a160fab 100644 --- a/x/assets/transactions/burn/transaction_keeper.go +++ b/x/assets/transactions/burn/transaction_keeper.go @@ -6,7 +6,6 @@ package burn import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/properties" propertyConstants "github.com/AssetMantle/schema/properties/constants" diff --git a/x/assets/transactions/define/transaction.go b/x/assets/transactions/define/transaction.go index 19e4243df..dac93a936 100644 --- a/x/assets/transactions/define/transaction.go +++ b/x/assets/transactions/define/transaction.go @@ -4,11 +4,10 @@ package define import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/define/transaction_keeper.go b/x/assets/transactions/define/transaction_keeper.go index 966dfdd5c..8ed438f24 100644 --- a/x/assets/transactions/define/transaction_keeper.go +++ b/x/assets/transactions/define/transaction_keeper.go @@ -5,7 +5,6 @@ package define import ( "context" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/assets/utilities" "github.com/AssetMantle/modules/x/classifications/auxiliaries/define" diff --git a/x/assets/transactions/deputize/transaction.go b/x/assets/transactions/deputize/transaction.go index fe1360902..5e3fbe2f0 100644 --- a/x/assets/transactions/deputize/transaction.go +++ b/x/assets/transactions/deputize/transaction.go @@ -4,11 +4,10 @@ package deputize import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/deputize/transaction_keeper.go b/x/assets/transactions/deputize/transaction_keeper.go index bd4d0fe66..7006bc035 100644 --- a/x/assets/transactions/deputize/transaction_keeper.go +++ b/x/assets/transactions/deputize/transaction_keeper.go @@ -5,7 +5,6 @@ package deputize import ( "context" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/assets/utilities" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" diff --git a/x/assets/transactions/mint/transaction.go b/x/assets/transactions/mint/transaction.go index 82f6a9627..2c44fab7e 100644 --- a/x/assets/transactions/mint/transaction.go +++ b/x/assets/transactions/mint/transaction.go @@ -4,11 +4,10 @@ package mint import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/mint/transaction_keeper.go b/x/assets/transactions/mint/transaction_keeper.go index b94e282bb..c35e06dd4 100644 --- a/x/assets/transactions/mint/transaction_keeper.go +++ b/x/assets/transactions/mint/transaction_keeper.go @@ -6,7 +6,6 @@ package mint import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" diff --git a/x/assets/transactions/mutate/transaction.go b/x/assets/transactions/mutate/transaction.go index 85abb1ea1..7408c6fa9 100644 --- a/x/assets/transactions/mutate/transaction.go +++ b/x/assets/transactions/mutate/transaction.go @@ -4,11 +4,10 @@ package mutate import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/mutate/transaction_keeper.go b/x/assets/transactions/mutate/transaction_keeper.go index 24020e51c..07142c151 100644 --- a/x/assets/transactions/mutate/transaction_keeper.go +++ b/x/assets/transactions/mutate/transaction_keeper.go @@ -5,9 +5,8 @@ package mutate import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/key" "github.com/AssetMantle/modules/x/assets/mappable" "github.com/AssetMantle/modules/x/assets/record" diff --git a/x/assets/transactions/renumerate/transaction.go b/x/assets/transactions/renumerate/transaction.go index d317f7d72..2fc4ab482 100644 --- a/x/assets/transactions/renumerate/transaction.go +++ b/x/assets/transactions/renumerate/transaction.go @@ -4,11 +4,10 @@ package renumerate import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/renumerate/transaction_keeper.go b/x/assets/transactions/renumerate/transaction_keeper.go index 92dbdc690..257fb1723 100644 --- a/x/assets/transactions/renumerate/transaction_keeper.go +++ b/x/assets/transactions/renumerate/transaction_keeper.go @@ -5,9 +5,8 @@ package renumerate import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/constants" "github.com/AssetMantle/modules/x/assets/key" "github.com/AssetMantle/modules/x/assets/mappable" diff --git a/x/assets/transactions/revoke/transaction.go b/x/assets/transactions/revoke/transaction.go index 639924c53..0e9712af4 100644 --- a/x/assets/transactions/revoke/transaction.go +++ b/x/assets/transactions/revoke/transaction.go @@ -4,11 +4,10 @@ package revoke import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/revoke/transaction_keeper.go b/x/assets/transactions/revoke/transaction_keeper.go index a045b5961..51a45d65f 100644 --- a/x/assets/transactions/revoke/transaction_keeper.go +++ b/x/assets/transactions/revoke/transaction_keeper.go @@ -5,7 +5,6 @@ package revoke import ( "context" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/x/maintainers/auxiliaries/revoke" diff --git a/x/assets/transactions/send/transaction.go b/x/assets/transactions/send/transaction.go index cde5d80c4..fa0712fae 100644 --- a/x/assets/transactions/send/transaction.go +++ b/x/assets/transactions/send/transaction.go @@ -4,11 +4,10 @@ package send import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/unwrap/transaction.go b/x/assets/transactions/unwrap/transaction.go index bd994f30b..85dc58386 100644 --- a/x/assets/transactions/unwrap/transaction.go +++ b/x/assets/transactions/unwrap/transaction.go @@ -4,11 +4,10 @@ package unwrap import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/assets/transactions/unwrap/transaction_keeper.go b/x/assets/transactions/unwrap/transaction_keeper.go index 9eb758f35..1cd1ea3eb 100644 --- a/x/assets/transactions/unwrap/transaction_keeper.go +++ b/x/assets/transactions/unwrap/transaction_keeper.go @@ -7,7 +7,6 @@ import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/constants" - "github.com/AssetMantle/schema/data/base" baseDocuments "github.com/AssetMantle/schema/documents/base" constantProperties "github.com/AssetMantle/schema/properties/constants" diff --git a/x/assets/transactions/wrap/transaction.go b/x/assets/transactions/wrap/transaction.go index 1270b6513..1aa978b1e 100644 --- a/x/assets/transactions/wrap/transaction.go +++ b/x/assets/transactions/wrap/transaction.go @@ -4,11 +4,10 @@ package wrap import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/define/transaction.go b/x/identities/transactions/define/transaction.go index 19e4243df..dac93a936 100644 --- a/x/identities/transactions/define/transaction.go +++ b/x/identities/transactions/define/transaction.go @@ -4,11 +4,10 @@ package define import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/define/transaction_keeper.go b/x/identities/transactions/define/transaction_keeper.go index b13409623..e4ca3b0f6 100644 --- a/x/identities/transactions/define/transaction_keeper.go +++ b/x/identities/transactions/define/transaction_keeper.go @@ -6,7 +6,6 @@ package define import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/properties/constants" "github.com/AssetMantle/schema/qualified/base" diff --git a/x/identities/transactions/deputize/transaction.go b/x/identities/transactions/deputize/transaction.go index f1dc365cd..a02c4815b 100644 --- a/x/identities/transactions/deputize/transaction.go +++ b/x/identities/transactions/deputize/transaction.go @@ -4,11 +4,10 @@ package deputize import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/deputize/transaction_keeper.go b/x/identities/transactions/deputize/transaction_keeper.go index db249dfbf..225919b36 100644 --- a/x/identities/transactions/deputize/transaction_keeper.go +++ b/x/identities/transactions/deputize/transaction_keeper.go @@ -5,9 +5,8 @@ package deputize import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/identities/key" "github.com/AssetMantle/modules/x/identities/mappable" "github.com/AssetMantle/modules/x/identities/utilities" diff --git a/x/identities/transactions/issue/transaction.go b/x/identities/transactions/issue/transaction.go index 433e0aad1..49b77de4e 100644 --- a/x/identities/transactions/issue/transaction.go +++ b/x/identities/transactions/issue/transaction.go @@ -4,11 +4,10 @@ package issue import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/issue/transaction_keeper.go b/x/identities/transactions/issue/transaction_keeper.go index c399cd1a9..cd74eb2f8 100644 --- a/x/identities/transactions/issue/transaction_keeper.go +++ b/x/identities/transactions/issue/transaction_keeper.go @@ -6,7 +6,6 @@ package issue import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" diff --git a/x/identities/transactions/name/transaction.go b/x/identities/transactions/name/transaction.go index f0e7a434b..469d28cf5 100644 --- a/x/identities/transactions/name/transaction.go +++ b/x/identities/transactions/name/transaction.go @@ -4,11 +4,10 @@ package name import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/name/transaction_keeper.go b/x/identities/transactions/name/transaction_keeper.go index d874fca83..d17e2f253 100644 --- a/x/identities/transactions/name/transaction_keeper.go +++ b/x/identities/transactions/name/transaction_keeper.go @@ -6,7 +6,6 @@ package name import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" "github.com/cosmos/cosmos-sdk/types" diff --git a/x/identities/transactions/provision/transaction.go b/x/identities/transactions/provision/transaction.go index 943152242..f75668980 100644 --- a/x/identities/transactions/provision/transaction.go +++ b/x/identities/transactions/provision/transaction.go @@ -4,11 +4,10 @@ package provision import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/provision/transaction_keeper.go b/x/identities/transactions/provision/transaction_keeper.go index 6d8a6b6cc..0a54425ae 100644 --- a/x/identities/transactions/provision/transaction_keeper.go +++ b/x/identities/transactions/provision/transaction_keeper.go @@ -6,7 +6,6 @@ package provision import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/properties/constants" sdkTypes "github.com/cosmos/cosmos-sdk/types" diff --git a/x/identities/transactions/quash/transaction.go b/x/identities/transactions/quash/transaction.go index bb558d772..834f9c601 100644 --- a/x/identities/transactions/quash/transaction.go +++ b/x/identities/transactions/quash/transaction.go @@ -4,11 +4,10 @@ package quash import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/quash/transaction_keeper.go b/x/identities/transactions/quash/transaction_keeper.go index 8a6b5bd02..eece7ced8 100644 --- a/x/identities/transactions/quash/transaction_keeper.go +++ b/x/identities/transactions/quash/transaction_keeper.go @@ -6,7 +6,6 @@ package quash import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/properties" constantProperties "github.com/AssetMantle/schema/properties/constants" diff --git a/x/identities/transactions/revoke/transaction.go b/x/identities/transactions/revoke/transaction.go index 639924c53..0e9712af4 100644 --- a/x/identities/transactions/revoke/transaction.go +++ b/x/identities/transactions/revoke/transaction.go @@ -4,11 +4,10 @@ package revoke import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/revoke/transaction_keeper.go b/x/identities/transactions/revoke/transaction_keeper.go index bab5b5005..b5b81afd0 100644 --- a/x/identities/transactions/revoke/transaction_keeper.go +++ b/x/identities/transactions/revoke/transaction_keeper.go @@ -5,9 +5,8 @@ package revoke import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/identities/key" "github.com/AssetMantle/modules/x/identities/mappable" "github.com/AssetMantle/modules/x/maintainers/auxiliaries/revoke" diff --git a/x/identities/transactions/unprovision/transaction.go b/x/identities/transactions/unprovision/transaction.go index 5e7eddca9..da1a95139 100644 --- a/x/identities/transactions/unprovision/transaction.go +++ b/x/identities/transactions/unprovision/transaction.go @@ -4,11 +4,10 @@ package unprovision import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/unprovision/transaction_keeper.go b/x/identities/transactions/unprovision/transaction_keeper.go index c4d6cbae0..c40872901 100644 --- a/x/identities/transactions/unprovision/transaction_keeper.go +++ b/x/identities/transactions/unprovision/transaction_keeper.go @@ -6,7 +6,6 @@ package unprovision import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/identities/transactions/update/transaction.go b/x/identities/transactions/update/transaction.go index f62f639da..d72d75ff1 100644 --- a/x/identities/transactions/update/transaction.go +++ b/x/identities/transactions/update/transaction.go @@ -4,11 +4,10 @@ package update import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/identities/transactions/update/transaction_keeper.go b/x/identities/transactions/update/transaction_keeper.go index 205d08607..ff822a89a 100644 --- a/x/identities/transactions/update/transaction_keeper.go +++ b/x/identities/transactions/update/transaction_keeper.go @@ -5,9 +5,8 @@ package update import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/classifications/auxiliaries/member" "github.com/AssetMantle/modules/x/identities/key" "github.com/AssetMantle/modules/x/identities/mappable" diff --git a/x/metas/transactions/reveal/transaction.go b/x/metas/transactions/reveal/transaction.go index f2f2484cb..f698f74a1 100644 --- a/x/metas/transactions/reveal/transaction.go +++ b/x/metas/transactions/reveal/transaction.go @@ -4,11 +4,10 @@ package reveal import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/metas/transactions/reveal/transaction_keeper.go b/x/metas/transactions/reveal/transaction_keeper.go index cbc0980d6..9c9960d98 100644 --- a/x/metas/transactions/reveal/transaction_keeper.go +++ b/x/metas/transactions/reveal/transaction_keeper.go @@ -6,7 +6,6 @@ package reveal import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" baseIDs "github.com/AssetMantle/schema/ids/base" constantProperties "github.com/AssetMantle/schema/properties/constants" diff --git a/x/orders/transactions/cancel/transaction.go b/x/orders/transactions/cancel/transaction.go index 2b5a01955..a9a93666a 100644 --- a/x/orders/transactions/cancel/transaction.go +++ b/x/orders/transactions/cancel/transaction.go @@ -4,11 +4,10 @@ package cancel import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/cancel/transaction_keeper.go b/x/orders/transactions/cancel/transaction_keeper.go index 9dcd51fca..fece1f3a5 100644 --- a/x/orders/transactions/cancel/transaction_keeper.go +++ b/x/orders/transactions/cancel/transaction_keeper.go @@ -5,9 +5,8 @@ package cancel import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/classifications/auxiliaries/unbond" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/x/maintainers/auxiliaries/authorize" diff --git a/x/orders/transactions/define/transaction.go b/x/orders/transactions/define/transaction.go index 19e4243df..dac93a936 100644 --- a/x/orders/transactions/define/transaction.go +++ b/x/orders/transactions/define/transaction.go @@ -4,11 +4,10 @@ package define import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/define/transaction_keeper.go b/x/orders/transactions/define/transaction_keeper.go index 1f6dcacd8..4cfa52bfe 100644 --- a/x/orders/transactions/define/transaction_keeper.go +++ b/x/orders/transactions/define/transaction_keeper.go @@ -5,7 +5,6 @@ package define import ( "context" - baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/properties/constants" "github.com/AssetMantle/schema/qualified/base" diff --git a/x/orders/transactions/deputize/transaction.go b/x/orders/transactions/deputize/transaction.go index a89eda61d..bf9c1c956 100644 --- a/x/orders/transactions/deputize/transaction.go +++ b/x/orders/transactions/deputize/transaction.go @@ -4,11 +4,10 @@ package deputize import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/deputize/transaction_keeper.go b/x/orders/transactions/deputize/transaction_keeper.go index 5b5c11e59..02a013a1b 100644 --- a/x/orders/transactions/deputize/transaction_keeper.go +++ b/x/orders/transactions/deputize/transaction_keeper.go @@ -5,7 +5,6 @@ package deputize import ( "context" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/identities/auxiliaries/authenticate" "github.com/AssetMantle/modules/x/maintainers/auxiliaries/deputize" diff --git a/x/orders/transactions/get/transaction.go b/x/orders/transactions/get/transaction.go index c4b2ee7db..e7723e1df 100644 --- a/x/orders/transactions/get/transaction.go +++ b/x/orders/transactions/get/transaction.go @@ -4,11 +4,10 @@ package get import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/get/transaction_keeper.go b/x/orders/transactions/get/transaction_keeper.go index 98465073e..6fdffaa3c 100644 --- a/x/orders/transactions/get/transaction_keeper.go +++ b/x/orders/transactions/get/transaction_keeper.go @@ -6,7 +6,6 @@ package get import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/orders/transactions/immediate/transaction.go b/x/orders/transactions/immediate/transaction.go index 4396d122c..7d411704a 100644 --- a/x/orders/transactions/immediate/transaction.go +++ b/x/orders/transactions/immediate/transaction.go @@ -4,11 +4,10 @@ package immediate import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/immediate/transaction_keeper.go b/x/orders/transactions/immediate/transaction_keeper.go index 31fd2caf6..cbb1729fc 100644 --- a/x/orders/transactions/immediate/transaction_keeper.go +++ b/x/orders/transactions/immediate/transaction_keeper.go @@ -6,7 +6,6 @@ package immediate import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" diff --git a/x/orders/transactions/make/transaction.go b/x/orders/transactions/make/transaction.go index 57c397280..2680e1763 100644 --- a/x/orders/transactions/make/transaction.go +++ b/x/orders/transactions/make/transaction.go @@ -4,11 +4,10 @@ package make import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/make/transaction_keeper.go b/x/orders/transactions/make/transaction_keeper.go index a68d168bd..b8236a2fd 100644 --- a/x/orders/transactions/make/transaction_keeper.go +++ b/x/orders/transactions/make/transaction_keeper.go @@ -6,7 +6,6 @@ package make import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" diff --git a/x/orders/transactions/modify/transaction.go b/x/orders/transactions/modify/transaction.go index f710e1448..f3fc561a3 100644 --- a/x/orders/transactions/modify/transaction.go +++ b/x/orders/transactions/modify/transaction.go @@ -4,11 +4,10 @@ package modify import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/modify/transaction_keeper.go b/x/orders/transactions/modify/transaction_keeper.go index dfbde6ca5..4f408f346 100644 --- a/x/orders/transactions/modify/transaction_keeper.go +++ b/x/orders/transactions/modify/transaction_keeper.go @@ -6,7 +6,6 @@ package modify import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" baseLists "github.com/AssetMantle/schema/lists/base" diff --git a/x/orders/transactions/put/transaction.go b/x/orders/transactions/put/transaction.go index abc5bd802..817572c04 100644 --- a/x/orders/transactions/put/transaction.go +++ b/x/orders/transactions/put/transaction.go @@ -4,11 +4,10 @@ package put import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/put/transaction_keeper.go b/x/orders/transactions/put/transaction_keeper.go index d9bfb89b9..ac2beb748 100644 --- a/x/orders/transactions/put/transaction_keeper.go +++ b/x/orders/transactions/put/transaction_keeper.go @@ -6,7 +6,6 @@ package put import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/documents/base" propertyConstants "github.com/AssetMantle/schema/properties/constants" diff --git a/x/orders/transactions/revoke/transaction.go b/x/orders/transactions/revoke/transaction.go index 639924c53..0e9712af4 100644 --- a/x/orders/transactions/revoke/transaction.go +++ b/x/orders/transactions/revoke/transaction.go @@ -4,11 +4,10 @@ package revoke import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/revoke/transaction_keeper.go b/x/orders/transactions/revoke/transaction_keeper.go index 0e0e10b10..b397997a0 100644 --- a/x/orders/transactions/revoke/transaction_keeper.go +++ b/x/orders/transactions/revoke/transaction_keeper.go @@ -5,7 +5,6 @@ package revoke import ( "context" - "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/orders/transactions/take/transaction.go b/x/orders/transactions/take/transaction.go index 2f2f349ee..9c5d8e958 100644 --- a/x/orders/transactions/take/transaction.go +++ b/x/orders/transactions/take/transaction.go @@ -4,11 +4,10 @@ package take import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Transaction = baseHelpers.NewTransaction( diff --git a/x/orders/transactions/take/transaction_keeper.go b/x/orders/transactions/take/transaction_keeper.go index 248d3d12b..ee4c2ba5d 100644 --- a/x/orders/transactions/take/transaction_keeper.go +++ b/x/orders/transactions/take/transaction_keeper.go @@ -6,7 +6,6 @@ package take import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" From 12d52ea4999b5192cb3a37098c48443dea124b8e Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:55:54 +0530 Subject: [PATCH 45/64] retiring(transaction): decode transaction request, used for wasm Signed-off-by: Deepanshu Tripathi --- helpers/base/transaction.go | 24 +++++++----------------- helpers/transaction.go | 2 -- 2 files changed, 7 insertions(+), 19 deletions(-) diff --git a/helpers/base/transaction.go b/helpers/base/transaction.go index ae1bfc6f4..219a9ba71 100644 --- a/helpers/base/transaction.go +++ b/helpers/base/transaction.go @@ -5,7 +5,6 @@ package base import ( "context" - "encoding/json" "fmt" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/utilities/rest" @@ -16,12 +15,11 @@ import ( codecTypes "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" + "net/http" "strings" "github.com/spf13/cobra" "google.golang.org/grpc" - "net/http" - "reflect" ) type transaction struct { @@ -79,13 +77,13 @@ func (transaction transaction) HandleMessage(context context.Context, message he } func (transaction transaction) RESTRequestHandler(context client.Context) http.HandlerFunc { return func(responseWriter http.ResponseWriter, httpRequest *http.Request) { - transactionRequest := transaction.requestPrototype() - if !rest.ReadRESTReq(responseWriter, httpRequest, context.LegacyAmino, &transactionRequest) { - return - } else if reflect.TypeOf(transaction.requestPrototype()) != reflect.TypeOf(transactionRequest) { - rest.CheckBadRequestError(responseWriter, fmt.Errorf("expected %s, got %s", reflect.TypeOf(transaction.requestPrototype()), reflect.TypeOf(transactionRequest))) + transactionRequest, err := transaction.requestPrototype().FromHTTPRequest(httpRequest) + if err != nil { + rest.CheckBadRequestError(responseWriter, err) return - } else if rest.CheckBadRequestError(responseWriter, transactionRequest.Validate()) { + } + + if rest.CheckBadRequestError(responseWriter, transactionRequest.Validate()) { return } @@ -117,14 +115,6 @@ func (transaction transaction) RegisterService(configurator sdkModuleTypes.Confi } transaction.serviceRegistrar(configurator.MsgServer(), transaction.keeper) } -func (transaction transaction) DecodeTransactionRequest(rawMessage json.RawMessage) (sdkTypes.Msg, error) { - transactionRequest, err := transaction.requestPrototype().FromJSON(rawMessage) - if err != nil { - return nil, err - } - - return transactionRequest.MakeMsg() -} func (transaction transaction) InitializeKeeper(mapper helpers.Mapper, parameterManager helpers.ParameterManager, auxiliaryKeepers ...interface{}) helpers.Transaction { transaction.keeper = transaction.keeperPrototype().Initialize(mapper, parameterManager, auxiliaryKeepers).(helpers.TransactionKeeper) return transaction diff --git a/helpers/transaction.go b/helpers/transaction.go index 960b30eb3..095671c64 100644 --- a/helpers/transaction.go +++ b/helpers/transaction.go @@ -5,7 +5,6 @@ package helpers import ( "context" - "encoding/json" "net/http" "github.com/cosmos/cosmos-sdk/client" @@ -24,6 +23,5 @@ type Transaction interface { RegisterLegacyAminoCodec(amino *codec.LegacyAmino) RegisterInterfaces(types.InterfaceRegistry) RegisterService(module.Configurator) - DecodeTransactionRequest(json.RawMessage) (sdkTypes.Msg, error) InitializeKeeper(Mapper, ParameterManager, ...interface{}) Transaction } From 06cfae90f4f3bee2bbc31109f846f4096e1f1f03 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 12:59:34 +0530 Subject: [PATCH 46/64] chore: import formatting Signed-off-by: Deepanshu Tripathi --- helpers/base/cli_flag.go | 1 - helpers/base/collection.go | 1 - helpers/base/invariants.go | 3 +-- helpers/base/mapper.go | 3 +-- helpers/base/parameter_manager.go | 1 - helpers/block.go | 1 - helpers/cli_command.go | 1 - helpers/genesis.go | 1 - helpers/mapper.go | 1 - helpers/simulator.go | 3 +-- simulation/schema/types/base/properties.go | 5 ++--- simulation/schema/types/base/property.go | 5 ++--- utilities/rest/queuing/kafka_types.go | 3 +-- x/assets/block/block.go | 1 - x/assets/genesis/genesis.go | 1 - x/assets/key/key.go | 3 +-- x/assets/mappable/mappable.go | 3 +-- x/assets/parameters/burn_enabled/parameter.go | 3 +-- x/assets/parameters/mint_enabled/parameter.go | 3 +-- x/assets/parameters/renumerate_enabled/parameter.go | 3 +-- x/assets/parameters/unwrap_allowed_coins/parameter.go | 3 +-- x/assets/parameters/wrap_allowed_coins/parameter.go | 3 +-- x/assets/queries/asset/query.go | 3 +-- x/assets/queries/asset/query_keeper.go | 1 - x/assets/queries/assets/query.go | 3 +-- x/assets/queries/assets/query_keeper.go | 1 - x/assets/record/record.go | 7 +++---- x/assets/simulator/genesis.go | 3 +-- x/assets/simulator/operations.go | 3 +-- x/assets/simulator/proposals.go | 7 +++---- x/assets/transactions/burn/message.go | 3 +-- x/assets/transactions/define/message.go | 3 +-- x/assets/transactions/deputize/message.go | 3 +-- x/assets/transactions/mint/message.go | 3 +-- x/assets/transactions/mutate/message.go | 3 +-- x/assets/transactions/renumerate/message.go | 3 +-- x/assets/transactions/revoke/message.go | 3 +-- x/assets/transactions/send/message.go | 3 +-- x/assets/transactions/unwrap/message.go | 3 +-- x/assets/transactions/wrap/message.go | 3 +-- x/assets/utilities/permissions.go | 3 +-- x/classifications/auxiliaries/bond/auxiliary_keeper.go | 1 - x/classifications/auxiliaries/bond/auxiliary_request.go | 3 +-- x/classifications/auxiliaries/burn/auxiliary_keeper.go | 1 - x/classifications/auxiliaries/burn/auxiliary_request.go | 3 +-- .../auxiliaries/conform/auxiliary_keeper.go | 5 ++--- .../auxiliaries/define/auxiliary_request.go | 3 +-- x/classifications/auxiliaries/member/auxiliary_keeper.go | 1 - x/classifications/auxiliaries/unbond/auxiliary_keeper.go | 1 - .../auxiliaries/unbond/auxiliary_request.go | 3 +-- x/classifications/block/block.go | 1 - x/classifications/genesis/genesis.go | 1 - x/classifications/key/key.go | 3 +-- x/classifications/mappable/mappable.go | 3 +-- x/classifications/parameters/bond_rate/parameter.go | 3 +-- x/classifications/parameters/define_enabled/parameter.go | 3 +-- .../parameters/max_property_count/parameter.go | 3 +-- x/classifications/queries/classification/query.go | 3 +-- x/classifications/queries/classification/query_keeper.go | 1 - x/classifications/queries/classifications/query.go | 3 +-- .../queries/classifications/query_keeper.go | 1 - x/classifications/record/record.go | 5 ++--- x/classifications/simulator/genesis.go | 3 +-- x/classifications/simulator/operations.go | 3 +-- x/classifications/simulator/params.go | 5 ++--- x/classifications/simulator/proposals.go | 7 +++---- .../auxiliaries/authenticate/auxiliary_keeper.go | 3 +-- .../auxiliaries/authenticate/auxiliary_request.go | 3 +-- x/identities/block/block.go | 1 - x/identities/genesis/genesis.go | 1 - x/identities/key/key.go | 3 +-- x/identities/mappable/mappable.go | 3 +-- x/identities/parameters/issue_enabled/parameter.go | 3 +-- .../parameters/max_provision_address_count/parameter.go | 3 +-- x/identities/parameters/quash_enabled/parameter.go | 3 +-- x/identities/queries/identities/query.go | 3 +-- x/identities/queries/identities/query_keeper.go | 1 - x/identities/queries/identity/query.go | 3 +-- x/identities/queries/identity/query_keeper.go | 1 - x/identities/record/record.go | 7 +++---- x/identities/simulator/genesis.go | 3 +-- x/identities/simulator/operations.go | 3 +-- x/identities/simulator/params.go | 5 ++--- x/identities/simulator/proposals.go | 7 +++---- x/identities/transactions/define/message.go | 3 +-- x/identities/transactions/deputize/message.go | 3 +-- x/identities/transactions/issue/message.go | 3 +-- x/identities/transactions/name/message.go | 3 +-- x/identities/transactions/provision/message.go | 3 +-- x/identities/transactions/quash/message.go | 3 +-- x/identities/transactions/revoke/message.go | 3 +-- x/identities/transactions/unprovision/message.go | 3 +-- x/identities/transactions/update/message.go | 3 +-- x/identities/utilities/permissions.go | 3 +-- x/maintainers/auxiliaries/authorize/auxiliary_keeper.go | 1 - x/maintainers/auxiliaries/deputize/auxiliary_keeper.go | 1 - x/maintainers/auxiliaries/maintain/auxiliary_keeper.go | 1 - x/maintainers/auxiliaries/revoke/auxiliary_keeper.go | 1 - x/maintainers/auxiliaries/super/auxiliary_keeper.go | 1 - x/maintainers/block/block.go | 1 - x/maintainers/genesis/genesis.go | 1 - x/maintainers/key/key.go | 3 +-- x/maintainers/mappable/mappable.go | 3 +-- x/maintainers/parameters/deputize_allowed/parameter.go | 3 +-- x/maintainers/queries/maintainer/query.go | 3 +-- x/maintainers/queries/maintainer/query_keeper.go | 1 - x/maintainers/queries/maintainers/query.go | 3 +-- x/maintainers/queries/maintainers/query_keeper.go | 1 - x/maintainers/record/record.go | 9 ++++----- x/maintainers/simulator/genesis.go | 3 +-- x/maintainers/simulator/operations.go | 3 +-- x/maintainers/simulator/proposals.go | 7 +++---- x/maintainers/utilities/permissions.go | 3 +-- x/metas/auxiliaries/scrub/auxiliary_keeper.go | 1 - x/metas/auxiliaries/scrub/auxiliary_response.go | 3 +-- x/metas/auxiliaries/supplement/auxiliary_keeper.go | 7 +++---- x/metas/auxiliaries/supplement/auxiliary_response.go | 3 +-- x/metas/block/block.go | 1 - x/metas/genesis/genesis.go | 1 - x/metas/key/key.go | 3 +-- x/metas/mappable/mappable.go | 3 +-- x/metas/parameters/reveal_enabled/parameter.go | 3 +-- x/metas/queries/meta/query.go | 3 +-- x/metas/queries/meta/query_keeper.go | 1 - x/metas/queries/metas/query.go | 3 +-- x/metas/queries/metas/query_keeper.go | 1 - x/metas/record/record.go | 7 +++---- x/metas/simulator/genesis.go | 5 ++--- x/metas/simulator/operations.go | 3 +-- x/metas/simulator/proposals.go | 7 +++---- x/metas/transactions/reveal/message.go | 3 +-- x/orders/block/block.go | 1 - x/orders/constants/module.go | 3 +-- x/orders/genesis/genesis.go | 1 - x/orders/key/key.go | 3 +-- x/orders/mappable/mappable.go | 3 +-- x/orders/parameters/max_order_life/parameter.go | 3 +-- x/orders/parameters/put_enabled/parameter.go | 3 +-- x/orders/queries/order/query.go | 3 +-- x/orders/queries/order/query_keeper.go | 1 - x/orders/queries/orders/query.go | 3 +-- x/orders/queries/orders/query_keeper.go | 1 - x/orders/record/record.go | 7 +++---- x/orders/simulator/genesis.go | 3 +-- x/orders/simulator/operations.go | 3 +-- x/orders/simulator/params.go | 5 ++--- x/orders/simulator/proposals.go | 7 +++---- x/orders/transactions/cancel/message.go | 3 +-- x/orders/transactions/define/message.go | 3 +-- x/orders/transactions/deputize/message.go | 3 +-- x/orders/transactions/get/message.go | 3 +-- x/orders/transactions/immediate/message.go | 3 +-- x/orders/transactions/make/message.go | 3 +-- x/orders/transactions/modify/message.go | 3 +-- x/orders/transactions/put/message.go | 3 +-- x/orders/transactions/revoke/message.go | 3 +-- x/orders/transactions/take/message.go | 3 +-- x/orders/utilities/permissions.go | 3 +-- x/splits/auxiliaries/burn/auxiliary_request.go | 3 +-- x/splits/auxiliaries/mint/auxiliary_request.go | 3 +-- x/splits/auxiliaries/prototype_test.go | 4 ++-- x/splits/auxiliaries/purge/auxiliary_keeper.go | 5 ++--- x/splits/auxiliaries/purge/auxiliary_request.go | 3 +-- x/splits/auxiliaries/renumerate/auxiliary_keeper.go | 5 ++--- x/splits/auxiliaries/transfer/auxiliary_keeper.go | 5 ++--- x/splits/auxiliaries/transfer/auxiliary_request.go | 3 +-- x/splits/block/block.go | 1 - x/splits/genesis/genesis.go | 1 - x/splits/key/key.go | 3 +-- x/splits/mappable/mappable.go | 3 +-- x/splits/parameters/transfer_enabled/parameter.go | 3 +-- x/splits/queries/balances/query.go | 3 +-- x/splits/queries/balances/query_keeper.go | 1 - x/splits/queries/split/query.go | 3 +-- x/splits/queries/split/query_keeper.go | 1 - x/splits/queries/splits/query.go | 3 +-- x/splits/queries/splits/query_keeper.go | 1 - x/splits/queries/supply/query.go | 3 +-- x/splits/queries/supply/query_keeper.go | 1 - x/splits/queries/supply/query_response.go | 3 +-- x/splits/record/record.go | 9 ++++----- x/splits/simulator/genesis.go | 3 +-- x/splits/simulator/operations.go | 3 +-- x/splits/simulator/params.go | 3 +-- x/splits/transactions/prototype_test.go | 2 +- x/splits/utilities/balances.go | 3 +-- x/splits/utilities/split.go | 9 ++++----- x/splits/utilities/supply.go | 7 +++---- 188 files changed, 186 insertions(+), 372 deletions(-) diff --git a/helpers/base/cli_flag.go b/helpers/base/cli_flag.go index 7c836b821..b4d216c6b 100644 --- a/helpers/base/cli_flag.go +++ b/helpers/base/cli_flag.go @@ -5,7 +5,6 @@ package base import ( "fmt" - "github.com/spf13/cobra" "github.com/spf13/viper" diff --git a/helpers/base/collection.go b/helpers/base/collection.go index 9bc574541..c6ca496ea 100644 --- a/helpers/base/collection.go +++ b/helpers/base/collection.go @@ -5,7 +5,6 @@ package base import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/helpers/base/invariants.go b/helpers/base/invariants.go index 3611c8d70..401138a48 100644 --- a/helpers/base/invariants.go +++ b/helpers/base/invariants.go @@ -1,9 +1,8 @@ package base import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) type invariants struct { diff --git a/helpers/base/mapper.go b/helpers/base/mapper.go index 54db19975..9eb34641a 100644 --- a/helpers/base/mapper.go +++ b/helpers/base/mapper.go @@ -7,10 +7,9 @@ import ( "bytes" "context" "fmt" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - prefixStore "github.com/cosmos/cosmos-sdk/store/prefix" storeTypes "github.com/cosmos/cosmos-sdk/store/types" + sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/kv" "github.com/AssetMantle/modules/helpers" diff --git a/helpers/base/parameter_manager.go b/helpers/base/parameter_manager.go index 8b6e0123b..f316ac948 100644 --- a/helpers/base/parameter_manager.go +++ b/helpers/base/parameter_manager.go @@ -10,7 +10,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/parameters" sdkTypes "github.com/cosmos/cosmos-sdk/types" - paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" "golang.org/x/net/context" diff --git a/helpers/block.go b/helpers/block.go index 3bc82c256..998050635 100644 --- a/helpers/block.go +++ b/helpers/block.go @@ -5,7 +5,6 @@ package helpers import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" ) diff --git a/helpers/cli_command.go b/helpers/cli_command.go index 48c3bff70..1b2c0dcd9 100644 --- a/helpers/cli_command.go +++ b/helpers/cli_command.go @@ -5,7 +5,6 @@ package helpers import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/spf13/cobra" ) diff --git a/helpers/genesis.go b/helpers/genesis.go index ab43d7d1d..2e185c883 100644 --- a/helpers/genesis.go +++ b/helpers/genesis.go @@ -2,7 +2,6 @@ package helpers import ( "context" - "github.com/AssetMantle/schema/lists" sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/gogoproto/proto" diff --git a/helpers/mapper.go b/helpers/mapper.go index b43812fef..44ea34498 100644 --- a/helpers/mapper.go +++ b/helpers/mapper.go @@ -5,7 +5,6 @@ package helpers import ( "context" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" "github.com/cosmos/cosmos-sdk/types/kv" ) diff --git a/helpers/simulator.go b/helpers/simulator.go index 6f79e4948..155adb39f 100644 --- a/helpers/simulator.go +++ b/helpers/simulator.go @@ -4,11 +4,10 @@ package helpers import ( - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) type Simulator interface { diff --git a/simulation/schema/types/base/properties.go b/simulation/schema/types/base/properties.go index 15de0f853..19750d9da 100644 --- a/simulation/schema/types/base/properties.go +++ b/simulation/schema/types/base/properties.go @@ -4,12 +4,11 @@ package base import ( - "math" - "math/rand" - "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/properties" + "math" + "math/rand" ) func GenerateRandomPropertyList(r *rand.Rand) lists.PropertyList { diff --git a/simulation/schema/types/base/property.go b/simulation/schema/types/base/property.go index 586aadc5e..34b3e8e07 100644 --- a/simulation/schema/types/base/property.go +++ b/simulation/schema/types/base/property.go @@ -4,13 +4,12 @@ package base import ( - "math" - "math/rand" - baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/properties" baseProperties "github.com/AssetMantle/schema/properties/base" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + "math" + "math/rand" "github.com/AssetMantle/modules/utilities/random" ) diff --git a/utilities/rest/queuing/kafka_types.go b/utilities/rest/queuing/kafka_types.go index cb0796edf..7a362dc7a 100755 --- a/utilities/rest/queuing/kafka_types.go +++ b/utilities/rest/queuing/kafka_types.go @@ -6,10 +6,9 @@ package queuing import ( "github.com/AssetMantle/modules/helpers" "github.com/Shopify/sarama" + dbm "github.com/cometbft/cometbft-db" "github.com/cosmos/cosmos-sdk/client" sdk "github.com/cosmos/cosmos-sdk/types" - - dbm "github.com/cometbft/cometbft-db" ) // TicketID : is a type that implements string diff --git a/x/assets/block/block.go b/x/assets/block/block.go index 1cbdcc3d6..36d85c5ae 100644 --- a/x/assets/block/block.go +++ b/x/assets/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/assets/genesis/genesis.go b/x/assets/genesis/genesis.go index 3553f8fcb..9b2cabc39 100644 --- a/x/assets/genesis/genesis.go +++ b/x/assets/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" sdkCodec "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/assets/key/key.go b/x/assets/key/key.go index 342b5e521..8d4edc6a9 100644 --- a/x/assets/key/key.go +++ b/x/assets/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/assets/mappable/mappable.go b/x/assets/mappable/mappable.go index f7dbea391..af36d18a9 100644 --- a/x/assets/mappable/mappable.go +++ b/x/assets/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/assets/parameters/burn_enabled/parameter.go b/x/assets/parameters/burn_enabled/parameter.go index 81cdc538d..2ff45e1d1 100644 --- a/x/assets/parameters/burn_enabled/parameter.go +++ b/x/assets/parameters/burn_enabled/parameter.go @@ -4,13 +4,12 @@ package burn_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.BurnEnabledProperty.GetKey() diff --git a/x/assets/parameters/mint_enabled/parameter.go b/x/assets/parameters/mint_enabled/parameter.go index 0c598171c..d4c8c4161 100644 --- a/x/assets/parameters/mint_enabled/parameter.go +++ b/x/assets/parameters/mint_enabled/parameter.go @@ -4,13 +4,12 @@ package mint_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.MintEnabledProperty.GetKey() diff --git a/x/assets/parameters/renumerate_enabled/parameter.go b/x/assets/parameters/renumerate_enabled/parameter.go index 103a4626b..69e478c9b 100644 --- a/x/assets/parameters/renumerate_enabled/parameter.go +++ b/x/assets/parameters/renumerate_enabled/parameter.go @@ -4,13 +4,12 @@ package renumerate_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.RenumerateEnabledProperty.GetKey() diff --git a/x/assets/parameters/unwrap_allowed_coins/parameter.go b/x/assets/parameters/unwrap_allowed_coins/parameter.go index f53b80124..183585bb4 100644 --- a/x/assets/parameters/unwrap_allowed_coins/parameter.go +++ b/x/assets/parameters/unwrap_allowed_coins/parameter.go @@ -4,6 +4,7 @@ package unwrap_allowed_coins import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" @@ -11,8 +12,6 @@ import ( "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.UnwrapAllowedCoinsProperty.GetKey() diff --git a/x/assets/parameters/wrap_allowed_coins/parameter.go b/x/assets/parameters/wrap_allowed_coins/parameter.go index f66c48cab..fa4e8b2e0 100644 --- a/x/assets/parameters/wrap_allowed_coins/parameter.go +++ b/x/assets/parameters/wrap_allowed_coins/parameter.go @@ -4,6 +4,7 @@ package wrap_allowed_coins import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" @@ -11,8 +12,6 @@ import ( "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.WrapAllowedCoinsProperty.GetKey() diff --git a/x/assets/queries/asset/query.go b/x/assets/queries/asset/query.go index 5068b78af..23341e718 100644 --- a/x/assets/queries/asset/query.go +++ b/x/assets/queries/asset/query.go @@ -4,11 +4,10 @@ package asset import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/assets/queries/asset/query_keeper.go b/x/assets/queries/asset/query_keeper.go index 0b41001d4..0957d6e42 100644 --- a/x/assets/queries/asset/query_keeper.go +++ b/x/assets/queries/asset/query_keeper.go @@ -5,7 +5,6 @@ package asset import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/assets/queries/assets/query.go b/x/assets/queries/assets/query.go index 2544da2f6..0f4b6787f 100644 --- a/x/assets/queries/assets/query.go +++ b/x/assets/queries/assets/query.go @@ -4,11 +4,10 @@ package assets import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/assets/queries/assets/query_keeper.go b/x/assets/queries/assets/query_keeper.go index 138de305d..455af4cde 100644 --- a/x/assets/queries/assets/query_keeper.go +++ b/x/assets/queries/assets/query_keeper.go @@ -5,7 +5,6 @@ package assets import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/assets/record/record.go b/x/assets/record/record.go index a5f367e60..d1e8d0fd2 100644 --- a/x/assets/record/record.go +++ b/x/assets/record/record.go @@ -1,14 +1,13 @@ package record import ( - "github.com/AssetMantle/schema/documents" - baseIDs "github.com/AssetMantle/schema/ids/base" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/assets/key" "github.com/AssetMantle/modules/x/assets/mappable" + "github.com/AssetMantle/schema/documents" + baseIDs "github.com/AssetMantle/schema/ids/base" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.Record = (*Record)(nil) diff --git a/x/assets/simulator/genesis.go b/x/assets/simulator/genesis.go index 9d884dee1..0673392ca 100644 --- a/x/assets/simulator/genesis.go +++ b/x/assets/simulator/genesis.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -16,6 +14,7 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/assets/simulator/operations.go b/x/assets/simulator/operations.go index 11b718a60..a0c6afbf1 100644 --- a/x/assets/simulator/operations.go +++ b/x/assets/simulator/operations.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" @@ -16,6 +14,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" diff --git a/x/assets/simulator/proposals.go b/x/assets/simulator/proposals.go index 3125e3c1a..53aac918f 100644 --- a/x/assets/simulator/proposals.go +++ b/x/assets/simulator/proposals.go @@ -4,14 +4,13 @@ package simulator import ( - govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { diff --git a/x/assets/transactions/burn/message.go b/x/assets/transactions/burn/message.go index 03dc9fcca..3c17f1e42 100644 --- a/x/assets/transactions/burn/message.go +++ b/x/assets/transactions/burn/message.go @@ -4,12 +4,11 @@ package burn import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/define/message.go b/x/assets/transactions/define/message.go index a28bae5ce..de8274451 100644 --- a/x/assets/transactions/define/message.go +++ b/x/assets/transactions/define/message.go @@ -4,14 +4,13 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/deputize/message.go b/x/assets/transactions/deputize/message.go index 3402db7c2..591038184 100644 --- a/x/assets/transactions/deputize/message.go +++ b/x/assets/transactions/deputize/message.go @@ -4,14 +4,13 @@ package deputize import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/mint/message.go b/x/assets/transactions/mint/message.go index f7fccad4d..0668438c6 100644 --- a/x/assets/transactions/mint/message.go +++ b/x/assets/transactions/mint/message.go @@ -4,14 +4,13 @@ package mint import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/mutate/message.go b/x/assets/transactions/mutate/message.go index fc4e8cc44..66104b62a 100644 --- a/x/assets/transactions/mutate/message.go +++ b/x/assets/transactions/mutate/message.go @@ -4,14 +4,13 @@ package mutate import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/renumerate/message.go b/x/assets/transactions/renumerate/message.go index fd1c44c0c..74cac82b9 100644 --- a/x/assets/transactions/renumerate/message.go +++ b/x/assets/transactions/renumerate/message.go @@ -4,12 +4,11 @@ package renumerate import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/revoke/message.go b/x/assets/transactions/revoke/message.go index d472ad4ea..c69516d95 100644 --- a/x/assets/transactions/revoke/message.go +++ b/x/assets/transactions/revoke/message.go @@ -4,12 +4,11 @@ package revoke import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/send/message.go b/x/assets/transactions/send/message.go index 2bfeca9f6..2e486dbde 100644 --- a/x/assets/transactions/send/message.go +++ b/x/assets/transactions/send/message.go @@ -4,13 +4,12 @@ package send import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/unwrap/message.go b/x/assets/transactions/unwrap/message.go index de0ec7393..15272d12c 100644 --- a/x/assets/transactions/unwrap/message.go +++ b/x/assets/transactions/unwrap/message.go @@ -4,14 +4,13 @@ package unwrap import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/transactions/wrap/message.go b/x/assets/transactions/wrap/message.go index ef4a4cdde..9dacc7e2e 100644 --- a/x/assets/transactions/wrap/message.go +++ b/x/assets/transactions/wrap/message.go @@ -4,6 +4,7 @@ package wrap import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/constants" codecUtilities "github.com/AssetMantle/schema/codec/utilities" @@ -12,8 +13,6 @@ import ( sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/assets/utilities/permissions.go b/x/assets/utilities/permissions.go index e43f04562..47a88e493 100644 --- a/x/assets/utilities/permissions.go +++ b/x/assets/utilities/permissions.go @@ -1,9 +1,8 @@ package utilities import ( - "github.com/AssetMantle/schema/ids" - "github.com/AssetMantle/modules/x/assets/constants" + "github.com/AssetMantle/schema/ids" ) func SetModulePermissions(canMintAsset bool, canRenumerateAsset bool, canBurnAsset bool) []ids.StringID { diff --git a/x/classifications/auxiliaries/bond/auxiliary_keeper.go b/x/classifications/auxiliaries/bond/auxiliary_keeper.go index 75255685f..897b38c86 100644 --- a/x/classifications/auxiliaries/bond/auxiliary_keeper.go +++ b/x/classifications/auxiliaries/bond/auxiliary_keeper.go @@ -6,7 +6,6 @@ package bond import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - sdkTypes "github.com/cosmos/cosmos-sdk/types" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/classifications/auxiliaries/bond/auxiliary_request.go b/x/classifications/auxiliaries/bond/auxiliary_request.go index f63ff93d2..862dbd9f5 100644 --- a/x/classifications/auxiliaries/bond/auxiliary_request.go +++ b/x/classifications/auxiliaries/bond/auxiliary_request.go @@ -4,11 +4,10 @@ package bond import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/classifications/auxiliaries/burn/auxiliary_keeper.go b/x/classifications/auxiliaries/burn/auxiliary_keeper.go index c48187b70..3b37a5e40 100644 --- a/x/classifications/auxiliaries/burn/auxiliary_keeper.go +++ b/x/classifications/auxiliaries/burn/auxiliary_keeper.go @@ -6,7 +6,6 @@ package burn import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - sdkTypes "github.com/cosmos/cosmos-sdk/types" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/classifications/auxiliaries/burn/auxiliary_request.go b/x/classifications/auxiliaries/burn/auxiliary_request.go index 49c01a3cb..5e38b065b 100644 --- a/x/classifications/auxiliaries/burn/auxiliary_request.go +++ b/x/classifications/auxiliaries/burn/auxiliary_request.go @@ -4,11 +4,10 @@ package burn import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/classifications/auxiliaries/conform/auxiliary_keeper.go b/x/classifications/auxiliaries/conform/auxiliary_keeper.go index b95515184..572fdb15d 100644 --- a/x/classifications/auxiliaries/conform/auxiliary_keeper.go +++ b/x/classifications/auxiliaries/conform/auxiliary_keeper.go @@ -5,12 +5,11 @@ package conform import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/classifications/key" "github.com/AssetMantle/modules/x/classifications/mappable" + baseIDs "github.com/AssetMantle/schema/ids/base" ) type auxiliaryKeeper struct { diff --git a/x/classifications/auxiliaries/define/auxiliary_request.go b/x/classifications/auxiliaries/define/auxiliary_request.go index 71d890ab5..fe679c8d1 100644 --- a/x/classifications/auxiliaries/define/auxiliary_request.go +++ b/x/classifications/auxiliaries/define/auxiliary_request.go @@ -4,11 +4,10 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/qualified" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/classifications/auxiliaries/member/auxiliary_keeper.go b/x/classifications/auxiliaries/member/auxiliary_keeper.go index bc5072b8d..ad849d87e 100644 --- a/x/classifications/auxiliaries/member/auxiliary_keeper.go +++ b/x/classifications/auxiliaries/member/auxiliary_keeper.go @@ -6,7 +6,6 @@ package member import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/modules/helpers" diff --git a/x/classifications/auxiliaries/unbond/auxiliary_keeper.go b/x/classifications/auxiliaries/unbond/auxiliary_keeper.go index 900ff6889..6a2ccf812 100644 --- a/x/classifications/auxiliaries/unbond/auxiliary_keeper.go +++ b/x/classifications/auxiliaries/unbond/auxiliary_keeper.go @@ -6,7 +6,6 @@ package unbond import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - sdkTypes "github.com/cosmos/cosmos-sdk/types" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" diff --git a/x/classifications/auxiliaries/unbond/auxiliary_request.go b/x/classifications/auxiliaries/unbond/auxiliary_request.go index 587a4c03d..fc4a13f8b 100644 --- a/x/classifications/auxiliaries/unbond/auxiliary_request.go +++ b/x/classifications/auxiliaries/unbond/auxiliary_request.go @@ -4,11 +4,10 @@ package unbond import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/classifications/block/block.go b/x/classifications/block/block.go index 1cbdcc3d6..36d85c5ae 100644 --- a/x/classifications/block/block.go +++ b/x/classifications/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/classifications/genesis/genesis.go b/x/classifications/genesis/genesis.go index 79c08a760..206b3460c 100644 --- a/x/classifications/genesis/genesis.go +++ b/x/classifications/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseDocuments "github.com/AssetMantle/schema/documents/base" "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" diff --git a/x/classifications/key/key.go b/x/classifications/key/key.go index 4c4057727..4d5492a06 100644 --- a/x/classifications/key/key.go +++ b/x/classifications/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/classifications/mappable/mappable.go b/x/classifications/mappable/mappable.go index e9f6afd1e..b220de55d 100644 --- a/x/classifications/mappable/mappable.go +++ b/x/classifications/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/classifications/parameters/bond_rate/parameter.go b/x/classifications/parameters/bond_rate/parameter.go index 2f60a6092..cf8f346d6 100644 --- a/x/classifications/parameters/bond_rate/parameter.go +++ b/x/classifications/parameters/bond_rate/parameter.go @@ -4,14 +4,13 @@ package bond_rate import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" "github.com/cosmos/cosmos-sdk/types" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.BondRateProperty.GetKey() diff --git a/x/classifications/parameters/define_enabled/parameter.go b/x/classifications/parameters/define_enabled/parameter.go index 747d7ecb6..63ae8a0bc 100644 --- a/x/classifications/parameters/define_enabled/parameter.go +++ b/x/classifications/parameters/define_enabled/parameter.go @@ -4,13 +4,12 @@ package define_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.DefineEnabledProperty.GetKey() diff --git a/x/classifications/parameters/max_property_count/parameter.go b/x/classifications/parameters/max_property_count/parameter.go index 61643882c..477671cb1 100644 --- a/x/classifications/parameters/max_property_count/parameter.go +++ b/x/classifications/parameters/max_property_count/parameter.go @@ -4,14 +4,13 @@ package max_property_count import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" "github.com/cosmos/cosmos-sdk/types" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.MaxPropertyCountProperty.GetKey() diff --git a/x/classifications/queries/classification/query.go b/x/classifications/queries/classification/query.go index 45ab05d13..d2421c8a5 100644 --- a/x/classifications/queries/classification/query.go +++ b/x/classifications/queries/classification/query.go @@ -4,11 +4,10 @@ package classification import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/classifications/queries/classification/query_keeper.go b/x/classifications/queries/classification/query_keeper.go index d49eecdfb..526a29853 100644 --- a/x/classifications/queries/classification/query_keeper.go +++ b/x/classifications/queries/classification/query_keeper.go @@ -5,7 +5,6 @@ package classification import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/classifications/queries/classifications/query.go b/x/classifications/queries/classifications/query.go index f9cf5f0ef..e02896bf6 100644 --- a/x/classifications/queries/classifications/query.go +++ b/x/classifications/queries/classifications/query.go @@ -4,11 +4,10 @@ package classifications import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/classifications/queries/classifications/query_keeper.go b/x/classifications/queries/classifications/query_keeper.go index ed1a78b08..39933d8d3 100644 --- a/x/classifications/queries/classifications/query_keeper.go +++ b/x/classifications/queries/classifications/query_keeper.go @@ -5,7 +5,6 @@ package classifications import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/classifications/record/record.go b/x/classifications/record/record.go index 3d7719e53..a7192eb16 100644 --- a/x/classifications/record/record.go +++ b/x/classifications/record/record.go @@ -1,13 +1,12 @@ package record import ( - "github.com/AssetMantle/schema/documents" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/classifications/key" "github.com/AssetMantle/modules/x/classifications/mappable" + "github.com/AssetMantle/schema/documents" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) func (record *Record) GetKey() helpers.Key { diff --git a/x/classifications/simulator/genesis.go b/x/classifications/simulator/genesis.go index d6e49e27d..ed72dffdb 100644 --- a/x/classifications/simulator/genesis.go +++ b/x/classifications/simulator/genesis.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" @@ -14,6 +12,7 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/classifications/simulator/operations.go b/x/classifications/simulator/operations.go index 9b2ee1b23..524fa0e87 100644 --- a/x/classifications/simulator/operations.go +++ b/x/classifications/simulator/operations.go @@ -4,10 +4,9 @@ package simulator import ( - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" ) diff --git a/x/classifications/simulator/params.go b/x/classifications/simulator/params.go index 218ebbea7..7bb8f8022 100644 --- a/x/classifications/simulator/params.go +++ b/x/classifications/simulator/params.go @@ -4,11 +4,10 @@ package simulator import ( - "math" - "math/rand" - simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math" + "math/rand" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/classifications/constants" diff --git a/x/classifications/simulator/proposals.go b/x/classifications/simulator/proposals.go index 2990dc422..53aac918f 100644 --- a/x/classifications/simulator/proposals.go +++ b/x/classifications/simulator/proposals.go @@ -5,13 +5,12 @@ package simulator import ( sdkTypes "github.com/cosmos/cosmos-sdk/types" - govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { diff --git a/x/identities/auxiliaries/authenticate/auxiliary_keeper.go b/x/identities/auxiliaries/authenticate/auxiliary_keeper.go index f4931941d..b515aabf2 100644 --- a/x/identities/auxiliaries/authenticate/auxiliary_keeper.go +++ b/x/identities/auxiliaries/authenticate/auxiliary_keeper.go @@ -5,9 +5,8 @@ package authenticate import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/identities/key" "github.com/AssetMantle/modules/x/identities/mappable" "github.com/AssetMantle/modules/x/metas/auxiliaries/supplement" diff --git a/x/identities/auxiliaries/authenticate/auxiliary_request.go b/x/identities/auxiliaries/authenticate/auxiliary_request.go index 7c2c3f543..bd9c8b1f3 100644 --- a/x/identities/auxiliaries/authenticate/auxiliary_request.go +++ b/x/identities/auxiliaries/authenticate/auxiliary_request.go @@ -4,11 +4,10 @@ package authenticate import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/identities/block/block.go b/x/identities/block/block.go index 1cbdcc3d6..36d85c5ae 100644 --- a/x/identities/block/block.go +++ b/x/identities/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/identities/genesis/genesis.go b/x/identities/genesis/genesis.go index f4226b0aa..591f25d67 100644 --- a/x/identities/genesis/genesis.go +++ b/x/identities/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseDocuments "github.com/AssetMantle/schema/documents/base" "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" diff --git a/x/identities/key/key.go b/x/identities/key/key.go index 72af92b3c..7b89de551 100644 --- a/x/identities/key/key.go +++ b/x/identities/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/identities/mappable/mappable.go b/x/identities/mappable/mappable.go index 3c131fc58..695a6119f 100644 --- a/x/identities/mappable/mappable.go +++ b/x/identities/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/identities/parameters/issue_enabled/parameter.go b/x/identities/parameters/issue_enabled/parameter.go index e2e674fa1..a03cd3498 100644 --- a/x/identities/parameters/issue_enabled/parameter.go +++ b/x/identities/parameters/issue_enabled/parameter.go @@ -4,13 +4,12 @@ package issue_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.IssueEnabledProperty.GetKey() diff --git a/x/identities/parameters/max_provision_address_count/parameter.go b/x/identities/parameters/max_provision_address_count/parameter.go index 2eba1171e..f6c4b7287 100644 --- a/x/identities/parameters/max_provision_address_count/parameter.go +++ b/x/identities/parameters/max_provision_address_count/parameter.go @@ -4,6 +4,7 @@ package max_provision_address_count import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/data/constants" @@ -11,8 +12,6 @@ import ( "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.MaxProvisionAddressCountProperty.GetKey() diff --git a/x/identities/parameters/quash_enabled/parameter.go b/x/identities/parameters/quash_enabled/parameter.go index 537c21572..74a1bae56 100644 --- a/x/identities/parameters/quash_enabled/parameter.go +++ b/x/identities/parameters/quash_enabled/parameter.go @@ -4,13 +4,12 @@ package quash_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.QuashEnabledProperty.GetKey() diff --git a/x/identities/queries/identities/query.go b/x/identities/queries/identities/query.go index d5d95474d..93a1c297d 100644 --- a/x/identities/queries/identities/query.go +++ b/x/identities/queries/identities/query.go @@ -1,11 +1,10 @@ package identities import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/identities/queries/identities/query_keeper.go b/x/identities/queries/identities/query_keeper.go index 3966b71db..24e42ebc7 100644 --- a/x/identities/queries/identities/query_keeper.go +++ b/x/identities/queries/identities/query_keeper.go @@ -5,7 +5,6 @@ package identities import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/identities/queries/identity/query.go b/x/identities/queries/identity/query.go index 1c4d5f778..146f96394 100644 --- a/x/identities/queries/identity/query.go +++ b/x/identities/queries/identity/query.go @@ -4,11 +4,10 @@ package identity import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/identities/queries/identity/query_keeper.go b/x/identities/queries/identity/query_keeper.go index d52b8f54c..89e5ba7fa 100644 --- a/x/identities/queries/identity/query_keeper.go +++ b/x/identities/queries/identity/query_keeper.go @@ -5,7 +5,6 @@ package identity import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/identities/record/record.go b/x/identities/record/record.go index c198fbeda..41256e850 100644 --- a/x/identities/record/record.go +++ b/x/identities/record/record.go @@ -1,14 +1,13 @@ package record import ( - "github.com/AssetMantle/schema/documents" - baseIDs "github.com/AssetMantle/schema/ids/base" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/identities/key" "github.com/AssetMantle/modules/x/identities/mappable" + "github.com/AssetMantle/schema/documents" + baseIDs "github.com/AssetMantle/schema/ids/base" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) func (record *Record) GetKey() helpers.Key { diff --git a/x/identities/simulator/genesis.go b/x/identities/simulator/genesis.go index 8c9f0088c..89b1e253a 100644 --- a/x/identities/simulator/genesis.go +++ b/x/identities/simulator/genesis.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" @@ -15,6 +13,7 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/identities/simulator/operations.go b/x/identities/simulator/operations.go index 59913ccd2..563544643 100644 --- a/x/identities/simulator/operations.go +++ b/x/identities/simulator/operations.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/identities/simulator/params.go b/x/identities/simulator/params.go index 815cc9714..bc9c056d3 100644 --- a/x/identities/simulator/params.go +++ b/x/identities/simulator/params.go @@ -4,12 +4,11 @@ package simulator import ( - "math" - "math/rand" - "github.com/AssetMantle/schema/data" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math" + "math/rand" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/identities/constants" diff --git a/x/identities/simulator/proposals.go b/x/identities/simulator/proposals.go index 2990dc422..53aac918f 100644 --- a/x/identities/simulator/proposals.go +++ b/x/identities/simulator/proposals.go @@ -5,13 +5,12 @@ package simulator import ( sdkTypes "github.com/cosmos/cosmos-sdk/types" - govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { diff --git a/x/identities/transactions/define/message.go b/x/identities/transactions/define/message.go index a28bae5ce..de8274451 100644 --- a/x/identities/transactions/define/message.go +++ b/x/identities/transactions/define/message.go @@ -4,14 +4,13 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/deputize/message.go b/x/identities/transactions/deputize/message.go index c300890b1..1af0c276a 100644 --- a/x/identities/transactions/deputize/message.go +++ b/x/identities/transactions/deputize/message.go @@ -4,14 +4,13 @@ package deputize import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/issue/message.go b/x/identities/transactions/issue/message.go index 7b7e3678d..87d889b25 100644 --- a/x/identities/transactions/issue/message.go +++ b/x/identities/transactions/issue/message.go @@ -4,14 +4,13 @@ package issue import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/name/message.go b/x/identities/transactions/name/message.go index 179c6fe92..315ec3d1e 100644 --- a/x/identities/transactions/name/message.go +++ b/x/identities/transactions/name/message.go @@ -4,13 +4,12 @@ package name import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/provision/message.go b/x/identities/transactions/provision/message.go index bb1ae3e73..09bdb6a27 100644 --- a/x/identities/transactions/provision/message.go +++ b/x/identities/transactions/provision/message.go @@ -4,12 +4,11 @@ package provision import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/quash/message.go b/x/identities/transactions/quash/message.go index f3679f444..016d74ebb 100644 --- a/x/identities/transactions/quash/message.go +++ b/x/identities/transactions/quash/message.go @@ -4,12 +4,11 @@ package quash import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/revoke/message.go b/x/identities/transactions/revoke/message.go index d472ad4ea..c69516d95 100644 --- a/x/identities/transactions/revoke/message.go +++ b/x/identities/transactions/revoke/message.go @@ -4,12 +4,11 @@ package revoke import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/unprovision/message.go b/x/identities/transactions/unprovision/message.go index 3f68d7fea..55ce8f296 100644 --- a/x/identities/transactions/unprovision/message.go +++ b/x/identities/transactions/unprovision/message.go @@ -4,12 +4,11 @@ package unprovision import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/transactions/update/message.go b/x/identities/transactions/update/message.go index 10b05d09a..ad37fffe6 100644 --- a/x/identities/transactions/update/message.go +++ b/x/identities/transactions/update/message.go @@ -4,14 +4,13 @@ package update import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/identities/utilities/permissions.go b/x/identities/utilities/permissions.go index b3d36b5f0..980d4a4fe 100644 --- a/x/identities/utilities/permissions.go +++ b/x/identities/utilities/permissions.go @@ -1,9 +1,8 @@ package utilities import ( - "github.com/AssetMantle/schema/ids" - "github.com/AssetMantle/modules/x/identities/constants" + "github.com/AssetMantle/schema/ids" ) func SetModulePermissions(canIssueIdentity bool, canQuashIdentity bool) []ids.StringID { diff --git a/x/maintainers/auxiliaries/authorize/auxiliary_keeper.go b/x/maintainers/auxiliaries/authorize/auxiliary_keeper.go index 2fc974315..1054ee450 100644 --- a/x/maintainers/auxiliaries/authorize/auxiliary_keeper.go +++ b/x/maintainers/auxiliaries/authorize/auxiliary_keeper.go @@ -6,7 +6,6 @@ package authorize import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" diff --git a/x/maintainers/auxiliaries/deputize/auxiliary_keeper.go b/x/maintainers/auxiliaries/deputize/auxiliary_keeper.go index a341fd376..28dc07b05 100644 --- a/x/maintainers/auxiliaries/deputize/auxiliary_keeper.go +++ b/x/maintainers/auxiliaries/deputize/auxiliary_keeper.go @@ -6,7 +6,6 @@ package deputize import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" diff --git a/x/maintainers/auxiliaries/maintain/auxiliary_keeper.go b/x/maintainers/auxiliaries/maintain/auxiliary_keeper.go index 9163e1c0a..6030fb3ed 100644 --- a/x/maintainers/auxiliaries/maintain/auxiliary_keeper.go +++ b/x/maintainers/auxiliaries/maintain/auxiliary_keeper.go @@ -6,7 +6,6 @@ package maintain import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" diff --git a/x/maintainers/auxiliaries/revoke/auxiliary_keeper.go b/x/maintainers/auxiliaries/revoke/auxiliary_keeper.go index 299494007..e7060ac18 100644 --- a/x/maintainers/auxiliaries/revoke/auxiliary_keeper.go +++ b/x/maintainers/auxiliaries/revoke/auxiliary_keeper.go @@ -6,7 +6,6 @@ package revoke import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" diff --git a/x/maintainers/auxiliaries/super/auxiliary_keeper.go b/x/maintainers/auxiliaries/super/auxiliary_keeper.go index b0d6c169e..59470d3ba 100644 --- a/x/maintainers/auxiliaries/super/auxiliary_keeper.go +++ b/x/maintainers/auxiliaries/super/auxiliary_keeper.go @@ -6,7 +6,6 @@ package super import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" baseIDs "github.com/AssetMantle/schema/ids/base" diff --git a/x/maintainers/block/block.go b/x/maintainers/block/block.go index 1cbdcc3d6..36d85c5ae 100644 --- a/x/maintainers/block/block.go +++ b/x/maintainers/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/maintainers/genesis/genesis.go b/x/maintainers/genesis/genesis.go index effbb79f1..3521a3dc0 100644 --- a/x/maintainers/genesis/genesis.go +++ b/x/maintainers/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" sdkCodec "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/maintainers/key/key.go b/x/maintainers/key/key.go index 5ed70d63b..5f7a664a1 100644 --- a/x/maintainers/key/key.go +++ b/x/maintainers/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/maintainers/mappable/mappable.go b/x/maintainers/mappable/mappable.go index 3577809f3..326e1ac15 100644 --- a/x/maintainers/mappable/mappable.go +++ b/x/maintainers/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/maintainers/parameters/deputize_allowed/parameter.go b/x/maintainers/parameters/deputize_allowed/parameter.go index 944575c5f..2454042e0 100644 --- a/x/maintainers/parameters/deputize_allowed/parameter.go +++ b/x/maintainers/parameters/deputize_allowed/parameter.go @@ -4,13 +4,12 @@ package deputize_allowed import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.DeputizeAllowedProperty.GetKey() diff --git a/x/maintainers/queries/maintainer/query.go b/x/maintainers/queries/maintainer/query.go index ec3e951a1..c3e474be7 100644 --- a/x/maintainers/queries/maintainer/query.go +++ b/x/maintainers/queries/maintainer/query.go @@ -4,11 +4,10 @@ package maintainer import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/maintainers/queries/maintainer/query_keeper.go b/x/maintainers/queries/maintainer/query_keeper.go index b60b54fcb..1f78d2383 100644 --- a/x/maintainers/queries/maintainer/query_keeper.go +++ b/x/maintainers/queries/maintainer/query_keeper.go @@ -5,7 +5,6 @@ package maintainer import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/maintainers/queries/maintainers/query.go b/x/maintainers/queries/maintainers/query.go index a7abfc684..2dca5337a 100644 --- a/x/maintainers/queries/maintainers/query.go +++ b/x/maintainers/queries/maintainers/query.go @@ -4,11 +4,10 @@ package maintainers import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/maintainers/queries/maintainers/query_keeper.go b/x/maintainers/queries/maintainers/query_keeper.go index 3a77f7225..b89db8fd5 100644 --- a/x/maintainers/queries/maintainers/query_keeper.go +++ b/x/maintainers/queries/maintainers/query_keeper.go @@ -5,7 +5,6 @@ package maintainers import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/maintainers/record/record.go b/x/maintainers/record/record.go index 1b7517c4a..a02dd30eb 100644 --- a/x/maintainers/record/record.go +++ b/x/maintainers/record/record.go @@ -1,6 +1,10 @@ package record import ( + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/x/maintainers/key" + "github.com/AssetMantle/modules/x/maintainers/mappable" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -10,11 +14,6 @@ import ( constantProperties "github.com/AssetMantle/schema/properties/constants" baseQualified "github.com/AssetMantle/schema/qualified/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/x/maintainers/key" - "github.com/AssetMantle/modules/x/maintainers/mappable" ) func (record *Record) GetKey() helpers.Key { diff --git a/x/maintainers/simulator/genesis.go b/x/maintainers/simulator/genesis.go index e063f96aa..f6c8fe5cd 100644 --- a/x/maintainers/simulator/genesis.go +++ b/x/maintainers/simulator/genesis.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" @@ -16,6 +14,7 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/maintainers/simulator/operations.go b/x/maintainers/simulator/operations.go index 9b2ee1b23..524fa0e87 100644 --- a/x/maintainers/simulator/operations.go +++ b/x/maintainers/simulator/operations.go @@ -4,10 +4,9 @@ package simulator import ( - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" ) diff --git a/x/maintainers/simulator/proposals.go b/x/maintainers/simulator/proposals.go index 2990dc422..53aac918f 100644 --- a/x/maintainers/simulator/proposals.go +++ b/x/maintainers/simulator/proposals.go @@ -5,13 +5,12 @@ package simulator import ( sdkTypes "github.com/cosmos/cosmos-sdk/types" - govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { diff --git a/x/maintainers/utilities/permissions.go b/x/maintainers/utilities/permissions.go index 868235415..8d9782d18 100644 --- a/x/maintainers/utilities/permissions.go +++ b/x/maintainers/utilities/permissions.go @@ -1,10 +1,9 @@ package utilities import ( + "github.com/AssetMantle/modules/x/maintainers/constants" "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" - - "github.com/AssetMantle/modules/x/maintainers/constants" ) func SetModulePermissions(canAddMaintainer bool, canMutateMaintainer bool, canRemoveMaintainer bool) lists.IDList { diff --git a/x/metas/auxiliaries/scrub/auxiliary_keeper.go b/x/metas/auxiliaries/scrub/auxiliary_keeper.go index cb86e3675..8abe5cef8 100644 --- a/x/metas/auxiliaries/scrub/auxiliary_keeper.go +++ b/x/metas/auxiliaries/scrub/auxiliary_keeper.go @@ -6,7 +6,6 @@ package scrub import ( "context" "github.com/AssetMantle/modules/helpers/constants" - baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/properties" diff --git a/x/metas/auxiliaries/scrub/auxiliary_response.go b/x/metas/auxiliaries/scrub/auxiliary_response.go index 26622f677..3806333c8 100644 --- a/x/metas/auxiliaries/scrub/auxiliary_response.go +++ b/x/metas/auxiliaries/scrub/auxiliary_response.go @@ -4,10 +4,9 @@ package scrub import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/lists" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryResponse struct { diff --git a/x/metas/auxiliaries/supplement/auxiliary_keeper.go b/x/metas/auxiliaries/supplement/auxiliary_keeper.go index 1be7f3e29..e0c1e6ded 100644 --- a/x/metas/auxiliaries/supplement/auxiliary_keeper.go +++ b/x/metas/auxiliaries/supplement/auxiliary_keeper.go @@ -5,15 +5,14 @@ package supplement import ( "context" + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/metas/key" + "github.com/AssetMantle/modules/x/metas/mappable" "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/x/metas/key" - "github.com/AssetMantle/modules/x/metas/mappable" ) type auxiliaryKeeper struct { diff --git a/x/metas/auxiliaries/supplement/auxiliary_response.go b/x/metas/auxiliaries/supplement/auxiliary_response.go index dc1aa29e1..8b6804fb0 100644 --- a/x/metas/auxiliaries/supplement/auxiliary_response.go +++ b/x/metas/auxiliaries/supplement/auxiliary_response.go @@ -4,10 +4,9 @@ package supplement import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/lists" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryResponse struct { diff --git a/x/metas/block/block.go b/x/metas/block/block.go index 1cbdcc3d6..36d85c5ae 100644 --- a/x/metas/block/block.go +++ b/x/metas/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/metas/genesis/genesis.go b/x/metas/genesis/genesis.go index cbdd2bc19..6f6f797c1 100644 --- a/x/metas/genesis/genesis.go +++ b/x/metas/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" sdkCodec "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/metas/key/key.go b/x/metas/key/key.go index c6259a7e6..cb557e5ac 100644 --- a/x/metas/key/key.go +++ b/x/metas/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/metas/mappable/mappable.go b/x/metas/mappable/mappable.go index a9424731d..868ff29fc 100644 --- a/x/metas/mappable/mappable.go +++ b/x/metas/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/metas/parameters/reveal_enabled/parameter.go b/x/metas/parameters/reveal_enabled/parameter.go index fd8e17550..2c389e715 100644 --- a/x/metas/parameters/reveal_enabled/parameter.go +++ b/x/metas/parameters/reveal_enabled/parameter.go @@ -4,13 +4,12 @@ package reveal_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.RevealEnabledProperty.GetKey() diff --git a/x/metas/queries/meta/query.go b/x/metas/queries/meta/query.go index c812e6926..ce0a382a2 100644 --- a/x/metas/queries/meta/query.go +++ b/x/metas/queries/meta/query.go @@ -4,11 +4,10 @@ package meta import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/metas/queries/meta/query_keeper.go b/x/metas/queries/meta/query_keeper.go index 6b5ce9749..472c5ddd2 100644 --- a/x/metas/queries/meta/query_keeper.go +++ b/x/metas/queries/meta/query_keeper.go @@ -5,7 +5,6 @@ package meta import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/metas/queries/metas/query.go b/x/metas/queries/metas/query.go index 94b831eff..02ff2466c 100644 --- a/x/metas/queries/metas/query.go +++ b/x/metas/queries/metas/query.go @@ -4,11 +4,10 @@ package metas import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/metas/queries/metas/query_keeper.go b/x/metas/queries/metas/query_keeper.go index ad7c4ca27..a6f8f16e4 100644 --- a/x/metas/queries/metas/query_keeper.go +++ b/x/metas/queries/metas/query_keeper.go @@ -5,7 +5,6 @@ package metas import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/metas/record/record.go b/x/metas/record/record.go index d5a8c741d..943a999ac 100644 --- a/x/metas/record/record.go +++ b/x/metas/record/record.go @@ -1,14 +1,13 @@ package record import ( - "github.com/AssetMantle/schema/data" - baseIDs "github.com/AssetMantle/schema/ids/base" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/metas/key" "github.com/AssetMantle/modules/x/metas/mappable" + "github.com/AssetMantle/schema/data" + baseIDs "github.com/AssetMantle/schema/ids/base" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) func (record *Record) GetKey() helpers.Key { diff --git a/x/metas/simulator/genesis.go b/x/metas/simulator/genesis.go index a34f49b9b..6901bc215 100644 --- a/x/metas/simulator/genesis.go +++ b/x/metas/simulator/genesis.go @@ -4,14 +4,13 @@ package simulator import ( - "math" - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/lists/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/metas/simulator/operations.go b/x/metas/simulator/operations.go index 81df6e4af..f017d4c43 100644 --- a/x/metas/simulator/operations.go +++ b/x/metas/simulator/operations.go @@ -4,13 +4,12 @@ package simulator import ( - "math/rand" - "github.com/cosmos/cosmos-sdk/baseapp" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" diff --git a/x/metas/simulator/proposals.go b/x/metas/simulator/proposals.go index 3125e3c1a..53aac918f 100644 --- a/x/metas/simulator/proposals.go +++ b/x/metas/simulator/proposals.go @@ -4,14 +4,13 @@ package simulator import ( - govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { diff --git a/x/metas/transactions/reveal/message.go b/x/metas/transactions/reveal/message.go index 5f7ba3b32..8f3ffe258 100644 --- a/x/metas/transactions/reveal/message.go +++ b/x/metas/transactions/reveal/message.go @@ -4,12 +4,11 @@ package reveal import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/block/block.go b/x/orders/block/block.go index 7337cd69c..7d9de455c 100755 --- a/x/orders/block/block.go +++ b/x/orders/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - "github.com/AssetMantle/schema/types/base" abciTypes "github.com/cometbft/cometbft/abci/types" diff --git a/x/orders/constants/module.go b/x/orders/constants/module.go index eef13c9b0..ee996a74b 100644 --- a/x/orders/constants/module.go +++ b/x/orders/constants/module.go @@ -4,9 +4,8 @@ package constants import ( - "github.com/AssetMantle/schema/documents/base" - "github.com/AssetMantle/modules/utilities/name" + "github.com/AssetMantle/schema/documents/base" ) type dummy struct{} diff --git a/x/orders/genesis/genesis.go b/x/orders/genesis/genesis.go index eeef7eb49..b3f752ba8 100644 --- a/x/orders/genesis/genesis.go +++ b/x/orders/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" sdkCodec "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/orders/key/key.go b/x/orders/key/key.go index c978f88da..061d5f363 100644 --- a/x/orders/key/key.go +++ b/x/orders/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/orders/mappable/mappable.go b/x/orders/mappable/mappable.go index ebc5368f1..ea9dff7aa 100644 --- a/x/orders/mappable/mappable.go +++ b/x/orders/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/orders/parameters/max_order_life/parameter.go b/x/orders/parameters/max_order_life/parameter.go index 7e7a3e147..8be32ef33 100644 --- a/x/orders/parameters/max_order_life/parameter.go +++ b/x/orders/parameters/max_order_life/parameter.go @@ -4,14 +4,13 @@ package max_order_life import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" baseProperties "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" baseTypes "github.com/AssetMantle/schema/types/base" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.MaxOrderLifeProperty.GetKey() diff --git a/x/orders/parameters/put_enabled/parameter.go b/x/orders/parameters/put_enabled/parameter.go index 008b9a00d..8a691161e 100644 --- a/x/orders/parameters/put_enabled/parameter.go +++ b/x/orders/parameters/put_enabled/parameter.go @@ -4,13 +4,12 @@ package put_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.PutEnabledProperty.GetKey() diff --git a/x/orders/queries/order/query.go b/x/orders/queries/order/query.go index c578424f0..ec75a24f3 100644 --- a/x/orders/queries/order/query.go +++ b/x/orders/queries/order/query.go @@ -4,11 +4,10 @@ package order import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/orders/queries/order/query_keeper.go b/x/orders/queries/order/query_keeper.go index d9f8f7045..4a2638943 100644 --- a/x/orders/queries/order/query_keeper.go +++ b/x/orders/queries/order/query_keeper.go @@ -5,7 +5,6 @@ package order import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/orders/queries/orders/query.go b/x/orders/queries/orders/query.go index 42b3c099e..834d1d554 100644 --- a/x/orders/queries/orders/query.go +++ b/x/orders/queries/orders/query.go @@ -4,11 +4,10 @@ package orders import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/orders/queries/orders/query_keeper.go b/x/orders/queries/orders/query_keeper.go index b6a486cde..cc3f3fc84 100644 --- a/x/orders/queries/orders/query_keeper.go +++ b/x/orders/queries/orders/query_keeper.go @@ -5,7 +5,6 @@ package orders import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/orders/record/record.go b/x/orders/record/record.go index 5eb40701d..43ddd610f 100644 --- a/x/orders/record/record.go +++ b/x/orders/record/record.go @@ -1,14 +1,13 @@ package record import ( - "github.com/AssetMantle/schema/documents" - baseIDs "github.com/AssetMantle/schema/ids/base" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/orders/key" "github.com/AssetMantle/modules/x/orders/mappable" + "github.com/AssetMantle/schema/documents" + baseIDs "github.com/AssetMantle/schema/ids/base" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) func (record *Record) GetKey() helpers.Key { diff --git a/x/orders/simulator/genesis.go b/x/orders/simulator/genesis.go index d711dc983..c96157dc4 100644 --- a/x/orders/simulator/genesis.go +++ b/x/orders/simulator/genesis.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" @@ -15,6 +13,7 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/orders/simulator/operations.go b/x/orders/simulator/operations.go index 5a49f201a..d15703428 100644 --- a/x/orders/simulator/operations.go +++ b/x/orders/simulator/operations.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - baseDocuments "github.com/AssetMantle/schema/documents/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -18,6 +16,7 @@ import ( "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" diff --git a/x/orders/simulator/params.go b/x/orders/simulator/params.go index 69b28204c..1d4caaab8 100644 --- a/x/orders/simulator/params.go +++ b/x/orders/simulator/params.go @@ -4,11 +4,10 @@ package simulator import ( - "math" - "math/rand" - simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math" + "math/rand" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/orders/constants" diff --git a/x/orders/simulator/proposals.go b/x/orders/simulator/proposals.go index 3125e3c1a..53aac918f 100644 --- a/x/orders/simulator/proposals.go +++ b/x/orders/simulator/proposals.go @@ -4,14 +4,13 @@ package simulator import ( - govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" - "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" - "math/rand" - sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" + govSimulation "github.com/cosmos/cosmos-sdk/x/gov/simulation" + "github.com/cosmos/cosmos-sdk/x/gov/types/v1beta1" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" ) func (simulator) ProposalMessages(_ module.SimulationState) []simulationTypes.WeightedProposalMsg { diff --git a/x/orders/transactions/cancel/message.go b/x/orders/transactions/cancel/message.go index b5dd6c1a8..32fd19b0b 100644 --- a/x/orders/transactions/cancel/message.go +++ b/x/orders/transactions/cancel/message.go @@ -4,12 +4,11 @@ package cancel import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/define/message.go b/x/orders/transactions/define/message.go index a28bae5ce..de8274451 100644 --- a/x/orders/transactions/define/message.go +++ b/x/orders/transactions/define/message.go @@ -4,14 +4,13 @@ package define import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/deputize/message.go b/x/orders/transactions/deputize/message.go index 25f1a6d39..c139975eb 100644 --- a/x/orders/transactions/deputize/message.go +++ b/x/orders/transactions/deputize/message.go @@ -4,14 +4,13 @@ package deputize import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" baseLists "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/get/message.go b/x/orders/transactions/get/message.go index a663d98de..b5da63ab6 100644 --- a/x/orders/transactions/get/message.go +++ b/x/orders/transactions/get/message.go @@ -4,12 +4,11 @@ package get import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/immediate/message.go b/x/orders/transactions/immediate/message.go index 4f70ba529..a2fd76288 100644 --- a/x/orders/transactions/immediate/message.go +++ b/x/orders/transactions/immediate/message.go @@ -4,6 +4,7 @@ package immediate import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -13,8 +14,6 @@ import ( baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/make/message.go b/x/orders/transactions/make/message.go index 6280b28d7..ebff520a8 100644 --- a/x/orders/transactions/make/message.go +++ b/x/orders/transactions/make/message.go @@ -4,6 +4,7 @@ package make import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -13,8 +14,6 @@ import ( baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/modify/message.go b/x/orders/transactions/modify/message.go index 549d29636..480ef6d90 100644 --- a/x/orders/transactions/modify/message.go +++ b/x/orders/transactions/modify/message.go @@ -4,6 +4,7 @@ package modify import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -13,8 +14,6 @@ import ( baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/put/message.go b/x/orders/transactions/put/message.go index 03752276e..a63791afa 100644 --- a/x/orders/transactions/put/message.go +++ b/x/orders/transactions/put/message.go @@ -4,6 +4,7 @@ package put import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -11,8 +12,6 @@ import ( baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/revoke/message.go b/x/orders/transactions/revoke/message.go index d472ad4ea..c69516d95 100644 --- a/x/orders/transactions/revoke/message.go +++ b/x/orders/transactions/revoke/message.go @@ -4,12 +4,11 @@ package revoke import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/transactions/take/message.go b/x/orders/transactions/take/message.go index 2af431e8b..a0a249ec9 100644 --- a/x/orders/transactions/take/message.go +++ b/x/orders/transactions/take/message.go @@ -4,13 +4,12 @@ package take import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Message = (*Message)(nil) diff --git a/x/orders/utilities/permissions.go b/x/orders/utilities/permissions.go index 9f567de00..59a34540b 100644 --- a/x/orders/utilities/permissions.go +++ b/x/orders/utilities/permissions.go @@ -1,9 +1,8 @@ package utilities import ( - "github.com/AssetMantle/schema/ids" - "github.com/AssetMantle/modules/x/orders/constants" + "github.com/AssetMantle/schema/ids" ) func SetModulePermissions(canMakeOrder bool, canCancelOrder bool) []ids.StringID { diff --git a/x/splits/auxiliaries/burn/auxiliary_request.go b/x/splits/auxiliaries/burn/auxiliary_request.go index 45407c0f4..f01f66108 100644 --- a/x/splits/auxiliaries/burn/auxiliary_request.go +++ b/x/splits/auxiliaries/burn/auxiliary_request.go @@ -4,11 +4,10 @@ package burn import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/splits/auxiliaries/mint/auxiliary_request.go b/x/splits/auxiliaries/mint/auxiliary_request.go index 90299fc83..61233b917 100644 --- a/x/splits/auxiliaries/mint/auxiliary_request.go +++ b/x/splits/auxiliaries/mint/auxiliary_request.go @@ -4,11 +4,10 @@ package mint import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/splits/auxiliaries/prototype_test.go b/x/splits/auxiliaries/prototype_test.go index ae341adb8..4f4fe295d 100644 --- a/x/splits/auxiliaries/prototype_test.go +++ b/x/splits/auxiliaries/prototype_test.go @@ -5,9 +5,9 @@ package auxiliaries import ( "testing" - + "github.com/stretchr/testify/require" - + baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/splits/auxiliaries/mint" "github.com/AssetMantle/modules/x/splits/auxiliaries/purge" diff --git a/x/splits/auxiliaries/purge/auxiliary_keeper.go b/x/splits/auxiliaries/purge/auxiliary_keeper.go index 8c864b429..637aa3cd1 100644 --- a/x/splits/auxiliaries/purge/auxiliary_keeper.go +++ b/x/splits/auxiliaries/purge/auxiliary_keeper.go @@ -5,14 +5,13 @@ package purge import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/splits/key" "github.com/AssetMantle/modules/x/splits/mappable" "github.com/AssetMantle/modules/x/splits/record" "github.com/AssetMantle/modules/x/splits/utilities" + baseIDs "github.com/AssetMantle/schema/ids/base" ) type auxiliaryKeeper struct { diff --git a/x/splits/auxiliaries/purge/auxiliary_request.go b/x/splits/auxiliaries/purge/auxiliary_request.go index 2f4a72f68..a53b5c0f7 100644 --- a/x/splits/auxiliaries/purge/auxiliary_request.go +++ b/x/splits/auxiliaries/purge/auxiliary_request.go @@ -4,11 +4,10 @@ package purge import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/splits/auxiliaries/renumerate/auxiliary_keeper.go b/x/splits/auxiliaries/renumerate/auxiliary_keeper.go index b35edf581..36f39fef8 100644 --- a/x/splits/auxiliaries/renumerate/auxiliary_keeper.go +++ b/x/splits/auxiliaries/renumerate/auxiliary_keeper.go @@ -5,11 +5,10 @@ package renumerate import ( "context" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" + errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/splits/utilities" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) type auxiliaryKeeper struct { diff --git a/x/splits/auxiliaries/transfer/auxiliary_keeper.go b/x/splits/auxiliaries/transfer/auxiliary_keeper.go index bf1298728..1ed800fe2 100644 --- a/x/splits/auxiliaries/transfer/auxiliary_keeper.go +++ b/x/splits/auxiliaries/transfer/auxiliary_keeper.go @@ -5,12 +5,11 @@ package transfer import ( "context" + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/splits/utilities" "github.com/AssetMantle/schema/data" propertyConstants "github.com/AssetMantle/schema/properties/constants" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/x/splits/utilities" ) type auxiliaryKeeper struct { diff --git a/x/splits/auxiliaries/transfer/auxiliary_request.go b/x/splits/auxiliaries/transfer/auxiliary_request.go index 4f21dc43d..78730ea23 100644 --- a/x/splits/auxiliaries/transfer/auxiliary_request.go +++ b/x/splits/auxiliaries/transfer/auxiliary_request.go @@ -4,11 +4,10 @@ package transfer import ( + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryRequest struct { diff --git a/x/splits/block/block.go b/x/splits/block/block.go index 1cbdcc3d6..36d85c5ae 100644 --- a/x/splits/block/block.go +++ b/x/splits/block/block.go @@ -5,7 +5,6 @@ package block import ( "context" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/AssetMantle/modules/helpers" diff --git a/x/splits/genesis/genesis.go b/x/splits/genesis/genesis.go index 6d8808b9f..7ad85a728 100644 --- a/x/splits/genesis/genesis.go +++ b/x/splits/genesis/genesis.go @@ -3,7 +3,6 @@ package genesis import ( "context" errorConstants "github.com/AssetMantle/modules/helpers/constants" - "github.com/AssetMantle/schema/lists" "github.com/AssetMantle/schema/lists/base" sdkCodec "github.com/cosmos/cosmos-sdk/codec" diff --git a/x/splits/key/key.go b/x/splits/key/key.go index fffb41f9a..87b491941 100644 --- a/x/splits/key/key.go +++ b/x/splits/key/key.go @@ -4,11 +4,10 @@ package key import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Key = (*Key)(nil) diff --git a/x/splits/mappable/mappable.go b/x/splits/mappable/mappable.go index 1f3fdb779..be11d8d59 100644 --- a/x/splits/mappable/mappable.go +++ b/x/splits/mappable/mappable.go @@ -4,12 +4,11 @@ package mappable import ( + "github.com/AssetMantle/modules/helpers" codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var _ helpers.Mappable = (*Mappable)(nil) diff --git a/x/splits/parameters/transfer_enabled/parameter.go b/x/splits/parameters/transfer_enabled/parameter.go index ef3e36bea..bdb24f1d5 100644 --- a/x/splits/parameters/transfer_enabled/parameter.go +++ b/x/splits/parameters/transfer_enabled/parameter.go @@ -4,13 +4,12 @@ package transfer_enabled import ( + baseHelpers "github.com/AssetMantle/modules/helpers/base" errorConstants "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" baseParameters "github.com/AssetMantle/schema/parameters/base" "github.com/AssetMantle/schema/properties/base" constantProperties "github.com/AssetMantle/schema/properties/constants" - - baseHelpers "github.com/AssetMantle/modules/helpers/base" ) var ID = constantProperties.TransferEnabledProperty.GetKey() diff --git a/x/splits/queries/balances/query.go b/x/splits/queries/balances/query.go index 55b50905b..d905ba25c 100644 --- a/x/splits/queries/balances/query.go +++ b/x/splits/queries/balances/query.go @@ -4,11 +4,10 @@ package balances import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/splits/queries/balances/query_keeper.go b/x/splits/queries/balances/query_keeper.go index 6d3b3c9da..97c19789f 100644 --- a/x/splits/queries/balances/query_keeper.go +++ b/x/splits/queries/balances/query_keeper.go @@ -5,7 +5,6 @@ package balances import ( "context" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/splits/utilities" ) diff --git a/x/splits/queries/split/query.go b/x/splits/queries/split/query.go index 70ffa80a0..38028276a 100644 --- a/x/splits/queries/split/query.go +++ b/x/splits/queries/split/query.go @@ -4,11 +4,10 @@ package split import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/splits/queries/split/query_keeper.go b/x/splits/queries/split/query_keeper.go index ec41f3fbc..c2af053e1 100644 --- a/x/splits/queries/split/query_keeper.go +++ b/x/splits/queries/split/query_keeper.go @@ -5,7 +5,6 @@ package split import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/splits/queries/splits/query.go b/x/splits/queries/splits/query.go index dec490a5a..cd9e22b49 100644 --- a/x/splits/queries/splits/query.go +++ b/x/splits/queries/splits/query.go @@ -4,11 +4,10 @@ package splits import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/splits/queries/splits/query_keeper.go b/x/splits/queries/splits/query_keeper.go index 18415174f..300b6d395 100644 --- a/x/splits/queries/splits/query_keeper.go +++ b/x/splits/queries/splits/query_keeper.go @@ -5,7 +5,6 @@ package splits import ( "context" - "github.com/AssetMantle/modules/helpers" ) diff --git a/x/splits/queries/supply/query.go b/x/splits/queries/supply/query.go index 44f0a97a9..cc3df5b46 100644 --- a/x/splits/queries/supply/query.go +++ b/x/splits/queries/supply/query.go @@ -4,11 +4,10 @@ package supply import ( - "google.golang.org/grpc" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" helperConstants "github.com/AssetMantle/modules/helpers/constants" + "google.golang.org/grpc" ) var Query = baseHelpers.NewQuery( diff --git a/x/splits/queries/supply/query_keeper.go b/x/splits/queries/supply/query_keeper.go index dff136756..f35102293 100644 --- a/x/splits/queries/supply/query_keeper.go +++ b/x/splits/queries/supply/query_keeper.go @@ -5,7 +5,6 @@ package supply import ( "context" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/splits/utilities" ) diff --git a/x/splits/queries/supply/query_response.go b/x/splits/queries/supply/query_response.go index f195f26d5..6f6f6ac75 100644 --- a/x/splits/queries/supply/query_response.go +++ b/x/splits/queries/supply/query_response.go @@ -4,10 +4,9 @@ package supply import ( - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) var _ helpers.QueryResponse = (*QueryResponse)(nil) diff --git a/x/splits/record/record.go b/x/splits/record/record.go index a38c07719..a0b0a0b2c 100644 --- a/x/splits/record/record.go +++ b/x/splits/record/record.go @@ -1,15 +1,14 @@ package record import ( - "github.com/AssetMantle/schema/ids" - baseIDs "github.com/AssetMantle/schema/ids/base" - "github.com/AssetMantle/schema/types" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/x/splits/key" "github.com/AssetMantle/modules/x/splits/mappable" + "github.com/AssetMantle/schema/ids" + baseIDs "github.com/AssetMantle/schema/ids/base" + "github.com/AssetMantle/schema/types" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) func (record *Record) GetKey() helpers.Key { diff --git a/x/splits/simulator/genesis.go b/x/splits/simulator/genesis.go index a30834808..1581b5da2 100644 --- a/x/splits/simulator/genesis.go +++ b/x/splits/simulator/genesis.go @@ -4,8 +4,6 @@ package simulator import ( - "math/rand" - "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -15,6 +13,7 @@ import ( baseTypes "github.com/AssetMantle/schema/types/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" + "math/rand" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" diff --git a/x/splits/simulator/operations.go b/x/splits/simulator/operations.go index 9b2ee1b23..524fa0e87 100644 --- a/x/splits/simulator/operations.go +++ b/x/splits/simulator/operations.go @@ -4,10 +4,9 @@ package simulator import ( - "math/rand" - "github.com/cosmos/cosmos-sdk/types/module" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" "github.com/AssetMantle/modules/helpers" ) diff --git a/x/splits/simulator/params.go b/x/splits/simulator/params.go index ef6132d6e..6a5d99d4f 100644 --- a/x/splits/simulator/params.go +++ b/x/splits/simulator/params.go @@ -4,10 +4,9 @@ package simulator import ( - "math/rand" - simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" "github.com/cosmos/cosmos-sdk/x/simulation" + "math/rand" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/simulation/schema/types/base" diff --git a/x/splits/transactions/prototype_test.go b/x/splits/transactions/prototype_test.go index 2111560ca..19db02301 100644 --- a/x/splits/transactions/prototype_test.go +++ b/x/splits/transactions/prototype_test.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" "testing" - + "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" ) diff --git a/x/splits/utilities/balances.go b/x/splits/utilities/balances.go index 0bb4664f5..c5cc3865a 100644 --- a/x/splits/utilities/balances.go +++ b/x/splits/utilities/balances.go @@ -1,10 +1,9 @@ package utilities import ( - "github.com/AssetMantle/schema/ids" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/splits/key" + "github.com/AssetMantle/schema/ids" ) func GetAllBalancesForIdentity(collection helpers.Collection, ownerID ids.IdentityID) helpers.Collection { diff --git a/x/splits/utilities/split.go b/x/splits/utilities/split.go index 93be339f3..058578b20 100644 --- a/x/splits/utilities/split.go +++ b/x/splits/utilities/split.go @@ -4,16 +4,15 @@ package utilities import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/splits/key" + "github.com/AssetMantle/modules/x/splits/mappable" + "github.com/AssetMantle/modules/x/splits/record" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/types/base" sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/x/splits/key" - "github.com/AssetMantle/modules/x/splits/mappable" - "github.com/AssetMantle/modules/x/splits/record" ) func AddSplits(splits helpers.Collection, ownerID ids.IdentityID, assetID ids.AssetID, value sdkTypes.Int) (helpers.Collection, error) { diff --git a/x/splits/utilities/supply.go b/x/splits/utilities/supply.go index 139aa3c76..06030505d 100644 --- a/x/splits/utilities/supply.go +++ b/x/splits/utilities/supply.go @@ -4,13 +4,12 @@ package utilities import ( - "github.com/AssetMantle/schema/ids" - baseIDs "github.com/AssetMantle/schema/ids/base" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/modules/x/splits/key" "github.com/AssetMantle/modules/x/splits/mappable" + "github.com/AssetMantle/schema/ids" + baseIDs "github.com/AssetMantle/schema/ids/base" + sdkTypes "github.com/cosmos/cosmos-sdk/types" ) func GetTotalSupply(collection helpers.Collection, assetID ids.AssetID) sdkTypes.Int { From ea6f6e9ba8d831073602b31bb5ff6eca9ded6252 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:01:37 +0530 Subject: [PATCH 47/64] retiring(query_request): encode decode methods Signed-off-by: Deepanshu Tripathi --- helpers/query_request.go | 4 +--- x/assets/queries/asset/query_request.go | 11 ----------- x/assets/queries/assets/query_request.go | 11 ----------- x/assets/queries/parameters/query_request.go | 12 ------------ .../queries/classification/query_request.go | 11 ----------- .../queries/classifications/query_request.go | 11 ----------- .../queries/parameters/query_request.go | 12 ------------ x/identities/queries/identities/query_request.go | 11 ----------- x/identities/queries/identity/query_request.go | 11 ----------- x/identities/queries/parameters/query_request.go | 12 ------------ x/maintainers/queries/maintainer/query_request.go | 12 ------------ x/maintainers/queries/maintainers/query_request.go | 12 ------------ x/maintainers/queries/parameters/query_request.go | 12 ------------ x/metas/queries/meta/query_request.go | 11 ----------- x/metas/queries/metas/query_request.go | 11 ----------- x/metas/queries/parameters/query_request.go | 12 ------------ x/orders/queries/order/query_request.go | 11 ----------- x/orders/queries/orders/query_request.go | 11 ----------- x/orders/queries/parameters/query_request.go | 12 ------------ x/splits/queries/balances/query_request.go | 11 ----------- x/splits/queries/parameters/query_request.go | 12 ------------ x/splits/queries/split/query_request.go | 11 ----------- x/splits/queries/splits/query_request.go | 11 ----------- x/splits/queries/supply/query_request.go | 11 ----------- 24 files changed, 1 insertion(+), 265 deletions(-) diff --git a/helpers/query_request.go b/helpers/query_request.go index 73077f88a..dcc020c50 100644 --- a/helpers/query_request.go +++ b/helpers/query_request.go @@ -10,9 +10,7 @@ import ( ) type QueryRequest interface { - Request + GRPCRequest FromCLI(CLICommand, client.Context) (QueryRequest, error) FromHTTPRequest(*http.Request) (QueryRequest, error) - Encode() ([]byte, error) - Decode([]byte) (QueryRequest, error) } diff --git a/x/assets/queries/asset/query_request.go b/x/assets/queries/asset/query_request.go index 09cae61ea..eb75859d9 100644 --- a/x/assets/queries/asset/query_request.go +++ b/x/assets/queries/asset/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/key" ) @@ -49,17 +48,7 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(assetID.(ids.AssetID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/assets/queries/assets/query_request.go b/x/assets/queries/assets/query_request.go index 18641aff8..02858c50b 100644 --- a/x/assets/queries/assets/query_request.go +++ b/x/assets/queries/assets/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/key" ) @@ -68,17 +67,7 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(assetID.(ids.AssetID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/assets/queries/parameters/query_request.go b/x/assets/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/assets/queries/parameters/query_request.go +++ b/x/assets/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/classifications/queries/classification/query_request.go b/x/classifications/queries/classification/query_request.go index 4ff45bff0..2ac51ec95 100644 --- a/x/classifications/queries/classification/query_request.go +++ b/x/classifications/queries/classification/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/classifications/key" ) @@ -49,16 +48,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(classificationID.(ids.ClassificationID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/classifications/queries/classifications/query_request.go b/x/classifications/queries/classifications/query_request.go index ea434c935..248bdc57b 100644 --- a/x/classifications/queries/classifications/query_request.go +++ b/x/classifications/queries/classifications/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/classifications/key" ) @@ -68,16 +67,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(classificationID.(ids.ClassificationID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/classifications/queries/parameters/query_request.go b/x/classifications/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/classifications/queries/parameters/query_request.go +++ b/x/classifications/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/identities/queries/identities/query_request.go b/x/identities/queries/identities/query_request.go index a3fefb942..83731c1a4 100644 --- a/x/identities/queries/identities/query_request.go +++ b/x/identities/queries/identities/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/identities/key" ) @@ -67,16 +66,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe } return newQueryRequest(identityID.(ids.IdentityID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/identities/queries/identity/query_request.go b/x/identities/queries/identity/query_request.go index 878bcaf17..de416eca7 100644 --- a/x/identities/queries/identity/query_request.go +++ b/x/identities/queries/identity/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/identities/key" ) @@ -49,16 +48,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(identityID.(ids.IdentityID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/identities/queries/parameters/query_request.go b/x/identities/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/identities/queries/parameters/query_request.go +++ b/x/identities/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/maintainers/queries/maintainer/query_request.go b/x/maintainers/queries/maintainer/query_request.go index 5e38be26e..fd73596bc 100644 --- a/x/maintainers/queries/maintainer/query_request.go +++ b/x/maintainers/queries/maintainer/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/maintainers/key" ) @@ -52,17 +51,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/maintainers/queries/maintainers/query_request.go b/x/maintainers/queries/maintainers/query_request.go index 6dd7ed0a1..336b1ed59 100644 --- a/x/maintainers/queries/maintainers/query_request.go +++ b/x/maintainers/queries/maintainers/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/maintainers/key" ) @@ -71,17 +70,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(maintainerID.(ids.MaintainerID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/maintainers/queries/parameters/query_request.go b/x/maintainers/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/maintainers/queries/parameters/query_request.go +++ b/x/maintainers/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/metas/queries/meta/query_request.go b/x/metas/queries/meta/query_request.go index 4f619dbdf..6c6332346 100644 --- a/x/metas/queries/meta/query_request.go +++ b/x/metas/queries/meta/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/metas/key" ) @@ -49,16 +48,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(dataID.(ids.DataID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/metas/queries/metas/query_request.go b/x/metas/queries/metas/query_request.go index fa7ab33d8..84b10971e 100644 --- a/x/metas/queries/metas/query_request.go +++ b/x/metas/queries/metas/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/metas/key" ) @@ -68,16 +67,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(dataID.(ids.DataID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/metas/queries/parameters/query_request.go b/x/metas/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/metas/queries/parameters/query_request.go +++ b/x/metas/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/orders/queries/order/query_request.go b/x/orders/queries/order/query_request.go index b1e18c65e..5600d8681 100644 --- a/x/orders/queries/order/query_request.go +++ b/x/orders/queries/order/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/orders/key" ) @@ -49,16 +48,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(orderID.(ids.OrderID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/orders/queries/orders/query_request.go b/x/orders/queries/orders/query_request.go index 6a683d9fb..676fb3dcc 100644 --- a/x/orders/queries/orders/query_request.go +++ b/x/orders/queries/orders/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/orders/key" ) @@ -68,16 +67,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(orderID.(ids.OrderID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/orders/queries/parameters/query_request.go b/x/orders/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/orders/queries/parameters/query_request.go +++ b/x/orders/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/splits/queries/balances/query_request.go b/x/splits/queries/balances/query_request.go index 733350b94..09c916537 100644 --- a/x/splits/queries/balances/query_request.go +++ b/x/splits/queries/balances/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" ) @@ -63,16 +62,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(identityID.(ids.IdentityID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/splits/queries/parameters/query_request.go b/x/splits/queries/parameters/query_request.go index e0a6ac388..9f99e7a01 100644 --- a/x/splits/queries/parameters/query_request.go +++ b/x/splits/queries/parameters/query_request.go @@ -2,7 +2,6 @@ package parameters import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/cosmos/cosmos-sdk/client" "net/http" ) @@ -21,17 +20,6 @@ func (queryRequest *QueryRequest) FromHTTPRequest(_ *http.Request) (helpers.Quer return requestPrototype(), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} - -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/splits/queries/split/query_request.go b/x/splits/queries/split/query_request.go index 277cdd117..677972dfb 100644 --- a/x/splits/queries/split/query_request.go +++ b/x/splits/queries/split/query_request.go @@ -11,7 +11,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/splits/key" ) @@ -50,16 +49,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(splitID.(ids.SplitID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/splits/queries/splits/query_request.go b/x/splits/queries/splits/query_request.go index 876f20f2c..bb89aa999 100644 --- a/x/splits/queries/splits/query_request.go +++ b/x/splits/queries/splits/query_request.go @@ -13,7 +13,6 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/splits/key" ) @@ -69,16 +68,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(splitID.(ids.SplitID), int32(limit)), nil } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } diff --git a/x/splits/queries/supply/query_request.go b/x/splits/queries/supply/query_request.go index 8a4cad26f..42871d9c8 100644 --- a/x/splits/queries/supply/query_request.go +++ b/x/splits/queries/supply/query_request.go @@ -5,7 +5,6 @@ package supply import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -47,16 +46,6 @@ func (*QueryRequest) FromHTTPRequest(httpRequest *http.Request) (helpers.QueryRe return newQueryRequest(assetID.(ids.AssetID)), nil } } -func (queryRequest *QueryRequest) Encode() ([]byte, error) { - return base.CodecPrototype().MarshalJSON(queryRequest) -} -func (queryRequest *QueryRequest) Decode(bytes []byte) (helpers.QueryRequest, error) { - if err := base.CodecPrototype().UnmarshalJSON(bytes, queryRequest); err != nil { - return nil, err - } - - return queryRequest, nil -} func requestPrototype() helpers.QueryRequest { return &QueryRequest{} } From e320725742d549d0db308872c0df21922e316518 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:02:03 +0530 Subject: [PATCH 48/64] retiring(query_request): encode decode methods Signed-off-by: Deepanshu Tripathi --- helpers/base/query.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/helpers/base/query.go b/helpers/base/query.go index eafc70e3a..18b012aed 100644 --- a/helpers/base/query.go +++ b/helpers/base/query.go @@ -63,8 +63,8 @@ func (query query) Command() *cobra.Command { return query.cliCommand.CreateCommand(runE) } func (query query) HandleQuery(context context.Context, requestQuery abciTypes.RequestQuery) ([]byte, error) { - request, err := query.requestPrototype().Decode(requestQuery.Data) - if err != nil { + request := query.requestPrototype() + if err := CodecPrototype().UnmarshalJSON(requestQuery.Data, request); err != nil { return nil, err } From 685bb1c38bf568a8e40ecb183beceb0971e94425 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:02:34 +0530 Subject: [PATCH 49/64] retiring(module): decode module transaction request, used for wasm Signed-off-by: Deepanshu Tripathi --- helpers/module.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/helpers/module.go b/helpers/module.go index ccc779c83..fd11c7598 100644 --- a/helpers/module.go +++ b/helpers/module.go @@ -4,14 +4,11 @@ package helpers import ( - "encoding/json" "github.com/cosmos/cosmos-sdk/client" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/gorilla/mux" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" paramsTypes "github.com/cosmos/cosmos-sdk/x/params/types" + "github.com/gorilla/mux" ) type Module interface { @@ -29,8 +26,6 @@ type Module interface { GetAuxiliary(string) Auxiliary - DecodeModuleTransactionRequest(string, json.RawMessage) (sdkTypes.Msg, error) - Initialize(*storeTypes.KVStoreKey, paramsTypes.Subspace, ...interface{}) Module GetTransactions() Transactions From e763e3464156276df8987e64da5b46985c0b17e9 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:02:44 +0530 Subject: [PATCH 50/64] retiring(module): decode module transaction request, used for wasm Signed-off-by: Deepanshu Tripathi --- helpers/base/module.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/helpers/base/module.go b/helpers/base/module.go index 35b4082a4..9c33f8056 100644 --- a/helpers/base/module.go +++ b/helpers/base/module.go @@ -6,13 +6,11 @@ package base import ( "encoding/json" "fmt" - storeTypes "github.com/cosmos/cosmos-sdk/store/types" - "math/rand" - abciTypes "github.com/cometbft/cometbft/abci/types" "github.com/cosmos/cosmos-sdk/client" sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" + storeTypes "github.com/cosmos/cosmos-sdk/store/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" simulationTypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -20,6 +18,7 @@ import ( "github.com/gorilla/mux" "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "math/rand" "github.com/AssetMantle/modules/helpers" ) @@ -189,13 +188,6 @@ func (module module) GetAuxiliary(auxiliaryName string) helpers.Auxiliary { panic(fmt.Errorf("auxiliary %v not found/initialized", auxiliaryName)) } -func (module module) DecodeModuleTransactionRequest(transactionName string, rawMessage json.RawMessage) (sdkTypes.Msg, error) { - if transaction := module.transactionsPrototype().GetTransaction(transactionName); transaction != nil { - return transaction.DecodeTransactionRequest(rawMessage) - } - - return nil, fmt.Errorf("transaction %s is not supported by module %s", transactionName, module.Name()) -} func (module module) Initialize(kvStoreKey *storeTypes.KVStoreKey, paramsSubspace paramsTypes.Subspace, auxiliaryKeepers ...interface{}) helpers.Module { module.mapper = module.mapperPrototype().Initialize(kvStoreKey) From 83bd43af1e77a40f362132253ed34168987227e6 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:03:15 +0530 Subject: [PATCH 51/64] retiring(utility): ReadRESTReq Signed-off-by: Deepanshu Tripathi --- utilities/rest/methods.go | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/utilities/rest/methods.go b/utilities/rest/methods.go index 9cab141cb..db96e1230 100644 --- a/utilities/rest/methods.go +++ b/utilities/rest/methods.go @@ -3,8 +3,6 @@ package rest import ( "encoding/json" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" - "io" "net/http" ) @@ -15,21 +13,6 @@ func PostProcessResponse(responseWriter http.ResponseWriter, context client.Cont _ = json.NewEncoder(responseWriter).Encode(response) } -func ReadRESTReq(responseWriter http.ResponseWriter, httpRequest *http.Request, legacyAmino *codec.LegacyAmino, request interface{}) bool { - body, err := io.ReadAll(httpRequest.Body) - if err != nil { - responseWriter.WriteHeader(http.StatusBadRequest) - _, _ = responseWriter.Write([]byte(err.Error())) - return false - } - if err := legacyAmino.UnmarshalJSON(body, request); err != nil { - responseWriter.WriteHeader(http.StatusBadRequest) - _, _ = responseWriter.Write([]byte(err.Error())) - return false - } - return true -} - func CheckBadRequestError(responseWriter http.ResponseWriter, err error) bool { if err != nil { responseWriter.WriteHeader(http.StatusBadRequest) From baf847a2d7d2cead5dc7a07ac4d5245d449c0d77 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:03:50 +0530 Subject: [PATCH 52/64] retiring(utility): custom wasm encoder Signed-off-by: Deepanshu Tripathi --- utilities/wasm/custom_encoder.go | 42 -------------------------------- 1 file changed, 42 deletions(-) delete mode 100644 utilities/wasm/custom_encoder.go diff --git a/utilities/wasm/custom_encoder.go b/utilities/wasm/custom_encoder.go deleted file mode 100644 index afb866d61..000000000 --- a/utilities/wasm/custom_encoder.go +++ /dev/null @@ -1,42 +0,0 @@ -// Copyright [2021] - [2022], AssetMantle Pte. Ltd. and the code contributors -// SPDX-License-Identifier: Apache-2.0 - -package wasm - -import ( - "encoding/json" - errorConstants "github.com/AssetMantle/modules/helpers/constants" - "strings" - - "github.com/CosmWasm/wasmd/x/wasm" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - - "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" -) - -func CustomEncoder(moduleList ...helpers.Module) wasm.CustomEncoder { - return func(sender sdkTypes.AccAddress, rawMessage json.RawMessage) ([]sdkTypes.Msg, error) { - wasmMessage := baseHelpers.WasmMessagePrototype() - - err := json.Unmarshal(rawMessage, &wasmMessage) - if err != nil { - return nil, errorConstants.InvalidMessage.Wrapf(err.Error()) - } - - path := strings.Split(wasmMessage.GetType(), "/") - - for _, module := range moduleList { - if module.Name() == path[0] { - msg, err := module.DecodeModuleTransactionRequest(path[1], wasmMessage.GetRawMessage()) - if err != nil { - return nil, err - } - - return []sdkTypes.Msg{msg}, nil - } - } - - return nil, errorConstants.InvalidMessage.Wrapf("module not found") - } -} From d22f8d781412fc52ded3fb2e3eb7f1891dbfba26 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:05:53 +0530 Subject: [PATCH 53/64] refactor(commonTransactionRequest): making common transaction request public Signed-off-by: Deepanshu Tripathi --- helpers/base/common_transaction_request.go | 148 -------------------- helpers/common_transaction_request.go | 155 ++++++++++++++++++--- 2 files changed, 137 insertions(+), 166 deletions(-) delete mode 100644 helpers/base/common_transaction_request.go diff --git a/helpers/base/common_transaction_request.go b/helpers/base/common_transaction_request.go deleted file mode 100644 index a24e46b65..000000000 --- a/helpers/base/common_transaction_request.go +++ /dev/null @@ -1,148 +0,0 @@ -package base - -import ( - "fmt" - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/utilities/rest" - "github.com/cosmos/cosmos-sdk/client" - sdkTypes "github.com/cosmos/cosmos-sdk/types" - "net/http" - "strings" -) - -type CommonTransactionRequest struct { - From string `json:"from"` - Memo string `json:"memo"` - TimeoutHeight uint64 `json:"timeoutHeight"` - AccountNumber uint64 `json:"accountNumber"` - Sequence uint64 `json:"sequence"` - ChainID string `json:"chainID"` - Gas string `json:"gas"` - Fees string `json:"fees"` - GasPrices string `json:"gasPrices"` - Simulate bool `json:"simulate"` - GasAdjustment string `json:"gasAdjustment"` -} - -var _ helpers.CommonTransactionRequest = CommonTransactionRequest{} - -func (commonTransactionRequest CommonTransactionRequest) SetFrom(from string) helpers.CommonTransactionRequest { - commonTransactionRequest.From = from - return commonTransactionRequest -} -func (commonTransactionRequest CommonTransactionRequest) SetAccountNumber(accountNumber uint64) helpers.CommonTransactionRequest { - commonTransactionRequest.AccountNumber = accountNumber - return commonTransactionRequest -} -func (commonTransactionRequest CommonTransactionRequest) GetAccountNumber() uint64 { - return commonTransactionRequest.AccountNumber -} -func (commonTransactionRequest CommonTransactionRequest) GetGas() string { - return commonTransactionRequest.Gas -} -func (commonTransactionRequest CommonTransactionRequest) GetGasAdjustment() string { - return commonTransactionRequest.GasAdjustment -} -func (commonTransactionRequest CommonTransactionRequest) GetMemo() string { - return commonTransactionRequest.Memo -} -func (commonTransactionRequest CommonTransactionRequest) GetSequence() uint64 { - return commonTransactionRequest.Sequence -} -func (commonTransactionRequest CommonTransactionRequest) GetTimeoutHeight() uint64 { - return commonTransactionRequest.TimeoutHeight -} -func (commonTransactionRequest CommonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { - decCoins, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices) - if err != nil { - panic(err) - } - - return decCoins -} -func (commonTransactionRequest CommonTransactionRequest) IsSimulated() bool { - return commonTransactionRequest.Simulate -} -func (commonTransactionRequest CommonTransactionRequest) GetFrom() string { - return commonTransactionRequest.From -} -func (commonTransactionRequest CommonTransactionRequest) GetChainID() string { - return commonTransactionRequest.ChainID -} -func (commonTransactionRequest CommonTransactionRequest) SetChainID(chainIDString string) helpers.CommonTransactionRequest { - commonTransactionRequest.ChainID = chainIDString - return commonTransactionRequest -} -func (commonTransactionRequest CommonTransactionRequest) GetFees() sdkTypes.Coins { - coins, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees) - if err != nil { - panic(err) - } - - return coins -} -func (commonTransactionRequest CommonTransactionRequest) Validate() error { - if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { - return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) - } - - if _, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices); err != nil { - return fmt.Errorf("invalid gas prices %s", commonTransactionRequest.GasPrices) - } - - if _, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees); err != nil { - return fmt.Errorf("invalid fees %s", commonTransactionRequest.Fees) - } - - if !commonTransactionRequest.Simulate { - if len(commonTransactionRequest.ChainID) == 0 { - return fmt.Errorf("chain-id required but not specified") - } - if !commonTransactionRequest.GetFees().IsZero() && !commonTransactionRequest.GetGasPrices().IsZero() { - return fmt.Errorf("cannot provide both fees and gas prices") - } - if !commonTransactionRequest.GetFees().IsValid() && !commonTransactionRequest.GetGasPrices().IsValid() { - return fmt.Errorf("invalid fees or gas prices provided") - } - } - - return nil -} -func (commonTransactionRequest CommonTransactionRequest) Sanitize() helpers.CommonTransactionRequest { - return NewCommonTransactionRequest(commonTransactionRequest.From, commonTransactionRequest.Memo, commonTransactionRequest.ChainID, commonTransactionRequest.Gas, commonTransactionRequest.GasAdjustment, commonTransactionRequest.AccountNumber, commonTransactionRequest.TimeoutHeight, commonTransactionRequest.Sequence, commonTransactionRequest.Fees, commonTransactionRequest.GasPrices, commonTransactionRequest.Simulate) -} -func (commonTransactionRequest CommonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { - if err := commonTransactionRequest.Validate(); err != nil { - rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) - return false - } - - return true -} - -func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees, gasPrices string, simulate bool) helpers.CommonTransactionRequest { - return CommonTransactionRequest{ - From: strings.TrimSpace(from), - Memo: strings.TrimSpace(memo), - ChainID: strings.TrimSpace(chainID), - Fees: strings.TrimSpace(fees), - GasPrices: strings.TrimSpace(gasPrices), - Gas: strings.TrimSpace(gas), - GasAdjustment: strings.TrimSpace(gasAdjustment), - AccountNumber: accountNumber, - Sequence: sequence, - TimeoutHeight: timeOutHeight, - Simulate: simulate, - } -} -func PrototypeCommonTransactionRequest() helpers.CommonTransactionRequest { - return &CommonTransactionRequest{} -} - -func NewCommonTransactionRequestFromContext(context client.Context) helpers.CommonTransactionRequest { - return CommonTransactionRequest{ - From: context.FromAddress.String(), - ChainID: context.ChainID, - Simulate: context.Simulate, - } -} diff --git a/helpers/common_transaction_request.go b/helpers/common_transaction_request.go index 9f867c39b..4b3d38886 100644 --- a/helpers/common_transaction_request.go +++ b/helpers/common_transaction_request.go @@ -1,26 +1,145 @@ package helpers import ( + "fmt" + "github.com/AssetMantle/modules/utilities/rest" + "github.com/cosmos/cosmos-sdk/client" sdkTypes "github.com/cosmos/cosmos-sdk/types" "net/http" + "strings" ) -type CommonTransactionRequest interface { - GetFrom() string - SetFrom(string) CommonTransactionRequest - GetChainID() string - SetChainID(string) CommonTransactionRequest - GetFees() sdkTypes.Coins - IsSimulated() bool - GetGasPrices() sdkTypes.DecCoins - GetTimeoutHeight() uint64 - GetSequence() uint64 - GetMemo() string - GetGas() string - GetGasAdjustment() string - GetAccountNumber() uint64 - SetAccountNumber(uint64) CommonTransactionRequest - Validate() error - Sanitize() CommonTransactionRequest - ValidateBasic(responseWriter http.ResponseWriter) bool +type CommonTransactionRequest struct { + From string `json:"from"` + Memo string `json:"memo"` + TimeoutHeight uint64 `json:"timeoutHeight"` + AccountNumber uint64 `json:"accountNumber"` + Sequence uint64 `json:"sequence"` + ChainID string `json:"chainID"` + Gas string `json:"gas"` + Fees string `json:"fees"` + GasPrices string `json:"gasPrices"` + Simulate bool `json:"simulate"` + GasAdjustment string `json:"gasAdjustment"` +} + +func (commonTransactionRequest CommonTransactionRequest) SetFrom(from string) CommonTransactionRequest { + commonTransactionRequest.From = from + return commonTransactionRequest +} +func (commonTransactionRequest CommonTransactionRequest) SetAccountNumber(accountNumber uint64) CommonTransactionRequest { + commonTransactionRequest.AccountNumber = accountNumber + return commonTransactionRequest +} +func (commonTransactionRequest CommonTransactionRequest) GetAccountNumber() uint64 { + return commonTransactionRequest.AccountNumber +} +func (commonTransactionRequest CommonTransactionRequest) GetGas() string { + return commonTransactionRequest.Gas +} +func (commonTransactionRequest CommonTransactionRequest) GetGasAdjustment() string { + return commonTransactionRequest.GasAdjustment +} +func (commonTransactionRequest CommonTransactionRequest) GetMemo() string { + return commonTransactionRequest.Memo +} +func (commonTransactionRequest CommonTransactionRequest) GetSequence() uint64 { + return commonTransactionRequest.Sequence +} +func (commonTransactionRequest CommonTransactionRequest) GetTimeoutHeight() uint64 { + return commonTransactionRequest.TimeoutHeight +} +func (commonTransactionRequest CommonTransactionRequest) GetGasPrices() sdkTypes.DecCoins { + decCoins, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices) + if err != nil { + panic(err) + } + + return decCoins +} +func (commonTransactionRequest CommonTransactionRequest) IsSimulated() bool { + return commonTransactionRequest.Simulate +} +func (commonTransactionRequest CommonTransactionRequest) GetFrom() string { + return commonTransactionRequest.From +} +func (commonTransactionRequest CommonTransactionRequest) GetChainID() string { + return commonTransactionRequest.ChainID +} +func (commonTransactionRequest CommonTransactionRequest) SetChainID(chainIDString string) CommonTransactionRequest { + commonTransactionRequest.ChainID = chainIDString + return commonTransactionRequest +} +func (commonTransactionRequest CommonTransactionRequest) GetFees() sdkTypes.Coins { + coins, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees) + if err != nil { + panic(err) + } + + return coins +} +func (commonTransactionRequest CommonTransactionRequest) Validate() error { + if _, err := sdkTypes.AccAddressFromBech32(commonTransactionRequest.From); err != nil || len(commonTransactionRequest.From) == 0 { + return fmt.Errorf("invalid from address: %s", commonTransactionRequest.From) + } + + if _, err := sdkTypes.ParseDecCoins(commonTransactionRequest.GasPrices); err != nil { + return fmt.Errorf("invalid gas prices %s", commonTransactionRequest.GasPrices) + } + + if _, err := sdkTypes.ParseCoinsNormalized(commonTransactionRequest.Fees); err != nil { + return fmt.Errorf("invalid fees %s", commonTransactionRequest.Fees) + } + + if !commonTransactionRequest.Simulate { + if len(commonTransactionRequest.ChainID) == 0 { + return fmt.Errorf("chain-id required but not specified") + } + if !commonTransactionRequest.GetFees().IsZero() && !commonTransactionRequest.GetGasPrices().IsZero() { + return fmt.Errorf("cannot provide both fees and gas prices") + } + if !commonTransactionRequest.GetFees().IsValid() && !commonTransactionRequest.GetGasPrices().IsValid() { + return fmt.Errorf("invalid fees or gas prices provided") + } + } + + return nil +} +func (commonTransactionRequest CommonTransactionRequest) Sanitize() CommonTransactionRequest { + return NewCommonTransactionRequest(commonTransactionRequest.From, commonTransactionRequest.Memo, commonTransactionRequest.ChainID, commonTransactionRequest.Gas, commonTransactionRequest.GasAdjustment, commonTransactionRequest.AccountNumber, commonTransactionRequest.TimeoutHeight, commonTransactionRequest.Sequence, commonTransactionRequest.Fees, commonTransactionRequest.GasPrices, commonTransactionRequest.Simulate) +} +func (commonTransactionRequest CommonTransactionRequest) ValidateBasic(responseWriter http.ResponseWriter) bool { + if err := commonTransactionRequest.Validate(); err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return false + } + + return true +} + +func NewCommonTransactionRequest(from, memo, chainID, gas, gasAdjustment string, accountNumber, sequence, timeOutHeight uint64, fees, gasPrices string, simulate bool) CommonTransactionRequest { + return CommonTransactionRequest{ + From: strings.TrimSpace(from), + Memo: strings.TrimSpace(memo), + ChainID: strings.TrimSpace(chainID), + Fees: strings.TrimSpace(fees), + GasPrices: strings.TrimSpace(gasPrices), + Gas: strings.TrimSpace(gas), + GasAdjustment: strings.TrimSpace(gasAdjustment), + AccountNumber: accountNumber, + Sequence: sequence, + TimeoutHeight: timeOutHeight, + Simulate: simulate, + } +} +func PrototypeCommonTransactionRequest() CommonTransactionRequest { + return CommonTransactionRequest{} +} + +func NewCommonTransactionRequestFromContext(context client.Context) CommonTransactionRequest { + return CommonTransactionRequest{ + From: context.FromAddress.String(), + ChainID: context.ChainID, + Simulate: context.Simulate, + } } From 4afe2943982dd26acfd6c3d51043ab574c5dbc36 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:06:39 +0530 Subject: [PATCH 54/64] code cleanup Signed-off-by: Deepanshu Tripathi --- helpers/amino_codec.go | 2 -- helpers/base/codec.go | 1 - 2 files changed, 3 deletions(-) diff --git a/helpers/amino_codec.go b/helpers/amino_codec.go index 4d631d72f..b3e8379cd 100644 --- a/helpers/amino_codec.go +++ b/helpers/amino_codec.go @@ -8,9 +8,7 @@ func RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { legacyAmino.RegisterInterface((*Mappable)(nil), nil) legacyAmino.RegisterInterface((*QueryResponse)(nil), nil) legacyAmino.RegisterInterface((*QueryRequest)(nil), nil) - legacyAmino.RegisterInterface((*CommonTransactionRequest)(nil), nil) legacyAmino.RegisterInterface((*TransactionRequest)(nil), nil) - legacyAmino.RegisterInterface((*Request)(nil), nil) legacyAmino.RegisterInterface((*Error)(nil), nil) legacyAmino.RegisterInterface((*error)(nil), nil) } diff --git a/helpers/base/codec.go b/helpers/base/codec.go index a77b7b14a..1bf24e46c 100644 --- a/helpers/base/codec.go +++ b/helpers/base/codec.go @@ -34,7 +34,6 @@ func (codec codec) Initialize(moduleManager helpers.ModuleManager) helpers.Codec std.RegisterLegacyAminoCodec(codec.legacyAmino) std.RegisterInterfaces(codec.interfaceRegistry) helpers.RegisterLegacyAminoCodec(codec.legacyAmino) - RegisterLegacyAminoCodec(codec.legacyAmino) schemaCodec.RegisterLegacyAminoCodec(codec.legacyAmino) docs.RegisterLegacyAminoCodec(codec.legacyAmino) moduleManager.RegisterLegacyAminoCodec(codec.legacyAmino) From 3ef86fa71bafff0921f00d82580a7c879f21c7c5 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:07:23 +0530 Subject: [PATCH 55/64] refactor(define): making NewAuxiliaryRequest public Signed-off-by: Deepanshu Tripathi --- .../auxiliaries/define/auxiliary_keeper.go | 13 ++++++------- .../auxiliaries/define/auxiliary_response.go | 5 ++--- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/x/classifications/auxiliaries/define/auxiliary_keeper.go b/x/classifications/auxiliaries/define/auxiliary_keeper.go index e878f74e7..146014542 100644 --- a/x/classifications/auxiliaries/define/auxiliary_keeper.go +++ b/x/classifications/auxiliaries/define/auxiliary_keeper.go @@ -5,7 +5,11 @@ package define import ( "context" + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" + "github.com/AssetMantle/modules/x/classifications/constants" + "github.com/AssetMantle/modules/x/classifications/key" + "github.com/AssetMantle/modules/x/classifications/record" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents/base" @@ -17,11 +21,6 @@ import ( sdkTypes "github.com/cosmos/cosmos-sdk/types" bankKeeper "github.com/cosmos/cosmos-sdk/x/bank/keeper" stakingKeeper "github.com/cosmos/cosmos-sdk/x/staking/keeper" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/x/classifications/constants" - "github.com/AssetMantle/modules/x/classifications/key" - "github.com/AssetMantle/modules/x/classifications/record" ) type auxiliaryKeeper struct { @@ -78,7 +77,7 @@ func (auxiliaryKeeper auxiliaryKeeper) Help(context context.Context, AuxiliaryRe classificationID := baseIDs.NewClassificationID(auxiliaryRequest.Immutables, auxiliaryRequest.Mutables) classifications := auxiliaryKeeper.mapper.NewCollection(context).Fetch(key.NewKey(classificationID)) if classifications.GetMappable(key.NewKey(classificationID)) != nil { - return newAuxiliaryResponse(classificationID), errorConstants.EntityAlreadyExists.Wrapf("classification with ID %s already exists", classificationID.AsString()) + return NewAuxiliaryResponse(classificationID), errorConstants.EntityAlreadyExists.Wrapf("classification with ID %s already exists", classificationID.AsString()) } if err := auxiliaryKeeper.bankKeeper.SendCoinsFromAccountToModule(sdkTypes.UnwrapSDKContext(context), auxiliaryRequest.AccAddress, constants.ModuleName, sdkTypes.NewCoins(sdkTypes.NewCoin(auxiliaryKeeper.stakingKeeper.BondDenom(sdkTypes.UnwrapSDKContext(context)), bondAmount.Get()))); err != nil { @@ -93,7 +92,7 @@ func (auxiliaryKeeper auxiliaryKeeper) Help(context context.Context, AuxiliaryRe classifications.Add(record.NewRecord(classification)) - return newAuxiliaryResponse(classificationID), nil + return NewAuxiliaryResponse(classificationID), nil } func (auxiliaryKeeper auxiliaryKeeper) Initialize(mapper helpers.Mapper, parameterManager helpers.ParameterManager, auxiliaries []interface{}) helpers.Keeper { diff --git a/x/classifications/auxiliaries/define/auxiliary_response.go b/x/classifications/auxiliaries/define/auxiliary_response.go index d1c5d4161..b4a6ea003 100644 --- a/x/classifications/auxiliaries/define/auxiliary_response.go +++ b/x/classifications/auxiliaries/define/auxiliary_response.go @@ -4,10 +4,9 @@ package define import ( + "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" - - "github.com/AssetMantle/modules/helpers" ) type auxiliaryResponse struct { @@ -16,7 +15,7 @@ type auxiliaryResponse struct { var _ helpers.AuxiliaryResponse = (*auxiliaryResponse)(nil) -func newAuxiliaryResponse(classificationID ids.ClassificationID) helpers.AuxiliaryResponse { +func NewAuxiliaryResponse(classificationID ids.ClassificationID) helpers.AuxiliaryResponse { return auxiliaryResponse{ ClassificationID: classificationID, } From c0fcb5323093f844faf165c6d77b241c0c569559 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:07:42 +0530 Subject: [PATCH 56/64] refactor(define): making NewAuxiliaryRequest public Signed-off-by: Deepanshu Tripathi --- .../auxiliaries/define/auxiliary_response_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/classifications/auxiliaries/define/auxiliary_response_test.go b/x/classifications/auxiliaries/define/auxiliary_response_test.go index ad27de223..e714a435d 100644 --- a/x/classifications/auxiliaries/define/auxiliary_response_test.go +++ b/x/classifications/auxiliaries/define/auxiliary_response_test.go @@ -37,8 +37,8 @@ func TestGetClassificationIDFromResponse(t *testing.T) { want ids.ClassificationID wantErr bool }{ - {"+ve", args{newAuxiliaryResponse(classificationID)}, classificationID, false}, - {"+ve", args{newAuxiliaryResponse(nil)}, nil, false}, + {"+ve", args{NewAuxiliaryResponse(classificationID)}, classificationID, false}, + {"+ve", args{NewAuxiliaryResponse(nil)}, nil, false}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { @@ -66,8 +66,8 @@ func Test_newAuxiliaryResponse(t *testing.T) { } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { - if got := newAuxiliaryResponse(tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { - t.Errorf("newAuxiliaryResponse() = %v, want %v", got, tt.want) + if got := NewAuxiliaryResponse(tt.args.classificationID); !reflect.DeepEqual(got, tt.want) { + t.Errorf("NewAuxiliaryResponse() = %v, want %v", got, tt.want) } }) } From fb0a1773b6983f296691661291d72263d6000325 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:08:17 +0530 Subject: [PATCH 57/64] refactor(commonTransactionRequest): making common transaction request public Signed-off-by: Deepanshu Tripathi --- helpers/base/cli_command.go | 3 +-- helpers/base/cli_command_test.go | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/helpers/base/cli_command.go b/helpers/base/cli_command.go index 064e17029..6d9a9b361 100644 --- a/helpers/base/cli_command.go +++ b/helpers/base/cli_command.go @@ -7,7 +7,6 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" - "github.com/spf13/cobra" "github.com/AssetMantle/modules/helpers" @@ -84,7 +83,7 @@ func (cliCommand cliCommand) ReadString(cliFlag helpers.CLIFlag) string { } func (cliCommand cliCommand) ReadCommonTransactionRequest(context client.Context) helpers.CommonTransactionRequest { - return NewCommonTransactionRequestFromContext(context) + return helpers.NewCommonTransactionRequestFromContext(context) } func (cliCommand cliCommand) CreateCommand(runE func(command *cobra.Command, args []string) error) *cobra.Command { command := &cobra.Command{ diff --git a/helpers/base/cli_command_test.go b/helpers/base/cli_command_test.go index 1b453eaf8..926abae4d 100644 --- a/helpers/base/cli_command_test.go +++ b/helpers/base/cli_command_test.go @@ -105,8 +105,8 @@ func Test_cliCommand_ReadBaseReq(t *testing.T) { want helpers.CommonTransactionRequest }{ - {"+ve", fields{"", "", "", testCliFlagList}, args{client.Context{ChainID: "chainID"}}, PrototypeCommonTransactionRequest()}, - {"-ve for nil", fields{"", "", "", nil}, args{client.Context{ChainID: ""}}, PrototypeCommonTransactionRequest()}, + {"+ve", fields{"", "", "", testCliFlagList}, args{client.Context{ChainID: "chainID"}}, helpers.PrototypeCommonTransactionRequest()}, + {"-ve for nil", fields{"", "", "", nil}, args{client.Context{ChainID: ""}}, helpers.PrototypeCommonTransactionRequest()}, } for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { From 25c3c95e022cd31301e070572f3230ab0ba72233 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:10:48 +0530 Subject: [PATCH 58/64] refactor(utilities): encoding decoding simplification Signed-off-by: Deepanshu Tripathi --- utilities/encoding/decode.go | 10 ++++++++ utilities/encoding/encode.go | 10 ++++++++ utilities/rest/id_getters/docs/common.go | 27 ++++++++++++---------- utilities/rest/id_getters/docs/identity.go | 18 +++++++++------ utilities/rest/id_getters/docs/request.go | 14 ----------- utilities/rest/id_getters/docs/split.go | 23 +++++++++--------- 6 files changed, 58 insertions(+), 44 deletions(-) create mode 100644 utilities/encoding/decode.go create mode 100644 utilities/encoding/encode.go diff --git a/utilities/encoding/decode.go b/utilities/encoding/decode.go new file mode 100644 index 000000000..94b81e563 --- /dev/null +++ b/utilities/encoding/decode.go @@ -0,0 +1,10 @@ +package encoding + +import ( + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/gogoproto/proto" +) + +func Decode[Message proto.Message](data []byte, message Message) error { + return base.CodecPrototype().UnmarshalJSON(data, message) +} diff --git a/utilities/encoding/encode.go b/utilities/encoding/encode.go new file mode 100644 index 000000000..e151da3c0 --- /dev/null +++ b/utilities/encoding/encode.go @@ -0,0 +1,10 @@ +package encoding + +import ( + "github.com/AssetMantle/modules/helpers/base" + "github.com/cosmos/gogoproto/proto" +) + +func Encode[Message proto.Message](message Message) ([]byte, error) { + return base.CodecPrototype().MarshalJSON(message) +} diff --git a/utilities/rest/id_getters/docs/common.go b/utilities/rest/id_getters/docs/common.go index f12749437..0b8470a0d 100644 --- a/utilities/rest/id_getters/docs/common.go +++ b/utilities/rest/id_getters/docs/common.go @@ -1,7 +1,9 @@ package docs import ( + "encoding/json" "github.com/AssetMantle/modules/utilities/rest" + "io" "net/http" codecUtilities "github.com/AssetMantle/schema/codec/utilities" @@ -40,31 +42,32 @@ func ReadAndProcess(context client.Context, responseWriter http.ResponseWriter, } func read(context client.Context, responseWriter http.ResponseWriter, httpRequest *http.Request) (request, ids.ClassificationID, lists.PropertyList, lists.PropertyList, lists.PropertyList, lists.PropertyList) { - transactionRequest := Prototype() - if !rest.ReadRESTReq(responseWriter, httpRequest, context.LegacyAmino, &transactionRequest) { + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) return request{}, nil, nil, nil, nil, nil } - if rest.CheckBadRequestError(responseWriter, transactionRequest.Validate()) { - return request{}, nil, nil, nil, nil, nil + request := request{} + if err := json.Unmarshal(body, &request); err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return request, nil, nil, nil, nil, nil } - req := transactionRequest.(request) - - immutableMetaProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(req.ImmutableMetaProperties) + immutableMetaProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(request.ImmutableMetaProperties) - immutableProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(req.ImmutableProperties) + immutableProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(request.ImmutableProperties) immutableProperties = immutableProperties.ScrubData() - mutableMetaProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(req.MutableMetaProperties) + mutableMetaProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(request.MutableMetaProperties) - mutableProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(req.MutableProperties) + mutableProperties, _ := baseLists.NewPropertyList().FromMetaPropertiesString(request.MutableProperties) mutableProperties = mutableProperties.ScrubData() - classificationID, _ := baseIDs.PrototypeClassificationID().FromString(req.ClassificationID) - return req, classificationID.(ids.ClassificationID), immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties + classificationID, _ := baseIDs.PrototypeClassificationID().FromString(request.ClassificationID) + return request, classificationID.(ids.ClassificationID), immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties } func Process(immutableMetaPropertyList, immutablePropertyList, mutableMetaPropertyList, mutablePropertyList lists.PropertyList) (qualified.Immutables, qualified.Mutables) { diff --git a/utilities/rest/id_getters/docs/identity.go b/utilities/rest/id_getters/docs/identity.go index 79c10ed76..a69e6a46e 100644 --- a/utilities/rest/id_getters/docs/identity.go +++ b/utilities/rest/id_getters/docs/identity.go @@ -1,8 +1,9 @@ package docs import ( - "fmt" + "encoding/json" "github.com/AssetMantle/modules/utilities/rest" + "io" "net/http" baseData "github.com/AssetMantle/schema/data/base" @@ -13,16 +14,19 @@ import ( func nameIdentityIDHandler(context client.Context) http.HandlerFunc { return func(responseWriter http.ResponseWriter, httpRequest *http.Request) { - transactionRequest := Prototype() - if !rest.ReadRESTReq(responseWriter, httpRequest, context.LegacyAmino, &transactionRequest) { - panic(fmt.Errorf("failed to read request")) + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return } - if rest.CheckBadRequestError(responseWriter, transactionRequest.Validate()) { - panic(fmt.Errorf("failed to validate request")) + request := request{} + if err := json.Unmarshal(body, &request); err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return } - rest.PostProcessResponse(responseWriter, context, newResponse(baseDocuments.NewNameIdentity(baseIDs.NewStringID(transactionRequest.(request).Name), baseData.PrototypeListData()).GetNameIdentityID().AsString(), nil)) + rest.PostProcessResponse(responseWriter, context, newResponse(baseDocuments.NewNameIdentity(baseIDs.NewStringID(request.Name), baseData.PrototypeListData()).GetNameIdentityID().AsString(), nil)) } } diff --git a/utilities/rest/id_getters/docs/request.go b/utilities/rest/id_getters/docs/request.go index 6bdd3e1de..e338f2530 100644 --- a/utilities/rest/id_getters/docs/request.go +++ b/utilities/rest/id_getters/docs/request.go @@ -3,10 +3,6 @@ package docs -import ( - "github.com/AssetMantle/modules/helpers" -) - type request struct { FromID string `json:"fromID" valid:"optional"` ImmutableMetaProperties string `json:"immutableMetaProperties" valid:"optional"` @@ -24,13 +20,3 @@ type request struct { Name string `json:"name" valid:"optional"` Coins string `json:"coins" valid:"optional"` } - -var _ helpers.Request = &request{} - -func (request request) Validate() error { - return nil -} - -func Prototype() helpers.Request { - return request{} -} diff --git a/utilities/rest/id_getters/docs/split.go b/utilities/rest/id_getters/docs/split.go index d756aa2bd..dd245051f 100644 --- a/utilities/rest/id_getters/docs/split.go +++ b/utilities/rest/id_getters/docs/split.go @@ -1,33 +1,34 @@ package docs import ( - "fmt" + "encoding/json" "github.com/AssetMantle/modules/utilities/rest" baseDocuments "github.com/AssetMantle/schema/documents/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" sdkTypes "github.com/cosmos/cosmos-sdk/types" - + "io" "net/http" ) func splitIDHandler(context client.Context) http.HandlerFunc { return func(responseWriter http.ResponseWriter, httpRequest *http.Request) { - transactionRequest := Prototype() - if !rest.ReadRESTReq(responseWriter, httpRequest, context.LegacyAmino, &transactionRequest) { - panic(fmt.Errorf("failed to read request")) + body, err := io.ReadAll(httpRequest.Body) + if err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return } - if rest.CheckBadRequestError(responseWriter, transactionRequest.Validate()) { - panic(fmt.Errorf("failed to validate request")) + request := request{} + if err := json.Unmarshal(body, &request); err != nil { + rest.WriteErrorResponse(responseWriter, http.StatusBadRequest, err.Error()) + return } - req := transactionRequest.(request) - - fromID, _ := baseIDs.PrototypeIdentityID().FromString(req.FromID) + fromID, _ := baseIDs.PrototypeIdentityID().FromString(request.FromID) - coins, _ := sdkTypes.ParseCoinsNormalized(req.Coins) + coins, _ := sdkTypes.ParseCoinsNormalized(request.Coins) var coinID ids.AssetID for _, coin := range coins { From 7d6ca424d910bfb803e97f8d22db2d9ddf85aff6 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:53:17 +0530 Subject: [PATCH 59/64] retiring(transaction request): legacy amino codec Signed-off-by: Deepanshu Tripathi --- helpers/transaction_request.go | 2 -- x/assets/transactions/burn/transaction_request.go | 5 ----- x/assets/transactions/define/transaction_request.go | 5 ----- x/assets/transactions/deputize/transaction_request.go | 5 ----- x/assets/transactions/mint/transaction_request.go | 5 ----- x/assets/transactions/mutate/transaction_request.go | 5 ----- x/assets/transactions/renumerate/transaction_request.go | 5 ----- x/assets/transactions/revoke/transaction_request.go | 5 ----- x/assets/transactions/send/transaction_request.go | 5 ----- x/assets/transactions/unwrap/transaction_request.go | 5 ----- x/assets/transactions/wrap/transaction_request.go | 5 ----- x/identities/transactions/define/transaction_request.go | 5 ----- x/identities/transactions/deputize/transaction_request.go | 5 ----- x/identities/transactions/issue/transaction_request.go | 5 ----- x/identities/transactions/name/transaction_request.go | 5 ----- x/identities/transactions/provision/transaction_request.go | 5 ----- x/identities/transactions/quash/transaction_request.go | 5 ----- x/identities/transactions/revoke/transaction_request.go | 5 ----- x/identities/transactions/unprovision/transaction_request.go | 5 ----- x/identities/transactions/update/transaction_request.go | 5 ----- x/metas/transactions/reveal/transaction_request.go | 5 ----- x/orders/transactions/cancel/transaction_request.go | 5 ----- x/orders/transactions/define/transaction_request.go | 5 ----- x/orders/transactions/deputize/transaction_request.go | 5 ----- x/orders/transactions/get/transaction_request.go | 5 ----- x/orders/transactions/immediate/transaction_request.go | 5 ----- x/orders/transactions/make/transaction_request.go | 5 ----- x/orders/transactions/modify/transaction_request.go | 5 ----- x/orders/transactions/put/transaction_request.go | 5 ----- x/orders/transactions/revoke/transaction_request.go | 5 ----- x/orders/transactions/take/transaction_request.go | 5 ----- 31 files changed, 152 deletions(-) diff --git a/helpers/transaction_request.go b/helpers/transaction_request.go index 9a959d893..563494b94 100644 --- a/helpers/transaction_request.go +++ b/helpers/transaction_request.go @@ -5,7 +5,6 @@ package helpers import ( "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "net/http" ) @@ -16,6 +15,5 @@ type TransactionRequest interface { FromCLI(CLICommand, client.Context) (TransactionRequest, error) FromHTTPRequest(*http.Request) (TransactionRequest, error) MakeMsg() (sdkTypes.Msg, error) - RegisterLegacyAminoCodec(*codec.LegacyAmino) Request } diff --git a/x/assets/transactions/burn/transaction_request.go b/x/assets/transactions/burn/transaction_request.go index 61efab024..ed20d3898 100644 --- a/x/assets/transactions/burn/transaction_request.go +++ b/x/assets/transactions/burn/transaction_request.go @@ -5,11 +5,9 @@ package burn import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { assetID.(ids.AssetID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/define/transaction_request.go b/x/assets/transactions/define/transaction_request.go index 22b6febc4..6dad1da67 100644 --- a/x/assets/transactions/define/transaction_request.go +++ b/x/assets/transactions/define/transaction_request.go @@ -5,12 +5,10 @@ package define import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -116,9 +114,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/deputize/transaction_request.go b/x/assets/transactions/deputize/transaction_request.go index 0aa25e61b..e154b0c63 100644 --- a/x/assets/transactions/deputize/transaction_request.go +++ b/x/assets/transactions/deputize/transaction_request.go @@ -5,12 +5,10 @@ package deputize import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -124,9 +122,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { transactionRequest.CanMutateMaintainer, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/mint/transaction_request.go b/x/assets/transactions/mint/transaction_request.go index 37486c74e..402ed3577 100644 --- a/x/assets/transactions/mint/transaction_request.go +++ b/x/assets/transactions/mint/transaction_request.go @@ -5,12 +5,10 @@ package mint import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -132,9 +130,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/mutate/transaction_request.go b/x/assets/transactions/mutate/transaction_request.go index 8c2008de8..5f0f56a3e 100644 --- a/x/assets/transactions/mutate/transaction_request.go +++ b/x/assets/transactions/mutate/transaction_request.go @@ -5,12 +5,10 @@ package mutate import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -107,9 +105,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/renumerate/transaction_request.go b/x/assets/transactions/renumerate/transaction_request.go index 34a08d6d6..cf63e78b0 100644 --- a/x/assets/transactions/renumerate/transaction_request.go +++ b/x/assets/transactions/renumerate/transaction_request.go @@ -5,11 +5,9 @@ package renumerate import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { assetID.(ids.AssetID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/revoke/transaction_request.go b/x/assets/transactions/revoke/transaction_request.go index 572868d51..ae86e635d 100644 --- a/x/assets/transactions/revoke/transaction_request.go +++ b/x/assets/transactions/revoke/transaction_request.go @@ -5,11 +5,9 @@ package revoke import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -97,9 +95,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { classificationID.(ids.ClassificationID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/send/transaction_request.go b/x/assets/transactions/send/transaction_request.go index 01ffd4e1b..396c3171c 100644 --- a/x/assets/transactions/send/transaction_request.go +++ b/x/assets/transactions/send/transaction_request.go @@ -5,11 +5,9 @@ package send import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -105,9 +103,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { value, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/unwrap/transaction_request.go b/x/assets/transactions/unwrap/transaction_request.go index 725d1f906..4b9f4c2e7 100644 --- a/x/assets/transactions/unwrap/transaction_request.go +++ b/x/assets/transactions/unwrap/transaction_request.go @@ -5,11 +5,9 @@ package unwrap import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { coins, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/assets/transactions/wrap/transaction_request.go b/x/assets/transactions/wrap/transaction_request.go index 5755d59af..9eff6956a 100644 --- a/x/assets/transactions/wrap/transaction_request.go +++ b/x/assets/transactions/wrap/transaction_request.go @@ -5,11 +5,9 @@ package wrap import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { coins, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/define/transaction_request.go b/x/identities/transactions/define/transaction_request.go index a3c7f1c8d..b06a75799 100644 --- a/x/identities/transactions/define/transaction_request.go +++ b/x/identities/transactions/define/transaction_request.go @@ -5,12 +5,10 @@ package define import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -117,9 +115,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/deputize/transaction_request.go b/x/identities/transactions/deputize/transaction_request.go index f1dad2501..54f14ded8 100644 --- a/x/identities/transactions/deputize/transaction_request.go +++ b/x/identities/transactions/deputize/transaction_request.go @@ -5,12 +5,10 @@ package deputize import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -121,9 +119,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { transactionRequest.CanMutateMaintainer, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/issue/transaction_request.go b/x/identities/transactions/issue/transaction_request.go index a28e60c01..99ab0bfab 100644 --- a/x/identities/transactions/issue/transaction_request.go +++ b/x/identities/transactions/issue/transaction_request.go @@ -5,12 +5,10 @@ package issue import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -123,9 +121,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/name/transaction_request.go b/x/identities/transactions/name/transaction_request.go index a3ed1ea6c..439f71086 100644 --- a/x/identities/transactions/name/transaction_request.go +++ b/x/identities/transactions/name/transaction_request.go @@ -5,10 +5,8 @@ package name import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -75,9 +73,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { baseIDs.NewStringID(transactionRequest.Name), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/provision/transaction_request.go b/x/identities/transactions/provision/transaction_request.go index 1671463ca..d38ba0ff1 100644 --- a/x/identities/transactions/provision/transaction_request.go +++ b/x/identities/transactions/provision/transaction_request.go @@ -5,11 +5,9 @@ package provision import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { identityID.(ids.IdentityID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/quash/transaction_request.go b/x/identities/transactions/quash/transaction_request.go index 6964d11bc..7f63a2c98 100644 --- a/x/identities/transactions/quash/transaction_request.go +++ b/x/identities/transactions/quash/transaction_request.go @@ -5,11 +5,9 @@ package quash import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { identityID.(ids.IdentityID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/revoke/transaction_request.go b/x/identities/transactions/revoke/transaction_request.go index 635033967..2e93f9030 100644 --- a/x/identities/transactions/revoke/transaction_request.go +++ b/x/identities/transactions/revoke/transaction_request.go @@ -5,11 +5,9 @@ package revoke import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -96,9 +94,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { classificationID.(ids.ClassificationID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/unprovision/transaction_request.go b/x/identities/transactions/unprovision/transaction_request.go index 386c5d855..f9e6caae5 100644 --- a/x/identities/transactions/unprovision/transaction_request.go +++ b/x/identities/transactions/unprovision/transaction_request.go @@ -5,11 +5,9 @@ package unprovision import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { identityID.(ids.IdentityID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/identities/transactions/update/transaction_request.go b/x/identities/transactions/update/transaction_request.go index c15a54de9..e45b759e1 100644 --- a/x/identities/transactions/update/transaction_request.go +++ b/x/identities/transactions/update/transaction_request.go @@ -5,12 +5,10 @@ package update import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -107,9 +105,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/metas/transactions/reveal/transaction_request.go b/x/metas/transactions/reveal/transaction_request.go index ca55ee454..2e4beda82 100644 --- a/x/metas/transactions/reveal/transaction_request.go +++ b/x/metas/transactions/reveal/transaction_request.go @@ -5,10 +5,8 @@ package reveal import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/data/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -80,9 +78,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { data, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/cancel/transaction_request.go b/x/orders/transactions/cancel/transaction_request.go index c95716869..6aea81553 100644 --- a/x/orders/transactions/cancel/transaction_request.go +++ b/x/orders/transactions/cancel/transaction_request.go @@ -5,11 +5,9 @@ package cancel import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { orderID.(ids.OrderID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/define/transaction_request.go b/x/orders/transactions/define/transaction_request.go index b2ca125ef..53cc10286 100644 --- a/x/orders/transactions/define/transaction_request.go +++ b/x/orders/transactions/define/transaction_request.go @@ -5,12 +5,10 @@ package define import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -116,9 +114,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/deputize/transaction_request.go b/x/orders/transactions/deputize/transaction_request.go index c0bc33e71..a0233718a 100644 --- a/x/orders/transactions/deputize/transaction_request.go +++ b/x/orders/transactions/deputize/transaction_request.go @@ -5,12 +5,10 @@ package deputize import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -121,9 +119,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { transactionRequest.CanMutateMaintainer, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/get/transaction_request.go b/x/orders/transactions/get/transaction_request.go index ede97c851..697d47f15 100644 --- a/x/orders/transactions/get/transaction_request.go +++ b/x/orders/transactions/get/transaction_request.go @@ -5,11 +5,9 @@ package get import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -89,9 +87,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { orderID.(ids.OrderID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/immediate/transaction_request.go b/x/orders/transactions/immediate/transaction_request.go index 76323db81..001392c33 100644 --- a/x/orders/transactions/immediate/transaction_request.go +++ b/x/orders/transactions/immediate/transaction_request.go @@ -5,13 +5,11 @@ package immediate import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -169,9 +167,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/make/transaction_request.go b/x/orders/transactions/make/transaction_request.go index ef11b14f9..73d0b12fe 100644 --- a/x/orders/transactions/make/transaction_request.go +++ b/x/orders/transactions/make/transaction_request.go @@ -5,13 +5,11 @@ package make import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -169,9 +167,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/modify/transaction_request.go b/x/orders/transactions/modify/transaction_request.go index 925194515..0eae5dd1b 100644 --- a/x/orders/transactions/modify/transaction_request.go +++ b/x/orders/transactions/modify/transaction_request.go @@ -5,13 +5,11 @@ package modify import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists/base" baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -128,9 +126,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { mutableProperties, ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/put/transaction_request.go b/x/orders/transactions/put/transaction_request.go index 410b52725..c3eae6585 100644 --- a/x/orders/transactions/put/transaction_request.go +++ b/x/orders/transactions/put/transaction_request.go @@ -5,12 +5,10 @@ package put import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" baseTypes "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -118,9 +116,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { baseTypes.NewHeight(transactionRequest.ExpiryHeight), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/revoke/transaction_request.go b/x/orders/transactions/revoke/transaction_request.go index 30227e20a..d45358ed4 100644 --- a/x/orders/transactions/revoke/transaction_request.go +++ b/x/orders/transactions/revoke/transaction_request.go @@ -5,11 +5,9 @@ package revoke import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -97,9 +95,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { classificationID.(ids.ClassificationID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } diff --git a/x/orders/transactions/take/transaction_request.go b/x/orders/transactions/take/transaction_request.go index 282059c74..da68b05bd 100644 --- a/x/orders/transactions/take/transaction_request.go +++ b/x/orders/transactions/take/transaction_request.go @@ -5,11 +5,9 @@ package take import ( "encoding/json" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "io" "net/http" @@ -97,9 +95,6 @@ func (transactionRequest transactionRequest) MakeMsg() (sdkTypes.Msg, error) { orderID.(ids.OrderID), ), nil } -func (transactionRequest) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, transactionRequest{}) -} func requestPrototype() helpers.TransactionRequest { return transactionRequest{} } From 8a05d9c3e0ce01f9275751edb9241dad046b77e8 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:53:29 +0530 Subject: [PATCH 60/64] retiring(transaction): legacy amino codec Signed-off-by: Deepanshu Tripathi --- helpers/base/transaction.go | 4 ---- helpers/transaction.go | 2 -- 2 files changed, 6 deletions(-) diff --git a/helpers/base/transaction.go b/helpers/base/transaction.go index 219a9ba71..b8d7ae8d4 100644 --- a/helpers/base/transaction.go +++ b/helpers/base/transaction.go @@ -11,7 +11,6 @@ import ( "github.com/AssetMantle/modules/utilities/rest/queuing" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" codecTypes "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" sdkModuleTypes "github.com/cosmos/cosmos-sdk/types/module" @@ -103,9 +102,6 @@ func (transaction transaction) RESTRequestHandler(context client.Context) http.H } } } -func (transaction transaction) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - transaction.requestPrototype().RegisterLegacyAminoCodec(legacyAmino) -} func (transaction transaction) RegisterInterfaces(interfaceRegistry codecTypes.InterfaceRegistry) { transaction.messagePrototype().RegisterInterface(interfaceRegistry) } diff --git a/helpers/transaction.go b/helpers/transaction.go index 095671c64..5f2473025 100644 --- a/helpers/transaction.go +++ b/helpers/transaction.go @@ -8,7 +8,6 @@ import ( "net/http" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" @@ -20,7 +19,6 @@ type Transaction interface { Command() *cobra.Command HandleMessage(context.Context, Message) (*sdkTypes.Result, error) RESTRequestHandler(client.Context) http.HandlerFunc - RegisterLegacyAminoCodec(amino *codec.LegacyAmino) RegisterInterfaces(types.InterfaceRegistry) RegisterService(module.Configurator) InitializeKeeper(Mapper, ParameterManager, ...interface{}) Transaction From bcc56b28ba56a9801f5ff1aba49461bbed5d5365 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:53:37 +0530 Subject: [PATCH 61/64] retiring(transaction): legacy amino codec Signed-off-by: Deepanshu Tripathi --- helpers/base/module.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/helpers/base/module.go b/helpers/base/module.go index 9c33f8056..172df31a3 100644 --- a/helpers/base/module.go +++ b/helpers/base/module.go @@ -54,11 +54,7 @@ func (module module) Name() string { func (module module) GetTransactions() helpers.Transactions { return module.transactions } -func (module module) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - for _, transaction := range module.transactionsPrototype().Get() { - transaction.RegisterLegacyAminoCodec(legacyAmino) - } -} +func (module module) RegisterLegacyAminoCodec(_ *sdkCodec.LegacyAmino) {} func (module module) RegisterInterfaces(interfaceRegistry types.InterfaceRegistry) { for _, transaction := range module.transactionsPrototype().Get() { transaction.RegisterInterfaces(interfaceRegistry) From 24b314d0907dd341c8d31ff37fc1f151c1ce1309 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:55:01 +0530 Subject: [PATCH 62/64] retiring:legacy amino Signed-off-by: Deepanshu Tripathi --- helpers/amino_codec.go | 14 ------------ helpers/amino_codec_test.go | 28 ------------------------ helpers/base/codec.go | 5 ----- utilities/rest/id_getters/docs/common.go | 6 ----- 4 files changed, 53 deletions(-) delete mode 100644 helpers/amino_codec.go delete mode 100644 helpers/amino_codec_test.go diff --git a/helpers/amino_codec.go b/helpers/amino_codec.go deleted file mode 100644 index b3e8379cd..000000000 --- a/helpers/amino_codec.go +++ /dev/null @@ -1,14 +0,0 @@ -package helpers - -import ( - "github.com/cosmos/cosmos-sdk/codec" -) - -func RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - legacyAmino.RegisterInterface((*Mappable)(nil), nil) - legacyAmino.RegisterInterface((*QueryResponse)(nil), nil) - legacyAmino.RegisterInterface((*QueryRequest)(nil), nil) - legacyAmino.RegisterInterface((*TransactionRequest)(nil), nil) - legacyAmino.RegisterInterface((*Error)(nil), nil) - legacyAmino.RegisterInterface((*error)(nil), nil) -} diff --git a/helpers/amino_codec_test.go b/helpers/amino_codec_test.go deleted file mode 100644 index 3d764ee82..000000000 --- a/helpers/amino_codec_test.go +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright [2021] - [2022], AssetMantle Pte. Ltd. and the code contributors -// SPDX-License-Identifier: Apache-2.0 - -package helpers - -import ( - "testing" - - "github.com/cosmos/cosmos-sdk/codec" -) - -func TestRegisterCodec(t *testing.T) { - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - args args - }{ - - {"+ve", args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/helpers/base/codec.go b/helpers/base/codec.go index 1bf24e46c..47a5e72b8 100644 --- a/helpers/base/codec.go +++ b/helpers/base/codec.go @@ -2,8 +2,6 @@ package base import ( "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/utilities/rest/id_getters/docs" - schemaCodec "github.com/AssetMantle/schema/codec" sdkClient "github.com/cosmos/cosmos-sdk/client" sdkCodec "github.com/cosmos/cosmos-sdk/codec" sdkCodecTypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -33,9 +31,6 @@ func (codec codec) InterfaceRegistry() sdkCodecTypes.InterfaceRegistry { func (codec codec) Initialize(moduleManager helpers.ModuleManager) helpers.Codec { std.RegisterLegacyAminoCodec(codec.legacyAmino) std.RegisterInterfaces(codec.interfaceRegistry) - helpers.RegisterLegacyAminoCodec(codec.legacyAmino) - schemaCodec.RegisterLegacyAminoCodec(codec.legacyAmino) - docs.RegisterLegacyAminoCodec(codec.legacyAmino) moduleManager.RegisterLegacyAminoCodec(codec.legacyAmino) moduleManager.RegisterInterfaces(codec.interfaceRegistry) return codec diff --git a/utilities/rest/id_getters/docs/common.go b/utilities/rest/id_getters/docs/common.go index 0b8470a0d..8362a61ef 100644 --- a/utilities/rest/id_getters/docs/common.go +++ b/utilities/rest/id_getters/docs/common.go @@ -6,7 +6,6 @@ import ( "io" "net/http" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/AssetMantle/schema/lists" @@ -14,16 +13,11 @@ import ( "github.com/AssetMantle/schema/qualified" "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/gorilla/mux" ) -func RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, request{}) -} - func GetTotalWeight(immutables qualified.Immutables, mutables qualified.Mutables) sdkTypes.Int { totalWeight := sdkTypes.ZeroInt() for _, property := range append(immutables.GetImmutablePropertyList().Get(), mutables.GetMutablePropertyList().Get()...) { From 17b2dc7a1043823dac6a1659afb441b85064ef2e Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 14:13:08 +0530 Subject: [PATCH 63/64] retiring:legacy amino Signed-off-by: Deepanshu Tripathi --- helpers/mappable.go | 1 - x/assets/mappable/mappable.go | 5 ----- x/assets/transactions/wrap/message.go | 5 ----- x/classifications/mappable/mappable.go | 5 ----- x/identities/mappable/mappable.go | 5 ----- x/maintainers/mappable/mappable.go | 5 ----- x/metas/mappable/mappable.go | 5 ----- x/orders/mappable/mappable.go | 5 ----- x/splits/mappable/mappable.go | 5 ----- 9 files changed, 41 deletions(-) diff --git a/helpers/mappable.go b/helpers/mappable.go index 4deec920f..f4125c0a7 100644 --- a/helpers/mappable.go +++ b/helpers/mappable.go @@ -9,6 +9,5 @@ import ( type Mappable interface { codec.ProtoMarshaler - RegisterLegacyAminoCodec(*codec.LegacyAmino) ValidateBasic() error } diff --git a/x/assets/mappable/mappable.go b/x/assets/mappable/mappable.go index af36d18a9..7c865e5aa 100644 --- a/x/assets/mappable/mappable.go +++ b/x/assets/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Asset.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func Prototype() helpers.Mappable { return &Mappable{} diff --git a/x/assets/transactions/wrap/message.go b/x/assets/transactions/wrap/message.go index 9dacc7e2e..21128345c 100644 --- a/x/assets/transactions/wrap/message.go +++ b/x/assets/transactions/wrap/message.go @@ -7,10 +7,8 @@ import ( "github.com/AssetMantle/modules/helpers" errorConstants "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/modules/x/assets/constants" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/types" sdkTypes "github.com/cosmos/cosmos-sdk/types" ) @@ -39,9 +37,6 @@ func (message *Message) GetSigners() []sdkTypes.AccAddress { } return []sdkTypes.AccAddress{from} } -func (*Message) RegisterLegacyAminoCodec(legacyAmino *sdkCodec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Message{}) -} func (message *Message) RegisterInterface(interfaceRegistry types.InterfaceRegistry) { interfaceRegistry.RegisterImplementations((*sdkTypes.Msg)(nil), message) } diff --git a/x/classifications/mappable/mappable.go b/x/classifications/mappable/mappable.go index b220de55d..28f41980f 100644 --- a/x/classifications/mappable/mappable.go +++ b/x/classifications/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Classification.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func NewMappable(classification documents.Classification) helpers.Mappable { return &Mappable{ Classification: classification.Get().(*base.Document), diff --git a/x/identities/mappable/mappable.go b/x/identities/mappable/mappable.go index 695a6119f..817fec96a 100644 --- a/x/identities/mappable/mappable.go +++ b/x/identities/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Identity.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func NewMappable(identity documents.Identity) helpers.Mappable { return &Mappable{ diff --git a/x/maintainers/mappable/mappable.go b/x/maintainers/mappable/mappable.go index 326e1ac15..a9d7eae85 100644 --- a/x/maintainers/mappable/mappable.go +++ b/x/maintainers/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Maintainer.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func NewMappable(maintainer documents.Maintainer) helpers.Mappable { return &Mappable{Maintainer: maintainer.Get().(*baseDocuments.Document)} diff --git a/x/metas/mappable/mappable.go b/x/metas/mappable/mappable.go index 868ff29fc..c7eee824d 100644 --- a/x/metas/mappable/mappable.go +++ b/x/metas/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/data" baseData "github.com/AssetMantle/schema/data/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Data.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func NewMappable(data data.Data) helpers.Mappable { return &Mappable{Data: data.ToAnyData().(*baseData.AnyData)} diff --git a/x/orders/mappable/mappable.go b/x/orders/mappable/mappable.go index ea9dff7aa..8d6c2111b 100644 --- a/x/orders/mappable/mappable.go +++ b/x/orders/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Order.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func NewMappable(order documents.Order) helpers.Mappable { return &Mappable{Order: order.Get().(*base.Document)} diff --git a/x/splits/mappable/mappable.go b/x/splits/mappable/mappable.go index be11d8d59..f40690a7d 100644 --- a/x/splits/mappable/mappable.go +++ b/x/splits/mappable/mappable.go @@ -5,10 +5,8 @@ package mappable import ( "github.com/AssetMantle/modules/helpers" - codecUtilities "github.com/AssetMantle/schema/codec/utilities" "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" ) var _ helpers.Mappable = (*Mappable)(nil) @@ -16,9 +14,6 @@ var _ helpers.Mappable = (*Mappable)(nil) func (mappable *Mappable) ValidateBasic() error { return mappable.Split.ValidateBasic() } -func (*Mappable) RegisterLegacyAminoCodec(legacyAmino *codec.LegacyAmino) { - codecUtilities.RegisterModuleConcrete(legacyAmino, Mappable{}) -} func NewMappable(split types.Split) helpers.Mappable { return &Mappable{Split: split.(*baseTypes.Split)} From 51cdf2e7f301269973f73e4ae8f9f15cbf366612 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 14:35:11 +0530 Subject: [PATCH 64/64] retiring:legacy amino Signed-off-by: Deepanshu Tripathi --- x/assets/mappable/mappable_test.go | 30 +---- x/assets/queries/asset/query_request_test.go | 73 ----------- .../burn/transaction_request_test.go | 67 ----------- .../define/transaction_request_test.go | 79 ------------ .../deputize/transaction_request_test.go | 98 --------------- .../mint/transaction_request_test.go | 86 ------------- .../mutate/transaction_request_test.go | 75 ------------ .../renumerate/transaction_request_test.go | 66 ---------- .../revoke/transaction_request_test.go | 70 ----------- .../send/transaction_request_test.go | 81 +------------ .../unwrap/transaction_request_test.go | 70 ----------- x/assets/transactions/wrap/message_test.go | 29 ----- .../wrap/transaction_request_test.go | 73 +---------- x/classifications/mappable/mappable_test.go | 30 +---- x/identities/mappable/mappable_test.go | 31 +---- .../define/transaction_request_test.go | 93 -------------- .../deputize/transaction_request_test.go | 104 ---------------- .../issue/transaction_request_test.go | 92 -------------- .../name/transaction_request_test.go | 66 ---------- .../provision/transaction_request_test.go | 70 ----------- .../quash/transaction_request_test.go | 70 ----------- .../revoke/transaction_request_test.go | 76 ------------ .../unprovision/transaction_request_test.go | 70 ----------- .../update/transaction_request_test.go | 79 ------------ x/maintainers/mappable/mappable_test.go | 29 +---- .../queries/maintainer/query_request_test.go | 80 +------------ x/metas/mappable/mappable_test.go | 28 +---- x/metas/queries/meta/query_request_test.go | 81 +------------ .../reveal/transaction_request_test.go | 55 --------- x/orders/mappable/mappable_test.go | 29 +---- x/orders/queries/order/query_request_test.go | 80 +------------ .../cancel/transaction_request_test.go | 78 +----------- .../define/transaction_request_test.go | 85 +------------ .../deputize/transaction_request_test.go | 101 +--------------- .../get/transaction_request_test.go | 73 +---------- .../immediate/transaction_request_test.go | 113 +----------------- .../make/transaction_request_test.go | 113 +----------------- .../modify/transaction_request_test.go | 93 +------------- .../put/transaction_request_test.go | 89 +------------- .../revoke/transaction_request_test.go | 77 +----------- .../take/transaction_request_test.go | 77 +----------- x/splits/mappable/mappable_test.go | 25 ---- .../queries/balances/query_request_test.go | 80 +------------ x/splits/queries/split/query_request_test.go | 80 +------------ x/splits/queries/supply/query_request_test.go | 80 +------------ 45 files changed, 36 insertions(+), 3188 deletions(-) diff --git a/x/assets/mappable/mappable_test.go b/x/assets/mappable/mappable_test.go index 803ce009d..0a24dcd42 100644 --- a/x/assets/mappable/mappable_test.go +++ b/x/assets/mappable/mappable_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" baseData "github.com/AssetMantle/schema/data/base" documentsSchema "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -16,9 +17,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" "github.com/AssetMantle/schema/qualified" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) func createTestInput() (ids.ClassificationID, qualified.Immutables, qualified.Mutables, *Mappable) { @@ -65,29 +63,3 @@ func TestNewMappable(t *testing.T) { }) } } - -func Test_mappable_RegisterCodec(t *testing.T) { - _, _, _, testMappable := createTestInput() - type fields struct { - Document *Mappable - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{testMappable}, args{legacyAmino: codec.NewLegacyAmino()}}, - {"+ve nil", fields{&Mappable{nil}}, args{legacyAmino: codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - as := &Mappable{ - Asset: tt.fields.Document.Asset, - } - as.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/assets/queries/asset/query_request_test.go b/x/assets/queries/asset/query_request_test.go index fe95a0660..9a2e71a77 100644 --- a/x/assets/queries/asset/query_request_test.go +++ b/x/assets/queries/asset/query_request_test.go @@ -16,7 +16,6 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" "reflect" "testing" ) @@ -70,78 +69,6 @@ func Test_queryRequestFromInterface(t *testing.T) { } } -func Test_queryRequest_Decode(t *testing.T) { - encodedQuery, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testAssetID)) - require.NoError(t, err) - encodedQuery1, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeAssetID().(*baseIDs.AssetID))) - require.NoError(t, err) - type fields struct { - Key *key.Key - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{testKey}, args{encodedQuery}, newQueryRequest(testAssetID), false}, - {"+ve", fields{key.NewKey(baseIDs.PrototypeAssetID()).(*key.Key)}, args{encodedQuery1}, newQueryRequest(baseIDs.PrototypeAssetID().(*baseIDs.AssetID)), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.Key, - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedQuery, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testAssetID)) - require.NoError(t, err) - encodedQuery1, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeAssetID().(*baseIDs.AssetID))) - require.NoError(t, err) - type fields struct { - Key *key.Key - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{testKey}, encodedQuery, false}, - {"+ve with nil", fields{key.NewKey(baseIDs.PrototypeAssetID().(*baseIDs.AssetID)).(*key.Key)}, encodedQuery1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.Key, - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID}) diff --git a/x/assets/transactions/burn/transaction_request_test.go b/x/assets/transactions/burn/transaction_request_test.go index 3e38710a1..d5ffc1fa0 100644 --- a/x/assets/transactions/burn/transaction_request_test.go +++ b/x/assets/transactions/burn/transaction_request_test.go @@ -4,12 +4,10 @@ package burn import ( - "encoding/json" "fmt" "reflect" "testing" - baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" sdkTypes "github.com/cosmos/cosmos-sdk/types" @@ -104,43 +102,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - AssetID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID.(*baseIDs.IdentityID), testAssetID.(*baseIDs.AssetID)}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -201,34 +162,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - AssetID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/define/transaction_request_test.go b/x/assets/transactions/define/transaction_request_test.go index c648cf477..8b269e218 100644 --- a/x/assets/transactions/define/transaction_request_test.go +++ b/x/assets/transactions/define/transaction_request_test.go @@ -4,13 +4,11 @@ package define import ( - "encoding/json" "fmt" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "reflect" "testing" @@ -128,49 +126,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -243,40 +198,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{sdkCodec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/deputize/transaction_request_test.go b/x/assets/transactions/deputize/transaction_request_test.go index 465c16f57..d30ed0bc9 100644 --- a/x/assets/transactions/deputize/transaction_request_test.go +++ b/x/assets/transactions/deputize/transaction_request_test.go @@ -4,7 +4,6 @@ package deputize import ( - "encoding/json" "fmt" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -141,59 +140,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, mutableMetaProperties, true, true, true, true, true, true}))}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -286,50 +232,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMintAsset bool - CanBurnAsset bool - CanRenumerateAsset bool - CanAddMaintainer bool - CanRemoveMaintainer bool - CanMutateMaintainer bool - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), fmt.Sprint(mutableMetaProperties), true, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMintAsset: tt.fields.CanMintAsset, - CanBurnAsset: tt.fields.CanBurnAsset, - CanRenumerateAsset: tt.fields.CanRenumerateAsset, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/mint/transaction_request_test.go b/x/assets/transactions/mint/transaction_request_test.go index fa1111bde..c62fbd4fb 100644 --- a/x/assets/transactions/mint/transaction_request_test.go +++ b/x/assets/transactions/mint/transaction_request_test.go @@ -4,7 +4,6 @@ package mint import ( - "encoding/json" "fmt" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -135,53 +134,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID, immutableMetaProperties, immutableProperties, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -262,44 +214,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/mutate/transaction_request_test.go b/x/assets/transactions/mutate/transaction_request_test.go index 2fac005e9..c7c9b7a6f 100644 --- a/x/assets/transactions/mutate/transaction_request_test.go +++ b/x/assets/transactions/mutate/transaction_request_test.go @@ -4,7 +4,6 @@ package mutate import ( - "encoding/json" "fmt" "reflect" "testing" @@ -118,48 +117,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { }) } } - -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID, mutableMetaProperties, mutableProperties}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -228,38 +185,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - AssetID string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString(), mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/renumerate/transaction_request_test.go b/x/assets/transactions/renumerate/transaction_request_test.go index 5f0cdab69..a1e4a8437 100644 --- a/x/assets/transactions/renumerate/transaction_request_test.go +++ b/x/assets/transactions/renumerate/transaction_request_test.go @@ -4,7 +4,6 @@ package renumerate import ( - "encoding/json" "fmt" "reflect" "testing" @@ -103,43 +102,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - AssetID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, testAssetID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), testAssetID.AsString()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -200,34 +162,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - AssetID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), testAssetID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - AssetID: tt.fields.AssetID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/revoke/transaction_request_test.go b/x/assets/transactions/revoke/transaction_request_test.go index 9474c1f73..a55c8ef8e 100644 --- a/x/assets/transactions/revoke/transaction_request_test.go +++ b/x/assets/transactions/revoke/transaction_request_test.go @@ -4,7 +4,6 @@ package revoke import ( - "encoding/json" "fmt" "reflect" "testing" @@ -107,45 +106,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), fromID, fromID, classificationID}))}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -210,36 +170,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), classificationID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/send/transaction_request_test.go b/x/assets/transactions/send/transaction_request_test.go index 7fed43a68..f88ba5577 100644 --- a/x/assets/transactions/send/transaction_request_test.go +++ b/x/assets/transactions/send/transaction_request_test.go @@ -4,22 +4,18 @@ package send import ( - "encoding/json" "fmt" baseIDs "github.com/AssetMantle/schema/ids/base" "reflect" "testing" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -117,49 +113,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String())) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - AssetID string - Value string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{jsonMessage}, transactionRequest{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -228,38 +181,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - AssetID string - Value string - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), fromID.AsString(), assetID.AsString(), testRate.String()}, args{codec.GetLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - AssetID: tt.fields.AssetID, - Value: tt.fields.Value, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/unwrap/transaction_request_test.go b/x/assets/transactions/unwrap/transaction_request_test.go index 3d52fe4e5..835f858bf 100644 --- a/x/assets/transactions/unwrap/transaction_request_test.go +++ b/x/assets/transactions/unwrap/transaction_request_test.go @@ -4,7 +4,6 @@ package unwrap import ( - "encoding/json" "fmt" "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" @@ -16,10 +15,8 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/spf13/viper" - "github.com/stretchr/testify/require" "reflect" "testing" ) @@ -120,45 +117,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String())) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - Coins string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -219,34 +177,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - Coins string - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{codec.GetLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/assets/transactions/wrap/message_test.go b/x/assets/transactions/wrap/message_test.go index 6c2c47693..0f7a9cf9b 100644 --- a/x/assets/transactions/wrap/message_test.go +++ b/x/assets/transactions/wrap/message_test.go @@ -11,7 +11,6 @@ import ( "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -189,34 +188,6 @@ func Test_message_GetSigners(t *testing.T) { } } -func Test_message_RegisterCodec(t *testing.T) { - type fields struct { - From string - FromID *baseIDs.IdentityID - Coins types.Coins - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{fromAccAddress.String(), fromID, coins}, args{codec.GetLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - me := &Message{ - From: tt.fields.From, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - me.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_NewMessage(t *testing.T) { type args struct { from types.AccAddress diff --git a/x/assets/transactions/wrap/transaction_request_test.go b/x/assets/transactions/wrap/transaction_request_test.go index 13173a9c5..4a1493820 100644 --- a/x/assets/transactions/wrap/transaction_request_test.go +++ b/x/assets/transactions/wrap/transaction_request_test.go @@ -4,26 +4,22 @@ package wrap import ( - "encoding/json" "fmt" baseData "github.com/AssetMantle/schema/data/base" baseIDs "github.com/AssetMantle/schema/ids/base" baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - sdkCodec "github.com/cosmos/cosmos-sdk/codec" "reflect" "testing" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -117,45 +113,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String())) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - Coins string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, fromID.AsString(), coins.String()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -216,34 +173,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - Coins string - } - type args struct { - legacyAmino *sdkCodec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, fromID.AsString(), coins.String()}, args{codec.GetLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - Coins: tt.fields.Coins, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/classifications/mappable/mappable_test.go b/x/classifications/mappable/mappable_test.go index 43ad9511b..116ed5810 100644 --- a/x/classifications/mappable/mappable_test.go +++ b/x/classifications/mappable/mappable_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" baseData "github.com/AssetMantle/schema/data/base" documentsSchema "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -16,9 +17,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" "github.com/AssetMantle/schema/qualified" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) func createTestInput() (ids.ClassificationID, qualified.Immutables, qualified.Mutables, *Mappable) { @@ -65,29 +63,3 @@ func TestPrototype(t *testing.T) { }) } } - -func Test_mappable_RegisterCodec(t *testing.T) { - _, _, _, testMappable := createTestInput() - type fields struct { - Document *Mappable - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{testMappable}, args{legacyAmino: codec.NewLegacyAmino()}}, - {"+ve nil", fields{&Mappable{nil}}, args{legacyAmino: codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - as := &Mappable{ - Classification: tt.fields.Document.Classification, - } - as.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/identities/mappable/mappable_test.go b/x/identities/mappable/mappable_test.go index 9fc182331..16843fabb 100644 --- a/x/identities/mappable/mappable_test.go +++ b/x/identities/mappable/mappable_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -16,9 +17,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" "github.com/AssetMantle/schema/qualified" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) func createTestInput() (documents.Identity, ids.ClassificationID, qualified.Immutables, qualified.Mutables) { @@ -68,30 +66,3 @@ func TestPrototype(t *testing.T) { }) } } - -func Test_identity_RegisterCodec(t *testing.T) { - testIdentity, _, _, _ := createTestInput() - - type fields struct { - Document documents.Identity - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{testIdentity}, args{codec.NewLegacyAmino()}}, - {"+ve nil", fields{nil}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - id := &Mappable{ - Identity: tt.fields.Document.Get().(*baseDocuments.Document), - } - id.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/identities/transactions/define/transaction_request_test.go b/x/identities/transactions/define/transaction_request_test.go index ceda56ad9..f50772450 100644 --- a/x/identities/transactions/define/transaction_request_test.go +++ b/x/identities/transactions/define/transaction_request_test.go @@ -4,7 +4,6 @@ package define import ( - "encoding/json" "reflect" "testing" @@ -13,7 +12,6 @@ import ( "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -122,57 +120,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - immutableMetaPropertiesString := "defaultImmutableMeta1:S|defaultImmutableMeta1" - immutablePropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" - mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" - mutablePropertiesString := "defaultMutable1:S|defaultMutable1" - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) - jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}) - - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, args{jsonMessage}, transactionRequest{CommonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { immutableMetaPropertiesString := "defaultImmutableMeta1:S|defaultImmutableMeta1" immutablePropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" @@ -274,46 +221,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - immutableMetaPropertiesString := "defaultImmutableMeta1:S|defaultImmutableMeta1" - immutablePropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" - mutableMetaPropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" - mutablePropertiesString := "defaultMutable1:S|defaultMutable1" - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest: commonTransactionRequest, FromID: "fromID", ImmutableMetaProperties: immutableMetaPropertiesString, ImmutableProperties: immutablePropertiesString, MutableMetaProperties: mutableMetaPropertiesString, MutableProperties: mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { immutableMetaPropertiesString := "defaultImmutableMeta1:S|defaultImmutableMeta1" immutablePropertiesString := "defaultMutableMeta1:S|defaultMutableMeta1" diff --git a/x/identities/transactions/deputize/transaction_request_test.go b/x/identities/transactions/deputize/transaction_request_test.go index 2b588553f..1fdbff2bf 100644 --- a/x/identities/transactions/deputize/transaction_request_test.go +++ b/x/identities/transactions/deputize/transaction_request_test.go @@ -4,12 +4,10 @@ package deputize import ( - "encoding/json" "reflect" "testing" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -120,62 +118,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) - jsonMessage, _ := json.Marshal(newTransactionRequest(commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false)) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, args{jsonMessage}, transactionRequest{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" @@ -267,52 +209,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - maintainedProperty := "maintainedProperties:S|maintainedProperties" - commonTransactionRequest := helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanIssueIdentity bool `json:"canIssueIdentity"` - CanQuashIdentity bool `json:"canQuashIdentity"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, "fromID", "toID", "classificationID", maintainedProperty, false, false, false, false, false}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanIssueIdentity: tt.fields.CanIssueIdentity, - CanQuashIdentity: tt.fields.CanQuashIdentity, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" diff --git a/x/identities/transactions/issue/transaction_request_test.go b/x/identities/transactions/issue/transaction_request_test.go index 1809b1392..644a2db1e 100644 --- a/x/identities/transactions/issue/transaction_request_test.go +++ b/x/identities/transactions/issue/transaction_request_test.go @@ -4,7 +4,6 @@ package issue import ( - "encoding/json" "fmt" "reflect" "testing" @@ -159,59 +158,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) - require.Equal(t, nil, err) - jsonMessage1, err := json.Marshal(newTransactionRequest(commonTransactionRequest, "", "", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) - require.Equal(t, nil, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - - {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, - {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage1}, transactionRequest{commonTransactionRequest, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) type fields struct { @@ -297,44 +243,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - To string - FromID string - ClassificationID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, toAddress, "fromID", "classificationID", immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { _, _, _, immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, _, _, toAddress, _, commonTransactionRequest := createTestInputForRequest(t) commonTransactionRequest1 := helpers.PrototypeCommonTransactionRequest() diff --git a/x/identities/transactions/name/transaction_request_test.go b/x/identities/transactions/name/transaction_request_test.go index f96157a64..9eda9eff0 100644 --- a/x/identities/transactions/name/transaction_request_test.go +++ b/x/identities/transactions/name/transaction_request_test.go @@ -4,7 +4,6 @@ package name import ( - "encoding/json" "reflect" "testing" @@ -109,43 +108,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - _, _, _, _, fromAccAddress, commonTransactionRequest := CreateTestInputForRequest(t) - - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - NubID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, "nubID"}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), baseIDs.NewStringID("nubID").(*baseIDs.StringID)}))}, transactionRequest{commonTransactionRequest, "nubID"}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - Name: tt.fields.NubID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) @@ -206,34 +168,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) - - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - NubID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, "nubID"}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - Name: tt.fields.NubID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { _, _, _, _, _, commonTransactionRequest := CreateTestInputForRequest(t) diff --git a/x/identities/transactions/provision/transaction_request_test.go b/x/identities/transactions/provision/transaction_request_test.go index 27a8df25f..3432f68fa 100644 --- a/x/identities/transactions/provision/transaction_request_test.go +++ b/x/identities/transactions/provision/transaction_request_test.go @@ -4,7 +4,6 @@ package provision import ( - "encoding/json" "reflect" "testing" @@ -14,7 +13,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -116,44 +114,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - commonTransactionRequest, testToAddress, testFromID := createTestInput(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - To string - IdentityID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{sdkTypes.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), sdkTypes.AccAddress(testToAddress).String(), testFromID}))}, transactionRequest{commonTransactionRequest, testToAddress, testFromID.AsString()}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { @@ -221,36 +181,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - commonTransactionRequest, testToAddress, testFromID := createTestInput(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - To string - IdentityID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { diff --git a/x/identities/transactions/quash/transaction_request_test.go b/x/identities/transactions/quash/transaction_request_test.go index f4464ae18..32e8562c1 100644 --- a/x/identities/transactions/quash/transaction_request_test.go +++ b/x/identities/transactions/quash/transaction_request_test.go @@ -4,7 +4,6 @@ package quash import ( - "encoding/json" "reflect" "testing" @@ -14,7 +13,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -116,44 +114,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - commonTransactionRequest, testToAddress, testFromID := createTestInput(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - IdentityID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{types.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), testFromID, testFromID}))}, transactionRequest{commonTransactionRequest, testToAddress, testFromID.AsString()}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { @@ -219,36 +179,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - commonTransactionRequest, testToAddress, testFromID := createTestInput(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - IdentityID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{commonTransactionRequest, testToAddress, testFromID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { commonTransactionRequest, testToAddress, testFromID := createTestInput(t) type fields struct { diff --git a/x/identities/transactions/revoke/transaction_request_test.go b/x/identities/transactions/revoke/transaction_request_test.go index cba75346d..11b89486b 100644 --- a/x/identities/transactions/revoke/transaction_request_test.go +++ b/x/identities/transactions/revoke/transaction_request_test.go @@ -4,7 +4,6 @@ package revoke import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,7 +14,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -121,48 +119,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - commonTransactionRequest, fromAddress, testFromID, testToID, testClassificationID := createTestInput(t) - fromAccAddress, err := sdkTypes.AccAddressFromBech32(fromAddress) - require.Nil(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{sdkTypes.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{fromAccAddress.String(), testFromID, testToID, testClassificationID}))}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { @@ -232,38 +188,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve with nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testToID.AsString(), testClassificationID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { commonTransactionRequest, _, testFromID, testToID, testClassificationID := createTestInput(t) type fields struct { diff --git a/x/identities/transactions/unprovision/transaction_request_test.go b/x/identities/transactions/unprovision/transaction_request_test.go index 480f102de..dcd1b5671 100644 --- a/x/identities/transactions/unprovision/transaction_request_test.go +++ b/x/identities/transactions/unprovision/transaction_request_test.go @@ -4,7 +4,6 @@ package unprovision import ( - "encoding/json" "reflect" "testing" @@ -14,7 +13,6 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" "github.com/stretchr/testify/require" @@ -126,44 +124,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - testIdentityID, toAddress, toAccAddress, _, commonTransactionRequest := createInputForMessage(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - To string - IdentityID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, args{types.MustSortJSON(baseHelpers.CodecPrototype().MustMarshalJSON(&Message{types.AccAddress("cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c").String(), toAccAddress.String(), testIdentityID}))}, transactionRequest{commonTransactionRequest, toAddress, testIdentityID.AsString()}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { @@ -229,36 +189,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - To string - IdentityID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve wit nil", fields{}, args{codec.NewLegacyAmino()}}, - {"+ve", fields{commonTransactionRequest, toAddress, testIdentityID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - To: tt.fields.To, - IdentityID: tt.fields.IdentityID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { testIdentityID, toAddress, _, _, commonTransactionRequest := createInputForMessage(t) type fields struct { diff --git a/x/identities/transactions/update/transaction_request_test.go b/x/identities/transactions/update/transaction_request_test.go index f789b9076..4c08eaf8b 100644 --- a/x/identities/transactions/update/transaction_request_test.go +++ b/x/identities/transactions/update/transaction_request_test.go @@ -4,7 +4,6 @@ package update import ( - "encoding/json" "reflect" "testing" @@ -131,50 +130,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) - jsonMessage, _ := json.Marshal(transactionRequest{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}) - - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) @@ -251,40 +206,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) - - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - IdentityID string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, "fromID", "identityID", mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - IdentityID: tt.fields.IdentityID, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { _, _, _, mutableMetaPropertiesString, mutablePropertiesString, _, _, _, _, commonTransactionRequest := createTestInput(t) diff --git a/x/maintainers/mappable/mappable_test.go b/x/maintainers/mappable/mappable_test.go index bcbf8e701..8ad07ac46 100644 --- a/x/maintainers/mappable/mappable_test.go +++ b/x/maintainers/mappable/mappable_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents" "github.com/AssetMantle/schema/documents/base" @@ -14,9 +15,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) func createTestData() documents.Maintainer { @@ -64,28 +62,3 @@ func TestPrototype(t *testing.T) { }) } } - -func Test_mappable_RegisterCodec(t *testing.T) { - testMaintainer := createTestData() - type fields struct { - Maintainer documents.Maintainer - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{testMaintainer}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ma := &Mappable{ - Maintainer: tt.fields.Maintainer.Get().(*base.Document), - } - ma.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/maintainers/queries/maintainer/query_request_test.go b/x/maintainers/queries/maintainer/query_request_test.go index bc11eb621..ecd79e5b7 100644 --- a/x/maintainers/queries/maintainer/query_request_test.go +++ b/x/maintainers/queries/maintainer/query_request_test.go @@ -8,15 +8,13 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" ) var ( @@ -68,78 +66,6 @@ func Test_queryRequestFromInterface(t *testing.T) { } } -func Test_queryRequest_Decode(t *testing.T) { - encodedQuery, err := (&QueryRequest{testKey}).Encode() - require.NoError(t, err) - encodedQuery1, err := (&QueryRequest{testKey1}).Encode() - require.NoError(t, err) - type fields struct { - key *key.Key - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{testKey}, args{encodedQuery}, &QueryRequest{testKey}, false}, - {"+ve", fields{testKey1}, args{encodedQuery1}, &QueryRequest{testKey1}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.key, - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedQuery, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(&QueryRequest{testKey}) - require.NoError(t, err) - encodedQuery1, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(&QueryRequest{testKey1}) - require.NoError(t, err) - type fields struct { - key *key.Key - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{testKey}, encodedQuery, false}, - {"+ve with nil", fields{testKey1}, encodedQuery1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.key, - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.MaintainerID}) viper.Set(constants.MaintainerID.GetName(), testMaintainerID.AsString()) diff --git a/x/metas/mappable/mappable_test.go b/x/metas/mappable/mappable_test.go index 99be94491..a0fd502d9 100644 --- a/x/metas/mappable/mappable_test.go +++ b/x/metas/mappable/mappable_test.go @@ -7,11 +7,9 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" "github.com/AssetMantle/schema/data" "github.com/AssetMantle/schema/data/base" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) func TestNewMappable(t *testing.T) { @@ -50,27 +48,3 @@ func TestPrototype(t *testing.T) { }) } } - -func Test_mappable_RegisterCodec(t *testing.T) { - type fields struct { - Data data.Data - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{base.NewStringData("Data")}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ma := &Mappable{ - Data: tt.fields.Data.ToAnyData().(*base.AnyData), - } - ma.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/metas/queries/meta/query_request_test.go b/x/metas/queries/meta/query_request_test.go index 9995be8e0..e0cc7283a 100644 --- a/x/metas/queries/meta/query_request_test.go +++ b/x/metas/queries/meta/query_request_test.go @@ -8,16 +8,14 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" ) var ( @@ -65,79 +63,6 @@ func Test_queryRequestFromInterface(t *testing.T) { }) } } - -func Test_queryRequest_Decode(t *testing.T) { - encodedQuery, err := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testDataID)) - require.NoError(t, err) - encodedQuery1, err := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeDataID().(*baseIDs.DataID))) - require.NoError(t, err) - type fields struct { - Key *key.Key - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{testKey}, args{encodedQuery}, newQueryRequest(testDataID), false}, - {"+ve with nil", fields{key.NewKey(baseIDs.PrototypeDataID()).(*key.Key)}, args{encodedQuery1}, newQueryRequest(baseIDs.PrototypeDataID().(*baseIDs.DataID)), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.Key, - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedQuery, err := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testDataID)) - require.NoError(t, err) - encodedQuery1, err := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeDataID().(*baseIDs.DataID))) - require.NoError(t, err) - type fields struct { - Key *key.Key - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{testKey}, encodedQuery, false}, - {"+ve with nil", fields{key.NewKey(baseIDs.PrototypeDataID()).(*key.Key)}, encodedQuery1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.Key, - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.DataID}) viper.Set(constants.DataID.GetName(), testKey) diff --git a/x/metas/transactions/reveal/transaction_request_test.go b/x/metas/transactions/reveal/transaction_request_test.go index 19f56cd65..ea8610bcc 100644 --- a/x/metas/transactions/reveal/transaction_request_test.go +++ b/x/metas/transactions/reveal/transaction_request_test.go @@ -2,58 +2,3 @@ // SPDX-License-Identifier: Apache-2.0 package reveal - -import ( - "encoding/json" - "github.com/cosmos/cosmos-sdk/client" - "testing" - - "github.com/cosmos/cosmos-sdk/codec" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" -) - -func Test_Reveal_Request(t *testing.T) { - cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.Data}) - - fromAddress := "cosmos1pkkayn066msg6kn33wnl5srhdt3tnu2vzasz9c" - data := "S|newData" - commonTransactionRequest := helpers.PrototypeCommonTransactionRequest() - testTransactionRequest := newTransactionRequest(commonTransactionRequest, data) - - require.Equal(t, transactionRequest{CommonTransactionRequest: commonTransactionRequest, Data: data}, testTransactionRequest) - require.Equal(t, nil, testTransactionRequest.Validate()) - - requestFromCLI, err := transactionRequest{}.FromCLI(cliCommand, client.Context{}.WithCodec(baseHelpers.CodecPrototype())) - require.Equal(t, nil, err) - require.Equal(t, transactionRequest{CommonTransactionRequest: helpers.PrototypeCommonTransactionRequest(), Data: ""}, requestFromCLI) - - jsonMessage, _ := json.Marshal(testTransactionRequest) - transactionRequestUnmarshalled, err := transactionRequest{}.FromJSON(jsonMessage) - require.Equal(t, nil, err) - require.Equal(t, testTransactionRequest, transactionRequestUnmarshalled) - - randomUnmarshall, err := transactionRequest{}.FromJSON([]byte{}) - require.Equal(t, nil, randomUnmarshall) - require.NotNil(t, err) - - require.Equal(t, commonTransactionRequest, testTransactionRequest.GetCommonTransactionRequest()) - - require.Nil(t, err) - - msg2, err := newTransactionRequest(helpers.PrototypeCommonTransactionRequest(), data).MakeMsg() - require.NotNil(t, err) - require.Nil(t, msg2) - - msg2, err = newTransactionRequest(helpers.PrototypeCommonTransactionRequest().SetFrom(fromAddress), "randomString").MakeMsg() - require.NotNil(t, err) - require.Nil(t, msg2) - - require.Equal(t, transactionRequest{}, requestPrototype()) - require.NotPanics(t, func() { - requestPrototype().RegisterLegacyAminoCodec(codec.NewLegacyAmino()) - }) -} diff --git a/x/orders/mappable/mappable_test.go b/x/orders/mappable/mappable_test.go index 4a3d9b87d..dcdd63f3f 100644 --- a/x/orders/mappable/mappable_test.go +++ b/x/orders/mappable/mappable_test.go @@ -7,6 +7,7 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/documents" baseDocuments "github.com/AssetMantle/schema/documents/base" @@ -14,9 +15,6 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" - "github.com/cosmos/cosmos-sdk/codec" - - "github.com/AssetMantle/modules/helpers" ) var ( @@ -62,28 +60,3 @@ func TestPrototype(t *testing.T) { }) } } - -func Test_mappable_RegisterCodec(t *testing.T) { - type fields struct { - Order documents.Order - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{testOrder}, args{codec.NewLegacyAmino()}}, - {"+ve nil", fields{nil}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ma := &Mappable{ - Order: tt.fields.Order.Get().(*baseDocuments.Document), - } - ma.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/orders/queries/order/query_request_test.go b/x/orders/queries/order/query_request_test.go index bc599faee..2848ce6f4 100644 --- a/x/orders/queries/order/query_request_test.go +++ b/x/orders/queries/order/query_request_test.go @@ -8,6 +8,9 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + baseHelpers "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -16,11 +19,6 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - baseHelpers "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" ) var ( @@ -75,78 +73,6 @@ func Test_queryRequestFromInterface(t *testing.T) { } } -func Test_queryRequest_Decode(t *testing.T) { - encodedReq, err := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testOrderID)) - require.NoError(t, err) - encodedReq1, err1 := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testOrderID1)) - require.NoError(t, err1) - type fields struct { - Key *key.Key - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{testKey}, args{encodedReq}, newQueryRequest(testOrderID), false}, - {"+ve", fields{testKey1}, args{encodedReq1}, newQueryRequest(testOrderID1), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.Key, - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedReq, err := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testOrderID)) - require.NoError(t, err) - encodedReq1, err1 := baseHelpers.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testOrderID1)) - require.NoError(t, err1) - type fields struct { - Key *key.Key - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{testKey}, encodedReq, false}, - {"+ve", fields{testKey1}, encodedReq1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: tt.fields.Key, - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := baseHelpers.NewCLICommand("", "", "", []helpers.CLIFlag{constants.OrderID}) diff --git a/x/orders/transactions/cancel/transaction_request_test.go b/x/orders/transactions/cancel/transaction_request_test.go index c765ba66f..d499139f9 100644 --- a/x/orders/transactions/cancel/transaction_request_test.go +++ b/x/orders/transactions/cancel/transaction_request_test.go @@ -4,7 +4,6 @@ package cancel import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -120,49 +116,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString())) - require.NoError(t, err) - jsonMessage1, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString())) - require.NoError(t, err) - - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - OrderID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{jsonMessage}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, false}, - {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, args{jsonMessage1}, transactionRequest{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -224,35 +177,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - OrderID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, - {"+ve with nil", fields{commonTransactionRequest, testFromID.AsString(), testOrderID1.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/define/transaction_request_test.go b/x/orders/transactions/define/transaction_request_test.go index 403679a67..fbec54862 100644 --- a/x/orders/transactions/define/transaction_request_test.go +++ b/x/orders/transactions/define/transaction_request_test.go @@ -4,7 +4,6 @@ package define import ( - "encoding/json" "fmt" "reflect" "testing" @@ -13,15 +12,12 @@ import ( baseLists "github.com/AssetMantle/schema/lists/base" "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -139,51 +135,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, transactionRequest{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -256,40 +207,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/deputize/transaction_request_test.go b/x/orders/transactions/deputize/transaction_request_test.go index a4a26c151..98943ed06 100644 --- a/x/orders/transactions/deputize/transaction_request_test.go +++ b/x/orders/transactions/deputize/transaction_request_test.go @@ -4,7 +4,6 @@ package deputize import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -148,59 +144,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true)) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -289,48 +232,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - MaintainedProperties string - CanMakeOrder bool `json:"canMakeOrder"` - CanCancelOrder bool `json:"canCancelOrder"` - CanAddMaintainer bool `json:"canAddMaintainer"` - CanRemoveMaintainer bool `json:"canRemoveMaintainer"` - CanMutateMaintainer bool `json:"canMutateMaintainer"` - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString(), maintainedPropertyString, true, true, true, true, true}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - MaintainedProperties: tt.fields.MaintainedProperties, - CanMakeOrder: tt.fields.CanMakeOrder, - CanCancelOrder: tt.fields.CanCancelOrder, - CanAddMaintainer: tt.fields.CanAddMaintainer, - CanRemoveMaintainer: tt.fields.CanRemoveMaintainer, - CanMutateMaintainer: tt.fields.CanMutateMaintainer, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/get/transaction_request_test.go b/x/orders/transactions/get/transaction_request_test.go index 656aede4f..ee8b124cb 100644 --- a/x/orders/transactions/get/transaction_request_test.go +++ b/x/orders/transactions/get/transaction_request_test.go @@ -4,7 +4,6 @@ package get import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -121,45 +117,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString())) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - OrderID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -222,34 +179,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - OrderID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/immediate/transaction_request_test.go b/x/orders/transactions/immediate/transaction_request_test.go index 0c585f5c0..6020ee70f 100644 --- a/x/orders/transactions/immediate/transaction_request_test.go +++ b/x/orders/transactions/immediate/transaction_request_test.go @@ -4,7 +4,6 @@ package immediate import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -171,65 +167,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -330,54 +267,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/make/transaction_request_test.go b/x/orders/transactions/make/transaction_request_test.go index 99c72d675..29420b90f 100644 --- a/x/orders/transactions/make/transaction_request_test.go +++ b/x/orders/transactions/make/transaction_request_test.go @@ -4,7 +4,6 @@ package make import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -169,65 +165,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString)) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -328,54 +265,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ClassificationID string - TakerID string - MakerAssetID string - TakerAssetID string - ExpiresIn int64 - MakerSplit string - TakerSplit string - ImmutableMetaProperties string - ImmutableProperties string - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testClassificationID.AsString(), testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), expiresIn, makerSplit.String(), takerSplit.String(), immutableMetaPropertiesString, immutablePropertiesString, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ClassificationID: tt.fields.ClassificationID, - TakerID: tt.fields.TakerID, - MakerAssetID: tt.fields.MakerAssetID, - TakerAssetID: tt.fields.TakerAssetID, - ExpiresIn: tt.fields.ExpiresIn, - MakerSplit: tt.fields.MakerSplit, - TakerSplit: tt.fields.TakerSplit, - ImmutableMetaProperties: tt.fields.ImmutableMetaProperties, - ImmutableProperties: tt.fields.ImmutableProperties, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/modify/transaction_request_test.go b/x/orders/transactions/modify/transaction_request_test.go index 4ea99a267..083ebc8a5 100644 --- a/x/orders/transactions/modify/transaction_request_test.go +++ b/x/orders/transactions/modify/transaction_request_test.go @@ -4,7 +4,6 @@ package modify import ( - "encoding/json" "fmt" "reflect" "testing" @@ -14,15 +13,12 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -148,55 +144,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString)) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -277,44 +224,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - OrderID string - TakerSplit string - MakerSplit string - ExpiresIn int64 - MutableMetaProperties string - MutableProperties string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testOrderID.AsString(), takerSplit.String(), makerSplit.String(), expiresIn, mutableMetaPropertiesString, mutablePropertiesString}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - OrderID: tt.fields.OrderID, - TakerSplit: tt.fields.TakerSplit, - MakerSplit: tt.fields.MakerSplit, - ExpiresIn: tt.fields.ExpiresIn, - MutableMetaProperties: tt.fields.MutableMetaProperties, - MutableProperties: tt.fields.MutableProperties, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/put/transaction_request_test.go b/x/orders/transactions/put/transaction_request_test.go index 5cadcf1a1..5c0254309 100644 --- a/x/orders/transactions/put/transaction_request_test.go +++ b/x/orders/transactions/put/transaction_request_test.go @@ -4,7 +4,6 @@ package put import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/AssetMantle/schema/types/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -146,53 +142,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight)) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - tt.fields.commonTransactionRequest, - tt.fields.FromID, - tt.fields.MakerAssetID, - tt.fields.TakerAssetID, - tt.fields.MakerSplit, - tt.fields.TakerSplit, - tt.fields.ExpiryHeight, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -269,42 +218,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - MakerAssetID string - TakerAssetID string - MakerSplit string - TakerSplit string - ExpiryHeight int64 - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), makerAssetID.AsString(), takerAssetID.AsString(), makerSplit.String(), takerSplit.String(), expiryHeight}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - tt.fields.commonTransactionRequest, - tt.fields.FromID, - tt.fields.MakerAssetID, - tt.fields.TakerAssetID, - tt.fields.MakerSplit, - tt.fields.TakerSplit, - tt.fields.ExpiryHeight, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/revoke/transaction_request_test.go b/x/orders/transactions/revoke/transaction_request_test.go index 503a2d991..db5d19af1 100644 --- a/x/orders/transactions/revoke/transaction_request_test.go +++ b/x/orders/transactions/revoke/transaction_request_test.go @@ -4,7 +4,6 @@ package revoke import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -121,47 +117,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString())) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -226,36 +181,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - ToID string - ClassificationID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), testFromID.AsString(), testClassificationID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - ToID: tt.fields.ToID, - ClassificationID: tt.fields.ClassificationID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/orders/transactions/take/transaction_request_test.go b/x/orders/transactions/take/transaction_request_test.go index 3781534bf..08ff28164 100644 --- a/x/orders/transactions/take/transaction_request_test.go +++ b/x/orders/transactions/take/transaction_request_test.go @@ -4,7 +4,6 @@ package take import ( - "encoding/json" "fmt" "reflect" "testing" @@ -15,15 +14,12 @@ import ( baseProperties "github.com/AssetMantle/schema/properties/base" baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/types" - "github.com/spf13/viper" - "github.com/stretchr/testify/require" - "github.com/AssetMantle/modules/helpers" baseHelpers "github.com/AssetMantle/modules/helpers/base" "github.com/AssetMantle/modules/helpers/constants" + "github.com/spf13/viper" ) var ( @@ -123,47 +119,6 @@ func Test_transactionRequest_FromCLI(t *testing.T) { } } -func Test_transactionRequest_FromJSON(t *testing.T) { - jsonMessage, err := json.Marshal(newTransactionRequest(commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString())) - require.NoError(t, err) - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - TakerSplit string - OrderID string - } - type args struct { - rawMessage json.RawMessage - } - tests := []struct { - name string - fields fields - args args - want helpers.TransactionRequest - wantErr bool - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{jsonMessage}, newTransactionRequest(commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - transactionRequest := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, - } - got, err := transactionRequest.FromJSON(tt.args.rawMessage) - if (err != nil) != tt.wantErr { - t.Errorf("FromJSON() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("FromJSON() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_transactionRequest_GetBaseReq(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest @@ -228,36 +183,6 @@ func Test_transactionRequest_MakeMsg(t *testing.T) { } } -func Test_transactionRequest_RegisterCodec(t *testing.T) { - type fields struct { - commonTransactionRequest helpers.CommonTransactionRequest - FromID string - TakerSplit string - OrderID string - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{commonTransactionRequest, testFromID.AsString(), takerSplit.String(), testOrderID.AsString()}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - tr := transactionRequest{ - CommonTransactionRequest: tt.fields.commonTransactionRequest, - FromID: tt.fields.FromID, - TakerSplit: tt.fields.TakerSplit, - OrderID: tt.fields.OrderID, - } - tr.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} - func Test_transactionRequest_Validate(t *testing.T) { type fields struct { commonTransactionRequest helpers.CommonTransactionRequest diff --git a/x/splits/mappable/mappable_test.go b/x/splits/mappable/mappable_test.go index 8de671acd..b7b4609a3 100644 --- a/x/splits/mappable/mappable_test.go +++ b/x/splits/mappable/mappable_test.go @@ -9,7 +9,6 @@ import ( "github.com/AssetMantle/schema/types" baseTypes "github.com/AssetMantle/schema/types/base" - "github.com/cosmos/cosmos-sdk/codec" sdkTypes "github.com/cosmos/cosmos-sdk/types" "github.com/AssetMantle/modules/helpers" @@ -55,27 +54,3 @@ func TestPrototype(t *testing.T) { }) } } - -func Test_mappable_RegisterCodec(t *testing.T) { - type fields struct { - Split *baseTypes.Split - } - type args struct { - legacyAmino *codec.LegacyAmino - } - tests := []struct { - name string - fields fields - args args - }{ - {"+ve", fields{split}, args{codec.NewLegacyAmino()}}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - ma := &Mappable{ - Split: tt.fields.Split, - } - ma.RegisterLegacyAminoCodec(tt.args.legacyAmino) - }) - } -} diff --git a/x/splits/queries/balances/query_request_test.go b/x/splits/queries/balances/query_request_test.go index 7bca4476a..578a261bd 100644 --- a/x/splits/queries/balances/query_request_test.go +++ b/x/splits/queries/balances/query_request_test.go @@ -7,15 +7,13 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/helpers/constants" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" ) var ( @@ -62,78 +60,6 @@ func Test_queryRequestFromInterface(t *testing.T) { } } -func Test_queryRequest_Decode(t *testing.T) { - encodedReq, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testIdentityID)) - require.NoError(t, err) - encodedReq1, err1 := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeIdentityID())) - require.NoError(t, err1) - type fields struct { - identityID ids.IdentityID - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{testIdentityID}, args{encodedReq}, newQueryRequest(testIdentityID), false}, - {"+ve", fields{baseIDs.PrototypeIdentityID()}, args{encodedReq1}, newQueryRequest(baseIDs.PrototypeIdentityID()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - IdentityID: tt.fields.identityID.(*baseIDs.IdentityID), - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedReq, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testIdentityID)) - require.NoError(t, err) - encodedReq1, err1 := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeIdentityID())) - require.NoError(t, err1) - type fields struct { - identityID ids.IdentityID - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{testIdentityID}, encodedReq, false}, - {"+ve", fields{baseIDs.PrototypeIdentityID().(*baseIDs.IdentityID)}, encodedReq1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - IdentityID: tt.fields.identityID.(*baseIDs.IdentityID), - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID}) diff --git a/x/splits/queries/split/query_request_test.go b/x/splits/queries/split/query_request_test.go index 44ab82f77..4824d3c64 100644 --- a/x/splits/queries/split/query_request_test.go +++ b/x/splits/queries/split/query_request_test.go @@ -9,6 +9,9 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/helpers/constants" baseData "github.com/AssetMantle/schema/data/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" @@ -17,11 +20,6 @@ import ( baseQualified "github.com/AssetMantle/schema/qualified/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" ) var ( @@ -73,78 +71,6 @@ func Test_queryRequestFromInterface(t *testing.T) { } } -func Test_queryRequest_Decode(t *testing.T) { - encodedReq, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(splitID)) - require.NoError(t, err) - encodedReq1, err1 := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeSplitID())) - require.NoError(t, err1) - type fields struct { - SplitID *baseIDs.SplitID - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{splitID}, args{encodedReq}, newQueryRequest(splitID), false}, - {"+ve", fields{baseIDs.PrototypeSplitID().(*baseIDs.SplitID)}, args{encodedReq1}, newQueryRequest(baseIDs.PrototypeSplitID()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: key.NewKey(tt.fields.SplitID).(*key.Key), - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedReq, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(splitID)) - require.NoError(t, err) - encodedReq1, err1 := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeSplitID())) - require.NoError(t, err1) - type fields struct { - SplitID *baseIDs.SplitID - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{splitID}, encodedReq, false}, - {"+ve", fields{baseIDs.PrototypeSplitID().(*baseIDs.SplitID)}, encodedReq1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - Key: key.NewKey(tt.fields.SplitID).(*key.Key), - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.SplitID}) diff --git a/x/splits/queries/supply/query_request_test.go b/x/splits/queries/supply/query_request_test.go index 2da88492c..bc9430e93 100644 --- a/x/splits/queries/supply/query_request_test.go +++ b/x/splits/queries/supply/query_request_test.go @@ -7,16 +7,14 @@ import ( "reflect" "testing" + "github.com/AssetMantle/modules/helpers" + "github.com/AssetMantle/modules/helpers/base" + "github.com/AssetMantle/modules/helpers/constants" baseDocuments "github.com/AssetMantle/schema/documents/base" "github.com/AssetMantle/schema/ids" baseIDs "github.com/AssetMantle/schema/ids/base" "github.com/cosmos/cosmos-sdk/client" "github.com/spf13/viper" - "github.com/stretchr/testify/require" - - "github.com/AssetMantle/modules/helpers" - "github.com/AssetMantle/modules/helpers/base" - "github.com/AssetMantle/modules/helpers/constants" ) var ( @@ -63,78 +61,6 @@ func Test_queryRequestFromInterface(t *testing.T) { } } -func Test_queryRequest_Decode(t *testing.T) { - encodedReq, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testAssetID)) - require.NoError(t, err) - encodedReq1, err1 := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeAssetID())) - require.NoError(t, err1) - type fields struct { - AssetID *baseIDs.AssetID - } - type args struct { - bytes []byte - } - tests := []struct { - name string - fields fields - args args - want helpers.QueryRequest - wantErr bool - }{ - {"+ve", fields{testAssetID}, args{encodedReq}, newQueryRequest(testAssetID), false}, - {"+ve", fields{baseIDs.PrototypeAssetID().(*baseIDs.AssetID)}, args{encodedReq1}, newQueryRequest(baseIDs.PrototypeAssetID()), false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - AssetID: tt.fields.AssetID, - } - got, err := queryRequest.Decode(tt.args.bytes) - if (err != nil) != tt.wantErr { - t.Errorf("Decode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Decode() got = %v, want %v", got, tt.want) - } - }) - } -} - -func Test_queryRequest_Encode(t *testing.T) { - encodedReq, err := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(testAssetID)) - require.NoError(t, err) - encodedReq1, err1 := base.CodecPrototype().GetLegacyAmino().MarshalJSON(newQueryRequest(baseIDs.PrototypeAssetID())) - require.NoError(t, err1) - type fields struct { - AssetID *baseIDs.AssetID - } - tests := []struct { - name string - fields fields - want []byte - wantErr bool - }{ - {"+ve", fields{testAssetID}, encodedReq, false}, - {"+ve", fields{baseIDs.PrototypeAssetID().(*baseIDs.AssetID)}, encodedReq1, false}, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - queryRequest := &QueryRequest{ - AssetID: tt.fields.AssetID, - } - got, err := queryRequest.Encode() - if (err != nil) != tt.wantErr { - t.Errorf("Encode() error = %v, wantErr %v", err, tt.wantErr) - return - } - if !reflect.DeepEqual(got, tt.want) { - t.Errorf("Encode() got = %v, want %v", got, tt.want) - } - }) - } -} - func Test_queryRequest_FromCLI(t *testing.T) { cliCommand := base.NewCLICommand("", "", "", []helpers.CLIFlag{constants.AssetID})