diff --git a/DXNS_MODULES_README.md b/DXNS_MODULES_README.md index 835c84bd..07c96fec 100644 --- a/DXNS_MODULES_README.md +++ b/DXNS_MODULES_README.md @@ -1,11 +1,11 @@ -# Vulcanize dxns gql +# Vulcanize chiba-clonk gql > Browser : http://localhost:9473 for gql ## Start server ```shell -./build/chibaclonkd start --gql-playground --gql-server +./build/chibaclonkd start --gql-playground --gql-server ``` Basic node status: @@ -100,7 +100,7 @@ Query records. ```graphql { - queryRecords(attributes: [{ key: "type", value: { string: "wrn:bot" } }]) { + queryRecords(attributes: [{ key: "type", value: { string: "crn:bot" } }]) { id names bondId @@ -316,7 +316,7 @@ LookUp Names ```graphql { - lookupNames(names: ["wrn://hello/test"]){ + lookupNames(names: ["crn://hello/test"]){ latest{ id height diff --git a/app/app.go b/app/app.go index 4d4636b9..c174003f 100644 --- a/app/app.go +++ b/app/app.go @@ -165,7 +165,7 @@ var ( // Ethermint modules evm.AppModuleBasic{}, feemarket.AppModuleBasic{}, - // Vulcanize DXNS modules + // Vulcanize chiba-clonk modules auction.AppModuleBasic{}, bond.AppModuleBasic{}, nameservice.AppModuleBasic{}, @@ -244,7 +244,7 @@ type EthermintApp struct { EvmKeeper *evmkeeper.Keeper FeeMarketKeeper feemarketkeeper.Keeper - // DXNS keepers + // chiba-clonk keepers AuctionKeeper auctionkeeper.Keeper BondKeeper bondkeeper.Keeper NameServiceKeeper nameservicekeeper.Keeper @@ -300,7 +300,7 @@ func NewEthermintApp( ibchost.StoreKey, ibctransfertypes.StoreKey, // ethermint keys evmtypes.StoreKey, feemarkettypes.StoreKey, - // dxns keys + // chiba-clonk keys auctiontypes.StoreKey, bondtypes.StoreKey, nameservicetypes.StoreKey, @@ -378,7 +378,7 @@ func NewEthermintApp( appCodec, keys[feemarkettypes.StoreKey], app.GetSubspace(feemarkettypes.ModuleName), ) - // Create Vulcanize dxns keepers + // Create Vulcanize chiba-clonk keepers app.AuctionKeeper = auctionkeeper.NewKeeper( app.AccountKeeper, app.BankKeeper, keys[auctiontypes.StoreKey], appCodec, app.GetSubspace(auctiontypes.ModuleName), @@ -486,7 +486,7 @@ func NewEthermintApp( // Ethermint app modules evm.NewAppModule(app.EvmKeeper, app.AccountKeeper), feemarket.NewAppModule(app.FeeMarketKeeper), - // DXNs modules + // chiba-clonk modules auction.NewAppModule(appCodec, app.AuctionKeeper), bond.NewAppModule(appCodec, app.BondKeeper), nameservice.NewAppModule(app.NameServiceKeeper), @@ -520,7 +520,7 @@ func NewEthermintApp( feegrant.ModuleName, paramstypes.ModuleName, vestingtypes.ModuleName, - // DXNS modules + // chiba-clonk modules auctiontypes.ModuleName, bondtypes.ModuleName, nameservicetypes.ModuleName, @@ -549,7 +549,7 @@ func NewEthermintApp( paramstypes.ModuleName, upgradetypes.ModuleName, vestingtypes.ModuleName, - // DXNS modules + // chiba-clonk modules auctiontypes.ModuleName, bondtypes.ModuleName, nameservicetypes.ModuleName, @@ -582,7 +582,7 @@ func NewEthermintApp( // Ethermint modules evmtypes.ModuleName, feemarkettypes.ModuleName, - // DXNS modules + // chiba-clonk modules auctiontypes.ModuleName, bondtypes.ModuleName, nameservicetypes.ModuleName, @@ -843,7 +843,7 @@ func initParamsKeeper( // ethermint subspaces paramsKeeper.Subspace(evmtypes.ModuleName) paramsKeeper.Subspace(feemarkettypes.ModuleName) - // dxns subspaces + // chiba-clonk subspaces paramsKeeper.Subspace(auctiontypes.ModuleName) paramsKeeper.Subspace(bondtypes.ModuleName) paramsKeeper.Subspace(nameservicetypes.ModuleName) diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index 1b082abc..94e938eb 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -179,17 +179,20 @@ - [QueryListNameRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest) - [QueryListNameRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse) - [QueryListRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest) + - [QueryListRecordsRequest.KeyValueInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.KeyValueInput) + - [QueryListRecordsRequest.ReferenceInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ReferenceInput) + - [QueryListRecordsRequest.ValueInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ValueInput) - [QueryListRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListRecordsResponse) - - [QueryLookupWrn](#vulcanize.nameservice.v1beta1.QueryLookupWrn) - - [QueryLookupWrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupWrnResponse) + - [QueryLookupCrn](#vulcanize.nameservice.v1beta1.QueryLookupCrn) + - [QueryLookupCrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupCrnResponse) - [QueryParamsRequest](#vulcanize.nameservice.v1beta1.QueryParamsRequest) - [QueryParamsResponse](#vulcanize.nameservice.v1beta1.QueryParamsResponse) - [QueryRecordByBondIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest) - [QueryRecordByBondIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse) - [QueryRecordByIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByIdRequest) - [QueryRecordByIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByIdResponse) - - [QueryResolveWrn](#vulcanize.nameservice.v1beta1.QueryResolveWrn) - - [QueryResolveWrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveWrnResponse) + - [QueryResolveCrn](#vulcanize.nameservice.v1beta1.QueryResolveCrn) + - [QueryResolveCrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveCrnResponse) - [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest) - [QueryWhoisResponse](#vulcanize.nameservice.v1beta1.QueryWhoisResponse) @@ -2362,11 +2365,12 @@ Params defines the nameservice module records | ----- | ---- | ----- | ----------- | | `id` | [string](#string) | | | | `bond_id` | [string](#string) | | | -| `create_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | -| `expiry_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `create_time` | [string](#string) | | | +| `expiry_time` | [string](#string) | | | | `deleted` | [bool](#bool) | | | | `owners` | [string](#string) | repeated | | -| `attributes` | [bytes](#bytes) | | | +| `attributes` | [string](#string) | | | +| `names` | [string](#string) | repeated | | @@ -2597,6 +2601,8 @@ QueryListRecordsRequest is request type for nameservice records list | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | +| `attributes` | [QueryListRecordsRequest.KeyValueInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.KeyValueInput) | repeated | | +| `all` | [bool](#bool) | | | | `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | @@ -2604,6 +2610,58 @@ QueryListRecordsRequest is request type for nameservice records list + + +### QueryListRecordsRequest.KeyValueInput + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `key` | [string](#string) | | | +| `value` | [QueryListRecordsRequest.ValueInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ValueInput) | | | + + + + + + + + +### QueryListRecordsRequest.ReferenceInput + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | + + + + + + + + +### QueryListRecordsRequest.ValueInput + + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `type` | [string](#string) | | | +| `string` | [string](#string) | | | +| `int` | [int64](#int64) | | | +| `float` | [double](#double) | | | +| `boolean` | [bool](#bool) | | | +| `reference` | [QueryListRecordsRequest.ReferenceInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ReferenceInput) | | | +| `values` | [QueryListRecordsRequest.ValueInput](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ValueInput) | repeated | | + + + + + + ### QueryListRecordsResponse @@ -2620,25 +2678,25 @@ QueryListRecordsResponse is response type for nameservice records list - + -### QueryLookupWrn -QueryLookupWrn is request type for LookupWrn +### QueryLookupCrn +QueryLookupCrn is request type for LookupCrn | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `wrn` | [string](#string) | | | +| `crn` | [string](#string) | | | - + -### QueryLookupWrnResponse -QueryLookupWrnResponse is response type for QueryLookupWrn +### QueryLookupCrnResponse +QueryLookupCrnResponse is response type for QueryLookupCrn | Field | Type | Label | Description | @@ -2737,25 +2795,25 @@ QueryRecordByIdResponse is response type for nameservice records by id - + -### QueryResolveWrn -QueryResolveWrn is request type for ResolveWrn +### QueryResolveCrn +QueryResolveCrn is request type for ResolveCrn | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `wrn` | [string](#string) | | | +| `crn` | [string](#string) | | | - + -### QueryResolveWrnResponse -QueryResolveWrnResponse is response type for QueryResolveWrn +### QueryResolveCrnResponse +QueryResolveCrnResponse is response type for QueryResolveCrn | Field | Type | Label | Description | @@ -2817,8 +2875,8 @@ Query defines the gRPC querier service for nameservice module | `GetNameServiceModuleBalance` | [GetNameServiceModuleBalanceRequest](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest) | [GetNameServiceModuleBalanceResponse](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse) | Get nameservice module balance | GET|/vulcanize/nameservice/v1beta1/balance| | `ListNameRecords` | [QueryListNameRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest) | [QueryListNameRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse) | List name records | GET|/vulcanize/nameservice/v1beta1/names| | `Whois` | [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest) | [QueryWhoisResponse](#vulcanize.nameservice.v1beta1.QueryWhoisResponse) | Whois method retrieve the name authority info | GET|/vulcanize/nameservice/v1beta1/whois/{name}| -| `LookupWrn` | [QueryLookupWrn](#vulcanize.nameservice.v1beta1.QueryLookupWrn) | [QueryLookupWrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupWrnResponse) | LookupWrn | GET|/vulcanize/nameservice/v1beta1/lookup| -| `ResolveWrn` | [QueryResolveWrn](#vulcanize.nameservice.v1beta1.QueryResolveWrn) | [QueryResolveWrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveWrnResponse) | ResolveWrn | GET|/vulcanize/nameservice/v1beta1/resolve| +| `LookupCrn` | [QueryLookupCrn](#vulcanize.nameservice.v1beta1.QueryLookupCrn) | [QueryLookupCrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupCrnResponse) | LookupCrn | GET|/vulcanize/nameservice/v1beta1/lookup| +| `ResolveCrn` | [QueryResolveCrn](#vulcanize.nameservice.v1beta1.QueryResolveCrn) | [QueryResolveCrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveCrnResponse) | ResolveCrn | GET|/vulcanize/nameservice/v1beta1/resolve| | `GetRecordExpiryQueue` | [QueryGetRecordExpiryQueue](#vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueue) | [QueryGetRecordExpiryQueueResponse](#vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueueResponse) | GetRecordExpiryQueue | GET|/vulcanize/nameservice/v1beta1/record-expiry| | `GetAuthorityExpiryQueue` | [QueryGetAuthorityExpiryQueue](#vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueue) | [QueryGetAuthorityExpiryQueueResponse](#vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueueResponse) | GetAuthorityExpiryQueue | GET|/vulcanize/nameservice/v1beta1/authority-expiry| @@ -2868,7 +2926,7 @@ MsgDeleteNameAuthority is SDK message for DeleteNameAuthority | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `wrn` | [string](#string) | | | +| `crn` | [string](#string) | | | | `signer` | [string](#string) | | | @@ -3053,7 +3111,7 @@ MsgSetName | Field | Type | Label | Description | | ----- | ---- | ----- | ----------- | -| `wrn` | [string](#string) | | | +| `crn` | [string](#string) | | | | `cid` | [string](#string) | | | | `signer` | [string](#string) | | | @@ -3095,6 +3153,11 @@ MsgSetRecord MsgSetRecordResponse +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | + + @@ -3134,7 +3197,7 @@ Msg | `DissociateBond` | [MsgDissociateBond](#vulcanize.nameservice.v1beta1.MsgDissociateBond) | [MsgDissociateBondResponse](#vulcanize.nameservice.v1beta1.MsgDissociateBondResponse) | DissociateBond | | | `DissociateRecords` | [MsgDissociateRecords](#vulcanize.nameservice.v1beta1.MsgDissociateRecords) | [MsgDissociateRecordsResponse](#vulcanize.nameservice.v1beta1.MsgDissociateRecordsResponse) | DissociateRecords | | | `ReAssociateRecords` | [MsgReAssociateRecords](#vulcanize.nameservice.v1beta1.MsgReAssociateRecords) | [MsgReAssociateRecordsResponse](#vulcanize.nameservice.v1beta1.MsgReAssociateRecordsResponse) | ReAssociateRecords | | -| `SetName` | [MsgSetName](#vulcanize.nameservice.v1beta1.MsgSetName) | [MsgSetNameResponse](#vulcanize.nameservice.v1beta1.MsgSetNameResponse) | SetName will store the name with given wrn and name | | +| `SetName` | [MsgSetName](#vulcanize.nameservice.v1beta1.MsgSetName) | [MsgSetNameResponse](#vulcanize.nameservice.v1beta1.MsgSetNameResponse) | SetName will store the name with given crn and name | | | `ReserveName` | [MsgReserveAuthority](#vulcanize.nameservice.v1beta1.MsgReserveAuthority) | [MsgReserveAuthorityResponse](#vulcanize.nameservice.v1beta1.MsgReserveAuthorityResponse) | Reserve name | | | `DeleteName` | [MsgDeleteNameAuthority](#vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority) | [MsgDeleteNameAuthorityResponse](#vulcanize.nameservice.v1beta1.MsgDeleteNameAuthorityResponse) | Delete Name method will remove authority name | | | `SetAuthorityBond` | [MsgSetAuthorityBond](#vulcanize.nameservice.v1beta1.MsgSetAuthorityBond) | [MsgSetAuthorityBondResponse](#vulcanize.nameservice.v1beta1.MsgSetAuthorityBondResponse) | SetAuthorityBond | | diff --git a/go.mod b/go.mod index c08b163f..f7634d58 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module github.com/tharsis/ethermint go 1.17 require ( + github.com/99designs/gqlgen v0.17.2 github.com/btcsuite/btcd v0.22.0-beta github.com/btcsuite/btcutil v1.0.3-0.20201208143702-a53e38424cce github.com/cosmos/cosmos-sdk v0.45.1 @@ -35,6 +36,7 @@ require ( github.com/tendermint/tendermint v0.34.14 github.com/tendermint/tm-db v0.6.7 github.com/tyler-smith/go-bip39 v1.1.0 + github.com/vektah/gqlparser/v2 v2.4.1 google.golang.org/genproto v0.0.0-20220401170504-314d38edb7de google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.28.0 @@ -44,7 +46,6 @@ require ( require ( filippo.io/edwards25519 v1.0.0-beta.2 // indirect - github.com/99designs/gqlgen v0.17.2 // indirect github.com/99designs/keyring v1.1.6 // indirect github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/DataDog/zstd v1.4.5 // indirect @@ -152,7 +153,6 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/tklauser/go-sysconf v0.3.5 // indirect github.com/tklauser/numcpus v0.2.2 // indirect - github.com/vektah/gqlparser/v2 v2.4.1 // indirect github.com/whyrusleeping/cbor-gen v0.0.0-20200123233031-1cdf64d27158 // indirect github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect diff --git a/go.sum b/go.sum index 9e822db8..f2dc9712 100644 --- a/go.sum +++ b/go.sum @@ -115,11 +115,13 @@ github.com/alecthomas/units v0.0.0-20190924025748-f65c72e2690d/go.mod h1:rBZYJk5 github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKSc= github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= +github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883 h1:bvNMNQO63//z+xNgfBlViaCIJKLlCJ6/fmUseuG0wVQ= github.com/andreyvit/diff v0.0.0-20170406064948-c7f18ee00883/go.mod h1:rCTlJbsFo29Kk6CurOXKm700vrz8f0KW0JNfpkRJY/8= github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= github.com/apache/arrow/go/arrow v0.0.0-20191024131854-af6fa24be0db/go.mod h1:VTxUBvSJ3s3eHAg65PNgrsn5BtqCRPdmyXh6rAfdxN0= github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= github.com/apache/thrift v0.13.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ= +github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0 h1:jfIu9sQUG6Ig+0+Ap1h4unLjW6YQJpKZVmUzxsD4E/Q= github.com/arbovm/levenshtein v0.0.0-20160628152529-48b4e1c0c4d0/go.mod h1:t2tdKJDJF9BV14lnkjHmOQgcvEKgtqs5a1N3LNdJhGE= github.com/aristanetworks/goarista v0.0.0-20170210015632-ea17b1a17847/go.mod h1:D/tb0zPVXnP7fmsLZjtdUhSsumbK/ij54UXjjVgMGxQ= github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= @@ -282,6 +284,7 @@ github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUn github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 h1:fAjc9m62+UWV/WAFKLNi6ZS0675eEUC9y3AlwSbQu1Y= github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= github.com/dgryski/go-sip13 v0.0.0-20181026042036-e10d5fee7954/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= +github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48 h1:fRzb/w+pyskVMQ+UbP35JkH8yB7MYb4q/qhBarqZE6g= github.com/dgryski/trifles v0.0.0-20200323201526-dd97f9abfb48/go.mod h1:if7Fbed8SFyPtHLHbg49SI7NAdJiC5WIA09pe59rfAA= github.com/dlclark/regexp2 v1.2.0/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91/go.mod h1:2pZnwuY/m+8K6iRw6wQdMtk+rH5tNGR1i55kozfMjCc= @@ -993,6 +996,7 @@ github.com/segmentio/fasthash v1.0.3/go.mod h1:waKX8l2N8yckOgmSsXJi7x1ZfdKZ4x7KR github.com/segmentio/kafka-go v0.1.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/segmentio/kafka-go v0.2.0/go.mod h1:X6itGqS9L4jDletMsxZ7Dz+JFWxM6JHfPOCvTvk+EJo= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= github.com/shirou/gopsutil v2.20.5+incompatible/go.mod h1:5b4v6he4MtMOwMlS0TUMTu2PcXUg8+E1lC7eC3UO/RA= github.com/shirou/gopsutil v3.21.4-0.20210419000835-c7a38de76ee5+incompatible h1:Bn1aCHHRnjv4Bl16T8rcaFjYSrGrIZvpiGO6P3Q4GpU= @@ -1112,7 +1116,6 @@ github.com/urfave/cli/v2 v2.3.0/go.mod h1:LJmUH05zAU44vOAcrfzZQKsZbVcdbOG8rtL3/X github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= -github.com/vektah/gqlparser/v2 v2.4.0 h1:EmA4dw9mqHm0j6Xzb9T21hOrp3oXmxnS40vwki70DZU= github.com/vektah/gqlparser/v2 v2.4.0/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= github.com/vektah/gqlparser/v2 v2.4.1 h1:QOyEn8DAPMUMARGMeshKDkDgNmVoEaEGiDB0uWxcSlQ= github.com/vektah/gqlparser/v2 v2.4.1/go.mod h1:flJWIR04IMQPGz+BXLrORkrARBxv/rtyIAFvd/MceW0= @@ -1524,8 +1527,8 @@ golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -golang.org/x/tools v0.1.5 h1:ouewzE6p+/VEB31YYnTbEJdi8pFqKp4P4n85vwo3DHA= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.9 h1:j9KsMiaP1c3B0OTQGth0/k+miLGTgLsAFUCrF2vLcF8= golang.org/x/tools v0.1.9/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= diff --git a/gql/README.md b/gql/README.md index 835c84bd..07c96fec 100644 --- a/gql/README.md +++ b/gql/README.md @@ -1,11 +1,11 @@ -# Vulcanize dxns gql +# Vulcanize chiba-clonk gql > Browser : http://localhost:9473 for gql ## Start server ```shell -./build/chibaclonkd start --gql-playground --gql-server +./build/chibaclonkd start --gql-playground --gql-server ``` Basic node status: @@ -100,7 +100,7 @@ Query records. ```graphql { - queryRecords(attributes: [{ key: "type", value: { string: "wrn:bot" } }]) { + queryRecords(attributes: [{ key: "type", value: { string: "crn:bot" } }]) { id names bondId @@ -316,7 +316,7 @@ LookUp Names ```graphql { - lookupNames(names: ["wrn://hello/test"]){ + lookupNames(names: ["crn://hello/test"]){ latest{ id height diff --git a/gql/generated.go b/gql/generated.go index 43e8f4da..8e030164 100644 --- a/gql/generated.go +++ b/gql/generated.go @@ -988,7 +988,7 @@ func (ec *executionContext) introspectType(name string) (*introspection.Type, er } var sources = []*ast.Source{ - {Name: "vulcanize/dxns/schema.graphql", Input: `# Reference to another record. + {Name: "vulcanize/chiba-clonk/schema.graphql", Input: `# Reference to another record. type Reference { id: String! # ID of linked record. } @@ -1096,7 +1096,7 @@ type PeerInfo { remote_ip: String! } -# Vulcanize DXNS status. +# Vulcanize chiba-clonk status. type Status { version: String! node: NodeInfo! diff --git a/gql/gqlgen.yml b/gql/gqlgen.yml index 2354079b..c50c7b44 100644 --- a/gql/gqlgen.yml +++ b/gql/gqlgen.yml @@ -4,7 +4,7 @@ # for detailed .gqlgen.yml documentation. schema: - - vulcanize/dxns/*.graphql + - vulcanize/chiba-clonk/*.graphql exec: filename: generated.go model: diff --git a/gql/resolver.go b/gql/resolver.go index adb0a531..7b02db5d 100644 --- a/gql/resolver.go +++ b/gql/resolver.go @@ -3,13 +3,14 @@ package gql import ( "context" "encoding/base64" + "strconv" + "github.com/cosmos/cosmos-sdk/client" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" auctiontypes "github.com/tharsis/ethermint/x/auction/types" bondtypes "github.com/tharsis/ethermint/x/bond/types" nstypes "github.com/tharsis/ethermint/x/nameservice/types" - "strconv" ) // DefaultLogNumLines is the number of log lines to tail by default. @@ -75,17 +76,18 @@ func (q queryResolver) ResolveNames(ctx context.Context, names []string) ([]*Rec nsQueryClient := nstypes.NewQueryClient(q.ctx) var gqlResponse []*Record for _, name := range names { - res, err := nsQueryClient.ResolveWrn(context.Background(), &nstypes.QueryResolveWrn{Wrn: name}) + res, err := nsQueryClient.ResolveCrn(context.Background(), &nstypes.QueryResolveCrn{Crn: name}) if err != nil { - return nil, err - } + // Return nil for record not found. + gqlResponse = append(gqlResponse, nil) + } else { + gqlRecord, err := getGQLRecord(context.Background(), q, *res.GetRecord()) + if err != nil { + return nil, err + } - gqlRecord, err := getGQLRecord(context.Background(), q, *res.GetRecord()) - if err != nil { - return nil, err + gqlResponse = append(gqlResponse, gqlRecord) } - - gqlResponse = append(gqlResponse, gqlRecord) } return gqlResponse, nil @@ -96,17 +98,18 @@ func (q queryResolver) LookupNames(ctx context.Context, names []string) ([]*Name var gqlResponse []*NameRecord for _, name := range names { - res, err := nsQueryClient.LookupWrn(context.Background(), &nstypes.QueryLookupWrn{Wrn: name}) + res, err := nsQueryClient.LookupCrn(context.Background(), &nstypes.QueryLookupCrn{Crn: name}) if err != nil { - return nil, err - } + // Return nil for name not found. + gqlResponse = append(gqlResponse, nil) + } else { + gqlRecord, err := getGQLNameRecord(res.GetName()) + if err != nil { + return nil, err + } - gqlRecord, err := getGQLNameRecord(res.GetName()) - if err != nil { - return nil, err + gqlResponse = append(gqlResponse, gqlRecord) } - - gqlResponse = append(gqlResponse, gqlRecord) } return gqlResponse, nil @@ -114,7 +117,15 @@ func (q queryResolver) LookupNames(ctx context.Context, names []string) ([]*Name func (q queryResolver) QueryRecords(ctx context.Context, attributes []*KeyValueInput, all *bool) ([]*Record, error) { nsQueryClient := nstypes.NewQueryClient(q.ctx) - res, err := nsQueryClient.ListRecords(context.Background(), &nstypes.QueryListRecordsRequest{}) + + res, err := nsQueryClient.ListRecords( + context.Background(), + &nstypes.QueryListRecordsRequest{ + Attributes: parseRequestAttributes(attributes), + All: (all != nil && *all), + }, + ) + if err != nil { return nil, err } @@ -141,13 +152,15 @@ func (q queryResolver) GetRecordsByIds(ctx context.Context, ids []string) ([]*Re for i, id := range ids { res, err := nsQueryClient.GetRecord(context.Background(), &nstypes.QueryRecordByIdRequest{Id: id}) if err != nil { - return nil, err + // Return nil for record not found. + gqlResponse[i] = nil + } else { + record, err := getGQLRecord(context.Background(), q, res.GetRecord()) + if err != nil { + return nil, err + } + gqlResponse[i] = record } - record, err := getGQLRecord(context.Background(), q, res.GetRecord()) - if err != nil { - return nil, err - } - gqlResponse[i] = record } return gqlResponse, nil diff --git a/gql/util.go b/gql/util.go index 4f76e42c..c2cbeb29 100644 --- a/gql/util.go +++ b/gql/util.go @@ -3,12 +3,13 @@ package gql import ( "context" "encoding/json" + "reflect" + "strconv" + sdk "github.com/cosmos/cosmos-sdk/types" auctiontypes "github.com/tharsis/ethermint/x/auction/types" bondtypes "github.com/tharsis/ethermint/x/bond/types" nstypes "github.com/tharsis/ethermint/x/nameservice/types" - "reflect" - "strconv" ) // OwnerAttributeName denotes the owner attribute name for a bond. @@ -72,9 +73,10 @@ func getGQLRecord(ctx context.Context, resolver QueryResolver, record nstypes.Re return &Record{ ID: record.Id, BondID: record.GetBondId(), - CreateTime: record.GetCreateTime().String(), - ExpiryTime: record.GetExpiryTime().String(), + CreateTime: record.GetCreateTime(), + ExpiryTime: record.GetExpiryTime(), Owners: record.GetOwners(), + Names: record.GetNames(), Attributes: attributes, References: references, }, nil @@ -265,3 +267,49 @@ func mapToKeyValuePairs(attrs map[string]interface{}) ([]*KeyValue, error) { return kvPairs, nil } + +func parseRequestAttributes(attrs []*KeyValueInput) []*nstypes.QueryListRecordsRequest_KeyValueInput { + kvPairs := []*nstypes.QueryListRecordsRequest_KeyValueInput{} + + for _, value := range attrs { + kvPair := &nstypes.QueryListRecordsRequest_KeyValueInput{ + Key: value.Key, + Value: &nstypes.QueryListRecordsRequest_ValueInput{}, + } + + if value.Value.String != nil { + kvPair.Value.String_ = *value.Value.String + kvPair.Value.Type = "string" + } + + if value.Value.Int != nil { + kvPair.Value.Int = int64(*value.Value.Int) + kvPair.Value.Type = "int" + } + + if value.Value.Float != nil { + kvPair.Value.Float = *value.Value.Float + kvPair.Value.Type = "float" + } + + if value.Value.Boolean != nil { + kvPair.Value.Boolean = *value.Value.Boolean + kvPair.Value.Type = "boolean" + } + + if value.Value.Reference != nil { + reference := &nstypes.QueryListRecordsRequest_ReferenceInput{ + Id: value.Value.Reference.ID, + } + + kvPair.Value.Reference = reference + kvPair.Value.Type = "reference" + } + + // TODO: Handle arrays. + + kvPairs = append(kvPairs, kvPair) + } + + return kvPairs +} diff --git a/gql/vulcanize/dxns/schema.graphql b/gql/vulcanize/chiba-clonk/schema.graphql similarity index 99% rename from gql/vulcanize/dxns/schema.graphql rename to gql/vulcanize/chiba-clonk/schema.graphql index b167c659..c1134277 100644 --- a/gql/vulcanize/dxns/schema.graphql +++ b/gql/vulcanize/chiba-clonk/schema.graphql @@ -106,7 +106,7 @@ type PeerInfo { remote_ip: String! } -# Vulcanize DXNS status. +# Vulcanize chiba-clonk status. type Status { version: String! node: NodeInfo! diff --git a/init.sh b/init.sh index 07ba55b3..bfd5f72d 100755 --- a/init.sh +++ b/init.sh @@ -32,6 +32,30 @@ cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["staking"]["params"] cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +# Custom modules +cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["record_rent"]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_rent"]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + +if [[ "$TEST_NAMESERVICE_EXPIRY" == "true" ]]; then + echo "Setting timers for expiry tests." + + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["record_rent_duration"]="60s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_grace_period"]="60s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_rent_duration"]="60s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +fi + +if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then + echo "Enabling auction and setting timers." + + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_enabled"]=true' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_rent_duration"]="60s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_grace_period"]="300s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_commits_duration"]="60s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json + cat $HOME/.chibaclonkd/config/genesis.json | jq '.app_state["nameservice"]["params"]["authority_auction_reveals_duration"]="60s"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json +fi # increase block time (?) cat $HOME/.chibaclonkd/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $HOME/.chibaclonkd/config/tmp_genesis.json && mv $HOME/.chibaclonkd/config/tmp_genesis.json $HOME/.chibaclonkd/config/genesis.json diff --git a/proto/vulcanize/nameservice/v1beta1/nameservice.proto b/proto/vulcanize/nameservice/v1beta1/nameservice.proto index eaea8149..860dd91c 100644 --- a/proto/vulcanize/nameservice/v1beta1/nameservice.proto +++ b/proto/vulcanize/nameservice/v1beta1/nameservice.proto @@ -68,23 +68,22 @@ message Record { string bond_id = 2 [ (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" ]; - google.protobuf.Timestamp create_time = 3 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, + string create_time = 3 [ (gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\"" ]; - google.protobuf.Timestamp expiry_time = 4 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false, + string expiry_time = 4 [ (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" ]; bool deleted = 5; repeated string owners = 6 [ (gogoproto.moretags) = "json:\"owners\" yaml:\"owners\"" ]; - bytes attributes = 7 [ + string attributes = 7 [ (gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\"" ]; + repeated string names = 8 [ + (gogoproto.moretags) = "json:\"names\" yaml:\"names\"" + ]; } // AuthorityEntry defines the nameservice module AuthorityEntries diff --git a/proto/vulcanize/nameservice/v1beta1/query.proto b/proto/vulcanize/nameservice/v1beta1/query.proto index 6a3b3762..c6dd8e08 100644 --- a/proto/vulcanize/nameservice/v1beta1/query.proto +++ b/proto/vulcanize/nameservice/v1beta1/query.proto @@ -39,12 +39,12 @@ service Query { rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse){ option (google.api.http).get = "/vulcanize/nameservice/v1beta1/whois/{name}"; } - // LookupWrn - rpc LookupWrn(QueryLookupWrn) returns (QueryLookupWrnResponse){ + // LookupCrn + rpc LookupCrn(QueryLookupCrn) returns (QueryLookupCrnResponse){ option (google.api.http).get = "/vulcanize/nameservice/v1beta1/lookup"; } - // ResolveWrn - rpc ResolveWrn(QueryResolveWrn) returns (QueryResolveWrnResponse){ + // ResolveCrn + rpc ResolveCrn(QueryResolveCrn) returns (QueryResolveCrnResponse){ option (google.api.http).get = "/vulcanize/nameservice/v1beta1/resolve"; } // GetRecordExpiryQueue @@ -68,8 +68,28 @@ message QueryParamsResponse{ // QueryListRecordsRequest is request type for nameservice records list message QueryListRecordsRequest{ + message ReferenceInput { + string id = 1; + } + message ValueInput { + string type = 1; + string string = 2; + int64 int = 3; + double float = 4; + bool boolean = 5; + ReferenceInput reference = 6; + repeated ValueInput values = 7; + } + message KeyValueInput { + string key = 1; + ValueInput value = 2; + } + repeated KeyValueInput attributes = 1; + + bool all = 2; + // pagination defines an optional pagination for the request. - cosmos.base.query.v1beta1.PageRequest pagination = 1; + cosmos.base.query.v1beta1.PageRequest pagination = 3; } // QueryListRecordsResponse is response type for nameservice records list @@ -158,23 +178,23 @@ message QueryWhoisResponse{ ]; } -// QueryLookupWrn is request type for LookupWrn -message QueryLookupWrn{ - string wrn = 1; +// QueryLookupCrn is request type for LookupCrn +message QueryLookupCrn{ + string crn = 1; } -// QueryLookupWrnResponse is response type for QueryLookupWrn -message QueryLookupWrnResponse{ +// QueryLookupCrnResponse is response type for QueryLookupCrn +message QueryLookupCrnResponse{ NameRecord name = 1; } -// QueryResolveWrn is request type for ResolveWrn -message QueryResolveWrn{ - string wrn = 1; +// QueryResolveCrn is request type for ResolveCrn +message QueryResolveCrn{ + string crn = 1; } -// QueryResolveWrnResponse is response type for QueryResolveWrn -message QueryResolveWrnResponse{ +// QueryResolveCrnResponse is response type for QueryResolveCrn +message QueryResolveCrnResponse{ Record record = 1; } diff --git a/proto/vulcanize/nameservice/v1beta1/tx.proto b/proto/vulcanize/nameservice/v1beta1/tx.proto index 5662aa6f..f66d3a11 100644 --- a/proto/vulcanize/nameservice/v1beta1/tx.proto +++ b/proto/vulcanize/nameservice/v1beta1/tx.proto @@ -20,7 +20,7 @@ service Msg { rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse){} // ReAssociateRecords rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse){} - // SetName will store the name with given wrn and name + // SetName will store the name with given crn and name rpc SetName(MsgSetName) returns (MsgSetNameResponse){} // Reserve name rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse){} @@ -43,6 +43,7 @@ message MsgSetRecord{ // MsgSetRecordResponse message MsgSetRecordResponse{ + string id = 1; } // Payload @@ -56,7 +57,7 @@ message Payload { // MsgSetName message MsgSetName{ - string wrn = 1; + string crn = 1; string cid = 2; string signer = 3; } @@ -92,7 +93,7 @@ message MsgSetAuthorityBondResponse{ // MsgDeleteNameAuthority is SDK message for DeleteNameAuthority message MsgDeleteNameAuthority{ - string wrn = 1; + string crn = 1; string signer = 2; } diff --git a/x/nameservice/README.md b/x/nameservice/README.md index d20ecf56..92b49c7c 100644 --- a/x/nameservice/README.md +++ b/x/nameservice/README.md @@ -1,17 +1,17 @@ # Build chain -```bash -# it will create binary in build folder with `ethermintd` -$ make build +```bash +# it will create binary in build folder with `ethermintd` +$ make build ``` # Setup Chain ```bash -./build/chibaclonkd keys add root +./build/chibaclonkd keys add root ./build/chibaclonkd init test-moniker --chain-id ethermint_9000-1 ./build/chibaclonkd add-genesis-account $(./build/chibaclonkd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake -./build/chibaclonkd gentx root 1000000000000000000stake --chain-id ethermint_9000-1 +./build/chibaclonkd gentx root 1000000000000000000stake --chain-id ethermint_9000-1 ./build/chibaclonkd collect-gentxs ./build/chibaclonkd start ``` @@ -78,7 +78,7 @@ $ ./build/chibaclonkd tx nameservice set ~/Desktop/examples/records/example1.yml ## Get records list ```bash -$ ./build/chibaclonkd q nameservice list -o json | jq +$ ./build/chibaclonkd q nameservice list -o json | jq [ { "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae", @@ -181,8 +181,8 @@ $ ./build/chibaclonkd q nameservice balance -o json | jq . ## add bond to the authority ```bash -$ ./build/chibaclonkd tx nameservice authority-bond [Authority Name] [Bond ID ] --from root --chain-id ethermint_9000-1 -y -o json | jq . -$ ./build/chibaclonkd tx nameservice authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 -y -o json | jq . +$ ./build/chibaclonkd tx nameservice authority-bond [Authority Name] [Bond ID ] --from root --chain-id ethermint_9000-1 -y -o json | jq . +$ ./build/chibaclonkd tx nameservice authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 -y -o json | jq . ``` ## Query the records by associate bond id @@ -247,12 +247,12 @@ txhash: 7AFEF524CB0D92D6576FC08601A787786E802449888FD8DDAA7635698CC85060 "timestamp": "" } -``` +``` ## dissociate-records => remove all record from bond ```bash -$./build/chibaclonkd tx nameservice dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1 -y -o json | jq . +$./build/chibaclonkd tx nameservice dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1 -y -o json | jq . { "height": "0", "txhash": "0316F503E5DEA47CB108AE6C7C7FFAF3F71CC56BC22F63CB97322E1BE48B33B9", @@ -274,14 +274,14 @@ $./build/chibaclonkd tx nameservice dissociate-records c3f7a78c5042d2003880962ba > When a record is expires , needs to renew record ```bash -$ ./build/chibaclonkd tx nameservice renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1 +$ ./build/chibaclonkd tx nameservice renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1 ``` ## Set the authority name ```bash -$ ./build/chibaclonkd tx nameservice set-name wrn://hello/test test_hello_cid --from root --chain-id ethermint_9000-1 -y -o json | jq . +$ ./build/chibaclonkd tx nameservice set-name crn://hello/test test_hello_cid --from root --chain-id ethermint_9000-1 -y -o json | jq . { "height": "0", "txhash": "66A63C73B076EEE9A2F7605354448EDEB161F0115D4D03AF68C01BA28DB97486", @@ -301,7 +301,7 @@ $ ./build/chibaclonkd tx nameservice set-name wrn://hello/test test_hello_cid - ## Delete the name ```bash -$./build/chibaclonkd tx nameservice delete-name wrn://hello/test --from root --chain-id ethermint_9000-1 -y +$./build/chibaclonkd tx nameservice delete-name crn://hello/test --from root --chain-id ethermint_9000-1 -y code: 0 codespace: "" data: "" @@ -320,7 +320,7 @@ txhash: A3FF4C46BAC7BD6E54BBB743A49830AE8C6F6FE59282384789CBA323C1FE540C ## List of Authorities Expire Queue ```bash -$ ./build/chibaclonkd q nameservice authority-expiry -o json | jq . +$ ./build/chibaclonkd q nameservice authority-expiry -o json | jq . { "authorities": [], "pagination": null @@ -331,7 +331,7 @@ $ ./build/chibaclonkd q nameservice authority-expiry -o json | jq . ## List of Records Expire Queue ```bash -$ ./build/chibaclonkd q nameservice record-expiry -o json | jq . +$ ./build/chibaclonkd q nameservice record-expiry -o json | jq . { "records": [], "pagination": null diff --git a/x/nameservice/abci.go b/x/nameservice/abci.go index dae9935c..7deb1556 100644 --- a/x/nameservice/abci.go +++ b/x/nameservice/abci.go @@ -13,5 +13,8 @@ func BeginBlocker(ctx sdk.Context, k keeper.Keeper) { // EndBlocker Called every block, update validator set func EndBlocker(ctx sdk.Context, k keeper.Keeper) []abci.ValidatorUpdate { + k.ProcessRecordExpiryQueue(ctx) + k.ProcessAuthorityExpiryQueue(ctx) + return []abci.ValidatorUpdate{} } diff --git a/x/nameservice/client/cli/query.go b/x/nameservice/client/cli/query.go index be981bad..71257932 100644 --- a/x/nameservice/client/cli/query.go +++ b/x/nameservice/client/cli/query.go @@ -3,12 +3,13 @@ package cli import ( "encoding/json" "fmt" + "strings" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/version" "github.com/spf13/cobra" "github.com/tharsis/ethermint/x/nameservice/types" - "strings" ) // GetQueryCmd returns the cli query commands for this module @@ -23,7 +24,7 @@ func GetQueryCmd() *cobra.Command { bondQueryCmd.AddCommand( GetCmdWhoIs(), GetCmdResolve(), - GetCmdLookupWRN(), + GetCmdLookupCRN(), GetRecordExpiryQueue(), GetAuthorityExpiryQueue(), GetQueryParamsCmd(), @@ -68,15 +69,15 @@ $ %s query %s whois [name] return cmd } -// GetCmdLookupWRN queries naming info for a WRN. -func GetCmdLookupWRN() *cobra.Command { +// GetCmdLookupCRN queries naming info for a CRN. +func GetCmdLookupCRN() *cobra.Command { cmd := &cobra.Command{ - Use: "lookup [wrn]", - Short: "Get naming info for WRN.", + Use: "lookup [crn]", + Short: "Get naming info for CRN.", Long: strings.TrimSpace( - fmt.Sprintf(`Get naming info for WRN. + fmt.Sprintf(`Get naming info for CRN. Example: -$ %s query %s lookup [wrn] +$ %s query %s lookup [crn] `, version.AppName, types.ModuleName, ), @@ -88,7 +89,7 @@ $ %s query %s lookup [wrn] return err } queryClient := types.NewQueryClient(clientCtx) - res, err := queryClient.LookupWrn(cmd.Context(), &types.QueryLookupWrn{Wrn: args[0]}) + res, err := queryClient.LookupCrn(cmd.Context(), &types.QueryLookupCrn{Crn: args[0]}) if err != nil { return err } @@ -141,7 +142,7 @@ func GetCmdList() *cobra.Command { Long: strings.TrimSpace( fmt.Sprintf(`Get the records. Example: -$ %s query %s list +$ %s query %s list `, version.AppName, types.ModuleName, ), @@ -184,7 +185,7 @@ func GetCmdGetResource() *cobra.Command { Long: strings.TrimSpace( fmt.Sprintf(`Get the record by id. Example: -$ %s query %s get [ID] +$ %s query %s get [ID] `, version.AppName, types.ModuleName, ), @@ -207,15 +208,15 @@ $ %s query %s get [ID] return cmd } -// GetCmdResolve resolves a WRN to a record. +// GetCmdResolve resolves a CRN to a record. func GetCmdResolve() *cobra.Command { cmd := &cobra.Command{ - Use: "resolve [wrn]", - Short: "Resolve WRN to record.", + Use: "resolve [crn]", + Short: "Resolve CRN to record.", Long: strings.TrimSpace( - fmt.Sprintf(`Resolve WRN to record. + fmt.Sprintf(`Resolve CRN to record. Example: -$ %s query %s resolve [wrn] +$ %s query %s resolve [crn] `, version.AppName, types.ModuleName, ), @@ -227,7 +228,7 @@ $ %s query %s resolve [wrn] return err } queryClient := types.NewQueryClient(clientCtx) - record, err := queryClient.ResolveWrn(cmd.Context(), &types.QueryResolveWrn{Wrn: args[0]}) + record, err := queryClient.ResolveCrn(cmd.Context(), &types.QueryResolveCrn{Crn: args[0]}) if err != nil { return err } @@ -246,7 +247,7 @@ func GetCmdQueryByBond() *cobra.Command { Long: strings.TrimSpace( fmt.Sprintf(`Get the record by bond id. Example: -$ %s query %s query-by-bond [bond id] +$ %s query %s query-by-bond [bond id] `, version.AppName, types.ModuleName, ), diff --git a/x/nameservice/client/cli/tx.go b/x/nameservice/client/cli/tx.go index d8e38f06..02840a76 100644 --- a/x/nameservice/client/cli/tx.go +++ b/x/nameservice/client/cli/tx.go @@ -2,6 +2,9 @@ package cli import ( "fmt" + "io/ioutil" + "strings" + "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,8 +13,6 @@ import ( "github.com/tharsis/ethermint/server/flags" "github.com/tharsis/ethermint/x/nameservice/types" "gopkg.in/yaml.v3" - "io/ioutil" - "strings" ) // NewTxCmd returns a root CLI command handler for all x/bond transaction commands. @@ -241,12 +242,12 @@ $ %s tx %s reassociate-records [old-bond-id] [new-bond-id] // GetCmdSetName is the CLI command for mapping a name to a CID. func GetCmdSetName() *cobra.Command { cmd := &cobra.Command{ - Use: "set-name [wrn] [cid]", - Short: "Set WRN to CID mapping.", + Use: "set-name [crn] [cid]", + Short: "Set CRN to CID mapping.", Long: strings.TrimSpace( - fmt.Sprintf(`Set name with wrn and cid. + fmt.Sprintf(`Set name with crn and cid. Example: -$ %s tx %s set-name [wrn] [cid] +$ %s tx %s set-name [crn] [cid] `, version.AppName, types.ModuleName, ), @@ -345,12 +346,12 @@ $ %s tx %s authority-bond [name] [bond-id] func GetCmdDeleteName() *cobra.Command { cmd := &cobra.Command{ - Use: "delete-name [wrn]", - Short: "Delete WRN.", + Use: "delete-name [crn]", + Short: "Delete CRN.", Long: strings.TrimSpace( - fmt.Sprintf(`Delete WRN. + fmt.Sprintf(`Delete CRN. Example: -$ %s tx %s delete-name [wrn] +$ %s tx %s delete-name [crn] `, version.AppName, types.ModuleName, ), diff --git a/x/nameservice/client/testutil/grpc.go b/x/nameservice/client/testutil/grpc.go index 569b147f..fd7a16e3 100644 --- a/x/nameservice/client/testutil/grpc.go +++ b/x/nameservice/client/testutil/grpc.go @@ -3,6 +3,9 @@ package testutil import ( "encoding/json" "fmt" + "os" + "time" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" @@ -10,8 +13,6 @@ import ( tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tharsis/ethermint/x/nameservice/client/cli" nstypes "github.com/tharsis/ethermint/x/nameservice/types" - "os" - "time" ) func (s *IntegrationTestSuite) TestGRPCQueryParams() { @@ -51,8 +52,8 @@ func (s *IntegrationTestSuite) TestGRPCQueryParams() { sr.NoError(err) params := nstypes.DefaultParams() params.RecordRent = sdk.NewCoin(s.cfg.BondDenom, nstypes.DefaultRecordRent) - params.RecordRentDuration = 5 * time.Second - params.AuthorityGracePeriod = 5 * time.Second + params.RecordRentDuration = 10 * time.Second + params.AuthorityGracePeriod = 10 * time.Second sr.Equal(response.GetParams().String(), params.String()) } }) @@ -130,7 +131,7 @@ func (s *IntegrationTestSuite) TestGRPCQueryWhoIs() { func (s *IntegrationTestSuite) TestGRPCQueryLookup() { val := s.network.Validators[0] sr := s.Require() - reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/lookup?wrn=%s" + reqUrl := val.APIAddress + "/vulcanize/nameservice/v1beta1/lookup?crn=%s" var authorityName = "QueryLookUp" testCases := []struct { @@ -165,13 +166,13 @@ func (s *IntegrationTestSuite) TestGRPCQueryLookup() { s.Run(tc.name, func() { if !tc.expectErr { tc.preRun(authorityName) - tc.url = fmt.Sprintf(reqUrl, fmt.Sprintf("wrn://%s/", authorityName)) + tc.url = fmt.Sprintf(reqUrl, fmt.Sprintf("crn://%s/", authorityName)) } resp, _ := rest.GetRequest(tc.url) if tc.expectErr { sr.Contains(string(resp), tc.errorMsg) } else { - var response nstypes.QueryLookupWrnResponse + var response nstypes.QueryLookupCrnResponse err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response) sr.NoError(err) sr.NotZero(len(response.Name.Latest.Id)) @@ -236,8 +237,8 @@ func (s *IntegrationTestSuite) TestGRPCQueryRecordExpiryQueue() { if !tc.expectErr { tc.preRun(s.bondId) } - // wait 7 seconds for records expires - time.Sleep(time.Second * 7) + // wait 12 seconds for records expires + time.Sleep(time.Second * 12) resp, _ := rest.GetRequest(tc.url) require := s.Require() if tc.expectErr { @@ -306,8 +307,8 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() { if !tc.expectErr { tc.preRun("QueryAuthorityExpiryQueue") } - // wait 7 seconds to name authorites expires - time.Sleep(time.Second * 7) + // wait 12 seconds to name authorites expires + time.Sleep(time.Second * 12) resp, _ := rest.GetRequest(tc.url) require := s.Require() @@ -317,7 +318,8 @@ func (s *IntegrationTestSuite) TestGRPCQueryAuthorityExpiryQueue() { var response nstypes.QueryGetAuthorityExpiryQueueResponse err := val.ClientCtx.Codec.UnmarshalJSON(resp, &response) sr.NoError(err) - sr.NotZero(len(response.GetAuthorities())) + // removed from expiry queue as no bond set + sr.Zero(len(response.GetAuthorities())) } }) } diff --git a/x/nameservice/client/testutil/query.go b/x/nameservice/client/testutil/query.go index 05829ab0..0616fb0b 100644 --- a/x/nameservice/client/testutil/query.go +++ b/x/nameservice/client/testutil/query.go @@ -3,14 +3,15 @@ package testutil import ( "encoding/json" "fmt" + "os" + "time" + "github.com/cosmos/cosmos-sdk/client/flags" clitestutil "github.com/cosmos/cosmos-sdk/testutil/cli" sdk "github.com/cosmos/cosmos-sdk/types" tmcli "github.com/tendermint/tendermint/libs/cli" "github.com/tharsis/ethermint/x/nameservice/client/cli" "github.com/tharsis/ethermint/x/nameservice/types" - "os" - "time" ) func (s *IntegrationTestSuite) TestGetCmdQueryParams() { @@ -39,8 +40,8 @@ func (s *IntegrationTestSuite) TestGetCmdQueryParams() { sr.NoError(err) params := types.DefaultParams() params.RecordRent = sdk.NewCoin(s.cfg.BondDenom, types.DefaultRecordRent) - params.RecordRentDuration = 5 * time.Second - params.AuthorityGracePeriod = 5 * time.Second + params.RecordRentDuration = 10 * time.Second + params.AuthorityGracePeriod = 10 * time.Second sr.Equal(param.GetParams().String(), params.String()) }) } @@ -302,7 +303,7 @@ func (s *IntegrationTestSuite) TestGetCmdWhoIs() { } } -func (s *IntegrationTestSuite) TestGetCmdLookupWRN() { +func (s *IntegrationTestSuite) TestGetCmdLookupCRN() { val := s.network.Validators[0] sr := s.Require() var authorityName = "test1" @@ -314,7 +315,7 @@ func (s *IntegrationTestSuite) TestGetCmdLookupWRN() { preRun func(authorityName string) }{ { - "invalid request without wrn", + "invalid request without crn", []string{fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, true, 0, @@ -324,7 +325,7 @@ func (s *IntegrationTestSuite) TestGetCmdLookupWRN() { }, { "success query with name", - []string{fmt.Sprintf("wrn://%s/", authorityName), fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, + []string{fmt.Sprintf("crn://%s/", authorityName), fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, false, 1, func(authorityName string) { @@ -337,10 +338,10 @@ func (s *IntegrationTestSuite) TestGetCmdLookupWRN() { for _, tc := range testCases { s.Run(tc.name, func() { if !tc.expErr { - // set-name with wrn and bond-id + // set-name with crn and bond-id tc.preRun(authorityName) } - cmd := cli.GetCmdLookupWRN() + cmd := cli.GetCmdLookupCRN() clientCtx := val.ClientCtx out, err := clitestutil.ExecTestCLICmd(clientCtx, cmd, tc.args) @@ -348,7 +349,7 @@ func (s *IntegrationTestSuite) TestGetCmdLookupWRN() { sr.Error(err) } else { sr.NoError(err) - var response types.QueryLookupWrnResponse + var response types.QueryLookupCrnResponse err = clientCtx.Codec.UnmarshalJSON(out.Bytes(), &response) sr.NoError(err) nameRecord := response.GetName() @@ -364,7 +365,7 @@ func (s *IntegrationTestSuite) TestGetCmdLookupWRN() { noOfRecords int }{ { - "invalid request without wrn", + "invalid request without crn", []string{"invalid", fmt.Sprintf("--%s=json", tmcli.OutputFlag)}, true, 0, @@ -432,7 +433,7 @@ func (s *IntegrationTestSuite) GetRecordExpiryQueue() { s.Run(tc.name, func() { if !tc.expErr { tc.preRun(authorityName, s) - time.Sleep(time.Second * 7) + time.Sleep(time.Second * 12) } cmd := cli.GetRecordExpiryQueue() clientCtx := val.ClientCtx @@ -565,7 +566,7 @@ func createNameRecord(authorityName string, s *IntegrationTestSuite) { sr.Zero(d.Code) args = []string{ - fmt.Sprintf("wrn://%s/", authorityName), + fmt.Sprintf("crn://%s/", authorityName), "test_hello_cid", fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), diff --git a/x/nameservice/client/testutil/tx.go b/x/nameservice/client/testutil/tx.go index ea277252..d45ecd9b 100644 --- a/x/nameservice/client/testutil/tx.go +++ b/x/nameservice/client/testutil/tx.go @@ -47,8 +47,8 @@ func (s *IntegrationTestSuite) SetupSuite() { s.Require().NoError(s.cfg.Codec.UnmarshalJSON(genesisState[nstypes.ModuleName], &nsData)) nsData.Params.RecordRent = sdk.NewCoin(s.cfg.BondDenom, nstypes.DefaultRecordRent) - nsData.Params.RecordRentDuration = 5 * time.Second - nsData.Params.AuthorityGracePeriod = 5 * time.Second + nsData.Params.RecordRentDuration = 10 * time.Second + nsData.Params.AuthorityGracePeriod = 10 * time.Second nsDataBz, err := s.cfg.Codec.MarshalJSON(&nsData) s.Require().NoError(err) genesisState[nstypes.ModuleName] = nsDataBz @@ -313,7 +313,7 @@ func (s *IntegrationTestSuite) TestGetCmdSetName() { { "success", []string{ - fmt.Sprintf("wrn://%s/", authorityName), + fmt.Sprintf("crn://%s/", authorityName), "test_hello_cid", fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -488,7 +488,7 @@ func (s *IntegrationTestSuite) TestGetCmdDeleteName() { preRun func(authorityName string, s *IntegrationTestSuite) }{ { - "invalid request without wrn", + "invalid request without crn", []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -521,7 +521,7 @@ func (s *IntegrationTestSuite) TestGetCmdDeleteName() { s.Run(fmt.Sprintf("Case %s", tc.name), func() { if !tc.err { tc.preRun(authorityName, s) - tc.args = append([]string{fmt.Sprintf("wrn://%s/", authorityName)}, tc.args...) + tc.args = append([]string{fmt.Sprintf("crn://%s/", authorityName)}, tc.args...) } clientCtx := val.ClientCtx cmd := cli.GetCmdDeleteName() @@ -551,7 +551,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() { postRun func(recordId string, s *IntegrationTestSuite) }{ { - "invalid request without wrn", + "invalid request without crn", []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -670,7 +670,7 @@ func (s *IntegrationTestSuite) TestGetCmdDissociateBond() { // postRun func(recordId string, s *IntegrationTestSuite) // }{ // { -// "invalid request without wrn", +// "invalid request without crn", // []string{ // fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName), // fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), @@ -794,7 +794,7 @@ func (s *IntegrationTestSuite) TestGetCmdAssociateBond() { postRun func(recordId, bondId string, s *IntegrationTestSuite) }{ { - "invalid request without wrn", + "invalid request without crn", []string{ fmt.Sprintf("--%s=%s", flags.FlagFrom, accountName), fmt.Sprintf("--%s=true", flags.FlagSkipConfirmation), diff --git a/x/nameservice/genesis.go b/x/nameservice/genesis.go index 22bd665a..040eea5a 100644 --- a/x/nameservice/genesis.go +++ b/x/nameservice/genesis.go @@ -1,6 +1,8 @@ package nameservice import ( + "time" + sdk "github.com/cosmos/cosmos-sdk/types" abci "github.com/tendermint/tendermint/abci/types" "github.com/tharsis/ethermint/x/nameservice/keeper" @@ -14,7 +16,13 @@ func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState) keeper.PutRecord(ctx, record) // Add to record expiry queue if expiry time is in the future. - if record.ExpiryTime.After(ctx.BlockTime()) { + expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime) + + if err != nil { + panic(err) + } + + if expiryTime.After(ctx.BlockTime()) { keeper.InsertRecordExpiryQueue(ctx, record) } diff --git a/x/nameservice/keeper/grpc_query.go b/x/nameservice/keeper/grpc_query.go index 62ab774c..35620223 100644 --- a/x/nameservice/keeper/grpc_query.go +++ b/x/nameservice/keeper/grpc_query.go @@ -2,11 +2,18 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/tharsis/ethermint/x/nameservice/types" ) +// BondIDAttributeName denotes the record bond ID. +const BondIDAttributeName = "bondId" + +// ExpiryTimeAttributeName denotes the record expiry time. +const ExpiryTimeAttributeName = "expiryTime" + type Querier struct { Keeper } @@ -19,9 +26,20 @@ func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types. return &types.QueryParamsResponse{Params: ¶ms}, nil } -func (q Querier) ListRecords(c context.Context, _ *types.QueryListRecordsRequest) (*types.QueryListRecordsResponse, error) { +func (q Querier) ListRecords(c context.Context, req *types.QueryListRecordsRequest) (*types.QueryListRecordsResponse, error) { ctx := sdk.UnwrapSDKContext(c) - records := q.Keeper.ListRecords(ctx) + attributes := req.GetAttributes() + all := req.GetAll() + records := []types.Record{} + + if len(attributes) > 0 { + records = q.Keeper.MatchRecords(ctx, func(record *types.RecordType) bool { + return MatchOnAttributes(record, attributes, all) + }) + } else { + records = q.Keeper.ListRecords(ctx) + } + return &types.QueryListRecordsResponse{Records: records}, nil } @@ -61,27 +79,27 @@ func (q Querier) Whois(c context.Context, request *types.QueryWhoisRequest) (*ty return &types.QueryWhoisResponse{NameAuthority: nameAuthority}, nil } -func (q Querier) LookupWrn(c context.Context, req *types.QueryLookupWrn) (*types.QueryLookupWrnResponse, error) { +func (q Querier) LookupCrn(c context.Context, req *types.QueryLookupCrn) (*types.QueryLookupCrnResponse, error) { ctx := sdk.UnwrapSDKContext(c) - wrn := req.GetWrn() - if !q.Keeper.HasNameRecord(ctx, wrn) { - return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "WRN not found.") + crn := req.GetCrn() + if !q.Keeper.HasNameRecord(ctx, crn) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "CRN not found.") } - nameRecord := q.Keeper.GetNameRecord(ctx, wrn) + nameRecord := q.Keeper.GetNameRecord(ctx, crn) if nameRecord == nil { return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "name record not found.") } - return &types.QueryLookupWrnResponse{Name: nameRecord}, nil + return &types.QueryLookupCrnResponse{Name: nameRecord}, nil } -func (q Querier) ResolveWrn(c context.Context, req *types.QueryResolveWrn) (*types.QueryResolveWrnResponse, error) { +func (q Querier) ResolveCrn(c context.Context, req *types.QueryResolveCrn) (*types.QueryResolveCrnResponse, error) { ctx := sdk.UnwrapSDKContext(c) - wrn := req.GetWrn() - record := q.Keeper.ResolveWRN(ctx, wrn) + crn := req.GetCrn() + record := q.Keeper.ResolveCRN(ctx, crn) if record == nil { return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "record not found.") } - return &types.QueryResolveWrnResponse{Record: record}, nil + return &types.QueryResolveCrnResponse{Record: record}, nil } func (q Querier) GetRecordExpiryQueue(c context.Context, _ *types.QueryGetRecordExpiryQueue) (*types.QueryGetRecordExpiryQueueResponse, error) { @@ -95,3 +113,115 @@ func (q Querier) GetAuthorityExpiryQueue(c context.Context, _ *types.QueryGetAut authorities := q.Keeper.GetAuthorityExpiryQueue(ctx) return &types.QueryGetAuthorityExpiryQueueResponse{Authorities: authorities}, nil } + +func matchOnRecordField(record *types.RecordType, attr *types.QueryListRecordsRequest_KeyValueInput) (fieldFound bool, matched bool) { + fieldFound = false + matched = true + + switch attr.Key { + case BondIDAttributeName: + { + fieldFound = true + if record.BondId != attr.Value.GetString_() { + matched = false + return + } + } + case ExpiryTimeAttributeName: + { + fieldFound = true + if record.ExpiryTime != attr.Value.GetString_() { + matched = false + return + } + } + } + + return +} + +func MatchOnAttributes(record *types.RecordType, attributes []*types.QueryListRecordsRequest_KeyValueInput, all bool) bool { + // Filter deleted records. + if record.Deleted { + return false + } + + // If ONLY named records are requested, check for that condition first. + if !all && len(record.Names) == 0 { + return false + } + + recAttrs := record.Attributes + + for _, attr := range attributes { + // First try matching on record struct fields. + fieldFound, matched := matchOnRecordField(record, attr) + + if fieldFound { + if !matched { + return false + } + + continue + } + + recAttrVal, recAttrFound := recAttrs[attr.Key] + if !recAttrFound { + return false + } + + if attr.Value.Type == "int" { + recAttrValInt, ok := recAttrVal.(int) + if !ok || int(attr.Value.GetInt()) != recAttrValInt { + return false + } + } + + if attr.Value.Type == "float" { + recAttrValFloat, ok := recAttrVal.(float64) + if !ok || attr.Value.GetFloat() != recAttrValFloat { + return false + } + } + + if attr.Value.Type == "string" { + recAttrValString, ok := recAttrVal.(string) + if !ok { + return false + } + + if attr.Value.GetString_() != recAttrValString { + return false + } + } + + if attr.Value.Type == "boolean" { + recAttrValBool, ok := recAttrVal.(bool) + if !ok || attr.Value.GetBoolean() != recAttrValBool { + return false + } + } + + if attr.Value.Type == "reference" { + obj, ok := recAttrVal.(map[string]interface{}) + if !ok { + // Attr value is not an object. + return false + } + + if _, ok := obj["/"].(string); !ok { + // Attr value is not a reference. + return false + } + + recAttrValRefID := obj["/"].(string) + if recAttrValRefID != attr.Value.GetReference().GetId() { + return false + } + } + + // TODO: Handle arrays. + } + + return true +} diff --git a/x/nameservice/keeper/grpc_query_test.go b/x/nameservice/keeper/grpc_query_test.go index 713a659f..331a2676 100644 --- a/x/nameservice/keeper/grpc_query_test.go +++ b/x/nameservice/keeper/grpc_query_test.go @@ -3,9 +3,10 @@ package keeper_test import ( "context" "fmt" + "os" + "github.com/tharsis/ethermint/x/nameservice/client/cli" nameservicetypes "github.com/tharsis/ethermint/x/nameservice/types" - "os" ) func (suite *KeeperTestSuite) TestGrpcQueryParams() { @@ -62,12 +63,13 @@ func (suite *KeeperTestSuite) TestGrpcGetRecordLists() { sr.NoError(err) payload, err := cli.GetPayloadFromFile(dir + "/../helpers/examples/example1.yml") sr.NoError(err) - err = suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{ + record, err := suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{ BondId: suite.bond.GetId(), Signer: suite.accounts[0].String(), Payload: payload.ToPayload(), }) sr.NoError(err) + sr.NotNil(record.Id) } resp, err := grpcClient.ListRecords(context.Background(), test.req) if test.expErr { @@ -192,12 +194,13 @@ func (suite *KeeperTestSuite) TestGrpcQueryNameserviceModuleBalance() { sr.NoError(err) payload, err := cli.GetPayloadFromFile(dir + "/../helpers/examples/example1.yml") sr.NoError(err) - err = suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{ + record, err := suite.app.NameServiceKeeper.ProcessSetRecord(ctx, nameservicetypes.MsgSetRecord{ BondId: suite.bond.GetId(), Signer: suite.accounts[0].String(), Payload: payload.ToPayload(), }) sr.NoError(err) + sr.NotNil(record.Id) } resp, err := grpcClient.GetNameServiceModuleBalance(context.Background(), test.req) if test.expErr { diff --git a/x/nameservice/keeper/keeper.go b/x/nameservice/keeper/keeper.go index b719fda3..f5fbeef9 100644 --- a/x/nameservice/keeper/keeper.go +++ b/x/nameservice/keeper/keeper.go @@ -1,7 +1,11 @@ package keeper import ( + "bytes" "fmt" + "sort" + "time" + "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/codec/legacy" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,8 +17,6 @@ import ( bondkeeper "github.com/tharsis/ethermint/x/bond/keeper" "github.com/tharsis/ethermint/x/nameservice/helpers" "github.com/tharsis/ethermint/x/nameservice/types" - "sort" - "time" ) var ( @@ -27,8 +29,8 @@ var ( // PrefixNameAuthorityRecordIndex is the prefix for the name -> NameAuthority index. PrefixNameAuthorityRecordIndex = []byte{0x01} - // PrefixWRNToNameRecordIndex is the prefix for the WRN -> NamingRecord index. - PrefixWRNToNameRecordIndex = []byte{0x02} + // PrefixCRNToNameRecordIndex is the prefix for the CRN -> NamingRecord index. + PrefixCRNToNameRecordIndex = []byte{0x02} // PrefixBondIDToRecordsIndex is the prefix for the Bond ID -> [Record] index. PrefixBondIDToRecordsIndex = []byte{0x03} @@ -118,8 +120,30 @@ func (k Keeper) ListRecords(ctx sdk.Context) []types.Record { if bz != nil { var obj types.Record k.cdc.MustUnmarshal(bz, &obj) - //records = append(records, recordObjToRecord(store, k.cdc, obj)) - records = append(records, obj) + records = append(records, recordObjToRecord(store, k.cdc, obj)) + } + } + + return records +} + +// MatchRecords - get all matching records. +func (k Keeper) MatchRecords(ctx sdk.Context, matchFn func(*types.RecordType) bool) []types.Record { + var records []types.Record + + store := ctx.KVStore(k.storeKey) + itr := sdk.KVStorePrefixIterator(store, PrefixCIDToRecordIndex) + defer itr.Close() + for ; itr.Valid(); itr.Next() { + bz := store.Get(itr.Key()) + if bz != nil { + var obj types.Record + k.cdc.MustUnmarshal(bz, &obj) + obj = recordObjToRecord(store, k.cdc, obj) + record := obj.ToRecordType() + if matchFn(&record) { + records = append(records, obj) + } } } @@ -147,7 +171,7 @@ func (k Keeper) GetRecordExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord } // ProcessSetRecord creates a record. -func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) error { +func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) (*types.RecordType, error) { payload := msg.Payload.ToReadablePayload() record := types.RecordType{Attributes: payload.Record, BondId: msg.BondId} @@ -155,13 +179,14 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) error resourceSignBytes, _ := record.GetSignBytes() cid, err := record.GetCID() if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON") + return nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON") } record.Id = cid if exists := k.HasRecord(ctx, record.Id); exists { - return nil + // Immutable record already exists. No-op. + return &record, nil } record.Owners = []string{} @@ -169,13 +194,13 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) error pubKey, err := legacy.PubKeyFromBytes(helpers.BytesFromBase64(sig.PubKey)) if err != nil { fmt.Println("Error decoding pubKey from bytes: ", err) - return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Invalid public key.") + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Invalid public key.") } sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig)) if !sigOK { fmt.Println("Signature mismatch: ", sig.PubKey) - return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.") + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.") } record.Owners = append(record.Owners, pubKey.Address().String()) } @@ -184,9 +209,9 @@ func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) error sort.Strings(record.Owners) sdkErr := k.processRecord(ctx, &record, false) if sdkErr != nil { - return sdkErr + return nil, sdkErr } - return nil + return &record, nil } func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenewal bool) error { @@ -198,8 +223,8 @@ func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenew return err } - record.CreateTime = ctx.BlockHeader().Time - record.ExpiryTime = ctx.BlockHeader().Time.Add(params.RecordRentDuration) + record.CreateTime = ctx.BlockHeader().Time.Format(time.RFC3339) + record.ExpiryTime = ctx.BlockHeader().Time.Add(params.RecordRentDuration).Format(time.RFC3339) record.Deleted = false k.PutRecord(ctx, record.ToRecordObj()) @@ -268,9 +293,111 @@ func (k Keeper) GetRecordExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Ti // InsertRecordExpiryQueue inserts a record CID to the appropriate timeslice in the record expiry queue. func (k Keeper) InsertRecordExpiryQueue(ctx sdk.Context, val types.Record) { - timeSlice := k.GetRecordExpiryQueueTimeSlice(ctx, val.ExpiryTime) + expiryTime, err := time.Parse(time.RFC3339, val.ExpiryTime) + + if err != nil { + panic(err) + } + + timeSlice := k.GetRecordExpiryQueueTimeSlice(ctx, expiryTime) timeSlice = append(timeSlice, val.Id) - k.SetRecordExpiryQueueTimeSlice(ctx, val.ExpiryTime, timeSlice) + k.SetRecordExpiryQueueTimeSlice(ctx, expiryTime, timeSlice) +} + +// DeleteRecordExpiryQueue deletes a record CID from the record expiry queue. +func (k Keeper) DeleteRecordExpiryQueue(ctx sdk.Context, record types.Record) { + expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime) + + if err != nil { + panic(err) + } + + timeSlice := k.GetRecordExpiryQueueTimeSlice(ctx, expiryTime) + var newTimeSlice []string + + for _, cid := range timeSlice { + if !bytes.Equal([]byte(cid), []byte(record.Id)) { + newTimeSlice = append(newTimeSlice, cid) + } + } + + if len(newTimeSlice) == 0 { + k.DeleteRecordExpiryQueueTimeSlice(ctx, expiryTime) + } else { + k.SetRecordExpiryQueueTimeSlice(ctx, expiryTime, newTimeSlice) + } +} + +// RecordExpiryQueueIterator returns all the record expiry queue timeslices from time 0 until endTime. +func (k Keeper) RecordExpiryQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator { + store := ctx.KVStore(k.storeKey) + rangeEndBytes := sdk.InclusiveEndBytes(getRecordExpiryQueueTimeKey(endTime)) + return store.Iterator(PrefixExpiryTimeToRecordsIndex, rangeEndBytes) +} + +// GetAllExpiredRecords returns a concatenated list of all the timeslices before currTime. +func (k Keeper) GetAllExpiredRecords(ctx sdk.Context, currTime time.Time) (expiredRecordCIDs []string) { + // Gets an iterator for all timeslices from time 0 until the current block header time. + itr := k.RecordExpiryQueueIterator(ctx, ctx.BlockHeader().Time) + defer itr.Close() + + for ; itr.Valid(); itr.Next() { + timeslice, err := helpers.BytesArrToStringArr(itr.Value()) + + if err != nil { + panic(err) + } + + expiredRecordCIDs = append(expiredRecordCIDs, timeslice...) + } + + return expiredRecordCIDs +} + +// ProcessRecordExpiryQueue tries to renew expiring records (by collecting rent) else marks them as deleted. +func (k Keeper) ProcessRecordExpiryQueue(ctx sdk.Context) { + cids := k.GetAllExpiredRecords(ctx, ctx.BlockHeader().Time) + for _, cid := range cids { + record := k.GetRecord(ctx, cid) + + // If record doesn't have an associated bond or if bond no longer exists, mark it deleted. + if record.BondId == "" || !k.bondKeeper.HasBond(ctx, record.BondId) { + record.Deleted = true + k.PutRecord(ctx, record) + k.DeleteRecordExpiryQueue(ctx, record) + + return + } + + // Try to renew the record by taking rent. + k.TryTakeRecordRent(ctx, record) + } +} + +// TryTakeRecordRent tries to take rent from the record bond. +func (k Keeper) TryTakeRecordRent(ctx sdk.Context, record types.Record) { + params := k.GetParams(ctx) + rent := params.RecordRent + sdkErr := k.bondKeeper.TransferCoinsToModuleAccount(ctx, record.BondId, types.RecordRentModuleAccountName, sdk.NewCoins(rent)) + + if sdkErr != nil { + // Insufficient funds, mark record as deleted. + record.Deleted = true + k.PutRecord(ctx, record) + k.DeleteRecordExpiryQueue(ctx, record) + + return + } + + // Delete old expiry queue entry, create new one. + k.DeleteRecordExpiryQueue(ctx, record) + record.ExpiryTime = ctx.BlockHeader().Time.Add(params.RecordRentDuration).Format(time.RFC3339) + k.InsertRecordExpiryQueue(ctx, record) + + // Save record. + record.Deleted = false + k.PutRecord(ctx, record) + k.AddBondToRecordIndexEntry(ctx, record.BondId, record.Id) } // GetModuleBalances gets the nameservice module account(s) balances. @@ -292,3 +419,19 @@ func (k Keeper) GetModuleBalances(ctx sdk.Context) []*types.AccountBalance { return balances } + +func recordObjToRecord(store sdk.KVStore, codec codec.BinaryCodec, record types.Record) types.Record { + reverseNameIndexKey := GetCIDToNamesIndexKey(record.Id) + + if store.Has(reverseNameIndexKey) { + names, err := helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey)) + + if err != nil { + panic(err) + } + + record.Names = names + } + + return record +} diff --git a/x/nameservice/keeper/msg_server.go b/x/nameservice/keeper/msg_server.go index 3701c0d9..31224b7a 100644 --- a/x/nameservice/keeper/msg_server.go +++ b/x/nameservice/keeper/msg_server.go @@ -2,6 +2,7 @@ package keeper import ( "context" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/tharsis/ethermint/x/nameservice/types" ) @@ -24,7 +25,7 @@ func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types return nil, err } - err = m.Keeper.ProcessSetRecord(ctx, types.MsgSetRecord{ + record, err := m.Keeper.ProcessSetRecord(ctx, types.MsgSetRecord{ BondId: msg.GetBondId(), Signer: msg.GetSigner(), Payload: msg.GetPayload(), @@ -47,7 +48,7 @@ func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types ), }) - return &types.MsgSetRecordResponse{}, nil + return &types.MsgSetRecordResponse{Id: record.Id}, nil } func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.MsgSetNameResponse, error) { @@ -64,7 +65,7 @@ func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.Msg sdk.NewEvent( types.EventTypeSetRecord, sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), - sdk.NewAttribute(types.AttributeKeyWRN, msg.Wrn), + sdk.NewAttribute(types.AttributeKeyCRN, msg.Crn), sdk.NewAttribute(types.AttributeKeyCID, msg.Cid), ), sdk.NewEvent( @@ -146,7 +147,7 @@ func (m msgServer) DeleteName(c context.Context, msg *types.MsgDeleteNameAuthori sdk.NewEvent( types.EventTypeDeleteName, sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), - sdk.NewAttribute(types.AttributeKeyWRN, msg.Wrn), + sdk.NewAttribute(types.AttributeKeyCRN, msg.Crn), ), sdk.NewEvent( sdk.EventTypeMessage, diff --git a/x/nameservice/keeper/naming_keeper.go b/x/nameservice/keeper/naming_keeper.go index df710ad4..cc61f567 100644 --- a/x/nameservice/keeper/naming_keeper.go +++ b/x/nameservice/keeper/naming_keeper.go @@ -1,7 +1,12 @@ package keeper import ( + "bytes" "fmt" + "net/url" + "strings" + "time" + "github.com/cosmos/cosmos-sdk/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" @@ -9,9 +14,6 @@ import ( auctiontypes "github.com/tharsis/ethermint/x/auction/types" "github.com/tharsis/ethermint/x/nameservice/helpers" "github.com/tharsis/ethermint/x/nameservice/types" - "net/url" - "strings" - "time" ) func getAuthorityPubKey(pubKey cryptotypes.PubKey) string { @@ -26,9 +28,9 @@ func GetNameAuthorityIndexKey(name string) []byte { return append(PrefixNameAuthorityRecordIndex, []byte(name)...) } -// GetNameRecordIndexKey Generates WRN -> NameRecord index key. -func GetNameRecordIndexKey(wrn string) []byte { - return append(PrefixWRNToNameRecordIndex, []byte(wrn)...) +// GetNameRecordIndexKey Generates CRN -> NameRecord index key. +func GetNameRecordIndexKey(crn string) []byte { + return append(PrefixCRNToNameRecordIndex, []byte(crn)...) } func GetCIDToNamesIndexKey(id string) []byte { @@ -101,35 +103,35 @@ func RemoveBondToAuthorityIndexEntry(store sdk.KVStore, bondID string, name stri store.Delete(getBondIDToAuthoritiesIndexKey(bondID, name)) } -func (k Keeper) updateBlockChangeSetForName(ctx sdk.Context, wrn string) { +func (k Keeper) updateBlockChangeSetForName(ctx sdk.Context, crn string) { changeSet := k.getOrCreateBlockChangeSet(ctx, ctx.BlockHeight()) - changeSet.Names = append(changeSet.Names, wrn) + changeSet.Names = append(changeSet.Names, crn) k.saveBlockChangeSet(ctx, changeSet) } -func (k Keeper) getAuthority(ctx sdk.Context, wrn string) (string, *url.URL, *types.NameAuthority, error) { - parsedWRN, err := url.Parse(wrn) +func (k Keeper) getAuthority(ctx sdk.Context, crn string) (string, *url.URL, *types.NameAuthority, error) { + parsedCRN, err := url.Parse(crn) if err != nil { - return "", nil, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid WRN.") + return "", nil, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid CRN.") } - name := parsedWRN.Host + name := parsedCRN.Host if !k.HasNameAuthority(ctx, name) { return name, nil, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Name authority not found.") } authority := k.GetNameAuthority(ctx, name) - return name, parsedWRN, &authority, nil + return name, parsedCRN, &authority, nil } -func (k Keeper) checkWRNAccess(ctx sdk.Context, signer sdk.AccAddress, wrn string) error { - name, parsedWRN, authority, err := k.getAuthority(ctx, wrn) +func (k Keeper) checkCRNAccess(ctx sdk.Context, signer sdk.AccAddress, crn string) error { + name, parsedCRN, authority, err := k.getAuthority(ctx, crn) if err != nil { return err } - formattedWRN := fmt.Sprintf("wrn://%s%s", name, parsedWRN.RequestURI()) - if formattedWRN != wrn { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid WRN.") + formattedCRN := fmt.Sprintf("crn://%s%s", name, parsedCRN.RequestURI()) + if formattedCRN != crn { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid CRN.") } if authority.OwnerAddress != signer.String() { @@ -159,14 +161,14 @@ func (k Keeper) checkWRNAccess(ctx sdk.Context, signer sdk.AccAddress, wrn strin } // HasNameRecord - checks if a name record exists. -func (k Keeper) HasNameRecord(ctx sdk.Context, wrn string) bool { +func (k Keeper) HasNameRecord(ctx sdk.Context, crn string) bool { store := ctx.KVStore(k.storeKey) - return store.Has(GetNameRecordIndexKey(wrn)) + return store.Has(GetNameRecordIndexKey(crn)) } // GetNameRecord - gets a name record from the store. -func GetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, wrn string) *types.NameRecord { - nameRecordKey := GetNameRecordIndexKey(wrn) +func GetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, crn string) *types.NameRecord { + nameRecordKey := GetNameRecordIndexKey(crn) if !store.Has(nameRecordKey) { return nil } @@ -179,14 +181,14 @@ func GetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, wrn string) *type } // GetNameRecord - gets a name record from the store. -func (k Keeper) GetNameRecord(ctx sdk.Context, wrn string) *types.NameRecord { - _, _, authority, err := k.getAuthority(ctx, wrn) +func (k Keeper) GetNameRecord(ctx sdk.Context, crn string) *types.NameRecord { + _, _, authority, err := k.getAuthority(ctx, crn) if err != nil || authority.Status != types.AuthorityActive { // If authority is not active (or any other error), lookup fails. return nil } - nameRecord := GetNameRecord(ctx.KVStore(k.storeKey), k.cdc, wrn) + nameRecord := GetNameRecord(ctx.KVStore(k.storeKey), k.cdc, crn) // Name record may not exist. if nameRecord == nil { @@ -203,12 +205,12 @@ func (k Keeper) GetNameRecord(ctx sdk.Context, wrn string) *types.NameRecord { } // RemoveRecordToNameMapping removes a name from the record ID -> []names index. -func RemoveRecordToNameMapping(store sdk.KVStore, id string, wrn string) { +func RemoveRecordToNameMapping(store sdk.KVStore, id string, crn string) { reverseNameIndexKey := GetCIDToNamesIndexKey(id) names, _ := helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey)) nameSet := helpers.SliceToSet(names) - nameSet.Remove(wrn) + nameSet.Remove(crn) if nameSet.Cardinality() == 0 { // Delete as storing empty slice throws error from baseapp. @@ -220,7 +222,7 @@ func RemoveRecordToNameMapping(store sdk.KVStore, id string, wrn string) { } // AddRecordToNameMapping adds a name to the record ID -> []names index. -func AddRecordToNameMapping(store sdk.KVStore, id string, wrn string) { +func AddRecordToNameMapping(store sdk.KVStore, id string, crn string) { reverseNameIndexKey := GetCIDToNamesIndexKey(id) var names []string @@ -229,14 +231,14 @@ func AddRecordToNameMapping(store sdk.KVStore, id string, wrn string) { } nameSet := helpers.SliceToSet(names) - nameSet.Add(wrn) + nameSet.Add(crn) bz, _ := helpers.StrArrToBytesArr(helpers.SetToSlice(nameSet)) store.Set(reverseNameIndexKey, bz) } // SetNameRecord - sets a name record. -func SetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, wrn string, id string, height int64) { - nameRecordIndexKey := GetNameRecordIndexKey(wrn) +func SetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, crn string, id string, height int64) { + nameRecordIndexKey := GetNameRecordIndexKey(crn) var nameRecord types.NameRecord if store.Has(nameRecordIndexKey) { @@ -246,7 +248,7 @@ func SetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, wrn string, id st // Update old CID -> []Name index. if nameRecord.Latest.Id != "" || len(nameRecord.Latest.Id) != 0 { - RemoveRecordToNameMapping(store, nameRecord.Latest.Id, wrn) + RemoveRecordToNameMapping(store, nameRecord.Latest.Id, crn) } } @@ -259,35 +261,35 @@ func SetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, wrn string, id st // Update new CID -> []Name index. if id != "" { - AddRecordToNameMapping(store, id, wrn) + AddRecordToNameMapping(store, id, crn) } } // SetNameRecord - sets a name record. -func (k Keeper) SetNameRecord(ctx sdk.Context, wrn string, id string) { - SetNameRecord(ctx.KVStore(k.storeKey), k.cdc, wrn, id, ctx.BlockHeight()) +func (k Keeper) SetNameRecord(ctx sdk.Context, crn string, id string) { + SetNameRecord(ctx.KVStore(k.storeKey), k.cdc, crn, id, ctx.BlockHeight()) // Update changeSet for name. - k.updateBlockChangeSetForName(ctx, wrn) + k.updateBlockChangeSetForName(ctx, crn) } -// ProcessSetName creates a WRN -> Record ID mapping. +// ProcessSetName creates a CRN -> Record ID mapping. func (k Keeper) ProcessSetName(ctx sdk.Context, msg types.MsgSetName) error { signerAddress, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { return err } - err = k.checkWRNAccess(ctx, signerAddress, msg.Wrn) + err = k.checkCRNAccess(ctx, signerAddress, msg.Crn) if err != nil { return err } - nameRecord := k.GetNameRecord(ctx, msg.Wrn) + nameRecord := k.GetNameRecord(ctx, msg.Crn) if nameRecord != nil && nameRecord.Latest.Id == msg.Cid { return nil } - k.SetNameRecord(ctx, msg.Wrn, msg.Cid) + k.SetNameRecord(ctx, msg.Crn, msg.Cid) return nil } @@ -296,7 +298,7 @@ func (k Keeper) ProcessSetName(ctx sdk.Context, msg types.MsgSetName) error { func (k Keeper) ListNameRecords(ctx sdk.Context) []types.NameEntry { var nameEntries []types.NameEntry store := ctx.KVStore(k.storeKey) - itr := sdk.KVStorePrefixIterator(store, PrefixWRNToNameRecordIndex) + itr := sdk.KVStorePrefixIterator(store, PrefixCRNToNameRecordIndex) defer itr.Close() for ; itr.Valid(); itr.Next() { bz := store.Get(itr.Key()) @@ -304,7 +306,7 @@ func (k Keeper) ListNameRecords(ctx sdk.Context) []types.NameEntry { var record types.NameRecord k.cdc.MustUnmarshal(bz, &record) nameEntries = append(nameEntries, types.NameEntry{ - Name: string(itr.Key()[len(PrefixWRNToNameRecordIndex):]), + Name: string(itr.Key()[len(PrefixCRNToNameRecordIndex):]), Entry: &record, }) } @@ -425,13 +427,13 @@ func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRo // ProcessReserveAuthority reserves a name authority. func (k Keeper) ProcessReserveAuthority(ctx sdk.Context, msg types.MsgReserveAuthority) error { - wrn := fmt.Sprintf("wrn://%s", msg.GetName()) - parsedWrn, err := url.Parse(wrn) + crn := fmt.Sprintf("crn://%s", msg.GetName()) + parsedCrn, err := url.Parse(crn) if err != nil { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid name") } - name := parsedWrn.Host - if fmt.Sprintf("wrn://%s", name) != wrn { + name := parsedCrn.Host + if fmt.Sprintf("crn://%s", name) != crn { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid name") } if strings.Contains(name, ".") { @@ -482,23 +484,23 @@ func (k Keeper) ProcessSetAuthorityBond(ctx sdk.Context, msg types.MsgSetAuthori return nil } -// ProcessDeleteName removes a WRN -> Record ID mapping. +// ProcessDeleteName removes a CRN -> Record ID mapping. func (k Keeper) ProcessDeleteName(ctx sdk.Context, msg types.MsgDeleteNameAuthority) error { signerAddress, err := sdk.AccAddressFromBech32(msg.Signer) if err != nil { return err } - err = k.checkWRNAccess(ctx, signerAddress, msg.Wrn) + err = k.checkCRNAccess(ctx, signerAddress, msg.Crn) if err != nil { return err } - if !k.HasNameRecord(ctx, msg.Wrn) { + if !k.HasNameRecord(ctx, msg.Crn) { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Name not found.") } // Set CID to empty string. - k.SetNameRecord(ctx, msg.Wrn, "") + k.SetNameRecord(ctx, msg.Crn, "") return nil } @@ -524,9 +526,9 @@ func (k Keeper) GetAuthorityExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRec return authorities } -// ResolveWRN resolves a WRN to a record. -func (k Keeper) ResolveWRN(ctx sdk.Context, wrn string) *types.Record { - _, _, authority, err := k.getAuthority(ctx, wrn) +// ResolveCRN resolves a CRN to a record. +func (k Keeper) ResolveCRN(ctx sdk.Context, crn string) *types.Record { + _, _, authority, err := k.getAuthority(ctx, crn) if err != nil || authority.Status != types.AuthorityActive { // If authority is not active (or any other error), resolution fails. return nil @@ -534,7 +536,7 @@ func (k Keeper) ResolveWRN(ctx sdk.Context, wrn string) *types.Record { // Name should not resolve if it's stale. // i.e. authority was registered later than the name. - record, nameRecord := ResolveWRN(ctx.KVStore(k.storeKey), wrn, k, ctx) + record, nameRecord := ResolveCRN(ctx.KVStore(k.storeKey), crn, k, ctx) if authority.Height > nameRecord.Latest.Height { return nil } @@ -542,9 +544,9 @@ func (k Keeper) ResolveWRN(ctx sdk.Context, wrn string) *types.Record { return record } -// ResolveWRN resolves a WRN to a record. -func ResolveWRN(store sdk.KVStore, wrn string, k Keeper, c sdk.Context) (*types.Record, *types.NameRecord) { - nameKey := GetNameRecordIndexKey(wrn) +// ResolveCRN resolves a CRN to a record. +func ResolveCRN(store sdk.KVStore, crn string, k Keeper, c sdk.Context) (*types.Record, *types.NameRecord) { + nameKey := GetNameRecordIndexKey(crn) if store.Has(nameKey) { bz := store.Get(nameKey) @@ -596,6 +598,111 @@ func (k Keeper) SetAuthorityExpiryQueueTimeSlice(ctx sdk.Context, timestamp time store.Set(getAuthorityExpiryQueueTimeKey(timestamp), bz) } +// ProcessAuthorityExpiryQueue tries to renew expiring authorities (by collecting rent) else marks them as expired. +func (k Keeper) ProcessAuthorityExpiryQueue(ctx sdk.Context) { + names := k.GetAllExpiredAuthorities(ctx, ctx.BlockHeader().Time) + for _, name := range names { + authority := k.GetNameAuthority(ctx, name) + + // If authority doesn't have an associated bond or if bond no longer exists, mark it expired. + if authority.BondId == "" || !k.bondKeeper.HasBond(ctx, authority.BondId) { + authority.Status = types.AuthorityExpired + k.SetNameAuthority(ctx, name, &authority) + k.DeleteAuthorityExpiryQueue(ctx, name, authority) + + ctx.Logger().Info(fmt.Sprintf("Marking authority expired as no bond present: %s", name)) + + return + } + + // Try to renew the authority by taking rent. + k.TryTakeAuthorityRent(ctx, name, authority) + } +} + +// DeleteAuthorityExpiryQueueTimeSlice deletes a specific authority expiry queue timeslice. +func (k Keeper) DeleteAuthorityExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Time) { + store := ctx.KVStore(k.storeKey) + store.Delete(getAuthorityExpiryQueueTimeKey(timestamp)) +} + +// DeleteAuthorityExpiryQueue deletes an authority name from the authority expiry queue. +func (k Keeper) DeleteAuthorityExpiryQueue(ctx sdk.Context, name string, authority types.NameAuthority) { + timeSlice := k.GetAuthorityExpiryQueueTimeSlice(ctx, authority.ExpiryTime) + newTimeSlice := []string{} + + for _, existingName := range timeSlice { + if !bytes.Equal([]byte(existingName), []byte(name)) { + newTimeSlice = append(newTimeSlice, existingName) + } + } + + if len(newTimeSlice) == 0 { + k.DeleteAuthorityExpiryQueueTimeSlice(ctx, authority.ExpiryTime) + } else { + k.SetAuthorityExpiryQueueTimeSlice(ctx, authority.ExpiryTime, newTimeSlice) + } +} + +// GetAllExpiredAuthorities returns a concatenated list of all the timeslices before currTime. +func (k Keeper) GetAllExpiredAuthorities(ctx sdk.Context, currTime time.Time) (expiredAuthorityNames []string) { + // Gets an iterator for all timeslices from time 0 until the current block header time. + itr := k.AuthorityExpiryQueueIterator(ctx, ctx.BlockHeader().Time) + defer itr.Close() + + for ; itr.Valid(); itr.Next() { + timeslice := []string{} + timeslice, err := helpers.BytesArrToStringArr(itr.Value()) + + if err != nil { + panic(err) + } + + expiredAuthorityNames = append(expiredAuthorityNames, timeslice...) + } + + return expiredAuthorityNames +} + +// AuthorityExpiryQueueIterator returns all the authority expiry queue timeslices from time 0 until endTime. +func (k Keeper) AuthorityExpiryQueueIterator(ctx sdk.Context, endTime time.Time) sdk.Iterator { + store := ctx.KVStore(k.storeKey) + rangeEndBytes := sdk.InclusiveEndBytes(getAuthorityExpiryQueueTimeKey(endTime)) + return store.Iterator(PrefixExpiryTimeToAuthoritiesIndex, rangeEndBytes) +} + +// TryTakeAuthorityRent tries to take rent from the authority bond. +func (k Keeper) TryTakeAuthorityRent(ctx sdk.Context, name string, authority types.NameAuthority) { + ctx.Logger().Info(fmt.Sprintf("Trying to take rent for authority: %s", name)) + + params := k.GetParams(ctx) + rent := params.AuthorityRent + sdkErr := k.bondKeeper.TransferCoinsToModuleAccount(ctx, authority.BondId, types.AuthorityRentModuleAccountName, sdk.NewCoins(rent)) + + if sdkErr != nil { + // Insufficient funds, mark authority as expired. + authority.Status = types.AuthorityExpired + k.SetNameAuthority(ctx, name, &authority) + k.DeleteAuthorityExpiryQueue(ctx, name, authority) + + ctx.Logger().Info(fmt.Sprintf("Insufficient funds in owner account to pay authority rent, marking as expired: %s", name)) + + return + } + + // Delete old expiry queue entry, create new one. + k.DeleteAuthorityExpiryQueue(ctx, name, authority) + authority.ExpiryTime = ctx.BlockTime().Add(params.AuthorityRentDuration) + k.InsertAuthorityExpiryQueue(ctx, name, authority.ExpiryTime) + + // Save authority. + authority.Status = types.AuthorityActive + k.SetNameAuthority(ctx, name, &authority) + k.AddBondToAuthorityIndexEntry(ctx, authority.BondId, name) + + ctx.Logger().Info(fmt.Sprintf("Authority rent paid successfully: %s", name)) +} + // ListNameAuthorityRecords - get all name authority records. func (k Keeper) ListNameAuthorityRecords(ctx sdk.Context) map[string]types.NameAuthority { nameAuthorityRecords := make(map[string]types.NameAuthority) diff --git a/x/nameservice/keeper/record_keeper.go b/x/nameservice/keeper/record_keeper.go index 0af7e320..2a856e32 100644 --- a/x/nameservice/keeper/record_keeper.go +++ b/x/nameservice/keeper/record_keeper.go @@ -2,6 +2,8 @@ package keeper import ( "fmt" + "time" + "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" @@ -143,8 +145,7 @@ func (k RecordKeeper) QueryRecordsByBond(ctx sdk.Context, bondID string) []types if bz != nil { var obj types.Record k.cdc.MustUnmarshal(bz, &obj) - //records = append(records, recordObjToRecord(store, k.cdc, obj)) - records = append(records, obj) + records = append(records, recordObjToRecord(store, k.cdc, obj)) } } @@ -159,12 +160,18 @@ func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) er // Check if renewal is required (i.e. expired record marked as deleted). record := k.GetRecord(ctx, msg.RecordId) - if !record.Deleted || record.ExpiryTime.After(ctx.BlockTime()) { + expiryTime, err := time.Parse(time.RFC3339, record.ExpiryTime) + + if err != nil { + panic(err) + } + + if !record.Deleted || expiryTime.After(ctx.BlockTime()) { return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Renewal not required.") } recordType := record.ToRecordType() - err := k.processRecord(ctx, &recordType, true) + err = k.processRecord(ctx, &recordType, true) if err != nil { return err } diff --git a/x/nameservice/types/events.go b/x/nameservice/types/events.go index a93683a7..d376f131 100644 --- a/x/nameservice/types/events.go +++ b/x/nameservice/types/events.go @@ -19,7 +19,7 @@ const ( AttributeKeyNewBondId = "new-bond-id" AttributeKeyCID = "cid" AttributeKeyName = "name" - AttributeKeyWRN = "wrn" + AttributeKeyCRN = "crn" AttributeKeyRecordId = "record-id" AttributeValueCategory = ModuleName ) diff --git a/x/nameservice/types/msg.go b/x/nameservice/types/msg.go index ee710f14..309ab017 100644 --- a/x/nameservice/types/msg.go +++ b/x/nameservice/types/msg.go @@ -1,9 +1,10 @@ package types import ( + "net/url" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - "net/url" ) var ( @@ -14,9 +15,9 @@ var ( ) // NewMsgSetName is the constructor function for MsgSetName. -func NewMsgSetName(wrn string, cid string, signer sdk.AccAddress) MsgSetName { +func NewMsgSetName(crn string, cid string, signer sdk.AccAddress) MsgSetName { return MsgSetName{ - Wrn: wrn, + Crn: crn, Cid: cid, Signer: signer.String(), } @@ -31,8 +32,8 @@ func (msg MsgSetName) Type() string { return "set-name" } // ValidateBasic Implements Msg. func (msg MsgSetName) ValidateBasic() error { - if msg.Wrn == "" { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "WRN is required.") + if msg.Crn == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "CRN is required.") } if msg.Cid == "" { @@ -144,9 +145,9 @@ func (msg MsgSetAuthorityBond) GetSigners() []sdk.AccAddress { } // NewMsgDeleteNameAuthority is the constructor function for MsgDeleteNameAuthority. -func NewMsgDeleteNameAuthority(wrn string, signer sdk.AccAddress) MsgDeleteNameAuthority { +func NewMsgDeleteNameAuthority(crn string, signer sdk.AccAddress) MsgDeleteNameAuthority { return MsgDeleteNameAuthority{ - Wrn: wrn, + Crn: crn, Signer: signer.String(), } } @@ -159,17 +160,17 @@ func (msg MsgDeleteNameAuthority) Type() string { return "delete-name" } // ValidateBasic Implements Msg. func (msg MsgDeleteNameAuthority) ValidateBasic() error { - if len(msg.Wrn) == 0 { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "wrn is required.") + if len(msg.Crn) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "crn is required.") } if len(msg.Signer) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") } - _, err := url.Parse(msg.Wrn) + _, err := url.Parse(msg.Crn) if err != nil { - return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid wrn.") + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid crn.") } return nil diff --git a/x/nameservice/types/nameservice.pb.go b/x/nameservice/types/nameservice.pb.go index 00fe593c..655895e3 100644 --- a/x/nameservice/types/nameservice.pb.go +++ b/x/nameservice/types/nameservice.pb.go @@ -156,13 +156,14 @@ func (m *Params) GetAuthorityAuctionMinimumBid() types.Coin { // Params defines the nameservice module records type Record struct { - Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" json:"id" yaml:"id"` - BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` - CreateTime time.Time `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3,stdtime" json:"create_time" json:"createTime" yaml:"createTime"` - ExpiryTime time.Time `protobuf:"bytes,4,opt,name=expiry_time,json=expiryTime,proto3,stdtime" json:"expiry_time" json:"expiryTime" yaml:"expiryTime"` - Deleted bool `protobuf:"varint,5,opt,name=deleted,proto3" json:"deleted,omitempty"` - Owners []string `protobuf:"bytes,6,rep,name=owners,proto3" json:"owners,omitempty" json:"owners" yaml:"owners"` - Attributes []byte `protobuf:"bytes,7,opt,name=attributes,proto3" json:"attributes,omitempty" json:"attributes" yaml:"attributes"` + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty" json:"id" yaml:"id"` + BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + CreateTime string `protobuf:"bytes,3,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty" json:"createTime" yaml:"createTime"` + ExpiryTime string `protobuf:"bytes,4,opt,name=expiry_time,json=expiryTime,proto3" json:"expiry_time,omitempty" json:"expiryTime" yaml:"expiryTime"` + Deleted bool `protobuf:"varint,5,opt,name=deleted,proto3" json:"deleted,omitempty"` + Owners []string `protobuf:"bytes,6,rep,name=owners,proto3" json:"owners,omitempty" json:"owners" yaml:"owners"` + Attributes string `protobuf:"bytes,7,opt,name=attributes,proto3" json:"attributes,omitempty" json:"attributes" yaml:"attributes"` + Names []string `protobuf:"bytes,8,rep,name=names,proto3" json:"names,omitempty" json:"names" yaml:"names"` } func (m *Record) Reset() { *m = Record{} } @@ -212,18 +213,18 @@ func (m *Record) GetBondId() string { return "" } -func (m *Record) GetCreateTime() time.Time { +func (m *Record) GetCreateTime() string { if m != nil { return m.CreateTime } - return time.Time{} + return "" } -func (m *Record) GetExpiryTime() time.Time { +func (m *Record) GetExpiryTime() string { if m != nil { return m.ExpiryTime } - return time.Time{} + return "" } func (m *Record) GetDeleted() bool { @@ -240,10 +241,17 @@ func (m *Record) GetOwners() []string { return nil } -func (m *Record) GetAttributes() []byte { +func (m *Record) GetAttributes() string { if m != nil { return m.Attributes } + return "" +} + +func (m *Record) GetNames() []string { + if m != nil { + return m.Names + } return nil } @@ -764,88 +772,90 @@ func init() { } var fileDescriptor_c2009c2df775dbad = []byte{ - // 1295 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x57, 0x4f, 0x6f, 0x1b, 0x45, - 0x14, 0xcf, 0xc6, 0x89, 0x1d, 0x8f, 0x1b, 0x83, 0x86, 0xb4, 0x75, 0x02, 0xf5, 0x06, 0xa3, 0xaa, - 0xad, 0x42, 0xbc, 0x94, 0x1e, 0xca, 0x1f, 0x21, 0x94, 0x4d, 0xd2, 0x10, 0x10, 0x10, 0x26, 0xbd, - 0xc0, 0xc5, 0xcc, 0xee, 0x4e, 0xec, 0xa1, 0xde, 0x5d, 0x6b, 0x67, 0x36, 0xd4, 0x70, 0xe2, 0x1b, - 0x44, 0xe2, 0xd2, 0x03, 0xe2, 0x0b, 0x80, 0xc4, 0xc7, 0xa0, 0xc7, 0x1e, 0x11, 0x12, 0x06, 0x25, - 0xdf, 0xc0, 0x9f, 0x00, 0xed, 0xcc, 0xec, 0x5f, 0xdb, 0x75, 0x69, 0xc5, 0x6d, 0xdf, 0xff, 0xdf, - 0x7b, 0xf3, 0xde, 0x9b, 0x59, 0x60, 0x9c, 0x86, 0x7d, 0x1b, 0x7b, 0xf4, 0x3b, 0x62, 0x78, 0xd8, - 0x25, 0x8c, 0x04, 0xa7, 0xd4, 0x26, 0xc6, 0xe9, 0x6d, 0x8b, 0x70, 0x7c, 0x3b, 0xcb, 0x6b, 0x0f, - 0x02, 0x9f, 0xfb, 0xf0, 0x5a, 0x62, 0xd0, 0xce, 0x0a, 0x95, 0xc1, 0x46, 0xb3, 0xeb, 0xfb, 0xdd, - 0x3e, 0x31, 0x84, 0xb2, 0x15, 0x9e, 0x18, 0x4e, 0x18, 0x60, 0x4e, 0x7d, 0x4f, 0x9a, 0x6f, 0xe8, - 0x45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xa5, 0x79, 0xc5, 0x38, 0x54, 0x00, 0x3e, 0x98, 0x06, 0x60, 0xa2, - 0x1e, 0xb3, 0xc4, 0xa2, 0x24, 0x97, 0x73, 0xb0, 0x92, 0xaa, 0x3c, 0xd2, 0xc0, 0x95, 0xd4, 0xae, - 0x1b, 0x60, 0x9b, 0x74, 0x06, 0x24, 0xa0, 0xbe, 0xd3, 0x58, 0x9e, 0x87, 0xee, 0x40, 0xa1, 0x7b, - 0xbf, 0x88, 0x2e, 0xeb, 0x66, 0x12, 0x5c, 0x4e, 0x2a, 0xb0, 0xad, 0x25, 0xc2, 0x83, 0x48, 0x76, - 0x24, 0x44, 0xf0, 0x07, 0x0d, 0xac, 0xa7, 0x56, 0x38, 0xb4, 0xa3, 0xa0, 0x1d, 0xe2, 0x61, 0xab, - 0x4f, 0x9c, 0x46, 0x79, 0x53, 0xbb, 0xb9, 0x62, 0xee, 0x8f, 0x47, 0xfa, 0x4e, 0x31, 0x7c, 0x41, - 0x75, 0x12, 0x41, 0x51, 0x01, 0xa5, 0x27, 0xb4, 0x23, 0x45, 0xfb, 0x52, 0x02, 0x7f, 0xd7, 0xc0, - 0x14, 0x3b, 0xdb, 0x77, 0x5d, 0xca, 0x59, 0x7a, 0x90, 0x95, 0x79, 0xa5, 0xea, 0xa8, 0x52, 0x1d, - 0xcf, 0xc2, 0x5a, 0x74, 0x39, 0x1b, 0xf4, 0x84, 0xa6, 0x28, 0xa1, 0x5e, 0xcc, 0x60, 0x57, 0xaa, - 0x25, 0x07, 0x3d, 0x3d, 0x93, 0x80, 0x9c, 0x12, 0xdc, 0xcf, 0x64, 0xb2, 0xf2, 0xc2, 0x99, 0x14, - 0x5d, 0xce, 0xce, 0x64, 0x42, 0x73, 0x7a, 0x26, 0x48, 0xaa, 0x25, 0x99, 0xfc, 0xa2, 0x81, 0xd7, - 0x66, 0x95, 0xa5, 0x73, 0x42, 0x48, 0xa3, 0x3a, 0x6f, 0xae, 0x3f, 0x57, 0x39, 0x1c, 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c, 0xb4, 0x0c, 0x47, 0x46, 0x4b, 0x19, 0xb0, 0x01, 0x2a, 0x0e, - 0xe9, 0x13, 0x4e, 0xe4, 0xea, 0x5f, 0x41, 0x31, 0x09, 0xef, 0x82, 0xb2, 0xff, 0xad, 0x47, 0x02, - 0xd6, 0x28, 0x6f, 0x96, 0xf2, 0xe5, 0x92, 0xfc, 0xd8, 0xbd, 0xa2, 0x90, 0x52, 0x87, 0x07, 0x00, - 0x60, 0xce, 0x03, 0x6a, 0x85, 0x9c, 0x30, 0xb1, 0x25, 0x2f, 0x99, 0x37, 0x52, 0x7c, 0xa9, 0x2c, - 0x69, 0x84, 0x94, 0x83, 0x32, 0xa6, 0xad, 0x1e, 0xa8, 0xef, 0xc4, 0x3d, 0xb0, 0xef, 0xf1, 0x60, - 0x08, 0x21, 0x58, 0x8a, 0x5e, 0x59, 0xf2, 0xb8, 0x91, 0xf8, 0x86, 0x26, 0x58, 0x26, 0x91, 0x50, - 0xbd, 0x32, 0xde, 0x6c, 0x3f, 0xf5, 0x45, 0xd6, 0xfe, 0x0c, 0xbb, 0x24, 0xf1, 0x8a, 0xa4, 0x69, - 0xeb, 0xcf, 0x12, 0x58, 0xcd, 0x09, 0xe0, 0x97, 0xe0, 0x65, 0x91, 0x4e, 0x67, 0x10, 0x5a, 0x7d, - 0x6a, 0x77, 0x1e, 0x90, 0xa1, 0x6a, 0x32, 0x23, 0x7d, 0x1b, 0x08, 0x8d, 0x23, 0xa1, 0xf0, 0x09, - 0x19, 0xe6, 0xea, 0x91, 0x72, 0x51, 0x3d, 0xcf, 0x80, 0x47, 0x60, 0x55, 0xba, 0xc6, 0x8e, 0x13, - 0x10, 0xc6, 0x54, 0x3b, 0x6e, 0x8d, 0x47, 0xfa, 0x8d, 0x8c, 0xdf, 0x1d, 0x29, 0xcd, 0x79, 0x8d, - 0x79, 0xe8, 0x52, 0x96, 0x84, 0x57, 0x40, 0xb9, 0x47, 0x68, 0xb7, 0x27, 0x5f, 0x37, 0x4b, 0x48, - 0x51, 0x11, 0x9f, 0x71, 0xcc, 0x43, 0x26, 0xba, 0xa8, 0x8a, 0x14, 0x05, 0xf7, 0x00, 0x88, 0x47, - 0x8e, 0xca, 0x73, 0xaf, 0x9a, 0xd7, 0xc7, 0x23, 0xfd, 0xf5, 0x78, 0x7a, 0x85, 0xec, 0x70, 0x2f, - 0x9d, 0xd4, 0x98, 0x81, 0xaa, 0xf1, 0x77, 0x6e, 0xa0, 0xca, 0x53, 0x07, 0x6a, 0x2f, 0x37, 0x50, - 0x7b, 0xb9, 0x81, 0xca, 0xb6, 0x78, 0xe5, 0x7f, 0x6d, 0xf1, 0xd6, 0xd7, 0xa0, 0x1a, 0x9d, 0xed, - 0xec, 0x0e, 0xfa, 0x30, 0xdf, 0x41, 0xb7, 0x9e, 0xa1, 0x83, 0xe4, 0xf2, 0x89, 0xdb, 0xe7, 0x67, - 0x0d, 0x80, 0x94, 0x0b, 0xef, 0x81, 0x72, 0x1f, 0x73, 0xc2, 0xe2, 0xd7, 0x76, 0xfb, 0x99, 0x1d, - 0x0a, 0x8c, 0x48, 0x59, 0xc3, 0x8f, 0x40, 0xa5, 0x47, 0x19, 0xf7, 0x05, 0xb2, 0xd2, 0x73, 0x38, - 0x8a, 0xcd, 0x5b, 0xef, 0x82, 0x97, 0x0a, 0x32, 0x58, 0x4f, 0xf7, 0xa6, 0x58, 0x8f, 0x69, 0x0f, - 0x2d, 0x66, 0x7b, 0xa8, 0x15, 0x80, 0xea, 0x31, 0xed, 0x7a, 0x98, 0x87, 0x01, 0x81, 0x5b, 0xa0, - 0xc4, 0x68, 0x57, 0x0d, 0xc2, 0xfa, 0x78, 0xa4, 0x5f, 0x96, 0x07, 0xc2, 0x68, 0x37, 0x3e, 0x89, - 0xe8, 0x13, 0x45, 0x5a, 0x51, 0x7f, 0x0c, 0x42, 0x4b, 0x4c, 0xce, 0xc4, 0xc2, 0x1d, 0x84, 0x56, - 0x66, 0x62, 0x14, 0x85, 0xca, 0xea, 0xe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0xcc, 0x20, 0xbc, 0x47, - 0x02, 0x97, 0x7a, 0xdc, 0x78, 0x98, 0xfb, 0xf3, 0xe6, 0xc3, 0x01, 0x61, 0x56, 0x59, 0xec, 0x84, - 0x3b, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x2a, 0x84, 0x83, 0x21, 0x9f, 0x0f, 0x00, 0x00, + // 1325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x57, 0xdd, 0x6e, 0x1b, 0xc5, + 0x17, 0xcf, 0xc6, 0x89, 0x13, 0x4f, 0x1a, 0xff, 0xff, 0x1a, 0xd2, 0x76, 0x13, 0xa8, 0x37, 0x18, + 0x55, 0x6d, 0x55, 0xea, 0xa5, 0xf4, 0xa2, 0x7c, 0x08, 0xa1, 0x6c, 0xd2, 0xa6, 0x01, 0x01, 0x61, + 0xda, 0x1b, 0xb8, 0x31, 0xb3, 0xbb, 0x53, 0x7b, 0xa8, 0x77, 0xd7, 0xda, 0x99, 0x0d, 0x35, 0x5c, + 0xf1, 0x06, 0x95, 0xb8, 0xe9, 0x05, 0xe2, 0x05, 0x40, 0xe2, 0x31, 0xe8, 0x65, 0x2f, 0x11, 0x12, + 0x06, 0xb5, 0x6f, 0xe0, 0x27, 0x40, 0x3b, 0x1f, 0xfb, 0x65, 0xbb, 0x8e, 0xda, 0xbb, 0x3d, 0xe7, + 0x77, 0xce, 0x99, 0xdf, 0x9c, 0x39, 0xe7, 0xcc, 0x2c, 0xb0, 0x4f, 0x92, 0x81, 0x87, 0x43, 0xfa, + 0x3d, 0xb1, 0x43, 0x1c, 0x10, 0x46, 0xe2, 0x13, 0xea, 0x11, 0xfb, 0xe4, 0xba, 0x4b, 0x38, 0xbe, + 0x5e, 0xd4, 0x75, 0x86, 0x71, 0xc4, 0x23, 0x78, 0x21, 0x73, 0xe8, 0x14, 0x41, 0xe5, 0xb0, 0xd3, + 0xea, 0x45, 0x51, 0x6f, 0x40, 0x6c, 0x61, 0xec, 0x26, 0xf7, 0x6d, 0x3f, 0x89, 0x31, 0xa7, 0x51, + 0x28, 0xdd, 0x77, 0xac, 0x2a, 0xce, 0x69, 0x40, 0x18, 0xc7, 0xc1, 0x50, 0x19, 0x6c, 0xf5, 0xa2, + 0x5e, 0x24, 0x3e, 0xed, 0xf4, 0x4b, 0x69, 0x5b, 0x5e, 0xc4, 0x82, 0x88, 0xd9, 0x2e, 0x66, 0x39, + 0x39, 0x2f, 0xa2, 0x2a, 0x6c, 0xfb, 0xef, 0x4d, 0x50, 0x3f, 0xc6, 0x31, 0x0e, 0x18, 0xa4, 0x60, + 0x23, 0x26, 0x5e, 0x14, 0xfb, 0xdd, 0x98, 0x84, 0xdc, 0x34, 0x76, 0x8d, 0xcb, 0x1b, 0xef, 0x6e, + 0x77, 0x64, 0x80, 0x4e, 0x1a, 0x40, 0x93, 0xed, 0xec, 0x47, 0x34, 0x74, 0xae, 0x3d, 0x19, 0x5b, + 0x4b, 0x93, 0xb1, 0x75, 0xf1, 0x5b, 0x16, 0x85, 0x1f, 0xb4, 0x0b, 0xbe, 0xed, 0xdd, 0x11, 0x0e, + 0x06, 0x65, 0x15, 0x02, 0x52, 0x42, 0x24, 0xe4, 0xf0, 0x91, 0x01, 0xb6, 0x0a, 0x60, 0x57, 0xef, + 0xd5, 0x5c, 0x56, 0x8b, 0xca, 0xcd, 0x76, 0xf4, 0x66, 0x3b, 0x07, 0xca, 0xc0, 0xd9, 0x57, 0x8b, + 0xde, 0x9c, 0x5a, 0x34, 0x0b, 0x32, 0x63, 0xf5, 0x1c, 0x7b, 0xfc, 0x8f, 0x65, 0x20, 0x98, 0x53, + 0xd1, 0x81, 0x61, 0x02, 0x9a, 0x38, 0xe1, 0xfd, 0x28, 0xa6, 0x7c, 0x24, 0x13, 0x50, 0x5b, 0x94, + 0x80, 0x1b, 0x8a, 0xcb, 0x55, 0xc9, 0xa5, 0xec, 0xae, 0x59, 0x54, 0xb4, 0x68, 0x33, 0x53, 0x88, + 0x4c, 0xfc, 0x6c, 0x80, 0xf3, 0x65, 0x93, 0x3c, 0x19, 0x2b, 0x8b, 0x92, 0x71, 0xa4, 0x08, 0x7c, + 0x34, 0x8b, 0xc0, 0x54, 0x3e, 0xe6, 0xc1, 0x22, 0x25, 0x67, 0x4b, 0xb4, 0xb2, 0xac, 0x3c, 0x36, + 0xc0, 0xb9, 0xdc, 0xaf, 0x17, 0x63, 0x8f, 0x74, 0x87, 0x24, 0xa6, 0x91, 0x6f, 0xae, 0x2e, 0x62, + 0x77, 0xa8, 0xd8, 0x7d, 0x58, 0x65, 0x57, 0x0c, 0x33, 0x4d, 0xae, 0x84, 0x0a, 0x6e, 0x5b, 0x19, + 0x78, 0x98, 0x62, 0xc7, 0x02, 0x82, 0x3f, 0x1a, 0x60, 0x3b, 0xf7, 0xc2, 0x89, 0x97, 0x2e, 0xda, + 0x25, 0x21, 0x76, 0x07, 0xc4, 0x37, 0xeb, 0xbb, 0xc6, 0xe5, 0x75, 0xe7, 0xd6, 0x64, 0x6c, 0xed, + 0x55, 0x97, 0xaf, 0x98, 0x4e, 0x33, 0xa8, 0x1a, 0xa0, 0xfc, 0x84, 0xf6, 0x24, 0x74, 0x4b, 0x22, + 0xf0, 0x0f, 0x03, 0xcc, 0xf0, 0xf3, 0xa2, 0x20, 0xa0, 0x9c, 0xe5, 0x07, 0xb9, 0xb6, 0x28, 0x55, + 0x5d, 0x95, 0xaa, 0xbb, 0xf3, 0xb8, 0x56, 0x43, 0xce, 0x27, 0x3d, 0x65, 0x29, 0x52, 0x68, 0x55, + 0x77, 0xb0, 0x2f, 0xcd, 0xb2, 0x83, 0x9e, 0xbd, 0x93, 0x98, 0x9c, 0x10, 0x3c, 0x28, 0xec, 0x64, + 0xfd, 0x95, 0x77, 0x52, 0x0d, 0x39, 0x7f, 0x27, 0x53, 0x96, 0xb3, 0x77, 0x82, 0xa4, 0x59, 0xb6, + 0x93, 0x5f, 0x0d, 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90, 0xc6, 0x23, 0x19, 0x69, 0xa5, 0x1a, + 0x49, 0x82, 0xc5, 0x48, 0x05, 0x0d, 0x02, 0xb9, 0x00, 0x4d, 0xb0, 0xe6, 0x93, 0x01, 0xe1, 0x44, + 0x8e, 0xec, 0x75, 0xa4, 0x45, 0x78, 0x13, 0xd4, 0xa3, 0xef, 0x42, 0x12, 0x33, 0xb3, 0xbe, 0x5b, + 0x2b, 0x6f, 0x53, 0xea, 0x75, 0x68, 0x25, 0x21, 0x65, 0x0e, 0x0f, 0x01, 0xc0, 0x9c, 0xc7, 0xd4, + 0x4d, 0x38, 0x61, 0x62, 0xba, 0x95, 0xb8, 0xe5, 0x58, 0x76, 0x80, 0xb9, 0x06, 0x15, 0x5c, 0xe1, + 0x0d, 0xb0, 0x2a, 0xde, 0x42, 0xe6, 0xba, 0x20, 0x70, 0x61, 0x32, 0xb6, 0xb6, 0x65, 0x0c, 0xa1, + 0xd6, 0xee, 0x52, 0x40, 0xd2, 0xb6, 0xdd, 0x07, 0xcd, 0x3d, 0x7d, 0xe0, 0xb7, 0x42, 0x1e, 0x8f, + 0x20, 0x04, 0x2b, 0x29, 0x24, 0xcf, 0x16, 0x89, 0x6f, 0xe8, 0x80, 0x55, 0x92, 0x82, 0xea, 0x49, + 0xf1, 0x76, 0xe7, 0x85, 0xcf, 0xaf, 0xce, 0xe7, 0x38, 0x20, 0x59, 0x54, 0x24, 0x5d, 0xdb, 0x7f, + 0xd5, 0xc0, 0x66, 0x09, 0x80, 0x5f, 0x81, 0xff, 0x8b, 0x1c, 0x74, 0x87, 0x89, 0x3b, 0xa0, 0x5e, + 0xf7, 0x01, 0x19, 0xa9, 0x8a, 0xb2, 0xf3, 0x87, 0x80, 0xb0, 0x38, 0x16, 0x06, 0x9f, 0x92, 0x51, + 0x29, 0x89, 0xb9, 0x16, 0x35, 0xcb, 0x0a, 0x78, 0x0c, 0x36, 0x65, 0x68, 0xec, 0xfb, 0x31, 0x61, + 0x4c, 0xd5, 0xde, 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 0x92, 0x9d, 0x4f, 0x9e, 0x3c, 0x6b, 0x19, 0x4f, 0x9f, 0xb5, 0x8c, 0x7f, 0x9f, 0xb5, 0x8c, 0x47, + 0xcf, 0x5b, 0x4b, 0x4f, 0x9f, 0xb7, 0x96, 0xfe, 0x7c, 0xde, 0x5a, 0xfa, 0xfa, 0x9d, 0x1e, 0xe5, + 0xfd, 0xc4, 0xed, 0x78, 0x51, 0x60, 0xf3, 0x3e, 0x8e, 0x19, 0x65, 0x36, 0xe1, 0x7d, 0x12, 0x07, + 0x34, 0xe4, 0xf6, 0xc3, 0xd2, 0x6f, 0x36, 0x1f, 0x0d, 0x09, 0x73, 0xeb, 0x62, 0x26, 0xdc, 0xf8, + 0x2f, 0x00, 0x00, 0xff, 0xff, 0x7f, 0x95, 0x34, 0xdd, 0x8c, 0x0f, 0x00, 0x00, } func (m *Params) Marshal() (dAtA []byte, err error) { @@ -991,6 +1001,15 @@ func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Names[iNdEx]) + copy(dAtA[i:], m.Names[iNdEx]) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Names[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } if len(m.Attributes) > 0 { i -= len(m.Attributes) copy(dAtA[i:], m.Attributes) @@ -1017,22 +1036,20 @@ func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x28 } - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpiryTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime):]) - if err11 != nil { - return 0, err11 + if len(m.ExpiryTime) > 0 { + i -= len(m.ExpiryTime) + copy(dAtA[i:], m.ExpiryTime) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.ExpiryTime))) + i-- + dAtA[i] = 0x22 } - i -= n11 - i = encodeVarintNameservice(dAtA, i, uint64(n11)) - i-- - dAtA[i] = 0x22 - n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CreateTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CreateTime):]) - if err12 != nil { - return 0, err12 + if len(m.CreateTime) > 0 { + i -= len(m.CreateTime) + copy(dAtA[i:], m.CreateTime) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.CreateTime))) + i-- + dAtA[i] = 0x1a } - i -= n12 - i = encodeVarintNameservice(dAtA, i, uint64(n12)) - i-- - dAtA[i] = 0x1a if len(m.BondId) > 0 { i -= len(m.BondId) copy(dAtA[i:], m.BondId) @@ -1112,12 +1129,12 @@ func (m *NameAuthority) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l - n14, err14 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpiryTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime):]) - if err14 != nil { - return 0, err14 + n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.ExpiryTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime):]) + if err12 != nil { + return 0, err12 } - i -= n14 - i = encodeVarintNameservice(dAtA, i, uint64(n14)) + i -= n12 + i = encodeVarintNameservice(dAtA, i, uint64(n12)) i-- dAtA[i] = 0x3a if len(m.BondId) > 0 { @@ -1498,10 +1515,14 @@ func (m *Record) Size() (n int) { if l > 0 { n += 1 + l + sovNameservice(uint64(l)) } - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CreateTime) - n += 1 + l + sovNameservice(uint64(l)) - l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime) - n += 1 + l + sovNameservice(uint64(l)) + l = len(m.CreateTime) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.ExpiryTime) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } if m.Deleted { n += 2 } @@ -1515,6 +1536,12 @@ func (m *Record) Size() (n int) { if l > 0 { n += 1 + l + sovNameservice(uint64(l)) } + if len(m.Names) > 0 { + for _, s := range m.Names { + l = len(s) + n += 1 + l + sovNameservice(uint64(l)) + } + } return n } @@ -2200,7 +2227,7 @@ func (m *Record) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNameservice @@ -2210,30 +2237,29 @@ func (m *Record) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthNameservice } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthNameservice } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CreateTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.CreateTime = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 4: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExpiryTime", wireType) } - var msglen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNameservice @@ -2243,24 +2269,23 @@ func (m *Record) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - msglen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if msglen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthNameservice } - postIndex := iNdEx + msglen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthNameservice } if postIndex > l { return io.ErrUnexpectedEOF } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.ExpiryTime, dAtA[iNdEx:postIndex]); err != nil { - return err - } + m.ExpiryTime = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 5: if wireType != 0 { @@ -2318,7 +2343,7 @@ func (m *Record) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowNameservice @@ -2328,25 +2353,55 @@ func (m *Record) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthNameservice } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthNameservice } if postIndex > l { return io.ErrUnexpectedEOF } - m.Attributes = append(m.Attributes[:0], dAtA[iNdEx:postIndex]...) - if m.Attributes == nil { - m.Attributes = []byte{} + m.Attributes = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Names = append(m.Names, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex diff --git a/x/nameservice/types/query.pb.go b/x/nameservice/types/query.pb.go index 34185606..064ac626 100644 --- a/x/nameservice/types/query.pb.go +++ b/x/nameservice/types/query.pb.go @@ -5,6 +5,7 @@ package types import ( context "context" + encoding_binary "encoding/binary" fmt "fmt" github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" types "github.com/cosmos/cosmos-sdk/types" @@ -116,8 +117,10 @@ func (m *QueryParamsResponse) GetParams() *Params { // QueryListRecordsRequest is request type for nameservice records list type QueryListRecordsRequest struct { + Attributes []*QueryListRecordsRequest_KeyValueInput `protobuf:"bytes,1,rep,name=attributes,proto3" json:"attributes,omitempty"` + All bool `protobuf:"varint,2,opt,name=all,proto3" json:"all,omitempty"` // pagination defines an optional pagination for the request. - Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` + Pagination *query.PageRequest `protobuf:"bytes,3,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryListRecordsRequest) Reset() { *m = QueryListRecordsRequest{} } @@ -153,6 +156,20 @@ func (m *QueryListRecordsRequest) XXX_DiscardUnknown() { var xxx_messageInfo_QueryListRecordsRequest proto.InternalMessageInfo +func (m *QueryListRecordsRequest) GetAttributes() []*QueryListRecordsRequest_KeyValueInput { + if m != nil { + return m.Attributes + } + return nil +} + +func (m *QueryListRecordsRequest) GetAll() bool { + if m != nil { + return m.All + } + return false +} + func (m *QueryListRecordsRequest) GetPagination() *query.PageRequest { if m != nil { return m.Pagination @@ -160,6 +177,196 @@ func (m *QueryListRecordsRequest) GetPagination() *query.PageRequest { return nil } +type QueryListRecordsRequest_ReferenceInput struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryListRecordsRequest_ReferenceInput) Reset() { + *m = QueryListRecordsRequest_ReferenceInput{} +} +func (m *QueryListRecordsRequest_ReferenceInput) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest_ReferenceInput) ProtoMessage() {} +func (*QueryListRecordsRequest_ReferenceInput) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{2, 0} +} +func (m *QueryListRecordsRequest_ReferenceInput) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsRequest_ReferenceInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsRequest_ReferenceInput.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 *QueryListRecordsRequest_ReferenceInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest_ReferenceInput.Merge(m, src) +} +func (m *QueryListRecordsRequest_ReferenceInput) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsRequest_ReferenceInput) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest_ReferenceInput.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsRequest_ReferenceInput proto.InternalMessageInfo + +func (m *QueryListRecordsRequest_ReferenceInput) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +type QueryListRecordsRequest_ValueInput struct { + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` + String_ string `protobuf:"bytes,2,opt,name=string,proto3" json:"string,omitempty"` + Int int64 `protobuf:"varint,3,opt,name=int,proto3" json:"int,omitempty"` + Float float64 `protobuf:"fixed64,4,opt,name=float,proto3" json:"float,omitempty"` + Boolean bool `protobuf:"varint,5,opt,name=boolean,proto3" json:"boolean,omitempty"` + Reference *QueryListRecordsRequest_ReferenceInput `protobuf:"bytes,6,opt,name=reference,proto3" json:"reference,omitempty"` + Values []*QueryListRecordsRequest_ValueInput `protobuf:"bytes,7,rep,name=values,proto3" json:"values,omitempty"` +} + +func (m *QueryListRecordsRequest_ValueInput) Reset() { *m = QueryListRecordsRequest_ValueInput{} } +func (m *QueryListRecordsRequest_ValueInput) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest_ValueInput) ProtoMessage() {} +func (*QueryListRecordsRequest_ValueInput) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{2, 1} +} +func (m *QueryListRecordsRequest_ValueInput) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsRequest_ValueInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsRequest_ValueInput.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 *QueryListRecordsRequest_ValueInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest_ValueInput.Merge(m, src) +} +func (m *QueryListRecordsRequest_ValueInput) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsRequest_ValueInput) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest_ValueInput.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsRequest_ValueInput proto.InternalMessageInfo + +func (m *QueryListRecordsRequest_ValueInput) GetType() string { + if m != nil { + return m.Type + } + return "" +} + +func (m *QueryListRecordsRequest_ValueInput) GetString_() string { + if m != nil { + return m.String_ + } + return "" +} + +func (m *QueryListRecordsRequest_ValueInput) GetInt() int64 { + if m != nil { + return m.Int + } + return 0 +} + +func (m *QueryListRecordsRequest_ValueInput) GetFloat() float64 { + if m != nil { + return m.Float + } + return 0 +} + +func (m *QueryListRecordsRequest_ValueInput) GetBoolean() bool { + if m != nil { + return m.Boolean + } + return false +} + +func (m *QueryListRecordsRequest_ValueInput) GetReference() *QueryListRecordsRequest_ReferenceInput { + if m != nil { + return m.Reference + } + return nil +} + +func (m *QueryListRecordsRequest_ValueInput) GetValues() []*QueryListRecordsRequest_ValueInput { + if m != nil { + return m.Values + } + return nil +} + +type QueryListRecordsRequest_KeyValueInput struct { + Key string `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` + Value *QueryListRecordsRequest_ValueInput `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` +} + +func (m *QueryListRecordsRequest_KeyValueInput) Reset() { *m = QueryListRecordsRequest_KeyValueInput{} } +func (m *QueryListRecordsRequest_KeyValueInput) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest_KeyValueInput) ProtoMessage() {} +func (*QueryListRecordsRequest_KeyValueInput) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{2, 2} +} +func (m *QueryListRecordsRequest_KeyValueInput) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsRequest_KeyValueInput) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsRequest_KeyValueInput.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 *QueryListRecordsRequest_KeyValueInput) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest_KeyValueInput.Merge(m, src) +} +func (m *QueryListRecordsRequest_KeyValueInput) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsRequest_KeyValueInput) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest_KeyValueInput.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsRequest_KeyValueInput proto.InternalMessageInfo + +func (m *QueryListRecordsRequest_KeyValueInput) GetKey() string { + if m != nil { + return m.Key + } + return "" +} + +func (m *QueryListRecordsRequest_KeyValueInput) GetValue() *QueryListRecordsRequest_ValueInput { + if m != nil { + return m.Value + } + return nil +} + // QueryListRecordsResponse is response type for nameservice records list type QueryListRecordsResponse struct { Records []Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records"` @@ -737,23 +944,23 @@ func (m *QueryWhoisResponse) GetNameAuthority() NameAuthority { return NameAuthority{} } -// QueryLookupWrn is request type for LookupWrn -type QueryLookupWrn struct { - Wrn string `protobuf:"bytes,1,opt,name=wrn,proto3" json:"wrn,omitempty"` +// QueryLookupCrn is request type for LookupCrn +type QueryLookupCrn struct { + Crn string `protobuf:"bytes,1,opt,name=crn,proto3" json:"crn,omitempty"` } -func (m *QueryLookupWrn) Reset() { *m = QueryLookupWrn{} } -func (m *QueryLookupWrn) String() string { return proto.CompactTextString(m) } -func (*QueryLookupWrn) ProtoMessage() {} -func (*QueryLookupWrn) Descriptor() ([]byte, []int) { +func (m *QueryLookupCrn) Reset() { *m = QueryLookupCrn{} } +func (m *QueryLookupCrn) String() string { return proto.CompactTextString(m) } +func (*QueryLookupCrn) ProtoMessage() {} +func (*QueryLookupCrn) Descriptor() ([]byte, []int) { return fileDescriptor_73d2465766c8f876, []int{15} } -func (m *QueryLookupWrn) XXX_Unmarshal(b []byte) error { +func (m *QueryLookupCrn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryLookupWrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryLookupCrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryLookupWrn.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryLookupCrn.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -763,42 +970,42 @@ func (m *QueryLookupWrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, erro return b[:n], nil } } -func (m *QueryLookupWrn) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLookupWrn.Merge(m, src) +func (m *QueryLookupCrn) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLookupCrn.Merge(m, src) } -func (m *QueryLookupWrn) XXX_Size() int { +func (m *QueryLookupCrn) XXX_Size() int { return m.Size() } -func (m *QueryLookupWrn) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLookupWrn.DiscardUnknown(m) +func (m *QueryLookupCrn) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLookupCrn.DiscardUnknown(m) } -var xxx_messageInfo_QueryLookupWrn proto.InternalMessageInfo +var xxx_messageInfo_QueryLookupCrn proto.InternalMessageInfo -func (m *QueryLookupWrn) GetWrn() string { +func (m *QueryLookupCrn) GetCrn() string { if m != nil { - return m.Wrn + return m.Crn } return "" } -// QueryLookupWrnResponse is response type for QueryLookupWrn -type QueryLookupWrnResponse struct { +// QueryLookupCrnResponse is response type for QueryLookupCrn +type QueryLookupCrnResponse struct { Name *NameRecord `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } -func (m *QueryLookupWrnResponse) Reset() { *m = QueryLookupWrnResponse{} } -func (m *QueryLookupWrnResponse) String() string { return proto.CompactTextString(m) } -func (*QueryLookupWrnResponse) ProtoMessage() {} -func (*QueryLookupWrnResponse) Descriptor() ([]byte, []int) { +func (m *QueryLookupCrnResponse) Reset() { *m = QueryLookupCrnResponse{} } +func (m *QueryLookupCrnResponse) String() string { return proto.CompactTextString(m) } +func (*QueryLookupCrnResponse) ProtoMessage() {} +func (*QueryLookupCrnResponse) Descriptor() ([]byte, []int) { return fileDescriptor_73d2465766c8f876, []int{16} } -func (m *QueryLookupWrnResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryLookupCrnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryLookupWrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryLookupCrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryLookupWrnResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryLookupCrnResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -808,42 +1015,42 @@ func (m *QueryLookupWrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]by return b[:n], nil } } -func (m *QueryLookupWrnResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryLookupWrnResponse.Merge(m, src) +func (m *QueryLookupCrnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLookupCrnResponse.Merge(m, src) } -func (m *QueryLookupWrnResponse) XXX_Size() int { +func (m *QueryLookupCrnResponse) XXX_Size() int { return m.Size() } -func (m *QueryLookupWrnResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryLookupWrnResponse.DiscardUnknown(m) +func (m *QueryLookupCrnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLookupCrnResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryLookupWrnResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryLookupCrnResponse proto.InternalMessageInfo -func (m *QueryLookupWrnResponse) GetName() *NameRecord { +func (m *QueryLookupCrnResponse) GetName() *NameRecord { if m != nil { return m.Name } return nil } -// QueryResolveWrn is request type for ResolveWrn -type QueryResolveWrn struct { - Wrn string `protobuf:"bytes,1,opt,name=wrn,proto3" json:"wrn,omitempty"` +// QueryResolveCrn is request type for ResolveCrn +type QueryResolveCrn struct { + Crn string `protobuf:"bytes,1,opt,name=crn,proto3" json:"crn,omitempty"` } -func (m *QueryResolveWrn) Reset() { *m = QueryResolveWrn{} } -func (m *QueryResolveWrn) String() string { return proto.CompactTextString(m) } -func (*QueryResolveWrn) ProtoMessage() {} -func (*QueryResolveWrn) Descriptor() ([]byte, []int) { +func (m *QueryResolveCrn) Reset() { *m = QueryResolveCrn{} } +func (m *QueryResolveCrn) String() string { return proto.CompactTextString(m) } +func (*QueryResolveCrn) ProtoMessage() {} +func (*QueryResolveCrn) Descriptor() ([]byte, []int) { return fileDescriptor_73d2465766c8f876, []int{17} } -func (m *QueryResolveWrn) XXX_Unmarshal(b []byte) error { +func (m *QueryResolveCrn) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryResolveWrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResolveCrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryResolveWrn.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResolveCrn.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -853,42 +1060,42 @@ func (m *QueryResolveWrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, err return b[:n], nil } } -func (m *QueryResolveWrn) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResolveWrn.Merge(m, src) +func (m *QueryResolveCrn) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResolveCrn.Merge(m, src) } -func (m *QueryResolveWrn) XXX_Size() int { +func (m *QueryResolveCrn) XXX_Size() int { return m.Size() } -func (m *QueryResolveWrn) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResolveWrn.DiscardUnknown(m) +func (m *QueryResolveCrn) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResolveCrn.DiscardUnknown(m) } -var xxx_messageInfo_QueryResolveWrn proto.InternalMessageInfo +var xxx_messageInfo_QueryResolveCrn proto.InternalMessageInfo -func (m *QueryResolveWrn) GetWrn() string { +func (m *QueryResolveCrn) GetCrn() string { if m != nil { - return m.Wrn + return m.Crn } return "" } -// QueryResolveWrnResponse is response type for QueryResolveWrn -type QueryResolveWrnResponse struct { +// QueryResolveCrnResponse is response type for QueryResolveCrn +type QueryResolveCrnResponse struct { Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` } -func (m *QueryResolveWrnResponse) Reset() { *m = QueryResolveWrnResponse{} } -func (m *QueryResolveWrnResponse) String() string { return proto.CompactTextString(m) } -func (*QueryResolveWrnResponse) ProtoMessage() {} -func (*QueryResolveWrnResponse) Descriptor() ([]byte, []int) { +func (m *QueryResolveCrnResponse) Reset() { *m = QueryResolveCrnResponse{} } +func (m *QueryResolveCrnResponse) String() string { return proto.CompactTextString(m) } +func (*QueryResolveCrnResponse) ProtoMessage() {} +func (*QueryResolveCrnResponse) Descriptor() ([]byte, []int) { return fileDescriptor_73d2465766c8f876, []int{18} } -func (m *QueryResolveWrnResponse) XXX_Unmarshal(b []byte) error { +func (m *QueryResolveCrnResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *QueryResolveWrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *QueryResolveCrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_QueryResolveWrnResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_QueryResolveCrnResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -898,19 +1105,19 @@ func (m *QueryResolveWrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]b return b[:n], nil } } -func (m *QueryResolveWrnResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_QueryResolveWrnResponse.Merge(m, src) +func (m *QueryResolveCrnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResolveCrnResponse.Merge(m, src) } -func (m *QueryResolveWrnResponse) XXX_Size() int { +func (m *QueryResolveCrnResponse) XXX_Size() int { return m.Size() } -func (m *QueryResolveWrnResponse) XXX_DiscardUnknown() { - xxx_messageInfo_QueryResolveWrnResponse.DiscardUnknown(m) +func (m *QueryResolveCrnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResolveCrnResponse.DiscardUnknown(m) } -var xxx_messageInfo_QueryResolveWrnResponse proto.InternalMessageInfo +var xxx_messageInfo_QueryResolveCrnResponse proto.InternalMessageInfo -func (m *QueryResolveWrnResponse) GetRecord() *Record { +func (m *QueryResolveCrnResponse) GetRecord() *Record { if m != nil { return m.Record } @@ -1174,6 +1381,9 @@ func init() { proto.RegisterType((*QueryParamsRequest)(nil), "vulcanize.nameservice.v1beta1.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "vulcanize.nameservice.v1beta1.QueryParamsResponse") proto.RegisterType((*QueryListRecordsRequest)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest") + proto.RegisterType((*QueryListRecordsRequest_ReferenceInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ReferenceInput") + proto.RegisterType((*QueryListRecordsRequest_ValueInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.ValueInput") + proto.RegisterType((*QueryListRecordsRequest_KeyValueInput)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsRequest.KeyValueInput") proto.RegisterType((*QueryListRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsResponse") proto.RegisterType((*QueryRecordByIdRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIdRequest") proto.RegisterType((*QueryRecordByIdResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIdResponse") @@ -1186,10 +1396,10 @@ func init() { proto.RegisterType((*QueryListNameRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse") proto.RegisterType((*QueryWhoisRequest)(nil), "vulcanize.nameservice.v1beta1.QueryWhoisRequest") proto.RegisterType((*QueryWhoisResponse)(nil), "vulcanize.nameservice.v1beta1.QueryWhoisResponse") - proto.RegisterType((*QueryLookupWrn)(nil), "vulcanize.nameservice.v1beta1.QueryLookupWrn") - proto.RegisterType((*QueryLookupWrnResponse)(nil), "vulcanize.nameservice.v1beta1.QueryLookupWrnResponse") - proto.RegisterType((*QueryResolveWrn)(nil), "vulcanize.nameservice.v1beta1.QueryResolveWrn") - proto.RegisterType((*QueryResolveWrnResponse)(nil), "vulcanize.nameservice.v1beta1.QueryResolveWrnResponse") + proto.RegisterType((*QueryLookupCrn)(nil), "vulcanize.nameservice.v1beta1.QueryLookupCrn") + proto.RegisterType((*QueryLookupCrnResponse)(nil), "vulcanize.nameservice.v1beta1.QueryLookupCrnResponse") + proto.RegisterType((*QueryResolveCrn)(nil), "vulcanize.nameservice.v1beta1.QueryResolveCrn") + proto.RegisterType((*QueryResolveCrnResponse)(nil), "vulcanize.nameservice.v1beta1.QueryResolveCrnResponse") proto.RegisterType((*QueryGetRecordExpiryQueue)(nil), "vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueue") proto.RegisterType((*QueryGetRecordExpiryQueueResponse)(nil), "vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueueResponse") proto.RegisterType((*ExpiryQueueRecord)(nil), "vulcanize.nameservice.v1beta1.ExpiryQueueRecord") @@ -1202,84 +1412,96 @@ func init() { } var fileDescriptor_73d2465766c8f876 = []byte{ - // 1218 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4d, 0x6c, 0xdc, 0x44, - 0x14, 0xce, 0x6c, 0x9a, 0x94, 0xbc, 0x40, 0x42, 0x86, 0x88, 0xa6, 0x6e, 0xbb, 0x09, 0x6e, 0x7e, - 0x36, 0x90, 0xb5, 0xb3, 0x29, 0x4d, 0xdb, 0x54, 0x20, 0xb2, 0x21, 0x44, 0xad, 0x0a, 0x22, 0x06, - 0x29, 0x88, 0x03, 0x95, 0x77, 0x3d, 0x6c, 0x4c, 0x77, 0x3d, 0x5b, 0xff, 0xa4, 0x5d, 0xaa, 0x5e, - 0x38, 0xf4, 0x8c, 0xc4, 0x19, 0x04, 0x12, 0xa7, 0x4a, 0x85, 0x6b, 0xef, 0x5c, 0x22, 0x4e, 0x95, - 0xe0, 0xc0, 0x29, 0xa0, 0x04, 0x89, 0x7b, 0x8f, 0x9c, 0x90, 0x67, 0xc6, 0x8e, 0x9d, 0xdd, 0xc4, - 0xf6, 0x36, 0x95, 0x38, 0xc5, 0x9e, 0x79, 0xdf, 0x7b, 0xdf, 0xf7, 0xde, 0xcc, 0xf3, 0xdb, 0xc0, - 0xec, 0x96, 0x57, 0xaf, 0xea, 0x96, 0xf9, 0x25, 0x51, 0x2d, 0xbd, 0x41, 0x1c, 0x62, 0x6f, 0x99, - 0x55, 0xa2, 0x6e, 0x95, 0x2a, 0xc4, 0xd5, 0x4b, 0xea, 0x6d, 0x8f, 0xd8, 0x2d, 0xa5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- 0x39, 0x81, 0xb9, 0x74, 0x31, 0x93, 0x79, 0xe6, 0x46, 0x58, 0x67, 0x48, 0xfc, 0x23, 0x02, 0x88, - 0xcc, 0x2d, 0x4a, 0xba, 0x3b, 0x16, 0xd8, 0xa7, 0xed, 0x28, 0x07, 0x47, 0x9e, 0x0c, 0xed, 0x8f, - 0x41, 0xf1, 0x36, 0x82, 0xd1, 0x8e, 0xf3, 0xcd, 0xe5, 0x34, 0x04, 0x3a, 0x21, 0xa5, 0x77, 0xba, - 0x45, 0x86, 0x22, 0xde, 0x64, 0x22, 0x14, 0x3c, 0x97, 0xaa, 0xa9, 0x14, 0x09, 0x73, 0xe1, 0xb7, - 0x92, 0x53, 0x87, 0xcd, 0x13, 0x57, 0x53, 0x72, 0xea, 0x04, 0x96, 0x56, 0x9e, 0x01, 0x1c, 0x6a, - 0xba, 0xc4, 0x34, 0x95, 0xb0, 0x9a, 0xa0, 0x29, 0x1c, 0xf8, 0x85, 0xac, 0xf2, 0xf5, 0xed, 0xdd, - 0x3c, 0x7a, 0xb2, 0x9b, 0x47, 0x7f, 0xed, 0xe6, 0xd1, 0xd7, 0x7b, 0xf9, 0x9e, 0x27, 0x7b, 0xf9, - 0x9e, 0x3f, 0xf6, 0xf2, 0x3d, 0x9f, 0xce, 0x47, 0x7e, 0xae, 0xb9, 0x9b, 0xba, 0xed, 0x98, 0x8e, - 0x4a, 0xdc, 0x4d, 0x62, 0x37, 0x4c, 0xcb, 0x55, 0xef, 0xc6, 0xdc, 0xb3, 0x1f, 0x6f, 0x95, 0x7e, - 0xf6, 0x2f, 0xa6, 0x0b, 0xff, 0x05, 0x00, 0x00, 0xff, 0xff, 0x7c, 0xa9, 0x7f, 0x91, 0x5f, 0x13, - 0x00, 0x00, + // 1412 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0x4b, 0x6c, 0x1b, 0x45, + 0x18, 0xce, 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x9d, 0xaa, 0xb3, 0x3a, 0x13, 0x4b, 0x33, 0x5c, 0xa9, + 0xdd, 0x62, 0xd2, 0x42, 0xa4, 0xeb, 0x30, 0x57, 0x69, 0xe9, 0x53, 0x80, 0xaf, 0x84, 0x76, 0xdf, + 0xb1, 0x3d, 0xbb, 0xe9, 0x5b, 0xe4, 0x66, 0x40, 0x7c, 0xae, 0xbf, 0x07, 0x2f, 0xa4, 0x76, 0xfd, + 0x16, 0xa3, 0x3e, 0xc1, 0xaf, 0x42, 0xbe, 0x25, 0x76, 0x0a, 0x68, 0x06, 0x95, 0x26, 0xe6, 0x0f, + 0x19, 0x1b, 0x46, 0xc3, 0x50, 0xea, 0x4a, 0x49, 0xff, 0x31, 0x07, 0xbb, 0x85, 0xd9, 0xcb, 0xae, + 0xcf, 0x2d, 0xe2, 0x30, 0xaf, 0x16, 0x79, 0xc4, 0x35, 0x00, 0x9b, 0x73, 0xcf, 0xad, 0x06, 0x9c, + 0x84, 0xe6, 0x47, 0x4a, 0x13, 0xf3, 0x17, 0x7a, 0x98, 0x5f, 0xc7, 0x96, 0xf1, 0x26, 0x69, 0xbf, + 0x6f, 0x37, 0x02, 0x72, 0x91, 0xb6, 0x02, 0x6e, 0x25, 0xec, 0xe2, 0xe7, 0x61, 0xc4, 0x6e, 0x34, + 0x0a, 0xc3, 0x33, 0xa8, 0xb4, 0xcd, 0x0a, 0x97, 0xf8, 0x0d, 0x80, 0x4e, 0x24, 0x0b, 0x23, 0x82, + 0xd6, 0x61, 0x43, 0x06, 0xcd, 0x08, 0x83, 0x66, 0xc8, 0xec, 0x77, 0x28, 0xd5, 0x89, 0xf2, 0x63, + 0x25, 0x34, 0xb5, 0x19, 0x98, 0xb4, 0xc8, 0x75, 0xe2, 0x11, 0xea, 0x48, 0xbf, 0x78, 0x12, 0x86, + 0xdd, 0x9a, 0x08, 0xd4, 0xb8, 0x35, 0xec, 0xd6, 0xb4, 0x9f, 0x86, 0x01, 0x3a, 0xb0, 0x30, 0x86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, 0x7d, 0x61, + 0xd1, 0xb7, 0x22, 0xe7, 0x3a, 0x51, 0x05, 0x13, 0x76, 0x77, 0x88, 0x6c, 0xd5, 0x87, 0x29, 0x5d, + 0x98, 0x68, 0x33, 0x85, 0xb9, 0xaf, 0xbb, 0x1f, 0x95, 0xbc, 0x0b, 0x90, 0x13, 0x19, 0x52, 0x99, + 0x2b, 0xf5, 0xc8, 0x5c, 0x68, 0x62, 0x91, 0x72, 0xaf, 0xad, 0x4a, 0x53, 0x2a, 0x6f, 0x5d, 0x61, + 0x1e, 0x81, 0x9d, 0x02, 0xee, 0xd5, 0x65, 0xe6, 0xc6, 0xc1, 0xc0, 0x30, 0xda, 0x49, 0xbd, 0x25, + 0xd6, 0xfa, 0x97, 0x48, 0x8d, 0x10, 0x4a, 0x52, 0xd1, 0xb9, 0x87, 0x60, 0x32, 0x7c, 0x7f, 0xcd, + 0x0e, 0xf8, 0x32, 0xf3, 0x5c, 0xde, 0x56, 0xc1, 0x3b, 0x9a, 0x81, 0xd8, 0xf9, 0x48, 0xa7, 0x32, + 0xa7, 0x32, 0x3f, 0x2b, 0x33, 0x4f, 0x93, 0x2f, 0xa3, 0xfc, 0xa7, 0x37, 0xad, 0xed, 0xe9, 0x67, + 0x1d, 0x26, 0x65, 0xdc, 0x19, 0xbb, 0x11, 0xb4, 0x16, 0x3c, 0x1a, 0x7e, 0x3b, 0x1c, 0x8f, 0x46, + 0xdf, 0x0e, 0xc7, 0xa3, 0xfa, 0x55, 0x75, 0x6a, 0xc6, 0x32, 0x89, 0x91, 0xa7, 0xc3, 0x78, 0x62, + 0x7e, 0x36, 0x03, 0x76, 0x99, 0x57, 0x15, 0x9c, 0x03, 0xb0, 0x43, 0x9d, 0x46, 0x3e, 0x6b, 0xac, + 0x90, 0xee, 0xde, 0x3f, 0x88, 0x4f, 0xe2, 0x48, 0x28, 0x39, 0x71, 0x0d, 0x70, 0x12, 0xc7, 0x67, + 0xb0, 0x03, 0x7b, 0x84, 0xe5, 0x25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0x33, 0x26, 0xf1, 0x8a, 0x20, 0x61, 0xe0, 0xa3, 0x99, 0x0e, 0x95, 0x32, 0x11, 0x26, + 0xc2, 0xa3, 0x64, 0xf7, 0x7a, 0xf3, 0xc4, 0xb9, 0x8c, 0x98, 0xba, 0x29, 0x6b, 0x0b, 0x9b, 0x50, + 0x8e, 0x39, 0x9d, 0x12, 0x9c, 0xe6, 0xb0, 0xd9, 0x83, 0x53, 0x3c, 0xf0, 0x2b, 0x5a, 0x95, 0x4b, + 0x0f, 0x9f, 0x14, 0xd1, 0xa3, 0x27, 0x45, 0xf4, 0xe7, 0x93, 0x22, 0xfa, 0xfc, 0x69, 0x71, 0xe8, + 0xd1, 0xd3, 0xe2, 0xd0, 0xef, 0x4f, 0x8b, 0x43, 0x1f, 0x1d, 0x4b, 0x5c, 0xd7, 0xf8, 0xb2, 0xed, + 0xf9, 0xae, 0x6f, 0x12, 0xbe, 0x4c, 0xbc, 0xa6, 0x4b, 0xb9, 0x79, 0x2b, 0x65, 0x5e, 0x5c, 0xde, + 0xaa, 0x79, 0xf1, 0xb7, 0xe5, 0xf1, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0xb9, 0x17, 0xf0, 0x11, + 0xb3, 0x15, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1308,10 +1530,10 @@ type QueryClient interface { ListNameRecords(ctx context.Context, in *QueryListNameRecordsRequest, opts ...grpc.CallOption) (*QueryListNameRecordsResponse, error) // Whois method retrieve the name authority info Whois(ctx context.Context, in *QueryWhoisRequest, opts ...grpc.CallOption) (*QueryWhoisResponse, error) - // LookupWrn - LookupWrn(ctx context.Context, in *QueryLookupWrn, opts ...grpc.CallOption) (*QueryLookupWrnResponse, error) - // ResolveWrn - ResolveWrn(ctx context.Context, in *QueryResolveWrn, opts ...grpc.CallOption) (*QueryResolveWrnResponse, error) + // LookupCrn + LookupCrn(ctx context.Context, in *QueryLookupCrn, opts ...grpc.CallOption) (*QueryLookupCrnResponse, error) + // ResolveCrn + ResolveCrn(ctx context.Context, in *QueryResolveCrn, opts ...grpc.CallOption) (*QueryResolveCrnResponse, error) // GetRecordExpiryQueue GetRecordExpiryQueue(ctx context.Context, in *QueryGetRecordExpiryQueue, opts ...grpc.CallOption) (*QueryGetRecordExpiryQueueResponse, error) // GetAuthorityExpiryQueue @@ -1389,18 +1611,18 @@ func (c *queryClient) Whois(ctx context.Context, in *QueryWhoisRequest, opts ... return out, nil } -func (c *queryClient) LookupWrn(ctx context.Context, in *QueryLookupWrn, opts ...grpc.CallOption) (*QueryLookupWrnResponse, error) { - out := new(QueryLookupWrnResponse) - err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/LookupWrn", in, out, opts...) +func (c *queryClient) LookupCrn(ctx context.Context, in *QueryLookupCrn, opts ...grpc.CallOption) (*QueryLookupCrnResponse, error) { + out := new(QueryLookupCrnResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/LookupCrn", in, out, opts...) if err != nil { return nil, err } return out, nil } -func (c *queryClient) ResolveWrn(ctx context.Context, in *QueryResolveWrn, opts ...grpc.CallOption) (*QueryResolveWrnResponse, error) { - out := new(QueryResolveWrnResponse) - err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/ResolveWrn", in, out, opts...) +func (c *queryClient) ResolveCrn(ctx context.Context, in *QueryResolveCrn, opts ...grpc.CallOption) (*QueryResolveCrnResponse, error) { + out := new(QueryResolveCrnResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/ResolveCrn", in, out, opts...) if err != nil { return nil, err } @@ -1441,10 +1663,10 @@ type QueryServer interface { ListNameRecords(context.Context, *QueryListNameRecordsRequest) (*QueryListNameRecordsResponse, error) // Whois method retrieve the name authority info Whois(context.Context, *QueryWhoisRequest) (*QueryWhoisResponse, error) - // LookupWrn - LookupWrn(context.Context, *QueryLookupWrn) (*QueryLookupWrnResponse, error) - // ResolveWrn - ResolveWrn(context.Context, *QueryResolveWrn) (*QueryResolveWrnResponse, error) + // LookupCrn + LookupCrn(context.Context, *QueryLookupCrn) (*QueryLookupCrnResponse, error) + // ResolveCrn + ResolveCrn(context.Context, *QueryResolveCrn) (*QueryResolveCrnResponse, error) // GetRecordExpiryQueue GetRecordExpiryQueue(context.Context, *QueryGetRecordExpiryQueue) (*QueryGetRecordExpiryQueueResponse, error) // GetAuthorityExpiryQueue @@ -1476,11 +1698,11 @@ func (*UnimplementedQueryServer) ListNameRecords(ctx context.Context, req *Query func (*UnimplementedQueryServer) Whois(ctx context.Context, req *QueryWhoisRequest) (*QueryWhoisResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Whois not implemented") } -func (*UnimplementedQueryServer) LookupWrn(ctx context.Context, req *QueryLookupWrn) (*QueryLookupWrnResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method LookupWrn not implemented") +func (*UnimplementedQueryServer) LookupCrn(ctx context.Context, req *QueryLookupCrn) (*QueryLookupCrnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LookupCrn not implemented") } -func (*UnimplementedQueryServer) ResolveWrn(ctx context.Context, req *QueryResolveWrn) (*QueryResolveWrnResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method ResolveWrn not implemented") +func (*UnimplementedQueryServer) ResolveCrn(ctx context.Context, req *QueryResolveCrn) (*QueryResolveCrnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResolveCrn not implemented") } func (*UnimplementedQueryServer) GetRecordExpiryQueue(ctx context.Context, req *QueryGetRecordExpiryQueue) (*QueryGetRecordExpiryQueueResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetRecordExpiryQueue not implemented") @@ -1619,38 +1841,38 @@ func _Query_Whois_Handler(srv interface{}, ctx context.Context, dec func(interfa return interceptor(ctx, in, info, handler) } -func _Query_LookupWrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryLookupWrn) +func _Query_LookupCrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryLookupCrn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).LookupWrn(ctx, in) + return srv.(QueryServer).LookupCrn(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/vulcanize.nameservice.v1beta1.Query/LookupWrn", + FullMethod: "/vulcanize.nameservice.v1beta1.Query/LookupCrn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).LookupWrn(ctx, req.(*QueryLookupWrn)) + return srv.(QueryServer).LookupCrn(ctx, req.(*QueryLookupCrn)) } return interceptor(ctx, in, info, handler) } -func _Query_ResolveWrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(QueryResolveWrn) +func _Query_ResolveCrn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryResolveCrn) if err := dec(in); err != nil { return nil, err } if interceptor == nil { - return srv.(QueryServer).ResolveWrn(ctx, in) + return srv.(QueryServer).ResolveCrn(ctx, in) } info := &grpc.UnaryServerInfo{ Server: srv, - FullMethod: "/vulcanize.nameservice.v1beta1.Query/ResolveWrn", + FullMethod: "/vulcanize.nameservice.v1beta1.Query/ResolveCrn", } handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(QueryServer).ResolveWrn(ctx, req.(*QueryResolveWrn)) + return srv.(QueryServer).ResolveCrn(ctx, req.(*QueryResolveCrn)) } return interceptor(ctx, in, info, handler) } @@ -1724,12 +1946,12 @@ var _Query_serviceDesc = grpc.ServiceDesc{ Handler: _Query_Whois_Handler, }, { - MethodName: "LookupWrn", - Handler: _Query_LookupWrn_Handler, + MethodName: "LookupCrn", + Handler: _Query_LookupCrn_Handler, }, { - MethodName: "ResolveWrn", - Handler: _Query_ResolveWrn_Handler, + MethodName: "ResolveCrn", + Handler: _Query_ResolveCrn_Handler, }, { MethodName: "GetRecordExpiryQueue", @@ -1832,6 +2054,186 @@ func (m *QueryListRecordsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) i = encodeVarintQuery(dAtA, i, uint64(size)) } i-- + dAtA[i] = 0x1a + } + if m.All { + i-- + if m.All { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.Attributes) > 0 { + for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *QueryListRecordsRequest_ReferenceInput) 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 *QueryListRecordsRequest_ReferenceInput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ReferenceInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryListRecordsRequest_ValueInput) 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 *QueryListRecordsRequest_ValueInput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_ValueInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Values) > 0 { + for iNdEx := len(m.Values) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Values[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if m.Reference != nil { + { + size, err := m.Reference.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if m.Boolean { + i-- + if m.Boolean { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + if m.Float != 0 { + i -= 8 + encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Float)))) + i-- + dAtA[i] = 0x21 + } + if m.Int != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Int)) + i-- + dAtA[i] = 0x18 + } + if len(m.String_) > 0 { + i -= len(m.String_) + copy(dAtA[i:], m.String_) + i = encodeVarintQuery(dAtA, i, uint64(len(m.String_))) + i-- + dAtA[i] = 0x12 + } + if len(m.Type) > 0 { + i -= len(m.Type) + copy(dAtA[i:], m.Type) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Type))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryListRecordsRequest_KeyValueInput) 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 *QueryListRecordsRequest_KeyValueInput) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest_KeyValueInput) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Value != nil { + { + size, err := m.Value.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Key) > 0 { + i -= len(m.Key) + copy(dAtA[i:], m.Key) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Key))) + i-- dAtA[i] = 0xa } return len(dAtA) - i, nil @@ -2291,7 +2693,7 @@ func (m *QueryWhoisResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *QueryLookupWrn) Marshal() (dAtA []byte, err error) { +func (m *QueryLookupCrn) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2301,27 +2703,27 @@ func (m *QueryLookupWrn) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryLookupWrn) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLookupCrn) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryLookupWrn) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLookupCrn) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Wrn) > 0 { - i -= len(m.Wrn) - copy(dAtA[i:], m.Wrn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Wrn))) + if len(m.Crn) > 0 { + i -= len(m.Crn) + copy(dAtA[i:], m.Crn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Crn))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryLookupWrnResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryLookupCrnResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2331,12 +2733,12 @@ func (m *QueryLookupWrnResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryLookupWrnResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryLookupCrnResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryLookupWrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryLookupCrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2356,7 +2758,7 @@ func (m *QueryLookupWrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) return len(dAtA) - i, nil } -func (m *QueryResolveWrn) Marshal() (dAtA []byte, err error) { +func (m *QueryResolveCrn) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2366,27 +2768,27 @@ func (m *QueryResolveWrn) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryResolveWrn) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResolveCrn) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryResolveWrn) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResolveCrn) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Wrn) > 0 { - i -= len(m.Wrn) - copy(dAtA[i:], m.Wrn) - i = encodeVarintQuery(dAtA, i, uint64(len(m.Wrn))) + if len(m.Crn) > 0 { + i -= len(m.Crn) + copy(dAtA[i:], m.Crn) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Crn))) i-- dAtA[i] = 0xa } return len(dAtA) - i, nil } -func (m *QueryResolveWrnResponse) Marshal() (dAtA []byte, err error) { +func (m *QueryResolveCrnResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -2396,12 +2798,12 @@ func (m *QueryResolveWrnResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *QueryResolveWrnResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *QueryResolveCrnResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *QueryResolveWrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *QueryResolveCrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -2667,6 +3069,15 @@ func (m *QueryListRecordsRequest) Size() (n int) { } var l int _ = l + if len(m.Attributes) > 0 { + for _, e := range m.Attributes { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.All { + n += 2 + } if m.Pagination != nil { l = m.Pagination.Size() n += 1 + l + sovQuery(uint64(l)) @@ -2674,6 +3085,72 @@ func (m *QueryListRecordsRequest) Size() (n int) { return n } +func (m *QueryListRecordsRequest_ReferenceInput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryListRecordsRequest_ValueInput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Type) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + l = len(m.String_) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Int != 0 { + n += 1 + sovQuery(uint64(m.Int)) + } + if m.Float != 0 { + n += 9 + } + if m.Boolean { + n += 2 + } + if m.Reference != nil { + l = m.Reference.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Values) > 0 { + for _, e := range m.Values { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryListRecordsRequest_KeyValueInput) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Key) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Value != nil { + l = m.Value.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func (m *QueryListRecordsResponse) Size() (n int) { if m == nil { return 0 @@ -2852,20 +3329,20 @@ func (m *QueryWhoisResponse) Size() (n int) { return n } -func (m *QueryLookupWrn) Size() (n int) { +func (m *QueryLookupCrn) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Wrn) + l = len(m.Crn) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryLookupWrnResponse) Size() (n int) { +func (m *QueryLookupCrnResponse) Size() (n int) { if m == nil { return 0 } @@ -2878,20 +3355,20 @@ func (m *QueryLookupWrnResponse) Size() (n int) { return n } -func (m *QueryResolveWrn) Size() (n int) { +func (m *QueryResolveCrn) Size() (n int) { if m == nil { return 0 } var l int _ = l - l = len(m.Wrn) + l = len(m.Crn) if l > 0 { n += 1 + l + sovQuery(uint64(l)) } return n } -func (m *QueryResolveWrnResponse) Size() (n int) { +func (m *QueryResolveCrnResponse) Size() (n int) { if m == nil { return 0 } @@ -3159,6 +3636,60 @@ func (m *QueryListRecordsRequest) Unmarshal(dAtA []byte) error { } switch fieldNum { case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Attributes = append(m.Attributes, &QueryListRecordsRequest_KeyValueInput{}) + if err := m.Attributes[len(m.Attributes)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field All", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.All = bool(v != 0) + case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) } @@ -3215,6 +3746,440 @@ func (m *QueryListRecordsRequest) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryListRecordsRequest_ReferenceInput) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ReferenceInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ReferenceInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListRecordsRequest_ValueInput) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ValueInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ValueInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Type", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Type = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field String_", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.String_ = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Int", wireType) + } + m.Int = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Int |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 1 { + return fmt.Errorf("proto: wrong wireType = %d for field Float", wireType) + } + var v uint64 + if (iNdEx + 8) > l { + return io.ErrUnexpectedEOF + } + v = uint64(encoding_binary.LittleEndian.Uint64(dAtA[iNdEx:])) + iNdEx += 8 + m.Float = float64(math.Float64frombits(v)) + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Boolean", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Boolean = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Reference", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Reference == nil { + m.Reference = &QueryListRecordsRequest_ReferenceInput{} + } + if err := m.Reference.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Values", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Values = append(m.Values, &QueryListRecordsRequest_ValueInput{}) + if err := m.Values[len(m.Values)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListRecordsRequest_KeyValueInput) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: KeyValueInput: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: KeyValueInput: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Key", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Key = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Value == nil { + m.Value = &QueryListRecordsRequest_ValueInput{} + } + if err := m.Value.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *QueryListRecordsResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4359,7 +5324,7 @@ func (m *QueryWhoisResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLookupWrn) Unmarshal(dAtA []byte) error { +func (m *QueryLookupCrn) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4382,15 +5347,15 @@ func (m *QueryLookupWrn) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLookupWrn: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLookupCrn: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLookupWrn: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLookupCrn: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Wrn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Crn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4418,7 +5383,7 @@ func (m *QueryLookupWrn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Wrn = string(dAtA[iNdEx:postIndex]) + m.Crn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4441,7 +5406,7 @@ func (m *QueryLookupWrn) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryLookupWrnResponse) Unmarshal(dAtA []byte) error { +func (m *QueryLookupCrnResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4464,10 +5429,10 @@ func (m *QueryLookupWrnResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryLookupWrnResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryLookupCrnResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryLookupWrnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryLookupCrnResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -4527,7 +5492,7 @@ func (m *QueryLookupWrnResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryResolveWrn) Unmarshal(dAtA []byte) error { +func (m *QueryResolveCrn) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4550,15 +5515,15 @@ func (m *QueryResolveWrn) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryResolveWrn: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResolveCrn: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResolveWrn: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResolveCrn: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Wrn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Crn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -4586,7 +5551,7 @@ func (m *QueryResolveWrn) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Wrn = string(dAtA[iNdEx:postIndex]) + m.Crn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -4609,7 +5574,7 @@ func (m *QueryResolveWrn) Unmarshal(dAtA []byte) error { } return nil } -func (m *QueryResolveWrnResponse) Unmarshal(dAtA []byte) error { +func (m *QueryResolveCrnResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -4632,10 +5597,10 @@ func (m *QueryResolveWrnResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: QueryResolveWrnResponse: wiretype end group for non-group") + return fmt.Errorf("proto: QueryResolveCrnResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: QueryResolveWrnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: QueryResolveCrnResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: diff --git a/x/nameservice/types/query.pb.gw.go b/x/nameservice/types/query.pb.gw.go index 4cbfa343..a6094b92 100644 --- a/x/nameservice/types/query.pb.gw.go +++ b/x/nameservice/types/query.pb.gw.go @@ -320,73 +320,73 @@ func local_request_Query_Whois_0(ctx context.Context, marshaler runtime.Marshale } var ( - filter_Query_LookupWrn_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_LookupCrn_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_LookupWrn_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLookupWrn +func request_Query_LookupCrn_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLookupCrn 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_LookupWrn_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LookupCrn_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.LookupWrn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.LookupCrn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_LookupWrn_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryLookupWrn +func local_request_Query_LookupCrn_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryLookupCrn 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_LookupWrn_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LookupCrn_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.LookupWrn(ctx, &protoReq) + msg, err := server.LookupCrn(ctx, &protoReq) return msg, metadata, err } var ( - filter_Query_ResolveWrn_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} + filter_Query_ResolveCrn_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} ) -func request_Query_ResolveWrn_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryResolveWrn +func request_Query_ResolveCrn_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryResolveCrn 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_ResolveWrn_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ResolveCrn_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := client.ResolveWrn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + msg, err := client.ResolveCrn(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) return msg, metadata, err } -func local_request_Query_ResolveWrn_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryResolveWrn +func local_request_Query_ResolveCrn_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryResolveCrn 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_ResolveWrn_0); err != nil { + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_ResolveCrn_0); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } - msg, err := server.ResolveWrn(ctx, &protoReq) + msg, err := server.ResolveCrn(ctx, &protoReq) return msg, metadata, err } @@ -609,7 +609,7 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) - mux.Handle("GET", pattern_Query_LookupWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_LookupCrn_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) @@ -618,18 +618,18 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_LookupWrn_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_LookupCrn_0(rctx, inboundMarshaler, server, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_LookupWrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_LookupCrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ResolveWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ResolveCrn_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) @@ -638,14 +638,14 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := local_request_Query_ResolveWrn_0(rctx, inboundMarshaler, server, req, pathParams) + resp, md, err := local_request_Query_ResolveCrn_0(rctx, inboundMarshaler, server, req, pathParams) ctx = runtime.NewServerMetadataContext(ctx, md) if err != nil { runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - forward_Query_ResolveWrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ResolveCrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -870,7 +870,7 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) - mux.Handle("GET", pattern_Query_LookupWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_LookupCrn_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) @@ -879,18 +879,18 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_LookupWrn_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_LookupCrn_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_LookupWrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_LookupCrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) - mux.Handle("GET", pattern_Query_ResolveWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + mux.Handle("GET", pattern_Query_ResolveCrn_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) @@ -899,14 +899,14 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) return } - resp, md, err := request_Query_ResolveWrn_0(rctx, inboundMarshaler, client, req, pathParams) + resp, md, err := request_Query_ResolveCrn_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_ResolveWrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + forward_Query_ResolveCrn_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) @@ -968,9 +968,9 @@ var ( pattern_Query_Whois_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"vulcanize", "nameservice", "v1beta1", "whois", "name"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_LookupWrn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "lookup"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_LookupCrn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "lookup"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_ResolveWrn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "resolve"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_ResolveCrn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "resolve"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_GetRecordExpiryQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"vulcanize", "nameservice", "v1beta1", "record-expiry"}, "", runtime.AssumeColonVerbOpt(true))) @@ -992,9 +992,9 @@ var ( forward_Query_Whois_0 = runtime.ForwardResponseMessage - forward_Query_LookupWrn_0 = runtime.ForwardResponseMessage + forward_Query_LookupCrn_0 = runtime.ForwardResponseMessage - forward_Query_ResolveWrn_0 = runtime.ForwardResponseMessage + forward_Query_ResolveCrn_0 = runtime.ForwardResponseMessage forward_Query_GetRecordExpiryQueue_0 = runtime.ForwardResponseMessage diff --git a/x/nameservice/types/record_msg.go b/x/nameservice/types/record_msg.go index 15f73492..c0dd6963 100644 --- a/x/nameservice/types/record_msg.go +++ b/x/nameservice/types/record_msg.go @@ -23,6 +23,12 @@ func NewMsgSetRecord(payload Payload, bondID string, signer sdk.AccAddress) MsgS } } +// Route Implements Msg. +func (msg MsgSetRecord) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgSetRecord) Type() string { return "set-record" } + func (msg MsgSetRecord) ValidateBasic() error { if len(msg.Signer) == 0 { return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) diff --git a/x/nameservice/types/tx.pb.go b/x/nameservice/types/tx.pb.go index 909f765b..40138fb8 100644 --- a/x/nameservice/types/tx.pb.go +++ b/x/nameservice/types/tx.pb.go @@ -91,6 +91,7 @@ func (m *MsgSetRecord) GetPayload() Payload { // MsgSetRecordResponse type MsgSetRecordResponse struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` } func (m *MsgSetRecordResponse) Reset() { *m = MsgSetRecordResponse{} } @@ -126,6 +127,13 @@ func (m *MsgSetRecordResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetRecordResponse proto.InternalMessageInfo +func (m *MsgSetRecordResponse) GetId() string { + if m != nil { + return m.Id + } + return "" +} + // Payload type Payload struct { Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` @@ -181,7 +189,7 @@ func (m *Payload) GetSignatures() []Signature { // MsgSetName type MsgSetName struct { - Wrn string `protobuf:"bytes,1,opt,name=wrn,proto3" json:"wrn,omitempty"` + Crn string `protobuf:"bytes,1,opt,name=crn,proto3" json:"crn,omitempty"` Cid string `protobuf:"bytes,2,opt,name=cid,proto3" json:"cid,omitempty"` Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` } @@ -219,9 +227,9 @@ func (m *MsgSetName) XXX_DiscardUnknown() { var xxx_messageInfo_MsgSetName proto.InternalMessageInfo -func (m *MsgSetName) GetWrn() string { +func (m *MsgSetName) GetCrn() string { if m != nil { - return m.Wrn + return m.Crn } return "" } @@ -476,7 +484,7 @@ var xxx_messageInfo_MsgSetAuthorityBondResponse proto.InternalMessageInfo // MsgDeleteNameAuthority is SDK message for DeleteNameAuthority type MsgDeleteNameAuthority struct { - Wrn string `protobuf:"bytes,1,opt,name=wrn,proto3" json:"wrn,omitempty"` + Crn string `protobuf:"bytes,1,opt,name=crn,proto3" json:"crn,omitempty"` Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` } @@ -513,9 +521,9 @@ func (m *MsgDeleteNameAuthority) XXX_DiscardUnknown() { var xxx_messageInfo_MsgDeleteNameAuthority proto.InternalMessageInfo -func (m *MsgDeleteNameAuthority) GetWrn() string { +func (m *MsgDeleteNameAuthority) GetCrn() string { if m != nil { - return m.Wrn + return m.Crn } return "" } @@ -1059,62 +1067,62 @@ func init() { } var fileDescriptor_b66a805dda801ce9 = []byte{ - // 866 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcd, 0x6e, 0xd3, 0x4c, - 0x14, 0x8d, 0x9b, 0x7e, 0xc9, 0x97, 0x1b, 0xa8, 0x5a, 0x13, 0xaa, 0xe0, 0x52, 0x3b, 0xb8, 0x6a, - 0x15, 0x54, 0x11, 0xb7, 0x29, 0x88, 0xaa, 0x50, 0x89, 0x46, 0x80, 0x00, 0x29, 0x08, 0xb9, 0x0b, - 0x24, 0x36, 0x95, 0x13, 0x8f, 0x1c, 0x57, 0x89, 0x27, 0xf2, 0x38, 0x4d, 0x43, 0x25, 0xd8, 0x20, - 0x21, 0xb1, 0xe2, 0x29, 0x10, 0x2f, 0x81, 0xd8, 0x76, 0xd9, 0x25, 0xab, 0x08, 0xb5, 0x6f, 0x90, - 0x2d, 0x1b, 0xe4, 0x9f, 0xd8, 0xe3, 0xfc, 0x34, 0x3f, 0x74, 0x37, 0x9e, 0xb9, 0xe7, 0x9e, 0x73, - 0xcf, 0xcc, 0xf5, 0x0c, 0xac, 0x1d, 0x35, 0xaa, 0x65, 0xc5, 0xd0, 0xdf, 0x23, 0xc9, 0x50, 0x6a, - 0x88, 0x20, 0xf3, 0x48, 0x2f, 0x23, 0xe9, 0x68, 0xb3, 0x84, 0x2c, 0x65, 0x53, 0xb2, 0x8e, 0x73, - 0x75, 0x13, 0x5b, 0x98, 0x5d, 0xf6, 0xe3, 0x72, 0x54, 0x5c, 0xce, 0x8b, 0xe3, 0x52, 0x1a, 0xd6, - 0xb0, 0x13, 0x29, 0xd9, 0x23, 0x17, 0xc4, 0x49, 0x97, 0x27, 0xa7, 0x13, 0x39, 0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 0x6d, 0xb6, 0x7e, 0xc5, 0x45, 0x0c, - 0x73, 0x73, 0x09, 0x6e, 0xf5, 0xd1, 0xf9, 0x5a, 0x2a, 0xce, 0xaf, 0x28, 0x58, 0x74, 0xfd, 0x26, - 0x57, 0xff, 0xf3, 0x14, 0x79, 0xb8, 0x3d, 0x88, 0xc9, 0x57, 0xf2, 0x83, 0x81, 0x9b, 0xce, 0xae, - 0xef, 0xf5, 0x6a, 0x79, 0x06, 0x49, 0x03, 0x35, 0x0f, 0xc2, 0x7a, 0x56, 0x3b, 0x6d, 0xe1, 0x8e, - 0xab, 0xc7, 0x40, 0xcd, 0x42, 0x48, 0x52, 0x30, 0x21, 0x27, 0xfc, 0xb1, 0x9d, 0x06, 0x57, 0xd5, - 0x83, 0xf0, 0x46, 0x53, 0x69, 0x70, 0x55, 0x0d, 0xa7, 0x09, 0x26, 0xe4, 0x84, 0x3f, 0x1e, 0xba, - 0xe3, 0x02, 0x2c, 0x0f, 0x94, 0xdf, 0x2d, 0x30, 0xff, 0x27, 0x01, 0xd1, 0x22, 0xd1, 0x58, 0x0c, - 0x89, 0xe0, 0x92, 0x5a, 0x1f, 0xf1, 0x4f, 0xa6, 0xef, 0x09, 0x6e, 0x6b, 0x82, 0x60, 0xdf, 0xd7, - 0x08, 0xdb, 0x80, 0x24, 0xdd, 0xb7, 0xf7, 0x46, 0x67, 0xa1, 0xc2, 0xb9, 0x07, 0x13, 0x85, 0x53, - 0xb4, 0x27, 0x70, 0x3d, 0xdc, 0xa7, 0xd2, 0xe8, 0x4c, 0x21, 0x00, 0xf7, 0x70, 0x42, 0x00, 0x45, - 0xfe, 0x01, 0xe6, 0x7a, 0x1a, 0x6c, 0x63, 0x74, 0xb2, 0x30, 0x82, 0xdb, 0x9e, 0x14, 0x41, 0xf1, - 0x7f, 0x66, 0x60, 0xa1, 0xbf, 0xab, 0xb6, 0x26, 0xc9, 0xe8, 0x81, 0xb8, 0x47, 0x53, 0x80, 0x28, - 0x25, 0x5f, 0x18, 0x60, 0x07, 0x34, 0xd5, 0xfd, 0x71, 0xb6, 0xb5, 0x17, 0xc5, 0x3d, 0x9e, 0x06, - 0x45, 0x89, 0xd1, 0x21, 0xde, 0x7d, 0x1c, 0xdc, 0x1d, 0xeb, 0x30, 0xdb, 0xa1, 0xdc, 0xe6, 0xd8, - 0xa1, 0x14, 0xd5, 0x47, 0xfb, 0xd4, 0x3b, 0xd7, 0xb9, 0x43, 0x97, 0x1f, 0x47, 0x79, 0xf8, 0xf6, - 0xe7, 0x76, 0x26, 0xc7, 0x50, 0x02, 0x3e, 0x31, 0x00, 0xc1, 0x8d, 0xca, 0x8e, 0xd1, 0x47, 0x03, - 0xee, 0x5f, 0x6e, 0x77, 0x2a, 0x58, 0x58, 0xc6, 0x7c, 0xdf, 0xc3, 0x25, 0x3f, 0x96, 0xa3, 0x21, - 0xcc, 0x38, 0x6e, 0x0c, 0x7d, 0xa3, 0x44, 0x0a, 0xaf, 0x4e, 0xcf, 0x79, 0xe6, 0xec, 0x9c, 0x67, - 0x7e, 0x9f, 0xf3, 0xcc, 0xd7, 0x0b, 0x3e, 0x72, 0x76, 0xc1, 0x47, 0x7e, 0x5d, 0xf0, 0x91, 0x77, - 0x1b, 0x9a, 0x6e, 0x55, 0x1a, 0xa5, 0x5c, 0x19, 0xd7, 0x24, 0xab, 0xa2, 0x98, 0x44, 0x27, 0x12, - 0xb2, 0x2a, 0xc8, 0xac, 0xe9, 0x86, 0x25, 0x1d, 0x87, 0x9e, 0xff, 0x56, 0xab, 0x8e, 0x48, 0x29, - 0xe6, 0xbc, 0xf8, 0xb7, 0xfe, 0x06, 0x00, 0x00, 0xff, 0xff, 0x20, 0x34, 0xe4, 0xef, 0x81, 0x0c, - 0x00, 0x00, + // 878 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4d, 0x6b, 0xe3, 0x46, + 0x18, 0xb6, 0xec, 0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0x0e, 0x65, 0xa8, 0xfe, 0x77, + 0x4f, 0x3d, 0xbd, 0xce, 0x29, 0x5d, 0x65, 0x1e, 0xe5, 0xf1, 0xdb, 0x5f, 0x38, 0x5e, 0x1c, 0xc3, + 0x08, 0x78, 0xc2, 0x01, 0x44, 0x37, 0x2a, 0x3f, 0x47, 0x1f, 0x4d, 0xb8, 0x7f, 0x85, 0x93, 0xa5, + 0x60, 0x71, 0x19, 0x6b, 0x63, 0x1f, 0x2e, 0x95, 0xb9, 0x1c, 0x8d, 0x61, 0xe6, 0x71, 0x63, 0xea, + 0x37, 0x4a, 0xa2, 0xfa, 0xc7, 0xcd, 0x9d, 0xc8, 0xdd, 0xde, 0x89, 0xdc, 0xdb, 0x3b, 0x91, 0x7b, + 0x7e, 0x2f, 0x26, 0x6e, 0xef, 0xc5, 0xc4, 0x9b, 0x7b, 0x31, 0xf1, 0xcf, 0xbe, 0x61, 0x3a, 0xcd, + 0x6e, 0xbd, 0xdc, 0xc0, 0x6d, 0xc5, 0x69, 0x6a, 0x36, 0x31, 0x89, 0x82, 0x9c, 0x26, 0xb2, 0xdb, + 0xa6, 0xe5, 0x28, 0x57, 0xb1, 0xdf, 0x01, 0xa7, 0xdf, 0x41, 0xa4, 0x9e, 0xa6, 0x7f, 0x00, 0x87, + 0xef, 0x03, 0x00, 0x00, 0xff, 0xff, 0x08, 0x20, 0xb1, 0x62, 0x91, 0x0c, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1141,7 +1149,7 @@ type MsgClient interface { DissociateRecords(ctx context.Context, in *MsgDissociateRecords, opts ...grpc.CallOption) (*MsgDissociateRecordsResponse, error) // ReAssociateRecords ReAssociateRecords(ctx context.Context, in *MsgReAssociateRecords, opts ...grpc.CallOption) (*MsgReAssociateRecordsResponse, error) - // SetName will store the name with given wrn and name + // SetName will store the name with given crn and name SetName(ctx context.Context, in *MsgSetName, opts ...grpc.CallOption) (*MsgSetNameResponse, error) // Reserve name ReserveName(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error) @@ -1263,7 +1271,7 @@ type MsgServer interface { DissociateRecords(context.Context, *MsgDissociateRecords) (*MsgDissociateRecordsResponse, error) // ReAssociateRecords ReAssociateRecords(context.Context, *MsgReAssociateRecords) (*MsgReAssociateRecordsResponse, error) - // SetName will store the name with given wrn and name + // SetName will store the name with given crn and name SetName(context.Context, *MsgSetName) (*MsgSetNameResponse, error) // Reserve name ReserveName(context.Context, *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error) @@ -1608,6 +1616,13 @@ func (m *MsgSetRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintTx(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } return len(dAtA) - i, nil } @@ -1694,10 +1709,10 @@ func (m *MsgSetName) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x12 } - if len(m.Wrn) > 0 { - i -= len(m.Wrn) - copy(dAtA[i:], m.Wrn) - i = encodeVarintTx(dAtA, i, uint64(len(m.Wrn))) + if len(m.Crn) > 0 { + i -= len(m.Crn) + copy(dAtA[i:], m.Crn) + i = encodeVarintTx(dAtA, i, uint64(len(m.Crn))) i-- dAtA[i] = 0xa } @@ -1888,10 +1903,10 @@ func (m *MsgDeleteNameAuthority) MarshalToSizedBuffer(dAtA []byte) (int, error) i-- dAtA[i] = 0x12 } - if len(m.Wrn) > 0 { - i -= len(m.Wrn) - copy(dAtA[i:], m.Wrn) - i = encodeVarintTx(dAtA, i, uint64(len(m.Wrn))) + if len(m.Crn) > 0 { + i -= len(m.Crn) + copy(dAtA[i:], m.Crn) + i = encodeVarintTx(dAtA, i, uint64(len(m.Crn))) i-- dAtA[i] = 0xa } @@ -2271,6 +2286,10 @@ func (m *MsgSetRecordResponse) Size() (n int) { } var l int _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -2299,7 +2318,7 @@ func (m *MsgSetName) Size() (n int) { } var l int _ = l - l = len(m.Wrn) + l = len(m.Crn) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2389,7 +2408,7 @@ func (m *MsgDeleteNameAuthority) Size() (n int) { } var l int _ = l - l = len(m.Wrn) + l = len(m.Crn) if l > 0 { n += 1 + l + sovTx(uint64(l)) } @@ -2729,6 +2748,38 @@ func (m *MsgSetRecordResponse) Unmarshal(dAtA []byte) error { return fmt.Errorf("proto: MsgSetRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Id", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -2901,7 +2952,7 @@ func (m *MsgSetName) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Wrn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Crn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -2929,7 +2980,7 @@ func (m *MsgSetName) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Wrn = string(dAtA[iNdEx:postIndex]) + m.Crn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { @@ -3489,7 +3540,7 @@ func (m *MsgDeleteNameAuthority) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Wrn", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Crn", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -3517,7 +3568,7 @@ func (m *MsgDeleteNameAuthority) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Wrn = string(dAtA[iNdEx:postIndex]) + m.Crn = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { diff --git a/x/nameservice/types/types.go b/x/nameservice/types/types.go index d2baba1d..f60b0cea 100644 --- a/x/nameservice/types/types.go +++ b/x/nameservice/types/types.go @@ -2,9 +2,9 @@ package types import ( "crypto/sha256" + canonicalJson "github.com/gibson042/canonicaljson-go" "github.com/tharsis/ethermint/x/nameservice/helpers" - "time" ) const ( @@ -24,11 +24,9 @@ type PayloadType struct { func (payloadObj *PayloadType) ToPayload() Payload { var payload = Payload{ Record: &Record{ - CreateTime: time.Time{}, - ExpiryTime: time.Time{}, Deleted: false, Owners: nil, - Attributes: helpers.MarshalMapToJSONBytes(payloadObj.Record), + Attributes: helpers.BytesToBase64(helpers.MarshalMapToJSONBytes(payloadObj.Record)), }, Signatures: payloadObj.Signatures, } @@ -40,7 +38,7 @@ func (payloadObj *PayloadType) ToPayload() Payload { func (payload Payload) ToReadablePayload() PayloadType { var payloadType PayloadType - payloadType.Record = helpers.UnMarshalMapFromJSONBytes(payload.Record.Attributes) + payloadType.Record = helpers.UnMarshalMapFromJSONBytes(helpers.BytesFromBase64(payload.Record.Attributes)) payloadType.Signatures = payload.Signatures @@ -58,7 +56,8 @@ func (r *Record) ToRecordType() RecordType { resourceObj.ExpiryTime = r.ExpiryTime resourceObj.Deleted = r.Deleted resourceObj.Owners = r.Owners - resourceObj.Attributes = helpers.UnMarshalMapFromJSONBytes(r.Attributes) + resourceObj.Names = r.Names + resourceObj.Attributes = helpers.UnMarshalMapFromJSONBytes(helpers.BytesFromBase64(r.Attributes)) return resourceObj } @@ -68,8 +67,8 @@ type RecordType struct { Id string `json:"id,omitempty"` Names []string `json:"names,omitempty"` BondId string `json:"bondId,omitempty"` - CreateTime time.Time `json:"createTime,omitempty"` - ExpiryTime time.Time `json:"expiryTime,omitempty"` + CreateTime string `json:"createTime,omitempty"` + ExpiryTime string `json:"expiryTime,omitempty"` Deleted bool `json:"deleted,omitempty"` Owners []string `json:"owners,omitempty"` Attributes map[string]interface{} `json:"attributes,omitempty"` @@ -86,7 +85,7 @@ func (r *RecordType) ToRecordObj() Record { resourceObj.ExpiryTime = r.ExpiryTime resourceObj.Deleted = r.Deleted resourceObj.Owners = r.Owners - resourceObj.Attributes = helpers.MarshalMapToJSONBytes(r.Attributes) + resourceObj.Attributes = helpers.BytesToBase64(helpers.MarshalMapToJSONBytes(r.Attributes)) return resourceObj }