From ea6f6e9ba8d831073602b31bb5ff6eca9ded6252 Mon Sep 17 00:00:00 2001 From: Deepanshu Tripathi Date: Mon, 2 Sep 2024 13:01:37 +0530 Subject: [PATCH] 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{} }