diff --git a/app/app.go b/app/app.go index 051d5aec..76df37db 100644 --- a/app/app.go +++ b/app/app.go @@ -2,6 +2,7 @@ package app import ( "encoding/json" + "io" "net/http" "os" @@ -98,12 +99,14 @@ import ( "github.com/tharsis/ethermint/app/ante" srvflags "github.com/tharsis/ethermint/server/flags" ethermint "github.com/tharsis/ethermint/types" + "github.com/tharsis/ethermint/x/auction" auctionkeeper "github.com/tharsis/ethermint/x/auction/keeper" auctiontypes "github.com/tharsis/ethermint/x/auction/types" "github.com/tharsis/ethermint/x/bond" bondkeeper "github.com/tharsis/ethermint/x/bond/keeper" bondtypes "github.com/tharsis/ethermint/x/bond/types" + "github.com/tharsis/ethermint/x/evm" evmrest "github.com/tharsis/ethermint/x/evm/client/rest" evmkeeper "github.com/tharsis/ethermint/x/evm/keeper" @@ -111,6 +114,10 @@ import ( "github.com/tharsis/ethermint/x/feemarket" feemarketkeeper "github.com/tharsis/ethermint/x/feemarket/keeper" feemarkettypes "github.com/tharsis/ethermint/x/feemarket/types" + + "github.com/tharsis/ethermint/x/nameservice" + nameservicekeeper "github.com/tharsis/ethermint/x/nameservice/keeper" + nameservicetypes "github.com/tharsis/ethermint/x/nameservice/types" ) func init() { @@ -154,26 +161,31 @@ var ( transfer.AppModuleBasic{}, vesting.AppModuleBasic{}, // Ethermint modules - auction.AppModuleBasic{}, evm.AppModuleBasic{}, feemarket.AppModuleBasic{}, - // DXNS modules + // Vulcanize DXNS modules + auction.AppModuleBasic{}, bond.AppModuleBasic{}, + nameservice.AppModuleBasic{}, ) // module account permissions maccPerms = map[string][]string{ - authtypes.FeeCollectorName: nil, - distrtypes.ModuleName: nil, - minttypes.ModuleName: {authtypes.Minter}, - stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, - stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, - govtypes.ModuleName: {authtypes.Burner}, - ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, - evmtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, // used for secure addition and subtraction of balance using module account - auctiontypes.ModuleName: nil, - auctiontypes.AuctionBurnModuleAccountName: nil, - bondtypes.ModuleName: nil, + authtypes.FeeCollectorName: nil, + distrtypes.ModuleName: nil, + minttypes.ModuleName: {authtypes.Minter}, + stakingtypes.BondedPoolName: {authtypes.Burner, authtypes.Staking}, + stakingtypes.NotBondedPoolName: {authtypes.Burner, authtypes.Staking}, + govtypes.ModuleName: {authtypes.Burner}, + ibctransfertypes.ModuleName: {authtypes.Minter, authtypes.Burner}, + evmtypes.ModuleName: {authtypes.Minter, authtypes.Burner}, // used for secure addition and subtraction of balance using module account + + auctiontypes.ModuleName: nil, + auctiontypes.AuctionBurnModuleAccountName: nil, + nameservicetypes.ModuleName: nil, + nameservicetypes.RecordRentModuleAccountName: nil, + nameservicetypes.AuthorityRentModuleAccountName: nil, + bondtypes.ModuleName: nil, } // module accounts that are allowed to receive tokens @@ -227,12 +239,14 @@ type EthermintApp struct { ScopedTransferKeeper capabilitykeeper.ScopedKeeper // Ethermint keepers - AuctionKeeper auctionkeeper.Keeper EvmKeeper *evmkeeper.Keeper FeeMarketKeeper feemarketkeeper.Keeper // DXNS keepers - BondKeeper bondkeeper.Keeper + AuctionKeeper auctionkeeper.Keeper + BondKeeper bondkeeper.Keeper + NameServiceKeeper nameservicekeeper.Keeper + NameServiceRecordKeeper nameservicekeeper.RecordKeeper // the module manager mm *module.Manager @@ -287,6 +301,7 @@ func NewEthermintApp( // dxns keys auctiontypes.StoreKey, bondtypes.StoreKey, + nameservicetypes.StoreKey, ) // Add the EVM transient store key @@ -357,11 +372,6 @@ func NewEthermintApp( tracer := cast.ToString(appOpts.Get(srvflags.EVMTracer)) // Create Ethermint keepers - app.AuctionKeeper = auctionkeeper.NewKeeper( - app.AccountKeeper, app.BankKeeper, keys[auctiontypes.StoreKey], - appCodec, app.GetSubspace(auctiontypes.ModuleName), - ) - app.EvmKeeper = evmkeeper.NewKeeper( appCodec, keys[evmtypes.StoreKey], tkeys[evmtypes.TransientKey], app.GetSubspace(evmtypes.ModuleName), app.AccountKeeper, app.BankKeeper, app.StakingKeeper, @@ -372,8 +382,27 @@ func NewEthermintApp( appCodec, keys[feemarkettypes.StoreKey], app.GetSubspace(feemarkettypes.ModuleName), ) - // Create DXNS keepers - app.BondKeeper = bondkeeper.NewKeeper(appCodec, app.AccountKeeper, app.BankKeeper, keys[bondtypes.StoreKey], app.GetSubspace(bondtypes.ModuleName)) + // Create Vulcanize dxns keepers + + app.AuctionKeeper = auctionkeeper.NewKeeper( + app.AccountKeeper, app.BankKeeper, keys[auctiontypes.StoreKey], + appCodec, app.GetSubspace(auctiontypes.ModuleName), + ) + + app.NameServiceRecordKeeper = nameservicekeeper.NewRecordKeeper(app.AuctionKeeper, keys[nameservicetypes.StoreKey], appCodec) + + app.AuctionKeeper.SetUsageKeepers([]auctiontypes.AuctionUsageKeeper{app.NameServiceRecordKeeper}) + + app.BondKeeper = bondkeeper.NewKeeper( + appCodec, app.AccountKeeper, app.BankKeeper, + []bondtypes.BondUsageKeeper{app.NameServiceRecordKeeper}, keys[bondtypes.StoreKey], app.GetSubspace(bondtypes.ModuleName), + ) + + app.NameServiceKeeper = nameservicekeeper.NewKeeper( + appCodec, app.AccountKeeper, app.BankKeeper, + app.NameServiceRecordKeeper, app.BondKeeper, app.AuctionKeeper, + keys[nameservicetypes.StoreKey], app.GetSubspace(nameservicetypes.ModuleName), + ) // Create IBC Keeper app.IBCKeeper = ibckeeper.NewKeeper( @@ -453,11 +482,12 @@ func NewEthermintApp( ibc.NewAppModule(app.IBCKeeper), transferModule, // Ethermint app modules - auction.NewAppModule(appCodec, app.AuctionKeeper), evm.NewAppModule(app.EvmKeeper, app.AccountKeeper), feemarket.NewAppModule(app.FeeMarketKeeper), // DXNs modules + auction.NewAppModule(appCodec, app.AuctionKeeper), bond.NewAppModule(appCodec, app.BondKeeper), + nameservice.NewAppModule(app.NameServiceKeeper), ) // During begin block slashing happens after distr.BeginBlocker so that @@ -477,7 +507,9 @@ func NewEthermintApp( // NOTE: fee market module must go last in order to retrieve the block gas used. app.mm.SetOrderEndBlockers( crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, - evmtypes.ModuleName, feemarkettypes.ModuleName, auctiontypes.ModuleName, + evmtypes.ModuleName, feemarkettypes.ModuleName, + nameservicetypes.ModuleName, + auctiontypes.ModuleName, ) // NOTE: The genutils module must occur after staking so that pools are @@ -496,6 +528,7 @@ func NewEthermintApp( // DXNS modules auctiontypes.ModuleName, bondtypes.ModuleName, + nameservicetypes.ModuleName, // NOTE: crisis module must go at the end to check for invariants on each module crisistypes.ModuleName, @@ -736,10 +769,12 @@ func initParamsKeeper( paramsKeeper.Subspace(ibctransfertypes.ModuleName) paramsKeeper.Subspace(ibchost.ModuleName) // ethermint subspaces - paramsKeeper.Subspace(auctiontypes.ModuleName) paramsKeeper.Subspace(evmtypes.ModuleName) paramsKeeper.Subspace(feemarkettypes.ModuleName) // dxns subspaces + paramsKeeper.Subspace(auctiontypes.ModuleName) paramsKeeper.Subspace(bondtypes.ModuleName) + paramsKeeper.Subspace(nameservicetypes.ModuleName) + return paramsKeeper } diff --git a/docs/api/proto-docs.md b/docs/api/proto-docs.md index 1e14acf5..ffa9d38b 100644 --- a/docs/api/proto-docs.md +++ b/docs/api/proto-docs.md @@ -150,6 +150,74 @@ - [Msg](#vulcanize.bond.v1beta1.Msg) +- [vulcanize/nameservice/v1beta1/nameservice.proto](#vulcanize/nameservice/v1beta1/nameservice.proto) + - [AuctionBidInfo](#vulcanize.nameservice.v1beta1.AuctionBidInfo) + - [AuthorityEntry](#vulcanize.nameservice.v1beta1.AuthorityEntry) + - [BlockChangeSet](#vulcanize.nameservice.v1beta1.BlockChangeSet) + - [NameAuthority](#vulcanize.nameservice.v1beta1.NameAuthority) + - [NameEntry](#vulcanize.nameservice.v1beta1.NameEntry) + - [NameRecord](#vulcanize.nameservice.v1beta1.NameRecord) + - [NameRecordEntry](#vulcanize.nameservice.v1beta1.NameRecordEntry) + - [Params](#vulcanize.nameservice.v1beta1.Params) + - [Record](#vulcanize.nameservice.v1beta1.Record) + - [Signature](#vulcanize.nameservice.v1beta1.Signature) + +- [vulcanize/nameservice/v1beta1/genesis.proto](#vulcanize/nameservice/v1beta1/genesis.proto) + - [GenesisState](#vulcanize.nameservice.v1beta1.GenesisState) + +- [vulcanize/nameservice/v1beta1/query.proto](#vulcanize/nameservice/v1beta1/query.proto) + - [AccountBalance](#vulcanize.nameservice.v1beta1.AccountBalance) + - [ExpiryQueueRecord](#vulcanize.nameservice.v1beta1.ExpiryQueueRecord) + - [GetNameServiceModuleBalanceRequest](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest) + - [GetNameServiceModuleBalanceResponse](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse) + - [QueryGetAuthorityExpiryQueue](#vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueue) + - [QueryGetAuthorityExpiryQueueResponse](#vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueueResponse) + - [QueryGetRecordExpiryQueue](#vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueue) + - [QueryGetRecordExpiryQueueResponse](#vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueueResponse) + - [QueryListNameRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest) + - [QueryListNameRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse) + - [QueryListRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest) + - [QueryListRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListRecordsResponse) + - [QueryLookupWrn](#vulcanize.nameservice.v1beta1.QueryLookupWrn) + - [QueryLookupWrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupWrnResponse) + - [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) + - [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest) + - [QueryWhoisResponse](#vulcanize.nameservice.v1beta1.QueryWhoisResponse) + + - [Query](#vulcanize.nameservice.v1beta1.Query) + +- [vulcanize/nameservice/v1beta1/tx.proto](#vulcanize/nameservice/v1beta1/tx.proto) + - [MsgAssociateBond](#vulcanize.nameservice.v1beta1.MsgAssociateBond) + - [MsgAssociateBondResponse](#vulcanize.nameservice.v1beta1.MsgAssociateBondResponse) + - [MsgDeleteNameAuthority](#vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority) + - [MsgDeleteNameAuthorityResponse](#vulcanize.nameservice.v1beta1.MsgDeleteNameAuthorityResponse) + - [MsgDissociateBond](#vulcanize.nameservice.v1beta1.MsgDissociateBond) + - [MsgDissociateBondResponse](#vulcanize.nameservice.v1beta1.MsgDissociateBondResponse) + - [MsgDissociateRecords](#vulcanize.nameservice.v1beta1.MsgDissociateRecords) + - [MsgDissociateRecordsResponse](#vulcanize.nameservice.v1beta1.MsgDissociateRecordsResponse) + - [MsgReAssociateRecords](#vulcanize.nameservice.v1beta1.MsgReAssociateRecords) + - [MsgReAssociateRecordsResponse](#vulcanize.nameservice.v1beta1.MsgReAssociateRecordsResponse) + - [MsgRenewRecord](#vulcanize.nameservice.v1beta1.MsgRenewRecord) + - [MsgRenewRecordResponse](#vulcanize.nameservice.v1beta1.MsgRenewRecordResponse) + - [MsgReserveAuthority](#vulcanize.nameservice.v1beta1.MsgReserveAuthority) + - [MsgReserveAuthorityResponse](#vulcanize.nameservice.v1beta1.MsgReserveAuthorityResponse) + - [MsgSetAuthorityBond](#vulcanize.nameservice.v1beta1.MsgSetAuthorityBond) + - [MsgSetAuthorityBondResponse](#vulcanize.nameservice.v1beta1.MsgSetAuthorityBondResponse) + - [MsgSetName](#vulcanize.nameservice.v1beta1.MsgSetName) + - [MsgSetNameResponse](#vulcanize.nameservice.v1beta1.MsgSetNameResponse) + - [MsgSetRecord](#vulcanize.nameservice.v1beta1.MsgSetRecord) + - [MsgSetRecordResponse](#vulcanize.nameservice.v1beta1.MsgSetRecordResponse) + - [Payload](#vulcanize.nameservice.v1beta1.Payload) + + - [Msg](#vulcanize.nameservice.v1beta1.Msg) + - [Scalar Value Types](#scalar-value-types) @@ -2089,6 +2157,900 @@ Msg defines the bond Msg service. + +

Top

+ +## vulcanize/nameservice/v1beta1/nameservice.proto + + + + + +### AuctionBidInfo + +AuctionBidInfo + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `auction_id` | [string](#string) | | | +| `bidder_address` | [string](#string) | | | + + + +### AuthorityEntry + +AuthorityEntry defines the nameservice module AuthorityEntries + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `entry` | [NameAuthority](#vulcanize.nameservice.v1beta1.NameAuthority) | | | + + + +### BlockChangeSet + +BlockChangeSet + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `height` | [int64](#int64) | | | +| `records` | [string](#string) | repeated | | +| `auctions` | [string](#string) | repeated | | +| `auction_bids` | [AuctionBidInfo](#vulcanize.nameservice.v1beta1.AuctionBidInfo) | repeated | | +| `authorities` | [string](#string) | repeated | | +| `names` | [string](#string) | repeated | | + + + +### NameAuthority + +NameAuthority + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `owner_public_key` | [string](#string) | | Owner public key. | +| `owner_address` | [string](#string) | | Owner address. | +| `height` | [uint64](#uint64) | | height at which name/authority was created. | +| `status` | [string](#string) | | | +| `auction_id` | [string](#string) | | | +| `bond_id` | [string](#string) | | | +| `expiry_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | + + + + + + + + +### NameEntry +NameEntry + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `entry` | [NameRecord](#vulcanize.nameservice.v1beta1.NameRecord) | | | + + + + + + + + +### NameRecord +NameRecord + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `latest` | [NameRecordEntry](#vulcanize.nameservice.v1beta1.NameRecordEntry) | | | +| `history` | [NameRecordEntry](#vulcanize.nameservice.v1beta1.NameRecordEntry) | repeated | | + + + + + + + + +### NameRecordEntry +NameRecordEntry + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | +| `height` | [uint64](#uint64) | | | + + + + + + + + +### Params +Params defines the nameservice module parameters + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record_rent` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `record_rent_duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `authority_rent` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `authority_rent_duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `authority_grace_period` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `authority_auction_enabled` | [bool](#bool) | | | +| `authority_auction_commits_duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `authority_auction_reveals_duration` | [google.protobuf.Duration](#google.protobuf.Duration) | | | +| `authority_auction_commit_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `authority_auction_reveal_fee` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | +| `authority_auction_minimum_bid` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | | + + + + + + + + +### Record +Params defines the nameservice module records + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | +| `bond_id` | [string](#string) | | | +| `create_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `expiry_time` | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | | +| `deleted` | [bool](#bool) | | | +| `owners` | [string](#string) | repeated | | +| `attributes` | [bytes](#bytes) | | | + + + + + + + + +### Signature +Signature + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `sig` | [string](#string) | | | +| `pub_key` | [string](#string) | | | + + + + + + + + + + + + + + + + +

Top

+ +## vulcanize/nameservice/v1beta1/genesis.proto + + + + + +### GenesisState +GenesisState defines the nameservice module's genesis state. + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#vulcanize.nameservice.v1beta1.Params) | | params defines all the params of nameservice module. | +| `records` | [Record](#vulcanize.nameservice.v1beta1.Record) | repeated | records | +| `authorities` | [AuthorityEntry](#vulcanize.nameservice.v1beta1.AuthorityEntry) | repeated | authorities | +| `names` | [NameEntry](#vulcanize.nameservice.v1beta1.NameEntry) | repeated | names | + + + + + + + + + + + + + + + + +

Top

+ +## vulcanize/nameservice/v1beta1/query.proto + + + + + +### AccountBalance + +AccountBalance is nameservice module account balance + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `account_name` | [string](#string) | | | +| `balance` | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | repeated | | + + + +### ExpiryQueueRecord + +ExpiryQueueRecord + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | +| `value` | [string](#string) | repeated | | + + + +### GetNameServiceModuleBalanceRequest + +GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance + + + +### GetNameServiceModuleBalanceResponse + +GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `balances` | [AccountBalance](#vulcanize.nameservice.v1beta1.AccountBalance) | repeated | | + + + + + + + + +### QueryGetAuthorityExpiryQueue +QueryGetAuthorityExpiryQueue + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryGetAuthorityExpiryQueueResponse +QueryGetAuthorityExpiryQueueResponse + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `authorities` | [ExpiryQueueRecord](#vulcanize.nameservice.v1beta1.ExpiryQueueRecord) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryGetRecordExpiryQueue +QueryGetRecordExpiryQueue + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryGetRecordExpiryQueueResponse +QueryGetRecordExpiryQueueResponse + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `records` | [ExpiryQueueRecord](#vulcanize.nameservice.v1beta1.ExpiryQueueRecord) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryListNameRecordsRequest +QueryListNameRecordsRequest is request type for nameservice names records + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryListNameRecordsResponse +QueryListNameRecordsResponse is response type for nameservice names records + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `names` | [NameEntry](#vulcanize.nameservice.v1beta1.NameEntry) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryListRecordsRequest +QueryListRecordsRequest is request type for nameservice records list + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryListRecordsResponse +QueryListRecordsResponse is response type for nameservice records list + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `records` | [Record](#vulcanize.nameservice.v1beta1.Record) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + +### QueryLookupWrn + +QueryLookupWrn is request type for LookupWrn + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `wrn` | [string](#string) | | | + + + +### QueryLookupWrnResponse + +QueryLookupWrnResponse is response type for QueryLookupWrn + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [NameRecord](#vulcanize.nameservice.v1beta1.NameRecord) | | | + + + +### QueryParamsRequest + +QueryParamsRequest is request type for nameservice params + + + +### QueryParamsResponse + +QueryParamsResponse is response type for nameservice params + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `params` | [Params](#vulcanize.nameservice.v1beta1.Params) | | | + + + + + + + + +### QueryRecordByBondIdRequest +QueryRecordByBondIdRequest is request type for get the records by bond-id + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | +| `pagination` | [cosmos.base.query.v1beta1.PageRequest](#cosmos.base.query.v1beta1.PageRequest) | | pagination defines an optional pagination for the request. | + + + + + + + + +### QueryRecordByBondIdResponse +QueryRecordByBondIdResponse is response type for records list by bond-id + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `records` | [Record](#vulcanize.nameservice.v1beta1.Record) | repeated | | +| `pagination` | [cosmos.base.query.v1beta1.PageResponse](#cosmos.base.query.v1beta1.PageResponse) | | pagination defines the pagination in the response. | + + + + + + + + +### QueryRecordByIdRequest +QueryRecordByIdRequest is request type for nameservice records by id + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `id` | [string](#string) | | | + + + + + + + + +### QueryRecordByIdResponse +QueryRecordByIdResponse is response type for nameservice records by id + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record` | [Record](#vulcanize.nameservice.v1beta1.Record) | | | + + + + + + + + +### QueryResolveWrn +QueryResolveWrn is request type for ResolveWrn + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `wrn` | [string](#string) | | | + + + + + + + + +### QueryResolveWrnResponse +QueryResolveWrnResponse is response type for QueryResolveWrn + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record` | [Record](#vulcanize.nameservice.v1beta1.Record) | | | + + + + + + + + +### QueryWhoisRequest +QueryWhoisRequest is request type for Get NameAuthority + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | + + + + + + + + +### QueryWhoisResponse +QueryWhoisResponse is response type for whois request + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name_authority` | [NameAuthority](#vulcanize.nameservice.v1beta1.NameAuthority) | | | + + + + + + + + + + + + + + +### Query +Query defines the gRPC querier service for nameservice module + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `Params` | [QueryParamsRequest](#vulcanize.nameservice.v1beta1.QueryParamsRequest) | [QueryParamsResponse](#vulcanize.nameservice.v1beta1.QueryParamsResponse) | Params queries the nameservice module params. | GET|/ethermint/nameservice/v1/params| +| `ListRecords` | [QueryListRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListRecordsRequest) | [QueryListRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListRecordsResponse) | List records | GET|/ethermint/nameservice/v1/records| +| `GetRecord` | [QueryRecordByIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByIdRequest) | [QueryRecordByIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByIdResponse) | Get record by id | GET|/ethermint/nameservice/v1/records/{id}| +| `GetRecordByBondId` | [QueryRecordByBondIdRequest](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest) | [QueryRecordByBondIdResponse](#vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse) | Get records by bond id | GET|/ethermint/nameservice/v1/records-by-bond-id/{id}| +| `GetNameServiceModuleBalance` | [GetNameServiceModuleBalanceRequest](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest) | [GetNameServiceModuleBalanceResponse](#vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse) | Get nameservice module balance | GET|/ethermint/nameservice/v1/balance| +| `ListNameRecords` | [QueryListNameRecordsRequest](#vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest) | [QueryListNameRecordsResponse](#vulcanize.nameservice.v1beta1.QueryListNameRecordsResponse) | List name records | GET|/ethermint/nameservice/v1/names| +| `Whois` | [QueryWhoisRequest](#vulcanize.nameservice.v1beta1.QueryWhoisRequest) | [QueryWhoisResponse](#vulcanize.nameservice.v1beta1.QueryWhoisResponse) | Whois method retrieve the name authority info | GET|/ethermint/nameservice/v1/whois/{name}| +| `LookupWrn` | [QueryLookupWrn](#vulcanize.nameservice.v1beta1.QueryLookupWrn) | [QueryLookupWrnResponse](#vulcanize.nameservice.v1beta1.QueryLookupWrnResponse) | LookupWrn | GET|/ethermint/nameservice/v1/lookup/{wrn}| +| `ResolveWrn` | [QueryResolveWrn](#vulcanize.nameservice.v1beta1.QueryResolveWrn) | [QueryResolveWrnResponse](#vulcanize.nameservice.v1beta1.QueryResolveWrnResponse) | ResolveWrn | GET|/ethermint/nameservice/v1/resolve/{wrn}| +| `GetRecordExpiryQueue` | [QueryGetRecordExpiryQueue](#vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueue) | [QueryGetRecordExpiryQueueResponse](#vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueueResponse) | GetRecordExpiryQueue | GET|/ethermint/nameservice/v1/record-expiry| +| `GetAuthorityExpiryQueue` | [QueryGetAuthorityExpiryQueue](#vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueue) | [QueryGetAuthorityExpiryQueueResponse](#vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueueResponse) | GetAuthorityExpiryQueue | GET|/ethermint/nameservice/v1/authority-expiry| + + + + + + +

Top

+ +## vulcanize/nameservice/v1beta1/tx.proto + + + + + +### MsgAssociateBond +MsgAssociateBond + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record_id` | [string](#string) | | | +| `bond_id` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgAssociateBondResponse +MsgAssociateBondResponse + + + + + + + + +### MsgDeleteNameAuthority +MsgDeleteNameAuthority is SDK message for DeleteNameAuthority + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `wrn` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgDeleteNameAuthorityResponse +MsgDeleteNameAuthorityResponse + + + + + + + + +### MsgDissociateBond +MsgDissociateBond is SDK message for Msg/DissociateBond + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record_id` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgDissociateBondResponse +MsgDissociateBondResponse is response type for MsgDissociateBond + + + + + + + + +### MsgDissociateRecords +MsgDissociateRecords is SDK message for Msg/DissociateRecords + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `bond_id` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgDissociateRecordsResponse +MsgDissociateRecordsResponse is response type for MsgDissociateRecords + + + + + + + + +### MsgReAssociateRecords +MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `new_bond_id` | [string](#string) | | | +| `old_bond_id` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgReAssociateRecordsResponse +MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords + + + + + + + + +### MsgRenewRecord +MsgRenewRecord is SDK message for Renew a record + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record_id` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgRenewRecordResponse +MsgRenewRecordResponse + + + + + + + + +### MsgReserveAuthority +MsgReserveName + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `signer` | [string](#string) | | | +| `owner` | [string](#string) | | if creating a sub-authority. | + + + + + + + + +### MsgReserveAuthorityResponse +MsgReserveNameResponse + + + + + + + + +### MsgSetAuthorityBond +MsgSetAuthorityBond is SDK message for SetAuthorityBond + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `name` | [string](#string) | | | +| `bond_id` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgSetAuthorityBondResponse +MsgSetAuthorityBondResponse + + + + + + + + +### MsgSetName +MsgSetName + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `wrn` | [string](#string) | | | +| `cid` | [string](#string) | | | +| `signer` | [string](#string) | | | + + + + + + + + +### MsgSetNameResponse +MsgSetNameResponse + + + + + + + + +### MsgSetRecord +MsgSetRecord + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `bond_id` | [string](#string) | | | +| `signer` | [string](#string) | | | +| `payload` | [Payload](#vulcanize.nameservice.v1beta1.Payload) | | | + + + + + + + + +### MsgSetRecordResponse +MsgSetRecordResponse + + + + + + + + +### Payload +Payload + + +| Field | Type | Label | Description | +| ----- | ---- | ----- | ----------- | +| `record` | [Record](#vulcanize.nameservice.v1beta1.Record) | | | +| `signatures` | [Signature](#vulcanize.nameservice.v1beta1.Signature) | repeated | | + + + + + + + + + + + + + + +### Msg +Msg + +| Method Name | Request Type | Response Type | Description | HTTP Verb | Endpoint | +| ----------- | ------------ | ------------- | ------------| ------- | -------- | +| `SetRecord` | [MsgSetRecord](#vulcanize.nameservice.v1beta1.MsgSetRecord) | [MsgSetRecordResponse](#vulcanize.nameservice.v1beta1.MsgSetRecordResponse) | SetRecord will records a new record with given payload and bond id | | +| `RenewRecord` | [MsgRenewRecord](#vulcanize.nameservice.v1beta1.MsgRenewRecord) | [MsgRenewRecordResponse](#vulcanize.nameservice.v1beta1.MsgRenewRecordResponse) | Renew Record will renew the expire record | | +| `AssociateBond` | [MsgAssociateBond](#vulcanize.nameservice.v1beta1.MsgAssociateBond) | [MsgAssociateBondResponse](#vulcanize.nameservice.v1beta1.MsgAssociateBondResponse) | AssociateBond | | +| `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 | | +| `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 | | + + + + + ## Scalar Value Types | .proto Type | Notes | C++ | Java | Python | Go | C# | PHP | Ruby | diff --git a/go.mod b/go.mod index 2fe5baa2..c1b73cca 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,6 @@ require ( github.com/cosmos/cosmos-sdk v0.44.0 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/ibc-go v1.2.0 - github.com/deckarep/golang-set v1.7.1 github.com/ethereum/go-ethereum v1.10.3 github.com/gibson042/canonicaljson-go v1.0.3 github.com/gogo/protobuf v1.3.3 @@ -17,9 +16,9 @@ require ( github.com/gorilla/websocket v1.4.2 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/improbable-eng/grpc-web v0.14.1 - github.com/ipfs/go-ipld-cbor v0.0.4 + github.com/ipfs/go-ipld-cbor v0.0.5 github.com/miguelmota/go-ethereum-hdwallet v0.0.1 - github.com/multiformats/go-multihash v0.0.14 + github.com/multiformats/go-multihash v0.0.10 github.com/palantir/stacktrace v0.0.0-20161112013806-78658fd2d177 github.com/pkg/errors v0.9.1 github.com/rakyll/statik v0.1.7 @@ -38,20 +37,25 @@ require ( golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f // indirect golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect - google.golang.org/genproto v0.0.0-20210929214142-896c89f843d2 + google.golang.org/genproto v0.0.0-20211001223012-bfb93cce50d9 google.golang.org/grpc v1.40.0 google.golang.org/protobuf v1.27.1 gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b ) require ( filippo.io/edwards25519 v1.0.0-beta.2 // indirect github.com/99designs/keyring v1.1.6 // indirect - github.com/ChainSafe/go-schnorrkel v0.0.0-20200626160457-b38283118816 // indirect + github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d // indirect github.com/DataDog/zstd v1.4.8 // indirect + github.com/Masterminds/goutils v1.1.1 // indirect + github.com/Masterminds/semver v1.5.0 // indirect + github.com/Masterminds/sprig v2.22.0+incompatible // indirect github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6 // indirect github.com/VictoriaMetrics/fastcache v1.5.7 // indirect github.com/Workiva/go-datastructures v1.0.52 // indirect + github.com/aokoli/goutils v1.1.1 // indirect github.com/armon/go-metrics v0.3.9 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.0 // indirect @@ -62,8 +66,9 @@ require ( github.com/cosmos/iavl v0.16.0 // indirect github.com/cosmos/ledger-cosmos-go v0.11.1 // indirect github.com/cosmos/ledger-go v0.9.2 // indirect - github.com/danieljoos/wincred v1.1.0 // indirect + github.com/danieljoos/wincred v1.0.2 // indirect github.com/davecgh/go-spew v1.1.1 // indirect + github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea // indirect github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.2 // indirect github.com/dgraph-io/ristretto v0.0.3 // indirect @@ -72,6 +77,7 @@ require ( github.com/dvsekhvalnov/jose2go v0.0.0-20200901110807-248326c1351b // indirect github.com/edsrzf/mmap-go v1.0.0 // indirect github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 // indirect + github.com/envoyproxy/protoc-gen-validate v0.6.1 // indirect github.com/felixge/httpsnoop v1.0.1 // indirect github.com/fsnotify/fsnotify v1.4.9 // indirect github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff // indirect @@ -96,7 +102,9 @@ require ( github.com/hdevalence/ed25519consensus v0.0.0-20210204194344-59a8610d2b87 // indirect github.com/holiman/bloomfilter/v2 v2.0.3 // indirect github.com/holiman/uint256 v1.1.1 // indirect + github.com/huandu/xstrings v1.3.2 // indirect github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88 // indirect + github.com/imdario/mergo v0.3.12 // indirect github.com/inconshreveable/mousetrap v1.0.0 // indirect github.com/ipfs/go-block-format v0.0.2 // indirect github.com/ipfs/go-cid v0.0.3 // indirect @@ -104,7 +112,7 @@ require ( github.com/ipfs/go-ipld-format v0.0.1 // indirect github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/keybase/go-keychain v0.0.0-20200502122510-cda31fe0c86d // indirect + github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d // indirect github.com/klauspost/compress v1.11.9 // indirect github.com/libp2p/go-buffer-pool v0.0.2 // indirect github.com/magiconair/properties v1.8.5 // indirect @@ -115,12 +123,13 @@ require ( github.com/minio/blake2b-simd v0.0.0-20160723061019-3f5f724cb5b1 // indirect github.com/minio/highwayhash v1.0.1 // indirect github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 // indirect + github.com/mitchellh/copystructure v1.2.0 // indirect github.com/mitchellh/mapstructure v1.4.1 // indirect - github.com/mr-tron/base58 v1.1.3 // indirect + github.com/mr-tron/base58 v1.1.2 // indirect github.com/mtibben/percent v0.2.1 // indirect github.com/multiformats/go-base32 v0.0.3 // indirect github.com/multiformats/go-multibase v0.0.1 // indirect - github.com/multiformats/go-varint v0.0.5 // indirect + github.com/mwitkow/go-proto-validators v0.3.2 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect github.com/pelletier/go-toml v1.9.3 // indirect github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect @@ -131,6 +140,7 @@ require ( github.com/prometheus/common v0.29.0 // indirect github.com/prometheus/procfs v0.6.0 // indirect github.com/prometheus/tsdb v0.7.1 // indirect + github.com/pseudomuto/protoc-gen-doc v1.5.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rjeczalik/notify v0.9.1 // indirect github.com/sasha-s/go-deadlock v0.2.1-0.20190427202633-1595213edefa // indirect @@ -156,7 +166,6 @@ require ( gopkg.in/ini.v1 v1.62.0 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect gopkg.in/olebedev/go-duktape.v3 v3.0.0-20200619000410-60c24ae608a6 // indirect - gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect nhooyr.io/websocket v1.8.6 // indirect ) diff --git a/go.sum b/go.sum index 6996599f..edcf6ea3 100644 --- a/go.sum +++ b/go.sum @@ -61,9 +61,8 @@ github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6L github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d h1:nalkkPQcITbvhmL4+C4cKA87NW0tfm3Kl9VXRoPywFg= github.com/ChainSafe/go-schnorrkel v0.0.0-20200405005733-88cbf1b4c40d/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200626160457-b38283118816 h1:X5jJ3e/jgFSnSoYOep/mf6pF1RuLZfvF1ts8NZIyzqE= -github.com/ChainSafe/go-schnorrkel v0.0.0-20200626160457-b38283118816/go.mod h1:URdX5+vg25ts3aCh8H5IFZybJYKWhJHYMTnf+ULtoC4= github.com/DATA-DOG/go-sqlmock v1.3.3/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.3.6-0.20190409195224-796139022798/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= @@ -72,6 +71,14 @@ github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t github.com/DataDog/zstd v1.4.8 h1:Rpmta4xZ/MgZnriKNd24iZMhGpP5dvUcs/uqfBapKZY= github.com/DataDog/zstd v1.4.8/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Knetic/govaluate v3.0.1-0.20171022003610-9aa49832a739+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/Masterminds/goutils v1.1.1 h1:5nUrii3FMTL5diU80unEVvNevw1nH4+ZV4DSLVJLSYI= +github.com/Masterminds/goutils v1.1.1/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.4.2/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.15.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/Microsoft/go-winio v0.4.14/go.mod h1:qXqCSQ3Xa7+6tgxaGTIe4Kpcdsi+P8jBhyzoq1bpyYA= github.com/Microsoft/go-winio v0.5.0 h1:Elr9Wn+sGKPlkaBvwu4mTrxtmOp3F3yV9qhaHbXGjwU= github.com/Microsoft/go-winio v0.5.0/go.mod h1:JPGBdM1cNvN/6ISo+n8V5iA4v8pBzdOpzfwIujj1a84= @@ -106,6 +113,9 @@ github.com/allegro/bigcache v1.2.1 h1:hg1sY1raCwic3Vnsvje6TT7/pnZba83LeFck5NrFKS github.com/allegro/bigcache v1.2.1/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= 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/aokoli/goutils v1.0.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= +github.com/aokoli/goutils v1.1.1 h1:/hA+Ywo3AxoDZY5ZMnkiEkUvkK4BPp927ax110KCqqg= +github.com/aokoli/goutils v1.1.1/go.mod h1:SijmP0QR8LtwsmDs8Yii5Z/S4trXFGFC2oO5g9DP+DQ= 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= @@ -241,17 +251,16 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cyphar/filepath-securejoin v0.2.2/go.mod h1:FpkQEhXnPnOthhzymB7CGsFk2G9VLXONKD9G7QGMM+4= +github.com/danieljoos/wincred v1.0.2 h1:zf4bhty2iLuwgjgpraD2E9UbvO+fe54XXGJbOwe23fU= github.com/danieljoos/wincred v1.0.2/go.mod h1:SnuYRW9lp1oJrZX/dXJqr0cPK5gYXqx3EJbmjhLdK9U= -github.com/danieljoos/wincred v1.1.0 h1:3RNcEpBg4IhIChZdFRSdlQt1QjCp1sMAPIrOnm7Yf8g= -github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7hqDjlFjiygg= github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= +github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea h1:j4317fAZh7X6GqbFowYdYdI0L9bwxL07jyPZIdepyZ0= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= -github.com/deckarep/golang-set v1.7.1 h1:SCQV0S6gTtp6itiFrTqI+pfmJ4LN85S1YzhDf9rTHJQ= -github.com/deckarep/golang-set v1.7.1/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= @@ -293,6 +302,9 @@ github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25 h1:2vLKys4RBU4 github.com/enigmampc/btcutil v1.0.3-0.20200723161021-e2fb6adb2a25/go.mod h1:hTr8+TLQmkUkgcuh3mcr5fjrT9c64ZzsBCdCEC6UppY= github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.3.0-java/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/envoyproxy/protoc-gen-validate v0.6.1 h1:4CF52PCseTFt4bE+Yk3dIpdVi7XWuPVMhPtm4FaIJPM= +github.com/envoyproxy/protoc-gen-validate v0.6.1/go.mod h1:txg5va2Qkip90uYoSKH+nkAAmXrb2j3iq4FLwdrCbXQ= github.com/ethereum/go-ethereum v1.9.25/go.mod h1:vMkFiYLHI4tgPw4k2j4MHKoovchFE8plZ0M9VMk4/oM= github.com/ethereum/go-ethereum v1.10.1/go.mod h1:E5e/zvdfUVr91JZ0AwjyuJM3x+no51zZJRz61orLLSk= github.com/ethereum/go-ethereum v1.10.3 h1:SEYOYARvbWnoDl1hOSks3ZJQpRiiRJe8ubaQGJQwq0s= @@ -454,6 +466,7 @@ github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/protobuf v3.14.0+incompatible/go.mod h1:lUQ9D1ePzbH2PrIS7ob/bjm9HXyH5WHB0Akwh7URreM= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v0.0.0-20161128191214-064e2069ce9c/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -544,14 +557,21 @@ github.com/holiman/bloomfilter/v2 v2.0.3/go.mod h1:zpoh+gs7qcpqrHr3dB55AMiJwo0iU github.com/holiman/uint256 v1.1.1 h1:4JywC80b+/hSfljFlEBLHrrh+CIONLDz9NuFl0af4Mw= github.com/holiman/uint256 v1.1.1/go.mod h1:y4ga/t+u+Xwd7CpDgZESaRcWy0I7XMlTMA25ApIH5Jw= github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/huandu/xstrings v1.0.0/go.mod h1:4qWG/gcEcfX4z/mBDHJ++3ReCw9ibxbsNJbcucJdbSo= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= github.com/hudl/fargo v1.3.0/go.mod h1:y3CKSmjA+wD2gak7sUSXTAoopbhU08POFhmITJgmKTg= github.com/huin/goupnp v1.0.0/go.mod h1:n9v9KO1tAxYH82qOn+UTIFQDmx5n1Zxd/ClZDMX7Bnc= github.com/huin/goupnp v1.0.1-0.20200620063722-49508fba0031/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88 h1:bcAj8KroPf552TScjFPIakjH2/tdIrIH8F+cc4v4SRo= github.com/huin/goupnp v1.0.1-0.20210310174557-0ca763054c88/go.mod h1:nNs7wvRfN1eKaMknBydLNQU6146XQim8t4h+q90biWo= github.com/huin/goutil v0.0.0-20170803182201-1ca381bf3150/go.mod h1:PpLOETDnJ0o3iZrZfqZzyLl6l7F3c6L1oWn7OICBi6o= +github.com/iancoleman/strcase v0.0.0-20180726023541-3605ed457bf7/go.mod h1:SK73tn/9oHe+/Y0h39VT4UCxmurVJkR5NA7kMEAOgSE= github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.4/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.12 h1:b6R2BslTbIEToALKP7LxUvijTsNI9TAe80pLWN2g/HU= +github.com/imdario/mergo v0.3.12/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/improbable-eng/grpc-web v0.14.0/go.mod h1:6hRR09jOEG81ADP5wCQju1z71g6OL4eEvELdran/3cs= github.com/improbable-eng/grpc-web v0.14.1 h1:NrN4PY71A6tAz2sKDvC5JCauENWp0ykG8Oq1H3cpFvw= github.com/improbable-eng/grpc-web v0.14.1/go.mod h1:zEjGHa8DAlkoOXmswrNvhUGEYQA9UI7DhrGeHR1DMGU= @@ -575,8 +595,8 @@ github.com/ipfs/go-cid v0.0.3 h1:UIAh32wymBpStoe83YCzwVQQ5Oy/H0FdxvUS6DJDzms= github.com/ipfs/go-cid v0.0.3/go.mod h1:GHWU/WuQdMPmIosc4Yn1bcCT7dSeX4lBafM7iqUPQvM= github.com/ipfs/go-ipfs-util v0.0.1 h1:Wz9bL2wB2YBJqggkA4dD7oSmqB4cAnpNbGrlHJulv50= github.com/ipfs/go-ipfs-util v0.0.1/go.mod h1:spsl5z8KUnrve+73pOhSVZND1SIxPW5RyBCNzQxlJBc= -github.com/ipfs/go-ipld-cbor v0.0.4 h1:Aw3KPOKXjvrm6VjwJvFf1F1ekR/BH3jdof3Bk7OTiSA= -github.com/ipfs/go-ipld-cbor v0.0.4/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= +github.com/ipfs/go-ipld-cbor v0.0.5 h1:ovz4CHKogtG2KB/h1zUp5U0c/IzZrL435rCh5+K/5G8= +github.com/ipfs/go-ipld-cbor v0.0.5/go.mod h1:BkCduEx3XBCO6t2Sfo5BaHzuok7hbhdMm9Oh8B2Ftq4= github.com/ipfs/go-ipld-format v0.0.1 h1:HCu4eB/Gh+KD/Q0M8u888RFkorTWNIL3da4oc5dwc80= github.com/ipfs/go-ipld-format v0.0.1/go.mod h1:kyJtbkDALmFHv3QR6et67i35QzO3S0dCDnkOJhcZkms= github.com/jackpal/go-nat-pmp v1.0.2-0.20160603034137-1fa385a6f458 h1:6OvNmYgJyexcZ3pYbTI9jWx5tHo1Dee/tWbLMfPe2TA= @@ -620,10 +640,8 @@ github.com/jung-kurt/gofpdf v1.0.3-0.20190309125859-24315acbbda5/go.mod h1:7Id9E github.com/jwilder/encoding v0.0.0-20170811194829-b4e1701a28ef/go.mod h1:Ct9fl0F6iIOGgxJ5npU/IUOhOhqlVrGjyIZc8/MagT0= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356 h1:I/yrLt2WilKxlQKCM52clh5rGzTKpVctGT1lH4Dc8Jw= github.com/karalabe/usb v0.0.0-20190919080040-51dc0efba356/go.mod h1:Od972xHfMJowv7NGVDiWVxk2zxnWgjLlJzE+F4F7AGU= +github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d h1:Z+RDyXzjKE0i2sTjZ/b1uxiGtPhFy34Ou/Tk0qwN0kM= github.com/keybase/go-keychain v0.0.0-20190712205309-48d3d31d256d/go.mod h1:JJNrCn9otv/2QP4D7SMJBgaleKpOf66PnW6F5WGNRIc= -github.com/keybase/go-keychain v0.0.0-20200502122510-cda31fe0c86d h1:gVjhBCfVGl32RIBooOANzfw+0UqX8HU+yPlMv8vypcg= -github.com/keybase/go-keychain v0.0.0-20200502122510-cda31fe0c86d/go.mod h1:W6EbaYmb4RldPn0N3gvVHjY1wmU59kbymhW9NATWhwY= -github.com/keybase/go.dbus v0.0.0-20200324223359-a94be52c0b03/go.mod h1:a8clEhrrGV/d76/f9r2I41BwANMihfZYV9C223vaxqE= github.com/kilic/bls12-381 v0.0.0-20201226121925-69dacb279461/go.mod h1:vDTTHJONJ6G+P2R74EhnyotQDTliQDnFEwhdmfzw1ig= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= @@ -667,6 +685,7 @@ github.com/libp2p/go-buffer-pool v0.0.2/go.mod h1:MvaB6xw5vOrDl8rYZGLFdKAuk/hRoR github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/lucasjones/reggen v0.0.0-20180717132126-cdb49ff09d77/go.mod h1:5ELEyG+X8f+meRWHuqUOewBOhvHkl7M76pdGEansxW4= +github.com/lyft/protoc-gen-star v0.5.1/go.mod h1:9toiA3cC7z5uVbODF7kEQ91Xn7XNFkVUl+SrEe+ZORU= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.1/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= @@ -706,6 +725,8 @@ github.com/minio/sha256-simd v0.0.0-20190131020904-2d45a736cd16/go.mod h1:2FMWW+ github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771 h1:MHkK1uRtFbVqvAgvWxafZe54+5uBxLluGylDiKgdhwo= github.com/minio/sha256-simd v0.1.1-0.20190913151208-6de447530771/go.mod h1:B5e1o+1/KgNmWrSQK08Y6Z1Vb5pwIktudl0J58iy0KM= github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/copystructure v1.2.0 h1:vpKXTN4ewci03Vljg/q9QvCGUDttBOGBIa15WveJJGw= +github.com/mitchellh/copystructure v1.2.0/go.mod h1:qLl+cE2AmVv+CoeAwDPye/v+N2HKCj9FbZEVFJRxO9s= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= @@ -716,6 +737,8 @@ github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh github.com/mitchellh/mapstructure v1.3.3/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/mapstructure v1.4.1 h1:CpVNEelQCZBooIPDn+AR3NpivK/TIKU8bDxdASFVQag= github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/reflectwalk v1.0.2 h1:G2LzWKi524PWgd3mLHV8Y5k7s6XUvT0Gef6zxSIeXaQ= +github.com/mitchellh/reflectwalk v1.0.2/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= github.com/moby/sys/mountinfo v0.4.1/go.mod h1:rEr8tzG/lsIZHBtN/JjGG+LMYx9eXgW2JI+6q0qou+A= github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= @@ -724,9 +747,8 @@ github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lN github.com/modern-go/reflect2 v1.0.1 h1:9f412s+6RmYXLWZSEzVVgPGK7C2PphHj5RJrvfx9AWI= github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= github.com/mr-tron/base58 v1.1.0/go.mod h1:xcD2VGqlgYjBdcBLw+TuYLr8afG+Hj8g2eTVqeSzSU8= +github.com/mr-tron/base58 v1.1.2 h1:ZEw4I2EgPKDJ2iEw0cNmLB3ROrEmkOtXIkaG7wZg+78= github.com/mr-tron/base58 v1.1.2/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= -github.com/mr-tron/base58 v1.1.3 h1:v+sk57XuaCKGXpWtVBX8YJzO7hMGx4Aajh4TQbdEFdc= -github.com/mr-tron/base58 v1.1.3/go.mod h1:BinMc/sQntlIE1frQmRFPUoPA1Zkr8VRgBdjWI2mNwc= github.com/mrunalp/fileutils v0.5.0/go.mod h1:M1WthSahJixYnrXQl/DFQuteStB1weuxD2QJNHXfbSQ= github.com/mschoch/smat v0.0.0-20160514031455-90eadee771ae/go.mod h1:qAyveg+e4CE+eKJXWVjKXM4ck2QobLqTDytGJbLLhJg= github.com/mtibben/percent v0.2.1 h1:5gssi8Nqo8QU/r2pynCm+hBQHpkB/uNK7BJCFogWdzs= @@ -736,14 +758,14 @@ github.com/multiformats/go-base32 v0.0.3/go.mod h1:pLiuGC8y0QR3Ue4Zug5UzK9LjgbkL github.com/multiformats/go-multibase v0.0.1 h1:PN9/v21eLywrFWdFNsFKaU04kLJzuYzmrJR+ubhT9qA= github.com/multiformats/go-multibase v0.0.1/go.mod h1:bja2MqRZ3ggyXtZSEDKpl0uO/gviWFaSteVbWT51qgs= github.com/multiformats/go-multihash v0.0.1/go.mod h1:w/5tugSrLEbWqlcgJabL3oHFKTwfvkofsjW2Qa1ct4U= +github.com/multiformats/go-multihash v0.0.10 h1:lMoNbh2Ssd9PUF74Nz008KGzGPlfeV6wH3rit5IIGCM= github.com/multiformats/go-multihash v0.0.10/go.mod h1:YSLudS+Pi8NHE7o6tb3D8vrpKa63epEDmG8nTduyAew= -github.com/multiformats/go-multihash v0.0.14 h1:QoBceQYQQtNUuf6s7wHxnE2c8bhbMqhfGzNI032se/I= -github.com/multiformats/go-multihash v0.0.14/go.mod h1:VdAWLKTwram9oKAatUcLxBNUjdtcVwxObEQBtRfuyjc= -github.com/multiformats/go-varint v0.0.5 h1:XVZwSo04Cs3j/jS0uAEPpT3JY6DzMcVLLoWOSnCxOjg= -github.com/multiformats/go-varint v0.0.5/go.mod h1:3Ls8CIEsrijN6+B7PbrXRPxHRPuXSrVKRY101jdMZYE= github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f h1:KUppIJq7/+SVif2QVs3tOP0zanoHgBEVAwHxUSIzRqU= github.com/mwitkow/go-conntrack v0.0.0-20190716064945-2f068394615f/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= +github.com/mwitkow/go-proto-validators v0.0.0-20180403085117-0950a7990007/go.mod h1:m2XC9Qq0AlmmVksL6FktJCdTYyLk7V3fKyp0sl1yWQo= +github.com/mwitkow/go-proto-validators v0.3.2 h1:qRlmpTzm2pstMKKzTdvwPCF5QfBNURSlAgN/R+qbKos= +github.com/mwitkow/go-proto-validators v0.3.2/go.mod h1:ej0Qp0qMgHN/KtDyUt+Q1/tA7a5VarXUOUxD+oeD30w= github.com/mwitkow/grpc-proxy v0.0.0-20181017164139-0f1106ef9c76/go.mod h1:x5OoJHDHqxHS801UIuhqGl6QdSAEJvtausosHSdazIo= github.com/naoina/go-stringutil v0.1.0/go.mod h1:XJ2SJL9jCtBh+P9q5btrd/Ylo8XwT/h1USek5+NqSA0= github.com/naoina/toml v0.1.2-0.20170918210437-9fafd6967416/go.mod h1:NBIhNtsFMo3G2szEBne+bO4gS192HuIYRqfvOWb4i1E= @@ -840,6 +862,7 @@ github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINE github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA= github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= github.com/pkg/term v0.0.0-20180730021639-bffc007b7fd5/go.mod h1:eCbImbZ95eXtAUIbLAuAVnBnwf83mjf6QIVH8SHYwqQ= +github.com/pmezard/go-difflib v0.0.0-20151028094244-d8ed2627bdf0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/polydawn/refmt v0.0.0-20190221155625-df39d6c2d992 h1:bzMe+2coZJYHnhGgVlcQKuRy4FSny4ds8dLQjw5P1XE= @@ -890,6 +913,10 @@ github.com/prometheus/procfs v0.6.0/go.mod h1:cz+aTbrPOrUb4q7XlbU9ygM+/jj0fzG6c1 github.com/prometheus/tsdb v0.6.2-0.20190402121629-4f204dcbc150/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= github.com/prometheus/tsdb v0.7.1 h1:YZcsG11NqnK4czYLrWd9mpEuAJIHVQLwdrleYfszMAA= github.com/prometheus/tsdb v0.7.1/go.mod h1:qhTCs0VvXwvX/y3TZrWD7rabWM+ijKTux40TwIPHuXU= +github.com/pseudomuto/protoc-gen-doc v1.5.0 h1:pHZp0MEiT68jrZV8js8BS7E9ZEnlSLegoQbbtXj5lfo= +github.com/pseudomuto/protoc-gen-doc v1.5.0/go.mod h1:exDTOVwqpp30eV/EDPFLZy3Pwr2sn6hBC1WIYH/UbIg= +github.com/pseudomuto/protokit v0.2.0 h1:hlnBDcy3YEDXH7kc9gV+NLaN0cDzhDvD1s7Y6FZ8RpM= +github.com/pseudomuto/protokit v0.2.0/go.mod h1:2PdH30hxVHsup8KpBTOXTBeMVhJZVio3Q8ViKSAXT0Q= github.com/rakyll/statik v0.1.7 h1:OF3QCZUuyPxuGEP7B4ypUa7sB/iHtqOTDYZXGM8KOdQ= github.com/rakyll/statik v0.1.7/go.mod h1:AlZONWzMtEnMs7W4e/1LURLiI49pIMmp6V9Unghqrcc= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -953,6 +980,8 @@ github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasO github.com/spaolacci/murmur3 v1.1.0 h1:7c1g84S4BPRrfL5Xrdp6fOJ206sU9y293DDHaoy0bLI= github.com/spaolacci/murmur3 v1.1.0/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= github.com/spf13/afero v1.1.2/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/afero v1.3.3/go.mod h1:5KUK8ByomD5Ti5Artl0RtHeI5pTF7MIDuXL3yY520V4= +github.com/spf13/afero v1.3.4/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/cast v1.3.0/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= @@ -992,6 +1021,7 @@ github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+ github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.2.0 h1:Hbg2NidpLE8veEBkEZTL3CvlkUIVzuU9jDplZO54c48= github.com/stretchr/objx v0.2.0/go.mod h1:qt09Ya8vawLte6SNmTgCsAVtYtaKzEcn8ATUoHMkEqE= +github.com/stretchr/testify v0.0.0-20170130113145-4d4bfba8f1d1/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.0/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= @@ -1109,6 +1139,7 @@ go.uber.org/zap v1.10.0/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= go.uber.org/zap v1.13.0/go.mod h1:zwrFLgMcdUuIBviXEYEH1YKNaOBnKXsx2IPda5bBwHM= go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= golang.org/x/crypto v0.0.0-20170930174604-9419663f5a44/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20180501155221-613d6eafa307/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20181203042331-505ab145d0a9/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= @@ -1125,7 +1156,6 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191206172530-e9b2fee46413/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200709230013-948cd5f35899/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= @@ -1138,6 +1168,8 @@ golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210220033148-5ea612d1eb83/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4= +golang.org/x/crypto v0.0.0-20210920023735-84f357641f63 h1:kETrAMYZq6WVGPa8IIixL0CaEcIUNi+1WX7grUoi3y8= +golang.org/x/crypto v0.0.0-20210920023735-84f357641f63/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1255,6 +1287,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190412183630-56d357773e84/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1474,6 +1507,7 @@ google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCID google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20181107211654-5fc9ac540362/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -1522,8 +1556,16 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20210929214142-896c89f843d2 h1:G7kbolbig6UyfoRItVUeBGV/38VzxjAZYTavVGbYYss= -google.golang.org/genproto v0.0.0-20210929214142-896c89f843d2/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20210920155426-26f343e4c215 h1:bdVWLCdfDvdxf+qXZp5iip6vl2zJGgzhkULcsAiBNmE= +google.golang.org/genproto v0.0.0-20210920155426-26f343e4c215/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6 h1:2ncG/LajxmrclaZH+ppVi02rQxz4eXYJzGHdFN4Y9UA= +google.golang.org/genproto v0.0.0-20210921142501-181ce0d877f6/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0 h1:5Tbluzus3QxoAJx4IefGt1W0HQZW4nuMrVk684jI74Q= +google.golang.org/genproto v0.0.0-20210924002016-3dee208752a0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20210930144712-2e2e1008e8a3 h1:+F3FcO6LTrzNq5wp1Z6JtoBvnJzX6euyN70FoyMDXy4= +google.golang.org/genproto v0.0.0-20210930144712-2e2e1008e8a3/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211001223012-bfb93cce50d9 h1:eF1wcrhdz56Vugf8qNX5dD93ItkrhothojQyHXqloe0= +google.golang.org/genproto v0.0.0-20211001223012-bfb93cce50d9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.0.1/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/proto/vulcanize/nameservice/v1beta1/genesis.proto b/proto/vulcanize/nameservice/v1beta1/genesis.proto new file mode 100644 index 00000000..8d71c3ec --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/genesis.proto @@ -0,0 +1,30 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/nameservice/v1beta1/nameservice.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// GenesisState defines the nameservice module's genesis state. +message GenesisState { + // params defines all the params of nameservice module. + Params params = 1 [ + (gogoproto.nullable) = false + ]; + // records + repeated Record records = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"records\" yaml:\"records\"" + ]; + // authorities + repeated AuthorityEntry authorities = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authorities\" yaml:\"authorities\"" + ]; + // names + repeated NameEntry names = 4 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"names\" yaml:\"names\"" + ]; +} diff --git a/proto/vulcanize/nameservice/v1beta1/nameservice.proto b/proto/vulcanize/nameservice/v1beta1/nameservice.proto new file mode 100644 index 00000000..eaea8149 --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/nameservice.proto @@ -0,0 +1,170 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "google/protobuf/duration.proto"; +import "google/protobuf/timestamp.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// Params defines the nameservice module parameters +message Params { + cosmos.base.v1beta1.Coin record_rent = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"record_rent\" yaml:\"record_rent\"" + ]; + google.protobuf.Duration record_rent_duration = 2 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"record_rent_duration\" yaml:\"record_rent_duration\"" + ]; + cosmos.base.v1beta1.Coin authority_rent = 3 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_rent\" yaml:\"authority_rent\"" + ]; + google.protobuf.Duration authority_rent_duration = 4 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_rent_duration\" yaml:\"authority_rent_duration\"" + ]; + google.protobuf.Duration authority_grace_period = 5 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_grace_period\" yaml:\"authority_grace_period\"" + ]; + bool authority_auction_enabled = 6 [ + (gogoproto.moretags) = "json:\"authority_auction_enabled\" yaml:\"authority_auction_enabled\"" + ]; + google.protobuf.Duration authority_auction_commits_duration = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_auction_commits_duration\" yaml:\"authority_auction_commits_duration\"" + ]; + google.protobuf.Duration authority_auction_reveals_duration = 8 [ + (gogoproto.nullable) = false, + (gogoproto.stdduration) = true, + (gogoproto.moretags) = "json:\"authority_auction_reveals_duration\" yaml:\"authority_auction_reveals_duration\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_commit_fee = 9 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_commit_fee\" yaml:\"authority_auction_commit_fee\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_reveal_fee = 10 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_reveal_fee\" yaml:\"authority_auction_reveal_fee\"" + ]; + cosmos.base.v1beta1.Coin authority_auction_minimum_bid = 11 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"authority_auction_minimum_bid\" yaml:\"authority_auction_minimum_bid\"" + ]; +} + +// Params defines the nameservice module records +message Record { + string id = 1 [ + (gogoproto.moretags) = "json:\"id\" yaml:\"id\"" + ]; + string bond_id = 2 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + google.protobuf.Timestamp create_time = 3 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"createTime\" yaml:\"createTime\"" + ]; + google.protobuf.Timestamp expiry_time = 4 [ + (gogoproto.stdtime) = true, + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" + ]; + bool deleted = 5; + repeated string owners = 6 [ + (gogoproto.moretags) = "json:\"owners\" yaml:\"owners\"" + ]; + bytes attributes = 7 [ + (gogoproto.moretags) = "json:\"attributes\" yaml:\"attributes\"" + ]; +} + +// AuthorityEntry defines the nameservice module AuthorityEntries +message AuthorityEntry{ + string name = 1; + NameAuthority entry = 2; +} + +// NameAuthority +message NameAuthority { + // Owner public key. + string owner_public_key = 1 [ + (gogoproto.moretags) = "json:\"ownerPublicKey\" yaml:\"ownerPublicKey\"" + ]; + // Owner address. + string owner_address = 2 [ + (gogoproto.moretags) = "json:\"ownerAddress\" yaml:\"ownerAddress\"" + ]; + // height at which name/authority was created. + uint64 height = 3; + string status = 4; + string auction_id = 5 [ + (gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\"" + ]; + string bond_id = 6 [ + (gogoproto.moretags) = "json:\"bondID\" yaml:\"bondID\"" + ]; + google.protobuf.Timestamp expiry_time = 7 [ + (gogoproto.nullable) = false, + (gogoproto.stdtime) = true, + (gogoproto.moretags) = "json:\"expiryTime\" yaml:\"expiryTime\"" + ]; +} + +// NameEntry +message NameEntry{ + string name = 1; + NameRecord entry = 2; +} + +// NameRecord +message NameRecord { + NameRecordEntry latest = 1; + repeated NameRecordEntry history = 2; +} + +// NameRecordEntry +message NameRecordEntry{ + string id = 1; + uint64 height = 2; +} + +// Signature +message Signature{ + string sig = 1 [ + (gogoproto.moretags) = "json:\"sig\" yaml:\"sig\"" + ]; + string pub_key = 2 [ + (gogoproto.moretags) = "json:\"pubKey\" yaml:\"pubKey\"" + ]; +} + +// BlockChangeSet +message BlockChangeSet{ + int64 height = 1; + repeated string records = 2; + repeated string auctions = 3; + repeated AuctionBidInfo auction_bids = 4 [ + (gogoproto.moretags) = "json:\"auctionBids\" yaml:\"auctionBids\"" + ]; + repeated string authorities = 5; + repeated string names = 6; +} + +// AuctionBidInfo +message AuctionBidInfo { + string auction_id = 1 [ + (gogoproto.moretags) = "json:\"auctionID\" yaml:\"auctionID\"" + ]; + string bidder_address = 2 [ + (gogoproto.moretags) = "json:\"bidderAddress\" yaml:\"bidderAddress\"" + ]; +} \ No newline at end of file diff --git a/proto/vulcanize/nameservice/v1beta1/query.proto b/proto/vulcanize/nameservice/v1beta1/query.proto new file mode 100644 index 00000000..807ddc2b --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/query.proto @@ -0,0 +1,211 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "vulcanize/nameservice/v1beta1/nameservice.proto"; +import "google/api/annotations.proto"; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "gogoproto/gogo.proto"; +import "cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// Query defines the gRPC querier service for nameservice module +service Query { + // Params queries the nameservice module params. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { + option (google.api.http).get = "/ethermint/nameservice/v1/params"; + } + // List records + rpc ListRecords(QueryListRecordsRequest) returns (QueryListRecordsResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/records"; + } + // Get record by id + rpc GetRecord(QueryRecordByIdRequest) returns (QueryRecordByIdResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/records/{id}"; + } + // Get records by bond id + rpc GetRecordByBondId(QueryRecordByBondIdRequest) returns (QueryRecordByBondIdResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/records-by-bond-id/{id}"; + } + // Get nameservice module balance + rpc GetNameServiceModuleBalance(GetNameServiceModuleBalanceRequest) returns (GetNameServiceModuleBalanceResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/balance"; + } + // List name records + rpc ListNameRecords(QueryListNameRecordsRequest) returns (QueryListNameRecordsResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/names"; + } + // Whois method retrieve the name authority info + rpc Whois(QueryWhoisRequest) returns (QueryWhoisResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/whois/{name}"; + } + // LookupWrn + rpc LookupWrn(QueryLookupWrn) returns (QueryLookupWrnResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/lookup/{wrn}"; + } + // ResolveWrn + rpc ResolveWrn(QueryResolveWrn) returns (QueryResolveWrnResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/resolve/{wrn}"; + } + // GetRecordExpiryQueue + rpc GetRecordExpiryQueue(QueryGetRecordExpiryQueue) returns (QueryGetRecordExpiryQueueResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/record-expiry"; + } + // GetAuthorityExpiryQueue + rpc GetAuthorityExpiryQueue(QueryGetAuthorityExpiryQueue) returns (QueryGetAuthorityExpiryQueueResponse){ + option (google.api.http).get = "/ethermint/nameservice/v1/authority-expiry"; + } +} + +// QueryParamsRequest is request type for nameservice params +message QueryParamsRequest{ +} + +// QueryParamsResponse is response type for nameservice params +message QueryParamsResponse{ + Params params = 1; +} + +// QueryListRecordsRequest is request type for nameservice records list +message QueryListRecordsRequest{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryListRecordsResponse is response type for nameservice records list +message QueryListRecordsResponse{ + repeated Record records = 1 [ + (gogoproto.nullable) = false + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +//QueryRecordByIdRequest is request type for nameservice records by id +message QueryRecordByIdRequest{ + string id = 1 ; +} + +// QueryRecordByIdResponse is response type for nameservice records by id +message QueryRecordByIdResponse{ + Record record = 1[ + (gogoproto.nullable) = false + ]; +} + +// QueryRecordByBondIdRequest is request type for get the records by bond-id +message QueryRecordByBondIdRequest{ + string id = 1; + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 2; +} + +// QueryRecordByBondIdResponse is response type for records list by bond-id +message QueryRecordByBondIdResponse{ + repeated Record records = 1 [ + (gogoproto.nullable) = false + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance +message GetNameServiceModuleBalanceRequest{ +} + +// GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance +message GetNameServiceModuleBalanceResponse{ + repeated AccountBalance balances = 1; +} + +// AccountBalance is nameservice module account balance +message AccountBalance { + string account_name = 1 [ + (gogoproto.moretags) = "json:\"accountName\" yaml:\"accountName\"" + ]; + repeated cosmos.base.v1beta1.Coin balance = 3 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (gogoproto.moretags) = "json:\"balance\" yaml:\"balance\"" + ]; +} + +// QueryListNameRecordsRequest is request type for nameservice names records +message QueryListNameRecordsRequest{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryListNameRecordsResponse is response type for nameservice names records +message QueryListNameRecordsResponse{ + repeated NameEntry names = 1 [ + (gogoproto.nullable) = false + ]; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// QueryWhoisRequest is request type for Get NameAuthority +message QueryWhoisRequest{ + string name = 1; +} + +// QueryWhoisResponse is response type for whois request +message QueryWhoisResponse{ + NameAuthority name_authority = 1 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"nameAuthority\" yaml:\"nameAuthority\"" + ]; +} + +// QueryLookupWrn is request type for LookupWrn +message QueryLookupWrn{ + string wrn = 1; +} + +// QueryLookupWrnResponse is response type for QueryLookupWrn +message QueryLookupWrnResponse{ + NameRecord name = 1; +} + +// QueryResolveWrn is request type for ResolveWrn +message QueryResolveWrn{ + string wrn = 1; +} + +// QueryResolveWrnResponse is response type for QueryResolveWrn +message QueryResolveWrnResponse{ + Record record = 1; +} + +// QueryGetRecordExpiryQueue +message QueryGetRecordExpiryQueue{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetRecordExpiryQueueResponse +message QueryGetRecordExpiryQueueResponse{ + repeated ExpiryQueueRecord records = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +// ExpiryQueueRecord +message ExpiryQueueRecord{ + string id = 1; + repeated string value = 2; +} + +// QueryGetAuthorityExpiryQueue +message QueryGetAuthorityExpiryQueue{ + // pagination defines an optional pagination for the request. + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// QueryGetAuthorityExpiryQueueResponse +message QueryGetAuthorityExpiryQueueResponse{ + repeated ExpiryQueueRecord authorities = 1; + // pagination defines the pagination in the response. + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} diff --git a/proto/vulcanize/nameservice/v1beta1/tx.proto b/proto/vulcanize/nameservice/v1beta1/tx.proto new file mode 100644 index 00000000..5662aa6f --- /dev/null +++ b/proto/vulcanize/nameservice/v1beta1/tx.proto @@ -0,0 +1,167 @@ +syntax = "proto3"; +package vulcanize.nameservice.v1beta1; + +import "gogoproto/gogo.proto"; +import "vulcanize/nameservice/v1beta1/nameservice.proto"; + +option go_package = "github.com/tharsis/ethermint/x/nameservice/types"; + +// Msg +service Msg { + // SetRecord will records a new record with given payload and bond id + rpc SetRecord(MsgSetRecord) returns(MsgSetRecordResponse){} + // Renew Record will renew the expire record + rpc RenewRecord(MsgRenewRecord) returns (MsgRenewRecordResponse){} + // AssociateBond + rpc AssociateBond(MsgAssociateBond) returns (MsgAssociateBondResponse){} + // DissociateBond + rpc DissociateBond(MsgDissociateBond) returns (MsgDissociateBondResponse){} + // DissociateRecords + rpc DissociateRecords(MsgDissociateRecords) returns (MsgDissociateRecordsResponse){} + // ReAssociateRecords + rpc ReAssociateRecords(MsgReAssociateRecords) returns (MsgReAssociateRecordsResponse){} + // SetName will store the name with given wrn and name + rpc SetName(MsgSetName) returns (MsgSetNameResponse){} + // Reserve name + rpc ReserveName(MsgReserveAuthority) returns (MsgReserveAuthorityResponse){} + // Delete Name method will remove authority name + rpc DeleteName(MsgDeleteNameAuthority) returns (MsgDeleteNameAuthorityResponse){} + // SetAuthorityBond + rpc SetAuthorityBond(MsgSetAuthorityBond) returns (MsgSetAuthorityBondResponse){} +} + +// MsgSetRecord +message MsgSetRecord{ + string bond_id = 1 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 2; + Payload payload = 3 [ + (gogoproto.nullable) = false + ]; +} + +// MsgSetRecordResponse +message MsgSetRecordResponse{ +} + +// Payload +message Payload { + Record record = 1; + repeated Signature signatures = 2 [ + (gogoproto.nullable) = false, + (gogoproto.moretags) = "json:\"signatures\" yaml:\"signatures\"" + ]; +} + +// MsgSetName +message MsgSetName{ + string wrn = 1; + string cid = 2; + string signer = 3; +} + +// MsgSetNameResponse +message MsgSetNameResponse{ +} + +// MsgReserveName +message MsgReserveAuthority{ + string name = 1; + string signer = 2; + // if creating a sub-authority. + string owner = 3; +} + +// MsgReserveNameResponse +message MsgReserveAuthorityResponse{ +} + +// MsgSetAuthorityBond is SDK message for SetAuthorityBond +message MsgSetAuthorityBond{ + string name = 1; + string bond_id = 2 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 3; +} + +// MsgSetAuthorityBondResponse +message MsgSetAuthorityBondResponse{ +} + +// MsgDeleteNameAuthority is SDK message for DeleteNameAuthority +message MsgDeleteNameAuthority{ + string wrn = 1; + string signer = 2; +} + +// MsgDeleteNameAuthorityResponse +message MsgDeleteNameAuthorityResponse{ +} + +//MsgRenewRecord is SDK message for Renew a record +message MsgRenewRecord{ + string record_id = 1 [ + (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" + ]; + string signer = 2; +} + +// MsgRenewRecordResponse +message MsgRenewRecordResponse{ +} + +// MsgAssociateBond +message MsgAssociateBond{ + string record_id = 1 [ + (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" + ]; + string bond_id = 2 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 3; +} + +// MsgAssociateBondResponse +message MsgAssociateBondResponse{ +} + +// MsgDissociateBond is SDK message for Msg/DissociateBond +message MsgDissociateBond{ + string record_id = 1 [ + (gogoproto.moretags) = "json:\"recordId\" yaml:\"recordId\"" + ]; + string signer = 2; +} + +// MsgDissociateBondResponse is response type for MsgDissociateBond +message MsgDissociateBondResponse{ +} + +// MsgDissociateRecords is SDK message for Msg/DissociateRecords +message MsgDissociateRecords{ + string bond_id = 1 [ + (gogoproto.moretags) = "json:\"bondId\" yaml:\"bondId\"" + ]; + string signer = 2; +} + +// MsgDissociateRecordsResponse is response type for MsgDissociateRecords +message MsgDissociateRecordsResponse{ +} + +// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords +message MsgReAssociateRecords{ + string new_bond_id = 1 [ + (gogoproto.moretags) = "json:\"newBondId\" yaml:\"newBondId\"" + ]; + string old_bond_id = 2 [ + (gogoproto.moretags) = "json:\"oldBondId\" yaml:\"oldBondId\"" + ]; + string signer = 3; +} + +// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords +message MsgReAssociateRecordsResponse{ +} diff --git a/server/flags/flags.go b/server/flags/flags.go index e2151a7c..710e3e3e 100644 --- a/server/flags/flags.go +++ b/server/flags/flags.go @@ -5,6 +5,7 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keyring" "github.com/spf13/cobra" "github.com/spf13/viper" + tmcli "github.com/tendermint/tendermint/libs/cli" ) // Tendermint full-node start flags @@ -49,6 +50,7 @@ func AddTxFlags(cmd *cobra.Command) *cobra.Command { cmd.PersistentFlags().StringP(flags.FlagBroadcastMode, "b", flags.BroadcastSync, "Transaction broadcasting mode (sync|async|block)") cmd.PersistentFlags().String(flags.FlagKeyringBackend, keyring.BackendOS, "Select keyring's backend") cmd.PersistentFlags().BoolP(flags.FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation") + cmd.Flags().StringP(tmcli.OutputFlag, "o", "text", "Output format (text|json)") // --gas can accept integers and "simulate" // cmd.PersistentFlags().Var(&flags.GasFlagVar, "gas", fmt.Sprintf( diff --git a/x/auction/keeper/keeper.go b/x/auction/keeper/keeper.go index 96df3016..1a71156c 100644 --- a/x/auction/keeper/keeper.go +++ b/x/auction/keeper/keeper.go @@ -19,7 +19,7 @@ import ( ) // CompletedAuctionDeleteTimeout => Completed auctions are deleted after this timeout (after reveals end time). -const CompletedAuctionDeleteTimeout time.Duration = time.Hour * 24 +const CompletedAuctionDeleteTimeout = time.Hour * 24 // PrefixIDToAuctionIndex is the prefix for Id -> Auction index in the KVStore. // Note: This is the primary index in the system. @@ -55,16 +55,16 @@ type AuctionClientKeeper interface { } // NewKeeper creates new instances of the auction Keeper -func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec, paramstore params.Subspace) Keeper { - if !paramstore.HasKeyTable() { - paramstore = paramstore.WithKeyTable(types.ParamKeyTable()) +func NewKeeper(accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec, ps params.Subspace) Keeper { + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) } return Keeper{ accountKeeper: accountKeeper, bankKeeper: bankKeeper, storeKey: storeKey, cdc: cdc, - paramSubspace: paramstore, + paramSubspace: ps, } } @@ -512,16 +512,13 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) { // Only consider revealed bids. if bid.Status != types.BidStatusRevealed { ctx.Logger().Info(fmt.Sprintf("Ignoring unrevealed bid %s %s", bid.BidderAddress, bid.BidAmount.String())) - continue } // Init highest bid. if highestBid == nil { highestBid = bid - ctx.Logger().Info(fmt.Sprintf("Initializing 1st bid %s %s", bid.BidderAddress, bid.BidAmount.String())) - continue } @@ -570,6 +567,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) { for _, bid := range bids { bidderAddress, err := sdk.AccAddressFromBech32(bid.BidderAddress) if err != nil { + ctx.Logger().Error(fmt.Sprintf("Invalid bidderAddress address. %v", err)) panic("Invalid bidder address.") } @@ -594,6 +592,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) { if auction.WinnerAddress != "" { winnerAddress, err := sdk.AccAddressFromBech32(auction.WinnerAddress) if err != nil { + ctx.Logger().Error(fmt.Sprintf("Invalid winner address. %v", err)) panic("Invalid winner address.") } @@ -607,6 +606,7 @@ func (k Keeper) pickAuctionWinner(ctx sdk.Context, auction *types.Auction) { // Burn anything over the min. bid amount. amountToBurn := auction.WinningPrice.Sub(auction.MinimumBid) if amountToBurn.IsNegative() { + ctx.Logger().Error(fmt.Sprintf("Auction coins to burn cannot be negative.")) panic("Auction coins to burn cannot be negative.") } diff --git a/x/auction/types/types.go b/x/auction/types/types.go index 6cdd63c5..db56bef1 100644 --- a/x/auction/types/types.go +++ b/x/auction/types/types.go @@ -63,9 +63,3 @@ func (bid Bid) GetCommitTime() string { func (bid Bid) GetRevealTime() string { return string(sdk.FormatTimeBytes(bid.RevealTime)) } - -// AuctionBidInfo is used in the block changeset. -type AuctionBidInfo struct { - AuctionID string - BidderAddress string -} diff --git a/x/bond/keeper/keeper.go b/x/bond/keeper/keeper.go index 70bc0338..3732bb19 100644 --- a/x/bond/keeper/keeper.go +++ b/x/bond/keeper/keeper.go @@ -26,6 +26,9 @@ type Keeper struct { accountKeeper auth.AccountKeeper bankKeeper bank.Keeper + // Track bond usage in other cosmos-sdk modules (more like a usage tracker). + usageKeepers []types.BondUsageKeeper + storeKey sdk.StoreKey cdc codec.BinaryCodec @@ -34,7 +37,7 @@ type Keeper struct { } // NewKeeper creates new instances of the bond Keeper -func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, storeKey sdk.StoreKey, ps paramtypes.Subspace) Keeper { +func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, usageKeepers []types.BondUsageKeeper, storeKey sdk.StoreKey, ps paramtypes.Subspace) Keeper { // set KeyTable if it has not already been set if !ps.HasKeyTable() { ps = ps.WithKeyTable(types.ParamKeyTable()) @@ -45,6 +48,7 @@ func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeep bankKeeper: bankKeeper, storeKey: storeKey, cdc: cdc, + usageKeepers: usageKeepers, paramSubspace: ps, } } @@ -269,13 +273,12 @@ func (k Keeper) CancelBond(ctx sdk.Context, id string, ownerAddress sdk.AccAddre return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond owner mismatch.") } - // todo: continue this once nameservice is implemented // Check if bond is used in other modules. - //for _, usageKeeper := range k.usageKeepers { - // if usageKeeper.UsesBond(ctx, id) { - // return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, fmt.Sprintf("Bond in use by the '%s' module.", usageKeeper.ModuleName())) - // } - //} + for _, usageKeeper := range k.usageKeepers { + if usageKeeper.UsesBond(ctx, id) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnauthorized, fmt.Sprintf("Bond in use by the '%s' module.", usageKeeper.ModuleName())) + } + } // Move funds from the bond into the account. err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, ownerAddress, bond.Balance) @@ -300,3 +303,32 @@ func (k Keeper) GetBondModuleBalances(ctx sdk.Context) sdk.Coins { balances := k.bankKeeper.GetAllBalances(ctx, moduleAddress) return balances } + +// TransferCoinsToModuleAccount moves funds from the bonds module account to another module account. +func (k Keeper) TransferCoinsToModuleAccount(ctx sdk.Context, id, moduleAccount string, coins sdk.Coins) error { + if !k.HasBond(ctx, id) { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond not found.") + } + + bondObj := k.GetBond(ctx, id) + + // Deduct rent from bond. + updatedBalance, isNeg := bondObj.Balance.SafeSub(coins) + + if isNeg { + // Check if bond has sufficient funds. + return sdkerrors.Wrap(sdkerrors.ErrInsufficientFunds, "Insufficient funds.") + } + + // Move funds from bond module to record rent module. + err := k.bankKeeper.SendCoinsFromModuleToModule(ctx, types.ModuleName, moduleAccount, coins) + if err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Error transferring funds.") + } + + // Update bond balance. + bondObj.Balance = updatedBalance + k.SaveBond(ctx, &bondObj) + + return nil +} diff --git a/x/bond/types/expected_keeper.go b/x/bond/types/expected_keeper.go new file mode 100644 index 00000000..a17e8931 --- /dev/null +++ b/x/bond/types/expected_keeper.go @@ -0,0 +1,12 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +// BondUsageKeeper keep track of bond usage in other modules. +// Used to, for example, prevent deletion of a bond that's in use. +type BondUsageKeeper interface { + ModuleName() string + UsesBond(ctx sdk.Context, bondId string) bool +} diff --git a/x/nameservice/README.md b/x/nameservice/README.md new file mode 100644 index 00000000..0142b4f7 --- /dev/null +++ b/x/nameservice/README.md @@ -0,0 +1,340 @@ +# Build chain + +```bash +# it will create binary in build folder with `ethermintd` +$ make build +``` + +# Setup Chain + +```bash +./build/ethermintd keys add root +./build/ethermintd init test-moniker --chain-id ethermint_9000-1 +./build/ethermintd add-genesis-account $(./build/ethermintd keys show root -a) 1000000000000000000aphoton,1000000000000000000stake +./build/ethermintd gentx root 1000000000000000000stake --chain-id ethermint_9000-1 +./build/ethermintd collect-gentxs +./build/ethermintd start +``` + +## Get Params + +```bash +$ ./build/ethermintd q nameservice params -o json | jq . +{ + "params": { + "record_rent": { + "denom": "stake", + "amount": "1000000" + }, + + "record_rent_duration": "31536000s", + "authority_rent": { + "denom": "stake", + "amount": "1000000" + }, + "authority_rent_duration": "31536000s", + "authority_grace_period": "172800s", + "authority_auction_enabled": false, + "authority_auction_commits_duration": "86400s", + "authority_auction_reveals_duration": "86400s", + "authority_auction_commit_fee": { + "denom": "stake", + "amount": "1000000" + }, + "authority_auction_reveal_fee": { + "denom": "stake", + "amount": "1000000" + }, + "authority_auction_minimum_bid": { + "denom": "stake", + "amount": "5000000" + } + } + +``` + +## Create (Set) Record + +> First you have to Create bond + +```bash +$ ./build/ethermintd tx nameservice set ~/Desktop/examples/records/example1.yml 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 --yes -o json +{ + "height": "0", + "txhash": "BA44ABE1194724694E7CB290F9F3121DB4E63E1A030D95CB84813EEA132CF95F", + "codespace": "", + "code": 0, + "data": "", + "raw_log": "[]", + "logs": [], + "info": "", + "gas_wanted": "0", + "gas_used": "0", + "tx": null, + "timestamp": "" +} +``` + +## Get records list + +```bash +$ ./build/ethermintd q nameservice list -o json | jq +[ + { + "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae", + "bondId": "c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440", + "createTime": "2021-10-04T06:50:06.369025861Z", + "expiryTime": "2022-10-04T06:50:06.369025861Z", + "attributes": { + "attr1": "value1", + "attr2": "value2", + "link1": { + "/": "QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D" + }, + "link2": { + "/": "QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9" + } + } + } +] + + +``` + +## Get record by id + +```bash +$ ./build/ethermintd q nameservice get bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae -o json | jq . +{ + "record": { + "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae", + "bond_id": "95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d", + "create_time": "2021-09-27T07:23:25.558111606Z", + "expiry_time": "2022-09-27T07:23:25.558111606Z", + "deleted": false, + "owners": [], + "attributes": "eyJhdHRyMSI6InZhbHVlMSIsImF0dHIyIjoidmFsdWUyIiwibGluazEiOnsiLyI6IlFtU251V214cHRKWmRMSnBLUmFyeEJNUzJKdTJvQU5WcmdicjJ4V2JpZTliMkQifSwibGluazIiOnsiLyI6IlFtUDhqVEcxbTlHU0RKTENiZVdoVlNWZ0V6Q1BQd1hSZENSdUp0UTVUejlLYzkifX0=" + } +} +``` + +## Reserve name + +```bash + ./build/ethermintd tx nameservice reserve-name hello --from root --chain-id ethermint_9000-1 --owner $(./build/ethermintd key +s show root -a) -y -o json | jq . +{ + "height": "0", + "txhash": "7EC19157AC89279DEBE840EA3384FC95D1E2A0931C27746CA42AC23AE285B7ED", + "codespace": "", + "code": 0, + "data": "", + "raw_log": "[]", + "logs": [], + "info": "", + "gas_wanted": "0", + "gas_used": "0", + "tx": null, + "timestamp": "" +} + +``` + +## Query Whois for name authority + +```bash + ./build/ethermintd q nameservice whois hello -o json | jq . +{ + "name_authority": { + "owner_public_key": "Au3hH1tzL1KgZfXfA71jGYSe5RV9Wg95kwhBWs8V+N+h", + "owner_address": "ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk", + "height": "174", + "status": "active", + "auction_id": "", + "bond_id": "", + "expiry_time": "2021-09-29T07:34:36.304545965Z" + } +} + +``` + +## Query the nameservice module balance + +```bash +$ ./build/ethermintd q nameservice balance -o json | jq . +{ + "balances": [ + { + "account_name": "record_rent", + "balance": [ + { + "denom": "stake", + "amount": "1000000" + } + ] + } + ] +} + +``` + +## add bond to the authority + +```bash +$ ./build/ethermintd tx nameservice authority-bond [Authority Name] [Bond ID ] --from root --chain-id ethermint_9000-1 -y -o json | jq . +$ ./build/ethermintd tx nameservice authority-bond hello 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d --from root --chain-id ethermint_9000-1 -y -o json | jq . + ``` + +## Query the records by associate bond id + +```bash +$ ./build/ethermintd q nameservice query-by-bond 95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d -o json | jq . +{ + "records": [ + { + "id": "bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae", + "bond_id": "95f68b1b862bfd1609b0c9aaf7300287b92fec90ac64027092c3e723af36e83d", + "create_time": "2021-09-27T08:25:32.893155609Z", + "expiry_time": "2022-09-27T08:25:32.893155609Z", + "deleted": false, + "owners": [], + "attributes": "eyJhdHRyMSI6InZhbHVlMSIsImF0dHIyIjoidmFsdWUyIiwibGluazEiOnsiLyI6IlFtU251V214cHRKWmRMSnBLUmFyeEJNUzJKdTJvQU5WcmdicjJ4V2JpZTliMkQifSwibGluazIiOnsiLyI6IlFtUDhqVEcxbTlHU0RKTENiZVdoVlNWZ0V6Q1BQd1hSZENSdUp0UTVUejlLYzkifX0=" + } + ], + "pagination": null +} + +``` + +## dissociate bond from record + +```bash +$ ./build/ethermintd tx nameservice dissociate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1 +{"body":{"messages":[{"@type":"/vulcanize.nameservice.v1beta1.MsgDissociateBond","record_id":"bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae","signer":"ethm1mfdjngh5jvjs9lqtt9a7y2hlgw8v3syh3hsqzk"}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""}},"signatures":[]} + +confirm transaction before signing and broadcasting [y/N]: y +code: 0 +codespace: "" +data: "" +gas_used: "0" +gas_wanted: "0" +height: "0" +info: "" +logs: [] +raw_log: '[]' +timestamp: "" +tx: null +txhash: 7AFEF524CB0D92D6576FC08601A787786E802449888FD8DDAA7635698CC85060 + +``` + +## Associate bond with record + +```bash +./build/ethermintd tx nameservice associate-bond bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1 -y -o json | jq . +{ + "height": "0", + "txhash": "F75C2BF2FE73668AE1332E1237F924AC549E31E822A56394DE5AC17200B199F9", + "codespace": "", + "code": 0, + "data": "", + "raw_log": "[]", + "logs": [], + "info": "", + "gas_wanted": "0", + "gas_used": "0", + "tx": null, + "timestamp": "" +} + +``` + +## dissociate-records => remove all record from bond + +```bash +$./build/ethermintd tx nameservice dissociate-records c3f7a78c5042d2003880962ba31ff3b01fcf5942960e0bc3ca331f816346a440 --from root --chain-id ethermint_9000-1 -y -o json | jq . +{ + "height": "0", + "txhash": "0316F503E5DEA47CB108AE6C7C7FFAF3F71CC56BC22F63CB97322E1BE48B33B9", + "codespace": "", + "code": 0, + "data": "", + "raw_log": "[]", + "logs": [], + "info": "", + "gas_wanted": "0", + "gas_used": "0", + "tx": null, + "timestamp": "" +} +``` + +## Renew a record + +> When a record is expires , needs to renew record + +```bash +$ ./build/ethermintd tx nameservice renew-record bafyreih7un2ntk235wshncebus5emlozdhdixrrv675my5umb6fgdergae --from root --chain-id ethermint_9000-1 + +``` + +## Set the authority name + +```bash +$ ./build/ethermintd tx nameservice set-name wrn://hello/test test_hello_cid --from root --chain-id ethermint_9000-1 -y -o json | jq . +{ + "height": "0", + "txhash": "66A63C73B076EEE9A2F7605354448EDEB161F0115D4D03AF68C01BA28DB97486", + "codespace": "", + "code": 0, + "data": "", + "raw_log": "[]", + "logs": [], + "info": "", + "gas_wanted": "0", + "gas_used": "0", + "tx": null, + "timestamp": "" +} +``` + +## Delete the name + +```bash +$./build/ethermintd tx nameservice delete-name wrn://hello/test --from root --chain-id ethermint_9000-1 -y +code: 0 +codespace: "" +data: "" +gas_used: "0" +gas_wanted: "0" +height: "0" +info: "" +logs: [] +raw_log: '[]' +timestamp: "" +tx: null +txhash: A3FF4C46BAC7BD6E54BBB743A49830AE8C6F6FE59282384789CBA323C1FE540C + +``` + +## List of Authorities Expire Queue + +```bash +$ ./build/ethermintd q nameservice authority-expiry -o json | jq . +{ + "authorities": [], + "pagination": null +} + +``` + +## List of Records Expire Queue + +```bash +$ ./build/ethermintd q nameservice record-expiry -o json | jq . +{ + "records": [], + "pagination": null +} + +``` \ No newline at end of file diff --git a/x/nameservice/abci.go b/x/nameservice/abci.go new file mode 100644 index 00000000..dae9935c --- /dev/null +++ b/x/nameservice/abci.go @@ -0,0 +1,17 @@ +package nameservice + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tharsis/ethermint/x/nameservice/keeper" +) + +// BeginBlocker will persist the current header and validator set as a historical entry +// and prune the oldest entry based on the HistoricalEntries parameter +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 { + return []abci.ValidatorUpdate{} +} diff --git a/x/nameservice/cli/query.go b/x/nameservice/cli/query.go new file mode 100644 index 00000000..be981bad --- /dev/null +++ b/x/nameservice/cli/query.go @@ -0,0 +1,397 @@ +package cli + +import ( + "encoding/json" + "fmt" + "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 +func GetQueryCmd() *cobra.Command { + bondQueryCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "Querying commands for the nameservice module", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + bondQueryCmd.AddCommand( + GetCmdWhoIs(), + GetCmdResolve(), + GetCmdLookupWRN(), + GetRecordExpiryQueue(), + GetAuthorityExpiryQueue(), + GetQueryParamsCmd(), + GetCmdList(), + GetCmdGetResource(), + GetCmdQueryByBond(), + GetCmdBalance(), + GetCmdNames(), + ) + return bondQueryCmd +} + +// GetCmdWhoIs queries a whois info for a name. +func GetCmdWhoIs() *cobra.Command { + cmd := &cobra.Command{ + Use: "whois [name]", + Short: "Get name owner info.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get name owner info. +Example: +$ %s query %s whois [name] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.Whois(cmd.Context(), &types.QueryWhoisRequest{Name: args[0]}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdLookupWRN queries naming info for a WRN. +func GetCmdLookupWRN() *cobra.Command { + cmd := &cobra.Command{ + Use: "lookup [wrn]", + Short: "Get naming info for WRN.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get naming info for WRN. +Example: +$ %s query %s lookup [wrn] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.LookupWrn(cmd.Context(), &types.QueryLookupWrn{Wrn: args[0]}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetQueryParamsCmd implements the params query command. +func GetQueryParamsCmd() *cobra.Command { + cmd := &cobra.Command{ + Use: "params", + Args: cobra.NoArgs, + Short: "Query the current bond parameters information.", + Long: strings.TrimSpace( + fmt.Sprintf(`Query values set as bond parameters. +Example: +$ %s query %s params +`, + version.AppName, types.ModuleName, + ), + ), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.Params(cmd.Context(), &types.QueryParamsRequest{}) + if err != nil { + return err + } + + return clientCtx.PrintProto(res) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdList queries all records. +func GetCmdList() *cobra.Command { + cmd := &cobra.Command{ + Use: "list", + Short: "List records.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get the records. +Example: +$ %s query %s list +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.ListRecords(cmd.Context(), &types.QueryListRecordsRequest{}) + if err != nil { + return err + } + + recordsList := res.GetRecords() + records := make([]types.RecordType, len(recordsList)) + for i, record := range res.GetRecords() { + records[i] = record.ToRecordType() + } + bytesResult, err := json.Marshal(records) + if err != nil { + return err + } + return clientCtx.PrintBytes(bytesResult) + }, + } + + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdGetResource queries a record record. +func GetCmdGetResource() *cobra.Command { + cmd := &cobra.Command{ + Use: "get [ID]", + Short: "Get record.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get the record by id. +Example: +$ %s query %s get [ID] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + record, err := queryClient.GetRecord(cmd.Context(), &types.QueryRecordByIdRequest{Id: args[0]}) + if err != nil { + return err + } + return clientCtx.PrintProto(record) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdResolve resolves a WRN to a record. +func GetCmdResolve() *cobra.Command { + cmd := &cobra.Command{ + Use: "resolve [wrn]", + Short: "Resolve WRN to record.", + Long: strings.TrimSpace( + fmt.Sprintf(`Resolve WRN to record. +Example: +$ %s query %s resolve [wrn] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + record, err := queryClient.ResolveWrn(cmd.Context(), &types.QueryResolveWrn{Wrn: args[0]}) + if err != nil { + return err + } + return clientCtx.PrintProto(record) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdQueryByBond queries records by bond ID. +func GetCmdQueryByBond() *cobra.Command { + cmd := &cobra.Command{ + Use: "query-by-bond [bond-id]", + Short: "Query records by bond ID.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get the record by bond id. +Example: +$ %s query %s query-by-bond [bond id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + + bondID := args[0] + res, err := queryClient.GetRecordByBondId(cmd.Context(), &types.QueryRecordByBondIdRequest{Id: bondID}) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdBalance queries the bond module account balance. +func GetCmdBalance() *cobra.Command { + cmd := &cobra.Command{ + Use: "balance", + Short: "Get record rent module account balance.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get the record rent module account balance. +Example: +$ %s query %s balance +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.GetNameServiceModuleBalance(cmd.Context(), &types.GetNameServiceModuleBalanceRequest{}) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetCmdNames queries all naming records. +func GetCmdNames() *cobra.Command { + cmd := &cobra.Command{ + Use: "names", + Short: "List name records.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get the names list. +Example: +$ %s query %s names +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.ListNameRecords(cmd.Context(), &types.QueryListNameRecordsRequest{}) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetRecordExpiryQueue gets the record expiry queue. +func GetRecordExpiryQueue() *cobra.Command { + cmd := &cobra.Command{ + Use: "record-expiry", + Short: "Get record expiry queue.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get record expiry queue. +Example: +$ %s query %s record-expiry +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.GetRecordExpiryQueue(cmd.Context(), &types.QueryGetRecordExpiryQueue{}) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} + +// GetAuthorityExpiryQueue gets the authority expiry queue. +func GetAuthorityExpiryQueue() *cobra.Command { + cmd := &cobra.Command{ + Use: "authority-expiry", + Short: "Get authority expiry queue.", + Long: strings.TrimSpace( + fmt.Sprintf(`Get authority expiry queue. +Example: +$ %s query %s authority-expiry +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(0), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientQueryContext(cmd) + if err != nil { + return err + } + queryClient := types.NewQueryClient(clientCtx) + res, err := queryClient.GetAuthorityExpiryQueue(cmd.Context(), &types.QueryGetAuthorityExpiryQueue{}) + if err != nil { + return err + } + return clientCtx.PrintProto(res) + }, + } + flags.AddQueryFlagsToCmd(cmd) + return cmd +} diff --git a/x/nameservice/cli/tx.go b/x/nameservice/cli/tx.go new file mode 100644 index 00000000..9747029f --- /dev/null +++ b/x/nameservice/cli/tx.go @@ -0,0 +1,388 @@ +package cli + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/tx" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/version" + "github.com/spf13/cobra" + "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. +func NewTxCmd() *cobra.Command { + bondTxCmd := &cobra.Command{ + Use: types.ModuleName, + Short: "nameservice transaction subcommands", + DisableFlagParsing: true, + SuggestionsMinimumDistance: 2, + RunE: client.ValidateCmd, + } + + bondTxCmd.AddCommand( + GetCmdSetRecord(), + GetCmdRenewRecord(), + GetCmdAssociateBond(), + GetCmdDissociateBond(), + GetCmdDissociateRecords(), + GetCmdReAssociateRecords(), + GetCmdSetName(), + GetCmdReserveName(), + GetCmdSetAuthorityBond(), + GetCmdDeleteName(), + ) + + return bondTxCmd +} + +// GetCmdSetRecord is the CLI command for creating/updating a record. +func GetCmdSetRecord() *cobra.Command { + cmd := &cobra.Command{ + Use: "set [payload file path] [bond-id]", + Short: "Set record.", + Long: strings.TrimSpace( + fmt.Sprintf(`Create a new record with payload and bond id. +Example: +$ %s tx %s set [payload file path] [bond-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + payload, err := getPayloadFromFile(args[0]) + if err != nil { + return err + } + + msg := types.NewMsgSetRecord(payload.ToPayload(), args[1], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdRenewRecord is the CLI command for renewing an expired record. +func GetCmdRenewRecord() *cobra.Command { + cmd := &cobra.Command{ + Use: "renew-record [record-id]", + Short: "Renew (expired) record.", + Long: strings.TrimSpace( + fmt.Sprintf(`Renew record. +Example: +$ %s tx %s renew-record [record-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgRenewRecord(args[0], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdAssociateBond is the CLI command for associating a record with a bond. +func GetCmdAssociateBond() *cobra.Command { + cmd := &cobra.Command{ + Use: "associate-bond [record-id] [bond-id]", + Short: "Associate record with bond.", + Long: strings.TrimSpace( + fmt.Sprintf(`Associate record with bond. +Example: +$ %s tx %s associate-bond [record-id] [bond-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgAssociateBond(args[0], args[1], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdDissociateBond is the CLI command for dissociating a record from a bond. +func GetCmdDissociateBond() *cobra.Command { + cmd := &cobra.Command{ + Use: "dissociate-bond [record-id]", + Short: "Dissociate record from (existing) bond.", + Long: strings.TrimSpace( + fmt.Sprintf(`Dissociate record from (existing) bond. +Example: +$ %s tx %s dissociate-bond [record-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgDissociateBond(args[0], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdDissociateRecords is the CLI command for dissociating all records from a bond. +func GetCmdDissociateRecords() *cobra.Command { + cmd := &cobra.Command{ + Use: "dissociate-records [bond-id]", + Short: "Dissociate all records from bond.", + Long: strings.TrimSpace( + fmt.Sprintf(`Dissociate all records from bond. +Example: +$ %s tx %s dissociate-bond [record-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgDissociateRecords(args[0], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdReAssociateRecords is the CLI command for reassociating all records from old to new bond. +func GetCmdReAssociateRecords() *cobra.Command { + cmd := &cobra.Command{ + Use: "reassociate-records [old-bond-id] [new-bond-id]", + Short: "Re-Associates all records from old to new bond.", + Long: strings.TrimSpace( + fmt.Sprintf(`Re-Associates all records from old to new bond. +Example: +$ %s tx %s reassociate-records [old-bond-id] [new-bond-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgReAssociateRecords(args[0], args[1], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// 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.", + Long: strings.TrimSpace( + fmt.Sprintf(`Set name with wrn and cid. +Example: +$ %s tx %s set-name [wrn] [cid] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgSetName(args[0], args[1], clientCtx.GetFromAddress()) + err = msg.ValidateBasic() + if err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdReserveName is the CLI command for reserving a name. +func GetCmdReserveName() *cobra.Command { + cmd := &cobra.Command{ + Use: "reserve-name [name]", + Short: "Reserve name.", + Long: strings.TrimSpace( + fmt.Sprintf(`Reserver name with owner address . +Example: +$ %s tx %s reserve-name [name] --owner [ownerAddress] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + owner, err := cmd.Flags().GetString("owner") + if err != nil { + return err + } + ownerAddress, err := sdk.AccAddressFromBech32(owner) + if err != nil { + return err + } + + msg := types.NewMsgReserveAuthority(args[0], clientCtx.GetFromAddress(), ownerAddress) + err = msg.ValidateBasic() + if err != nil { + return err + } + + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + cmd.Flags().String("owner", "", "Owner address, if creating a sub-authority.") + + flags.AddTxFlags(cmd) + return cmd +} + +// GetCmdSetAuthorityBond is the CLI command for associating a bond with an authority. +func GetCmdSetAuthorityBond() *cobra.Command { + cmd := &cobra.Command{ + Use: "authority-bond [name] [bond-id]", + Short: "Associate authority with bond.", + Long: strings.TrimSpace( + fmt.Sprintf(`Reserver name with owner address . +Example: +$ %s tx %s authority-bond [name] [bond-id] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgSetAuthorityBond(args[0], args[1], clientCtx.GetFromAddress()) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +func GetCmdDeleteName() *cobra.Command { + cmd := &cobra.Command{ + Use: "delete-name [wrn]", + Short: "Delete WRN.", + Long: strings.TrimSpace( + fmt.Sprintf(`Delete WRN. +Example: +$ %s tx %s delete-name [wrn] +`, + version.AppName, types.ModuleName, + ), + ), + Args: cobra.ExactArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + msg := types.NewMsgDeleteNameAuthority(args[0], clientCtx.GetFromAddress()) + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), &msg) + }, + } + + flags.AddTxFlags(cmd) + return cmd +} + +// Load payload object from YAML file. +func getPayloadFromFile(filePath string) (*types.PayloadType, error) { + var payload types.PayloadType + + data, err := ioutil.ReadFile(filePath) + if err != nil { + return nil, err + } + + err = yaml.Unmarshal(data, &payload) + if err != nil { + return nil, err + } + + return &payload, nil +} diff --git a/x/nameservice/genesis.go b/x/nameservice/genesis.go new file mode 100644 index 00000000..22bd665a --- /dev/null +++ b/x/nameservice/genesis.go @@ -0,0 +1,71 @@ +package nameservice + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tharsis/ethermint/x/nameservice/keeper" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +func InitGenesis(ctx sdk.Context, keeper keeper.Keeper, data types.GenesisState) []abci.ValidatorUpdate { + keeper.SetParams(ctx, data.Params) + + for _, record := range data.Records { + keeper.PutRecord(ctx, record) + + // Add to record expiry queue if expiry time is in the future. + if record.ExpiryTime.After(ctx.BlockTime()) { + keeper.InsertRecordExpiryQueue(ctx, record) + } + + // Note: Bond genesis runs first, so bonds will already be present. + if record.BondId != "" { + keeper.AddBondToRecordIndexEntry(ctx, record.BondId, record.Id) + } + } + + for _, authority := range data.Authorities { + //Only import authorities that are marked active. + if authority.Entry.Status == types.AuthorityActive { + keeper.SetNameAuthority(ctx, authority.Name, authority.Entry) + + // Add authority name to expiry queue. + keeper.InsertAuthorityExpiryQueue(ctx, authority.Name, authority.Entry.ExpiryTime) + + // Note: Bond genesis runs first, so bonds will already be present. + if authority.Entry.BondId != "" { + keeper.AddBondToAuthorityIndexEntry(ctx, authority.Entry.BondId, authority.Name) + } + } + } + + for _, nameEntry := range data.Names { + keeper.SetNameRecord(ctx, nameEntry.Name, nameEntry.Entry.Latest.Id) + } + + return []abci.ValidatorUpdate{} +} + +func ExportGenesis(ctx sdk.Context, keeper keeper.Keeper) types.GenesisState { + params := keeper.GetParams(ctx) + + records := keeper.ListRecords(ctx) + + authorities := keeper.ListNameAuthorityRecords(ctx) + var authorityEntries []types.AuthorityEntry + for name, record := range authorities { + authorityEntries = append(authorityEntries, types.AuthorityEntry{ + Name: name, + Entry: &record, + }) + } + + names := keeper.ListNameRecords(ctx) + + return types.GenesisState{ + Params: params, + Records: records, + Authorities: authorityEntries, + Names: names, + } +} diff --git a/x/nameservice/helpers/helpers.go b/x/nameservice/helpers/helpers.go new file mode 100644 index 00000000..2864315f --- /dev/null +++ b/x/nameservice/helpers/helpers.go @@ -0,0 +1,144 @@ +package helpers + +import ( + "bytes" + "encoding/base64" + "encoding/binary" + "encoding/gob" + "encoding/hex" + "encoding/json" + set "github.com/deckarep/golang-set" + cbor "github.com/ipfs/go-ipld-cbor" + mh "github.com/multiformats/go-multihash" + + "sort" +) + +func StringToBytes(val string) []byte { + return []byte(val) +} + +func BytesToString(val []byte) string { + return string(val) +} + +func StrArrToBytesArr(val []string) ([]byte, error) { + buffer := &bytes.Buffer{} + + err := gob.NewEncoder(buffer).Encode(val) + if err != nil { + return nil, err + } + return buffer.Bytes(), nil +} + +func BytesArrToStringArr(val []byte) ([]string, error) { + buffer := bytes.NewReader(val) + var v []string + err := gob.NewDecoder(buffer).Decode(&v) + if err != nil { + return nil, err + } + return v, nil +} + +func Int64ToBytes(num int64) []byte { + buf := new(bytes.Buffer) + binary.Write(buf, binary.BigEndian, num) + return buf.Bytes() +} + +// MarshalMapToJSONBytes converts map[string]interface{} to bytes. +func MarshalMapToJSONBytes(val map[string]interface{}) (bytes []byte) { + bytes, err := json.Marshal(val) + if err != nil { + panic("Marshal error.") + } + + return +} + +// UnMarshalMapFromJSONBytes converts bytes to map[string]interface{}. +func UnMarshalMapFromJSONBytes(bytes []byte) map[string]interface{} { + var val map[string]interface{} + err := json.Unmarshal(bytes, &val) + + if err != nil { + panic("Marshal error.") + } + + return val +} + +// GetCid gets the content ID. +func GetCid(content []byte) (string, error) { + node, err := cbor.FromJSON(bytes.NewReader(content), mh.SHA2_256, -1) + if err != nil { + return "", err + } + + return node.Cid().String(), nil +} + +// BytesToBase64 encodes a byte array as a base64 string. +func BytesToBase64(bytes []byte) string { + return base64.StdEncoding.EncodeToString(bytes) +} + +// BytesFromBase64 decodes a byte array from a base64 string. +func BytesFromBase64(str string) []byte { + bytes, err := base64.StdEncoding.DecodeString(str) + if err != nil { + panic("Error decoding string to bytes.") + } + + return bytes +} + +// BytesToHex encodes a byte array as a hex string. +func BytesToHex(bytes []byte) string { + return hex.EncodeToString(bytes) +} + +// BytesFromHex decodes a byte array from a hex string. +func BytesFromHex(str string) []byte { + bytes, err := hex.DecodeString(str) + if err != nil { + panic("Error decoding hex to bytes.") + } + + return bytes +} + +func SetToSlice(set set.Set) []string { + names := []string{} + + for name := range set.Iter() { + if name, ok := name.(string); ok && name != "" { + names = append(names, name) + } + } + + sort.SliceStable(names, func(i, j int) bool { return names[i] < names[j] }) + + return names +} + +func SliceToSet(names []string) set.Set { + set := set.NewThreadUnsafeSet() + + for _, name := range names { + if name != "" { + set.Add(name) + } + } + + return set +} + +func AppendUnique(list []string, element string) []string { + set := SliceToSet(list) + set.Add(element) + + return SetToSlice(set) +} diff --git a/x/nameservice/keeper/grpc_query.go b/x/nameservice/keeper/grpc_query.go new file mode 100644 index 00000000..c4b872b6 --- /dev/null +++ b/x/nameservice/keeper/grpc_query.go @@ -0,0 +1,97 @@ +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" +) + +type Querier struct { + Keeper +} + +var _ types.QueryServer = Querier{} + +func (q Querier) Params(c context.Context, _ *types.QueryParamsRequest) (*types.QueryParamsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + params := q.Keeper.GetParams(ctx) + return &types.QueryParamsResponse{Params: ¶ms}, nil +} + +func (q Querier) ListRecords(c context.Context, _ *types.QueryListRecordsRequest) (*types.QueryListRecordsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + records := q.Keeper.ListRecords(ctx) + return &types.QueryListRecordsResponse{Records: records}, nil +} + +func (q Querier) GetRecord(c context.Context, req *types.QueryRecordByIdRequest) (*types.QueryRecordByIdResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + id := req.GetId() + if !q.Keeper.HasRecord(ctx, id) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "Record not found.") + } + record := q.Keeper.GetRecord(ctx, id) + return &types.QueryRecordByIdResponse{Record: record}, nil +} + +func (q Querier) GetRecordByBondId(c context.Context, req *types.QueryRecordByBondIdRequest) (*types.QueryRecordByBondIdResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + records := q.recordKeeper.QueryRecordsByBond(ctx, req.GetId()) + return &types.QueryRecordByBondIdResponse{Records: records}, nil +} + +func (q Querier) GetNameServiceModuleBalance(c context.Context, _ *types.GetNameServiceModuleBalanceRequest) (*types.GetNameServiceModuleBalanceResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + balances := q.Keeper.GetModuleBalances(ctx) + return &types.GetNameServiceModuleBalanceResponse{ + Balances: balances, + }, nil +} + +func (q Querier) ListNameRecords(c context.Context, _ *types.QueryListNameRecordsRequest) (*types.QueryListNameRecordsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + nameRecords := q.Keeper.ListNameRecords(ctx) + return &types.QueryListNameRecordsResponse{Names: nameRecords}, nil +} + +func (q Querier) Whois(c context.Context, request *types.QueryWhoisRequest) (*types.QueryWhoisResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + nameAuthority := q.Keeper.GetNameAuthority(ctx, request.GetName()) + return &types.QueryWhoisResponse{NameAuthority: *nameAuthority}, nil +} + +func (q Querier) LookupWrn(c context.Context, req *types.QueryLookupWrn) (*types.QueryLookupWrnResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + wrn := req.GetWrn() + if !q.Keeper.HasNameRecord(ctx, wrn) { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "WRN not found.") + } + nameRecord := q.Keeper.GetNameRecord(ctx, wrn) + if nameRecord == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "name record not found.") + } + return &types.QueryLookupWrnResponse{Name: nameRecord}, nil +} + +func (q Querier) ResolveWrn(c context.Context, req *types.QueryResolveWrn) (*types.QueryResolveWrnResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + wrn := req.GetWrn() + record := q.Keeper.ResolveWRN(ctx, wrn) + if record == nil { + return nil, sdkerrors.Wrap(sdkerrors.ErrUnknownRequest, "record not found.") + } + return &types.QueryResolveWrnResponse{Record: record}, nil +} + +func (q Querier) GetRecordExpiryQueue(c context.Context, _ *types.QueryGetRecordExpiryQueue) (*types.QueryGetRecordExpiryQueueResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + records := q.Keeper.GetRecordExpiryQueue(ctx) + return &types.QueryGetRecordExpiryQueueResponse{Records: records}, nil +} + +func (q Querier) GetAuthorityExpiryQueue(c context.Context, _ *types.QueryGetAuthorityExpiryQueue) (*types.QueryGetAuthorityExpiryQueueResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + authorities := q.Keeper.GetAuthorityExpiryQueue(ctx) + return &types.QueryGetAuthorityExpiryQueueResponse{Authorities: authorities}, nil +} diff --git a/x/nameservice/keeper/invariants.go b/x/nameservice/keeper/invariants.go new file mode 100644 index 00000000..00069e31 --- /dev/null +++ b/x/nameservice/keeper/invariants.go @@ -0,0 +1,36 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +// RegisterInvariants registers all nameservice module invariants. +func RegisterInvariants(ir sdk.InvariantRegistry, k Keeper) { + ir.RegisterRoute(types.ModuleName, "record", RecordInvariants(k)) +} + +// RecordInvariants checks that every record: +// (1) has a corresponding naming record & +// (2) associated bond exists, if bondID is not null. +func RecordInvariants(k Keeper) sdk.Invariant { + return func(ctx sdk.Context) (string, bool) { + //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.RecordObj + // k.cdc.MustUnmarshalBinaryBare(bz, &obj) + // record := obj.ToRecord() + // + // if record.BondID != "" && !k.bondKeeper.HasBond(ctx, record.BondID) { + // return sdk.FormatInvariant(types.ModuleName, "record-bond", fmt.Sprintf("Bond not found for record ID: '%s'.", record.ID)), true + // } + // } + //} + + return "", false + } +} diff --git a/x/nameservice/keeper/keeper.go b/x/nameservice/keeper/keeper.go new file mode 100644 index 00000000..61f5a9bc --- /dev/null +++ b/x/nameservice/keeper/keeper.go @@ -0,0 +1,296 @@ +package keeper + +import ( + "encoding/json" + "fmt" + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/legacy" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + auth "github.com/cosmos/cosmos-sdk/x/auth/keeper" + bank "github.com/cosmos/cosmos-sdk/x/bank/keeper" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + auctionkeeper "github.com/tharsis/ethermint/x/auction/keeper" + 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 ( + + // PrefixCIDToRecordIndex is the prefix for CID -> Record index. + // Note: This is the primary index in the system. + // Note: Golang doesn't support const arrays. + PrefixCIDToRecordIndex = []byte{0x00} + + // PrefixNameAuthorityRecordIndex is the prefix for the name -> NameAuthority index. + PrefixNameAuthorityRecordIndex = []byte{0x01} + + // PrefixWRNToNameRecordIndex is the prefix for the WRN -> NamingRecord index. + PrefixWRNToNameRecordIndex = []byte{0x02} + + // PrefixBondIDToRecordsIndex is the prefix for the Bond ID -> [Record] index. + PrefixBondIDToRecordsIndex = []byte{0x03} + + // PrefixBlockChangesetIndex is the prefix for the block changeset index. + PrefixBlockChangesetIndex = []byte{0x04} + + // PrefixAuctionToAuthorityNameIndex is the prefix for the auction ID -> authority name index. + PrefixAuctionToAuthorityNameIndex = []byte{0x05} + + // PrefixBondIDToAuthoritiesIndex is the prefix for the Bond ID -> [Authority] index. + PrefixBondIDToAuthoritiesIndex = []byte{0x06} + + // PrefixExpiryTimeToRecordsIndex is the prefix for the Expiry Time -> [Record] index. + PrefixExpiryTimeToRecordsIndex = []byte{0x10} + + // PrefixExpiryTimeToAuthoritiesIndex is the prefix for the Expiry Time -> [Authority] index. + PrefixExpiryTimeToAuthoritiesIndex = []byte{0x11} + + // PrefixCIDToNamesIndex the the reverse index for naming, i.e. maps CID -> []Names. + // TODO(ashwin): Move out of WNS once we have an indexing service. + PrefixCIDToNamesIndex = []byte{0xe0} +) + +// Keeper maintains the link to storage and exposes getter/setter methods for the various parts of the state machine +type Keeper struct { + accountKeeper auth.AccountKeeper + bankKeeper bank.Keeper + recordKeeper RecordKeeper + bondKeeper bondkeeper.Keeper + auctionKeeper auctionkeeper.Keeper + + storeKey sdk.StoreKey // Unexposed key to access store from sdk.Context + + cdc codec.BinaryCodec // The wire codec for binary encoding/decoding. + + paramSubspace paramtypes.Subspace +} + +// NewKeeper creates new instances of the nameservice Keeper +func NewKeeper(cdc codec.BinaryCodec, accountKeeper auth.AccountKeeper, bankKeeper bank.Keeper, recordKeeper RecordKeeper, + bondKeeper bondkeeper.Keeper, auctionKeeper auctionkeeper.Keeper, storeKey sdk.StoreKey, ps paramtypes.Subspace) Keeper { + // set KeyTable if it has not already been set + if !ps.HasKeyTable() { + ps = ps.WithKeyTable(types.ParamKeyTable()) + } + return Keeper{ + accountKeeper: accountKeeper, + bankKeeper: bankKeeper, + recordKeeper: recordKeeper, + bondKeeper: bondKeeper, + auctionKeeper: auctionKeeper, + storeKey: storeKey, + cdc: cdc, + paramSubspace: ps, + } +} + +// GetRecordIndexKey Generates Bond ID -> Bond index key. +func GetRecordIndexKey(id string) []byte { + return append(PrefixCIDToRecordIndex, []byte(id)...) +} + +// HasRecord - checks if a record by the given ID exists. +func (k Keeper) HasRecord(ctx sdk.Context, id string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(GetRecordIndexKey(id)) +} + +// GetRecord - gets a record from the store. +func (k Keeper) GetRecord(ctx sdk.Context, id string) (record types.Record) { + store := ctx.KVStore(k.storeKey) + result := store.Get(GetRecordIndexKey(id)) + k.cdc.MustUnmarshal(result, &record) + return record +} + +// ListRecords - get all records. +func (k Keeper) ListRecords(ctx sdk.Context) []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) + //records = append(records, recordObjToRecord(store, k.cdc, obj)) + records = append(records, obj) + } + } + + return records +} + +func (k Keeper) GetRecordExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord { + var records []*types.ExpiryQueueRecord + + store := ctx.KVStore(k.storeKey) + itr := sdk.KVStorePrefixIterator(store, PrefixExpiryTimeToRecordsIndex) + defer itr.Close() + for ; itr.Valid(); itr.Next() { + var record []string + err := json.Unmarshal(itr.Value(), &record) + if err != nil { + return records + } + records = append(records, &types.ExpiryQueueRecord{ + Id: string(itr.Key()[len(PrefixExpiryTimeToRecordsIndex):]), + Value: record, + }) + } + + return records +} + +// ProcessSetRecord creates a record. +func (k Keeper) ProcessSetRecord(ctx sdk.Context, msg types.MsgSetRecord) error { + payload := msg.Payload.ToReadablePayload() + record := types.RecordType{Attributes: payload.Record, BondId: msg.BondId} + + // Check signatures. + resourceSignBytes, _ := record.GetSignBytes() + cid, err := record.GetCID() + if err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid record JSON") + } + + record.Id = cid + + if exists := k.HasRecord(ctx, record.Id); exists { + return nil + } + + record.Owners = []string{} + for _, sig := range payload.Signatures { + 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.") + } + + sigOK := pubKey.VerifySignature(resourceSignBytes, helpers.BytesFromBase64(sig.Sig)) + if !sigOK { + fmt.Println("Signature mismatch: ", sig.PubKey) + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Invalid signature.") + } + record.Owners = append(record.Owners, pubKey.Address().String()) + } + + // Sort owners list. + sort.Strings(record.Owners) + sdkErr := k.processRecord(ctx, &record, false) + if sdkErr != nil { + return sdkErr + } + return nil +} + +func (k Keeper) processRecord(ctx sdk.Context, record *types.RecordType, isRenewal bool) error { + params := k.GetParams(ctx) + rent := params.RecordRent + + err := k.bondKeeper.TransferCoinsToModuleAccount(ctx, record.BondId, types.RecordRentModuleAccountName, sdk.NewCoins(rent)) + if err != nil { + return err + } + + record.CreateTime = ctx.BlockHeader().Time + record.ExpiryTime = ctx.BlockHeader().Time.Add(params.RecordRentDuration) + record.Deleted = false + + k.PutRecord(ctx, record.ToRecordObj()) + k.InsertRecordExpiryQueue(ctx, record.ToRecordObj()) + + // Renewal doesn't change the name and bond indexes. + if !isRenewal { + k.AddBondToRecordIndexEntry(ctx, record.BondId, record.Id) + } + + return nil +} + +// PutRecord - saves a record to the store and updates ID -> Record index. +func (k Keeper) PutRecord(ctx sdk.Context, record types.Record) { + store := ctx.KVStore(k.storeKey) + store.Set(GetRecordIndexKey(record.Id), k.cdc.MustMarshal(&record)) + k.updateBlockChangeSetForRecord(ctx, record.Id) +} + +// AddBondToRecordIndexEntry adds the Bond ID -> [Record] index entry. +func (k Keeper) AddBondToRecordIndexEntry(ctx sdk.Context, bondID string, id string) { + store := ctx.KVStore(k.storeKey) + store.Set(getBondIDToRecordsIndexKey(bondID, id), []byte{}) +} + +// Generates Bond ID -> Records index key. +func getBondIDToRecordsIndexKey(bondID string, id string) []byte { + return append(append(PrefixBondIDToRecordsIndex, []byte(bondID)...), []byte(id)...) +} + +// getRecordExpiryQueueTimeKey gets the prefix for the record expiry queue. +func getRecordExpiryQueueTimeKey(timestamp time.Time) []byte { + timeBytes := sdk.FormatTimeBytes(timestamp) + return append(PrefixExpiryTimeToRecordsIndex, timeBytes...) +} + +// SetRecordExpiryQueueTimeSlice sets a specific record expiry queue timeslice. +func (k Keeper) SetRecordExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Time, cids []string) { + store := ctx.KVStore(k.storeKey) + bz, _ := helpers.StrArrToBytesArr(cids) + store.Set(getRecordExpiryQueueTimeKey(timestamp), bz) +} + +// DeleteRecordExpiryQueueTimeSlice deletes a specific record expiry queue timeslice. +func (k Keeper) DeleteRecordExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Time) { + store := ctx.KVStore(k.storeKey) + store.Delete(getRecordExpiryQueueTimeKey(timestamp)) +} + +// GetRecordExpiryQueueTimeSlice gets a specific record queue timeslice. +// A timeslice is a slice of CIDs corresponding to records that expire at a certain time. +func (k Keeper) GetRecordExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []string { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(getRecordExpiryQueueTimeKey(timestamp)) + if bz == nil { + return []string{} + } + cids, err := helpers.BytesArrToStringArr(bz) + if err != nil { + return []string{} + } + return cids +} + +// 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) + timeSlice = append(timeSlice, val.Id) + k.SetRecordExpiryQueueTimeSlice(ctx, val.ExpiryTime, timeSlice) +} + +// GetModuleBalances gets the nameservice module account(s) balances. +func (k Keeper) GetModuleBalances(ctx sdk.Context) []*types.AccountBalance { + var balances []*types.AccountBalance + accountNames := []string{types.RecordRentModuleAccountName, types.AuthorityRentModuleAccountName} + + for _, accountName := range accountNames { + moduleAddress := k.accountKeeper.GetModuleAddress(accountName) + moduleAccount := k.accountKeeper.GetAccount(ctx, moduleAddress) + if moduleAccount != nil { + accountBalance := k.bankKeeper.GetAllBalances(ctx, moduleAddress) + balances = append(balances, &types.AccountBalance{ + AccountName: accountName, + Balance: accountBalance, + }) + } + } + + return balances +} diff --git a/x/nameservice/keeper/msg_server.go b/x/nameservice/keeper/msg_server.go new file mode 100644 index 00000000..3701c0d9 --- /dev/null +++ b/x/nameservice/keeper/msg_server.go @@ -0,0 +1,280 @@ +package keeper + +import ( + "context" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +type msgServer struct { + Keeper +} + +// NewMsgServerImpl returns an implementation of the bond MsgServer interface for the provided Keeper. +func NewMsgServerImpl(keeper Keeper) types.MsgServer { + return &msgServer{Keeper: keeper} +} + +var _ types.MsgServer = msgServer{} + +func (m msgServer) SetRecord(c context.Context, msg *types.MsgSetRecord) (*types.MsgSetRecordResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + + err = m.Keeper.ProcessSetRecord(ctx, types.MsgSetRecord{ + BondId: msg.GetBondId(), + Signer: msg.GetSigner(), + Payload: msg.GetPayload(), + }) + if err != nil { + return nil, err + } + + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeSetRecord, + sdk.NewAttribute(types.AttributeKeySigner, msg.GetSigner()), + sdk.NewAttribute(types.AttributeKeyBondId, msg.GetBondId()), + sdk.NewAttribute(types.AttributeKeyPayload, msg.Payload.String()), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + + return &types.MsgSetRecordResponse{}, nil +} + +func (m msgServer) SetName(c context.Context, msg *types.MsgSetName) (*types.MsgSetNameResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessSetName(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeSetRecord, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyWRN, msg.Wrn), + sdk.NewAttribute(types.AttributeKeyCID, msg.Cid), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgSetNameResponse{}, nil +} + +func (m msgServer) ReserveName(c context.Context, msg *types.MsgReserveAuthority) (*types.MsgReserveAuthorityResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + _, err = sdk.AccAddressFromBech32(msg.Owner) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessReserveAuthority(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeReserveNameAuthority, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyName, msg.Name), + sdk.NewAttribute(types.AttributeKeyOwner, msg.Owner), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgReserveAuthorityResponse{}, nil +} + +func (m msgServer) SetAuthorityBond(c context.Context, msg *types.MsgSetAuthorityBond) (*types.MsgSetAuthorityBondResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessSetAuthorityBond(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeAuthorityBond, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyName, msg.Name), + sdk.NewAttribute(types.AttributeKeyBondId, msg.BondId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgSetAuthorityBondResponse{}, nil +} + +func (m msgServer) DeleteName(c context.Context, msg *types.MsgDeleteNameAuthority) (*types.MsgDeleteNameAuthorityResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessDeleteName(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeDeleteName, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyWRN, msg.Wrn), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgDeleteNameAuthorityResponse{}, nil +} + +func (m msgServer) RenewRecord(c context.Context, msg *types.MsgRenewRecord) (*types.MsgRenewRecordResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + err = m.Keeper.ProcessRenewRecord(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeRenewRecord, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyRecordId, msg.RecordId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgRenewRecordResponse{}, nil +} + +func (m msgServer) AssociateBond(c context.Context, msg *types.MsgAssociateBond) (*types.MsgAssociateBondResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + + err = m.Keeper.ProcessAssociateBond(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeAssociateBond, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyRecordId, msg.RecordId), + sdk.NewAttribute(types.AttributeKeyBondId, msg.BondId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgAssociateBondResponse{}, nil +} + +func (m msgServer) DissociateBond(c context.Context, msg *types.MsgDissociateBond) (*types.MsgDissociateBondResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessDissociateBond(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeDissociateBond, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyRecordId, msg.RecordId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgDissociateBondResponse{}, nil +} + +func (m msgServer) DissociateRecords(c context.Context, msg *types.MsgDissociateRecords) (*types.MsgDissociateRecordsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessDissociateRecords(ctx, *msg) + if err != nil { + return nil, err + } + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeDissociateRecords, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyBondId, msg.BondId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgDissociateRecordsResponse{}, nil +} + +func (m msgServer) ReAssociateRecords(c context.Context, msg *types.MsgReAssociateRecords) (*types.MsgReAssociateRecordsResponse, error) { + ctx := sdk.UnwrapSDKContext(c) + _, err := sdk.AccAddressFromBech32(msg.Signer) + if err != nil { + return nil, err + } + err = m.Keeper.ProcessReAssociateRecords(ctx, *msg) + ctx.EventManager().EmitEvents(sdk.Events{ + sdk.NewEvent( + types.EventTypeReAssociateRecords, + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + sdk.NewAttribute(types.AttributeKeyOldBondId, msg.OldBondId), + sdk.NewAttribute(types.AttributeKeyNewBondId, msg.NewBondId), + ), + sdk.NewEvent( + sdk.EventTypeMessage, + sdk.NewAttribute(sdk.AttributeKeyModule, types.AttributeValueCategory), + sdk.NewAttribute(types.AttributeKeySigner, msg.Signer), + ), + }) + return &types.MsgReAssociateRecordsResponse{}, nil +} diff --git a/x/nameservice/keeper/naming_keeper.go b/x/nameservice/keeper/naming_keeper.go new file mode 100644 index 00000000..b36c0e3a --- /dev/null +++ b/x/nameservice/keeper/naming_keeper.go @@ -0,0 +1,616 @@ +package keeper + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + 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 { + if pubKey != nil { + return helpers.BytesToBase64(pubKey.Bytes()) + } + return "" +} + +// GetNameAuthorityIndexKey Generates name -> NameAuthority index key. +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)...) +} + +func GetCIDToNamesIndexKey(id string) []byte { + return append(PrefixCIDToNamesIndex, []byte(id)...) +} + +func SetNameAuthority(ctx sdk.Context, store sdk.KVStore, codec codec.BinaryCodec, name string, authority *types.NameAuthority) { + store.Set(GetNameAuthorityIndexKey(name), codec.MustMarshal(authority)) + updateBlockChangeSetForNameAuthority(ctx, codec, store, name) +} + +// SetNameAuthority creates the NameAuthority record. +func (k Keeper) SetNameAuthority(ctx sdk.Context, name string, authority *types.NameAuthority) { + SetNameAuthority(ctx, ctx.KVStore(k.storeKey), k.cdc, name, authority) +} + +func removeAuctionToAuthorityMapping(store sdk.KVStore, auctionID string) { + store.Delete(GetAuctionToAuthorityIndexKey(auctionID)) +} + +func (k Keeper) RemoveAuctionToAuthorityMapping(ctx sdk.Context, auctionID string) { + removeAuctionToAuthorityMapping(ctx.KVStore(k.storeKey), auctionID) +} + +// GetNameAuthority - gets a name authority from the store. +func GetNameAuthority(store sdk.KVStore, codec codec.BinaryCodec, name string) *types.NameAuthority { + authorityKey := GetNameAuthorityIndexKey(name) + if !store.Has(authorityKey) { + return nil + } + + bz := store.Get(authorityKey) + var obj types.NameAuthority + codec.MustUnmarshal(bz, &obj) + + return &obj +} + +// GetNameAuthority - gets a name authority from the store. +func (k Keeper) GetNameAuthority(ctx sdk.Context, name string) *types.NameAuthority { + return GetNameAuthority(ctx.KVStore(k.storeKey), k.cdc, name) +} + +// HasNameAuthority - checks if a name authority entry exists. +func HasNameAuthority(store sdk.KVStore, name string) bool { + return store.Has(GetNameAuthorityIndexKey(name)) +} + +// HasNameAuthority - checks if a name/authority exists. +func (k Keeper) HasNameAuthority(ctx sdk.Context, name string) bool { + return HasNameAuthority(ctx.KVStore(k.storeKey), name) +} + +func getBondIDToAuthoritiesIndexKey(bondID string, name string) []byte { + return append(append(PrefixBondIDToAuthoritiesIndex, []byte(bondID)...), []byte(name)...) +} + +// AddBondToAuthorityIndexEntry adds the Bond ID -> [Authority] index entry. +func (k Keeper) AddBondToAuthorityIndexEntry(ctx sdk.Context, bondID string, name string) { + store := ctx.KVStore(k.storeKey) + store.Set(getBondIDToAuthoritiesIndexKey(bondID, name), []byte{}) +} + +// RemoveBondToAuthorityIndexEntry removes the Bond ID -> [Authority] index entry. +func (k Keeper) RemoveBondToAuthorityIndexEntry(ctx sdk.Context, bondID string, name string) { + RemoveBondToAuthorityIndexEntry(ctx.KVStore(k.storeKey), bondID, name) +} + +func RemoveBondToAuthorityIndexEntry(store sdk.KVStore, bondID string, name string) { + store.Delete(getBondIDToAuthoritiesIndexKey(bondID, name)) +} + +func (k Keeper) updateBlockChangeSetForName(ctx sdk.Context, wrn string) { + changeSet := k.getOrCreateBlockChangeSet(ctx, ctx.BlockHeight()) + changeSet.Names = append(changeSet.Names, wrn) + k.saveBlockChangeSet(ctx, changeSet) +} + +func (k Keeper) getAuthority(ctx sdk.Context, wrn string) (string, *url.URL, *types.NameAuthority, error) { + parsedWRN, err := url.Parse(wrn) + if err != nil { + return "", nil, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid WRN.") + } + + name := parsedWRN.Host + authority := k.GetNameAuthority(ctx, name) + if authority == nil { + return name, nil, nil, sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Name authority not found.") + } + + return name, parsedWRN, authority, nil +} + +func (k Keeper) checkWRNAccess(ctx sdk.Context, signer sdk.AccAddress, wrn string) error { + name, parsedWRN, authority, err := k.getAuthority(ctx, wrn) + if err != nil { + return err + } + + formattedWRN := fmt.Sprintf("wrn://%s%s", name, parsedWRN.RequestURI()) + if formattedWRN != wrn { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid WRN.") + } + + if authority.OwnerAddress != signer.String() { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Access denied.") + } + + if authority.Status != types.AuthorityActive { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Authority is not active.") + } + + if authority.BondId == "" || len(authority.BondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Authority bond not found.") + } + + if authority.OwnerPublicKey == "" { + // Try to set owner public key if account has it available now. + ownerAccount := k.accountKeeper.GetAccount(ctx, signer) + pubKey := ownerAccount.GetPubKey() + if pubKey != nil { + // Update public key in authority record. + authority.OwnerPublicKey = getAuthorityPubKey(pubKey) + k.SetNameAuthority(ctx, name, authority) + } + } + + return nil +} + +// HasNameRecord - checks if a name record exists. +func (k Keeper) HasNameRecord(ctx sdk.Context, wrn string) bool { + store := ctx.KVStore(k.storeKey) + return store.Has(GetNameRecordIndexKey(wrn)) +} + +// GetNameRecord - gets a name record from the store. +func GetNameRecord(store sdk.KVStore, codec codec.BinaryCodec, wrn string) *types.NameRecord { + nameRecordKey := GetNameRecordIndexKey(wrn) + if !store.Has(nameRecordKey) { + return nil + } + + bz := store.Get(nameRecordKey) + var obj types.NameRecord + codec.MustUnmarshal(bz, &obj) + + return &obj +} + +// 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) + 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) + + // Name record may not exist. + if nameRecord == nil { + return nil + } + + // Name lookup should fail if the name record is stale. + // i.e. authority was registered later than the name. + if authority.Height > nameRecord.Latest.Height { + return nil + } + + return nameRecord +} + +// RemoveRecordToNameMapping removes a name from the record ID -> []names index. +func RemoveRecordToNameMapping(store sdk.KVStore, codec codec.BinaryCodec, id string, wrn string) { + reverseNameIndexKey := GetCIDToNamesIndexKey(id) + + names, _ := helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey)) + nameSet := helpers.SliceToSet(names) + nameSet.Remove(wrn) + + if nameSet.Cardinality() == 0 { + // Delete as storing empty slice throws error from baseapp. + store.Delete(reverseNameIndexKey) + } else { + data, _ := helpers.StrArrToBytesArr(helpers.SetToSlice(nameSet)) + store.Set(reverseNameIndexKey, data) + } +} + +// AddRecordToNameMapping adds a name to the record ID -> []names index. +func AddRecordToNameMapping(store sdk.KVStore, id string, wrn string) { + reverseNameIndexKey := GetCIDToNamesIndexKey(id) + + var names []string + if store.Has(reverseNameIndexKey) { + names, _ = helpers.BytesArrToStringArr(store.Get(reverseNameIndexKey)) + } + + nameSet := helpers.SliceToSet(names) + nameSet.Add(wrn) + 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) + + var nameRecord types.NameRecord + if store.Has(nameRecordIndexKey) { + bz := store.Get(nameRecordIndexKey) + codec.MustUnmarshal(bz, &nameRecord) + nameRecord.History = append(nameRecord.History, nameRecord.Latest) + + // Update old CID -> []Name index. + if nameRecord.Latest.Id != "" || len(nameRecord.Latest.Id) != 0 { + RemoveRecordToNameMapping(store, codec, nameRecord.Latest.Id, wrn) + } + } + + nameRecord.Latest = &types.NameRecordEntry{ + Id: id, + Height: uint64(height), + } + + store.Set(nameRecordIndexKey, codec.MustMarshal(&nameRecord)) + + // Update new CID -> []Name index. + if id != "" { + AddRecordToNameMapping(store, id, wrn) + } +} + +// 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()) + + // Update changeSet for name. + k.updateBlockChangeSetForName(ctx, wrn) +} + +// ProcessSetName creates a WRN -> 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) + if err != nil { + return err + } + + nameRecord := k.GetNameRecord(ctx, msg.Wrn) + if nameRecord != nil && nameRecord.Latest.Id == msg.Cid { + return nil + } + + k.SetNameRecord(ctx, msg.Wrn, msg.Cid) + + return nil +} + +// ListNameRecords - get all name records. +func (k Keeper) ListNameRecords(ctx sdk.Context) []types.NameEntry { + var nameEntries []types.NameEntry + store := ctx.KVStore(k.storeKey) + itr := sdk.KVStorePrefixIterator(store, PrefixWRNToNameRecordIndex) + defer itr.Close() + for ; itr.Valid(); itr.Next() { + bz := store.Get(itr.Key()) + if bz != nil { + var record types.NameRecord + k.cdc.MustUnmarshal(bz, &record) + nameEntries = append(nameEntries, types.NameEntry{ + Name: string(itr.Key()[len(PrefixWRNToNameRecordIndex):]), + Entry: &record, + }) + } + } + + return nameEntries +} + +// ProcessReserveSubAuthority reserves a sub-authority. +func (k Keeper) ProcessReserveSubAuthority(ctx sdk.Context, name string, msg types.MsgReserveAuthority) error { + // Get parent authority name. + names := strings.Split(name, ".") + parent := strings.Join(names[1:], ".") + + // Check if parent authority exists. + parentAuthority := k.GetNameAuthority(ctx, parent) + if parentAuthority == nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Parent authority not found.") + } + + // Sub-authority creator needs to be the owner of the parent authority. + if parentAuthority.OwnerAddress != msg.Signer { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Access denied.") + } + + // Sub-authority owner defaults to parent authority owner. + subAuthorityOwner := msg.Signer + if len(msg.Owner) != 0 { + // Override sub-authority owner if provided in message. + subAuthorityOwner = msg.Owner + } + + sdkErr := k.createAuthority(ctx, name, subAuthorityOwner, false) + if sdkErr != nil { + return sdkErr + } + + return nil +} + +func GetAuctionToAuthorityIndexKey(auctionID string) []byte { + return append(PrefixAuctionToAuthorityNameIndex, []byte(auctionID)...) +} + +func (k Keeper) AddAuctionToAuthorityMapping(ctx sdk.Context, auctionID string, name string) { + store := ctx.KVStore(k.storeKey) + store.Set(GetAuctionToAuthorityIndexKey(auctionID), []byte(name)) +} + +func (k Keeper) createAuthority(ctx sdk.Context, name string, owner string, isRoot bool) error { + moduleParams := k.GetParams(ctx) + + if k.HasNameAuthority(ctx, name) { + authority := k.GetNameAuthority(ctx, name) + if authority.Status != types.AuthorityExpired { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Name already reserved.") + } + } + + ownerAddress, err := sdk.AccAddressFromBech32(owner) + if err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid owner address.") + } + ownerAccount := k.accountKeeper.GetAccount(ctx, ownerAddress) + if ownerAccount == nil { + return sdkerrors.Wrap(sdkerrors.ErrUnknownAddress, "Account not found.") + } + + authority := types.NameAuthority{ + OwnerPublicKey: getAuthorityPubKey(ownerAccount.GetPubKey()), + OwnerAddress: owner, + Height: uint64(ctx.BlockHeight()), + Status: types.AuthorityActive, + AuctionId: "", + BondId: "", + ExpiryTime: ctx.BlockTime().Add(moduleParams.AuthorityGracePeriod), + } + + if isRoot && moduleParams.AuthorityAuctionEnabled { + // If auctions are enabled, clear out owner fields. They will be set after a winner is picked. + authority.OwnerAddress = "" + authority.OwnerPublicKey = "" + // Reset bond ID if required. + if authority.BondId != "" || len(authority.BondId) != 0 { + k.RemoveBondToAuthorityIndexEntry(ctx, authority.BondId, name) + authority.BondId = "" + } + + params := auctiontypes.Params{ + CommitsDuration: moduleParams.AuthorityAuctionCommitsDuration, + RevealsDuration: moduleParams.AuthorityAuctionRevealsDuration, + CommitFee: moduleParams.AuthorityAuctionCommitFee, + RevealFee: moduleParams.AuthorityAuctionRevealFee, + MinimumBid: moduleParams.AuthorityAuctionMinimumBid, + } + + // Create an auction. + msg := auctiontypes.NewMsgCreateAuction(params, ownerAddress) + + auction, sdkErr := k.auctionKeeper.CreateAuction(ctx, msg) + if sdkErr != nil { + return sdkErr + } + + // Create auction ID -> authority name index. + k.AddAuctionToAuthorityMapping(ctx, auction.Id, name) + + authority.Status = types.AuthorityUnderAuction + authority.AuctionId = auction.Id + authority.ExpiryTime = auction.RevealsEndTime.Add(moduleParams.AuthorityGracePeriod) + } + k.SetNameAuthority(ctx, name, &authority) + k.InsertAuthorityExpiryQueue(ctx, name, authority.ExpiryTime) + + return nil +} + +// 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) + if err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid name") + } + name := parsedWrn.Host + if fmt.Sprintf("wrn://%s", name) != wrn { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Invalid name") + } + if strings.Contains(name, ".") { + return k.ProcessReserveSubAuthority(ctx, name, msg) + } + err = k.createAuthority(ctx, name, msg.GetSigner(), true) + if err != nil { + return err + } + return nil +} + +func (k Keeper) ProcessSetAuthorityBond(ctx sdk.Context, msg types.MsgSetAuthorityBond) error { + name := msg.GetName() + signer := msg.GetSigner() + authority := k.GetNameAuthority(ctx, name) + if authority == nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Name authority not found.") + } + if authority.OwnerAddress != signer { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Access denied") + } + + if !k.bondKeeper.HasBond(ctx, msg.BondId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Bond not found.") + } + // + bond := k.bondKeeper.GetBond(ctx, msg.BondId) + if bond.Owner != signer { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond owner mismatch.") + } + + // No-op if bond hasn't changed. + if authority.BondId == msg.BondId { + return nil + } + + // Remove old bond ID mapping, if any. + if authority.BondId != "" { + k.RemoveBondToAuthorityIndexEntry(ctx, authority.BondId, name) + } + + // Update bond ID for authority. + authority.BondId = bond.Id + k.SetNameAuthority(ctx, name, authority) + // Add new bond ID mapping. + k.AddBondToAuthorityIndexEntry(ctx, authority.BondId, name) + return nil +} + +// ProcessDeleteName removes a WRN -> 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) + if err != nil { + return err + } + + if !k.HasNameRecord(ctx, msg.Wrn) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Name not found.") + } + + // Set CID to empty string. + k.SetNameRecord(ctx, msg.Wrn, "") + + return nil +} + +func (k Keeper) GetAuthorityExpiryQueue(ctx sdk.Context) []*types.ExpiryQueueRecord { + var authorities []*types.ExpiryQueueRecord + + store := ctx.KVStore(k.storeKey) + itr := sdk.KVStorePrefixIterator(store, PrefixExpiryTimeToAuthoritiesIndex) + defer itr.Close() + for ; itr.Valid(); itr.Next() { + var record []string + record, err := helpers.BytesArrToStringArr(itr.Value()) + if err != nil { + return authorities + } + authorities = append(authorities, &types.ExpiryQueueRecord{ + Id: string(itr.Key()[len(PrefixExpiryTimeToAuthoritiesIndex):]), + Value: record, + }) + } + + 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) + if err != nil || authority.Status != types.AuthorityActive { + // If authority is not active (or any other error), resolution fails. + return nil + } + + // 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) + if authority.Height > nameRecord.Latest.Height { + return nil + } + + 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) + + if store.Has(nameKey) { + bz := store.Get(nameKey) + var obj types.NameRecord + k.cdc.MustUnmarshal(bz, &obj) + + recordExists := k.HasRecord(c, obj.Latest.Id) + if !recordExists || obj.Latest.Id == "" { + return nil, &obj + } + + record := k.GetRecord(c, obj.Latest.Id) + return &record, &obj + } + + return nil, nil +} + +func getAuthorityExpiryQueueTimeKey(timestamp time.Time) []byte { + timeBytes := sdk.FormatTimeBytes(timestamp) + return append(PrefixExpiryTimeToAuthoritiesIndex, timeBytes...) +} + +func (k Keeper) InsertAuthorityExpiryQueue(ctx sdk.Context, name string, expiryTime time.Time) { + timeSlice := k.GetAuthorityExpiryQueueTimeSlice(ctx, expiryTime) + timeSlice = append(timeSlice, name) + k.SetAuthorityExpiryQueueTimeSlice(ctx, expiryTime, timeSlice) +} + +func (k Keeper) GetAuthorityExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Time) []string { + store := ctx.KVStore(k.storeKey) + + bz := store.Get(getAuthorityExpiryQueueTimeKey(timestamp)) + if bz == nil { + return []string{} + } + + names, err := helpers.BytesArrToStringArr(bz) + if err != nil { + return []string{} + } + + return names +} + +func (k Keeper) SetAuthorityExpiryQueueTimeSlice(ctx sdk.Context, timestamp time.Time, names []string) { + store := ctx.KVStore(k.storeKey) + bz, _ := helpers.StrArrToBytesArr(names) + store.Set(getAuthorityExpiryQueueTimeKey(timestamp), bz) +} + +// ListNameAuthorityRecords - get all name authority records. +func (k Keeper) ListNameAuthorityRecords(ctx sdk.Context) map[string]types.NameAuthority { + nameAuthorityRecords := make(map[string]types.NameAuthority) + store := ctx.KVStore(k.storeKey) + + itr := sdk.KVStorePrefixIterator(store, PrefixNameAuthorityRecordIndex) + defer itr.Close() + for ; itr.Valid(); itr.Next() { + bz := store.Get(itr.Key()) + if bz != nil { + var record types.NameAuthority + k.cdc.MustUnmarshal(bz, &record) + nameAuthorityRecords[string(itr.Key()[len(PrefixNameAuthorityRecordIndex):])] = record + } + } + + return nameAuthorityRecords +} diff --git a/x/nameservice/keeper/params.go b/x/nameservice/keeper/params.go new file mode 100644 index 00000000..da9c8360 --- /dev/null +++ b/x/nameservice/keeper/params.go @@ -0,0 +1,17 @@ +package keeper + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +// GetParams - Get all parameters as types.Params. +func (k Keeper) GetParams(ctx sdk.Context) (params types.Params) { + k.paramSubspace.GetParamSet(ctx, ¶ms) + return +} + +// SetParams - set the params. +func (k Keeper) SetParams(ctx sdk.Context, params types.Params) { + k.paramSubspace.SetParamSet(ctx, ¶ms) +} diff --git a/x/nameservice/keeper/record_keeper.go b/x/nameservice/keeper/record_keeper.go new file mode 100644 index 00000000..8e4f7472 --- /dev/null +++ b/x/nameservice/keeper/record_keeper.go @@ -0,0 +1,299 @@ +package keeper + +import ( + "fmt" + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + auctionkeeper "github.com/tharsis/ethermint/x/auction/keeper" + auctiontypes "github.com/tharsis/ethermint/x/auction/types" + bondtypes "github.com/tharsis/ethermint/x/bond/types" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +// RecordKeeper exposes the bare minimal read-only API for other modules. +type RecordKeeper struct { + auctionKeeper auctionkeeper.Keeper + storeKey sdk.StoreKey // Unexposed key to access store from sdk.Context + cdc codec.BinaryCodec // The wire codec for binary encoding/decoding. +} + +func (k RecordKeeper) UsesAuction(ctx sdk.Context, auctionID string) bool { + return k.GetAuctionToAuthorityMapping(ctx, auctionID) != "" +} + +func (k RecordKeeper) OnAuction(ctx sdk.Context, auctionId string) { + updateBlockChangeSetForAuction(ctx, k, auctionId) +} + +func (k RecordKeeper) OnAuctionBid(ctx sdk.Context, auctionID string, bidderAddress string) { + updateBlockChangeSetForAuctionBid(ctx, k, auctionID, bidderAddress) +} + +func (k RecordKeeper) OnAuctionWinnerSelected(ctx sdk.Context, auctionID string) { + // Update authority status based on auction status/winner. + name := k.GetAuctionToAuthorityMapping(ctx, auctionID) + if name == "" { + // We don't know about this auction, ignore. + ctx.Logger().Info(fmt.Sprintf("Ignoring auction notification, name mapping not found: %s", auctionID)) + return + } + + store := ctx.KVStore(k.storeKey) + if !HasNameAuthority(store, name) { + // We don't know about this authority, ignore. + ctx.Logger().Info(fmt.Sprintf("Ignoring auction notification, authority not found: %s", auctionID)) + return + } + + authority := GetNameAuthority(store, k.cdc, name) + auctionObj := k.auctionKeeper.GetAuction(ctx, auctionID) + + if auctionObj.Status == auctiontypes.AuctionStatusCompleted { + store := ctx.KVStore(k.storeKey) + + if auctionObj.WinnerAddress != "" { + // Mark authority owner and change status to active. + authority.OwnerAddress = auctionObj.WinnerAddress + authority.Status = types.AuthorityActive + + // Reset bond ID if required, as owner has changed. + if authority.BondId != "" { + RemoveBondToAuthorityIndexEntry(store, authority.BondId, name) + authority.BondId = "" + } + + // Update height for updated/changed authority (owner). + // Can be used to check if names are older than the authority itself (stale names). + authority.Height = uint64(ctx.BlockHeight()) + + ctx.Logger().Info(fmt.Sprintf("Winner selected, marking authority as active: %s", name)) + } else { + // Mark as expired. + authority.Status = types.AuthorityExpired + + ctx.Logger().Info(fmt.Sprintf("No winner, marking authority as expired: %s", name)) + } + + authority.AuctionId = "" + SetNameAuthority(ctx, store, k.cdc, name, authority) + + // Forget about this auction now, we no longer need it. + removeAuctionToAuthorityMapping(store, auctionID) + } else { + ctx.Logger().Info(fmt.Sprintf("Ignoring auction notification, status: %s", auctionObj.Status)) + } +} + +// Record keeper implements the bond usage keeper interface. +var _ bondtypes.BondUsageKeeper = (*RecordKeeper)(nil) +var _ auctiontypes.AuctionUsageKeeper = (*RecordKeeper)(nil) + +// ModuleName returns the module name. +func (k RecordKeeper) ModuleName() string { + return types.ModuleName +} + +func (k RecordKeeper) GetAuctionToAuthorityMapping(ctx sdk.Context, auctionID string) string { + store := ctx.KVStore(k.storeKey) + + auctionToAuthorityIndexKey := GetAuctionToAuthorityIndexKey(auctionID) + if store.Has(auctionToAuthorityIndexKey) { + bz := store.Get(auctionToAuthorityIndexKey) + return string(bz) + } + return "" +} + +// UsesBond returns true if the bond has associated records. +func (k RecordKeeper) UsesBond(ctx sdk.Context, bondId string) bool { + bondIDPrefix := append(PrefixBondIDToRecordsIndex, []byte(bondId)...) + store := ctx.KVStore(k.storeKey) + itr := sdk.KVStorePrefixIterator(store, bondIDPrefix) + defer itr.Close() + return itr.Valid() +} + +// RemoveBondToRecordIndexEntry removes the Bond ID -> [Record] index entry. +func (k Keeper) RemoveBondToRecordIndexEntry(ctx sdk.Context, bondID string, id string) { + store := ctx.KVStore(k.storeKey) + store.Delete(getBondIDToRecordsIndexKey(bondID, id)) +} + +// NewRecordKeeper creates new instances of the nameservice RecordKeeper +func NewRecordKeeper(auctionKeeper auctionkeeper.Keeper, storeKey sdk.StoreKey, cdc codec.BinaryCodec) RecordKeeper { + return RecordKeeper{ + auctionKeeper: auctionKeeper, + storeKey: storeKey, + cdc: cdc, + } +} + +// QueryRecordsByBond - get all records for the given bond. +func (k RecordKeeper) QueryRecordsByBond(ctx sdk.Context, bondID string) []types.Record { + var records []types.Record + + bondIDPrefix := append(PrefixBondIDToRecordsIndex, []byte(bondID)...) + store := ctx.KVStore(k.storeKey) + itr := sdk.KVStorePrefixIterator(store, bondIDPrefix) + defer itr.Close() + for ; itr.Valid(); itr.Next() { + cid := itr.Key()[len(bondIDPrefix):] + bz := store.Get(append(PrefixCIDToRecordIndex, cid...)) + if bz != nil { + var obj types.Record + k.cdc.MustUnmarshal(bz, &obj) + //records = append(records, recordObjToRecord(store, k.cdc, obj)) + records = append(records, obj) + } + } + + return records +} + +// ProcessRenewRecord renews a record. +func (k Keeper) ProcessRenewRecord(ctx sdk.Context, msg types.MsgRenewRecord) error { + if !k.HasRecord(ctx, msg.RecordId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record not found.") + } + + // 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()) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Renewal not required.") + } + + recordType := record.ToRecordType() + err := k.processRecord(ctx, &recordType, true) + if err != nil { + return err + } + + return nil +} + +// ProcessAssociateBond associates a record with a bond. +func (k Keeper) ProcessAssociateBond(ctx sdk.Context, msg types.MsgAssociateBond) error { + + if !k.HasRecord(ctx, msg.RecordId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record not found.") + } + + if !k.bondKeeper.HasBond(ctx, msg.BondId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Bond not found.") + } + + // Check if already associated with a bond. + record := k.GetRecord(ctx, msg.RecordId) + if record.BondId != "" || len(record.BondId) != 0 { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond already exists.") + } + + // Only the bond owner can associate a record with the bond. + bond := k.bondKeeper.GetBond(ctx, msg.BondId) + if msg.Signer != bond.Owner { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond owner mismatch.") + } + + record.BondId = msg.BondId + k.PutRecord(ctx, record) + k.AddBondToRecordIndexEntry(ctx, msg.BondId, msg.RecordId) + + // Required so that renewal is triggered (with new bond ID) for expired records. + if record.Deleted { + k.InsertRecordExpiryQueue(ctx, record) + } + + return nil +} + +// ProcessDissociateBond dissociates a record from its bond. +func (k Keeper) ProcessDissociateBond(ctx sdk.Context, msg types.MsgDissociateBond) error { + if !k.HasRecord(ctx, msg.RecordId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record not found.") + } + + // Check if associated with a bond. + record := k.GetRecord(ctx, msg.RecordId) + bondID := record.BondId + if bondID == "" || len(bondID) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond not found.") + } + + // Only the bond owner can dissociate a record from the bond. + bond := k.bondKeeper.GetBond(ctx, bondID) + if msg.Signer != bond.Owner { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond owner mismatch.") + } + + // Clear bond ID. + record.BondId = "" + k.PutRecord(ctx, record) + k.RemoveBondToRecordIndexEntry(ctx, bondID, record.Id) + + return nil +} + +// ProcessDissociateRecords dissociates all records associated with a given bond. +func (k Keeper) ProcessDissociateRecords(ctx sdk.Context, msg types.MsgDissociateRecords) error { + if !k.bondKeeper.HasBond(ctx, msg.BondId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Bond not found.") + } + + // Only the bond owner can dissociate all records from the bond. + bond := k.bondKeeper.GetBond(ctx, msg.BondId) + if msg.Signer != bond.Owner { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond owner mismatch.") + } + + // Dissociate all records from the bond. + records := k.recordKeeper.QueryRecordsByBond(ctx, msg.BondId) + for _, record := range records { + // Clear bond ID. + record.BondId = "" + k.PutRecord(ctx, record) + k.RemoveBondToRecordIndexEntry(ctx, msg.BondId, record.Id) + } + + return nil +} + +// ProcessReAssociateRecords switches records from and old to new bond. +func (k Keeper) ProcessReAssociateRecords(ctx sdk.Context, msg types.MsgReAssociateRecords) error { + if !k.bondKeeper.HasBond(ctx, msg.OldBondId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Old bond not found.") + } + + if !k.bondKeeper.HasBond(ctx, msg.NewBondId) { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "New bond not found.") + } + + // Only the bond owner can re-associate all records. + oldBond := k.bondKeeper.GetBond(ctx, msg.OldBondId) + if msg.Signer != oldBond.Owner { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Old bond owner mismatch.") + } + + newBond := k.bondKeeper.GetBond(ctx, msg.NewBondId) + if msg.Signer != newBond.Owner { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "New bond owner mismatch.") + } + + // Re-associate all records. + records := k.recordKeeper.QueryRecordsByBond(ctx, msg.OldBondId) + for _, record := range records { + // Switch bond ID. + record.BondId = msg.NewBondId + k.PutRecord(ctx, record) + + k.RemoveBondToRecordIndexEntry(ctx, msg.OldBondId, record.Id) + k.AddBondToRecordIndexEntry(ctx, msg.NewBondId, record.Id) + + // Required so that renewal is triggered (with new bond ID) for expired records. + if record.Deleted { + k.InsertRecordExpiryQueue(ctx, record) + } + } + + return nil +} diff --git a/x/nameservice/keeper/sync.go b/x/nameservice/keeper/sync.go new file mode 100644 index 00000000..e0de1d35 --- /dev/null +++ b/x/nameservice/keeper/sync.go @@ -0,0 +1,99 @@ +package keeper + +import ( + "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/tharsis/ethermint/x/nameservice/helpers" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +func GetBlockChangeSetIndexKey(height int64) []byte { + return append(PrefixBlockChangesetIndex, helpers.Int64ToBytes(height)...) +} + +func getOrCreateBlockChangeset(store sdk.KVStore, codec codec.BinaryCodec, height int64) *types.BlockChangeSet { + bz := store.Get(GetBlockChangeSetIndexKey(height)) + + if bz != nil { + var changeSet types.BlockChangeSet + err := codec.Unmarshal(bz, &changeSet) + if err != nil { + return nil + } + return &changeSet + } + + return &types.BlockChangeSet{ + Height: height, + Records: []string{}, + Names: []string{}, + Auctions: []string{}, + AuctionBids: []*types.AuctionBidInfo{}, + } +} + +func updateBlockChangeSetForAuction(ctx sdk.Context, k RecordKeeper, id string) { + changeSet := getOrCreateBlockChangeset(ctx.KVStore(k.storeKey), k.cdc, ctx.BlockHeight()) + + found := false + for _, elem := range changeSet.Auctions { + if id == elem { + found = true + break + } + } + + if !found { + changeSet.Auctions = append(changeSet.Auctions, id) + saveBlockChangeSet(ctx.KVStore(k.storeKey), k.cdc, changeSet) + } +} + +func saveBlockChangeSet(store sdk.KVStore, codec codec.BinaryCodec, changeset *types.BlockChangeSet) { + bz := codec.MustMarshal(changeset) + store.Set(GetBlockChangeSetIndexKey(changeset.Height), bz) +} + +func (k Keeper) saveBlockChangeSet(ctx sdk.Context, changeSet *types.BlockChangeSet) { + saveBlockChangeSet(ctx.KVStore(k.storeKey), k.cdc, changeSet) +} + +func (k Keeper) updateBlockChangeSetForRecord(ctx sdk.Context, id string) { + changeSet := k.getOrCreateBlockChangeSet(ctx, ctx.BlockHeight()) + changeSet.Records = append(changeSet.Records, id) + k.saveBlockChangeSet(ctx, changeSet) +} + +func (k Keeper) getOrCreateBlockChangeSet(ctx sdk.Context, height int64) *types.BlockChangeSet { + store := ctx.KVStore(k.storeKey) + bz := store.Get(GetBlockChangeSetIndexKey(height)) + + if bz != nil { + var changeSet types.BlockChangeSet + err := k.cdc.Unmarshal(bz, &changeSet) + if err != nil { + return nil + } + return &changeSet + } + + return &types.BlockChangeSet{ + Height: height, + Records: []string{}, + Names: []string{}, + Auctions: []string{}, + AuctionBids: []*types.AuctionBidInfo{}, + } +} + +func updateBlockChangeSetForAuctionBid(ctx sdk.Context, k RecordKeeper, id, bidderAddress string) { + changeSet := getOrCreateBlockChangeset(ctx.KVStore(k.storeKey), k.cdc, ctx.BlockHeight()) + changeSet.AuctionBids = append(changeSet.AuctionBids, &types.AuctionBidInfo{AuctionId: id, BidderAddress: bidderAddress}) + saveBlockChangeSet(ctx.KVStore(k.storeKey), k.cdc, changeSet) +} + +func updateBlockChangeSetForNameAuthority(ctx sdk.Context, codec codec.BinaryCodec, store sdk.KVStore, name string) { + changeSet := getOrCreateBlockChangeset(store, codec, ctx.BlockHeight()) + changeSet.Authorities = append(changeSet.Authorities, name) + saveBlockChangeSet(store, codec, changeSet) +} diff --git a/x/nameservice/module.go b/x/nameservice/module.go new file mode 100644 index 00000000..d4ae0eca --- /dev/null +++ b/x/nameservice/module.go @@ -0,0 +1,129 @@ +package nameservice + +import ( + "encoding/json" + "fmt" + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/module" + "github.com/gorilla/mux" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tharsis/ethermint/x/nameservice/cli" + "github.com/tharsis/ethermint/x/nameservice/keeper" + "github.com/tharsis/ethermint/x/nameservice/types" +) + +// type check to ensure the interface is properly implemented +var ( + _ module.AppModule = AppModule{} + _ module.AppModuleBasic = AppModuleBasic{} +) + +// AppModuleBasic _ app module Basics object +type AppModuleBasic struct{} + +func (a AppModuleBasic) Name() string { + return types.ModuleName +} + +func (a AppModuleBasic) RegisterLegacyAminoCodec(amino *codec.LegacyAmino) { + types.RegisterLegacyAminoCodec(amino) +} + +func (a AppModuleBasic) RegisterInterfaces(registry codectypes.InterfaceRegistry) { + types.RegisterInterfaces(registry) +} + +func (a AppModuleBasic) DefaultGenesis(cdc codec.JSONCodec) json.RawMessage { + return cdc.MustMarshalJSON(types.DefaultGenesisState()) +} + +func (a AppModuleBasic) ValidateGenesis(cdc codec.JSONCodec, config client.TxEncodingConfig, message json.RawMessage) error { + var data types.GenesisState + if err := cdc.UnmarshalJSON(message, &data); err != nil { + return fmt.Errorf("failed to unmarshal %s genesis state: %w", types.ModuleName, err) + } + + return types.ValidateGenesis(data) +} + +func (a AppModuleBasic) RegisterRESTRoutes(context client.Context, router *mux.Router) { +} + +func (a AppModuleBasic) RegisterGRPCGatewayRoutes(context client.Context, mux *runtime.ServeMux) { +} + +func (a AppModuleBasic) GetTxCmd() *cobra.Command { + return cli.NewTxCmd() +} + +func (a AppModuleBasic) GetQueryCmd() *cobra.Command { + return cli.GetQueryCmd() +} + +type AppModule struct { + AppModuleBasic + keeper keeper.Keeper +} + +func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, message json.RawMessage) []abci.ValidatorUpdate { + var genesisState types.GenesisState + + cdc.MustUnmarshalJSON(message, &genesisState) + + return InitGenesis(ctx, am.keeper, genesisState) +} + +func (am AppModule) ExportGenesis(ctx sdk.Context, cdc codec.JSONCodec) json.RawMessage { + gs := ExportGenesis(ctx, am.keeper) + return cdc.MustMarshalJSON(&gs) +} + +func (am AppModule) RegisterInvariants(registry sdk.InvariantRegistry) { + keeper.RegisterInvariants(registry, am.keeper) +} + +func (am AppModule) Route() sdk.Route { + return sdk.Route{} +} + +func (am AppModule) QuerierRoute() string { + return types.QuerierRoute +} + +func (am AppModule) LegacyQuerierHandler(amino *codec.LegacyAmino) sdk.Querier { + return nil +} + +func (am AppModule) RegisterServices(cfg module.Configurator) { + + querier := keeper.Querier{Keeper: am.keeper} + types.RegisterQueryServer(cfg.QueryServer(), querier) + + msgServer := keeper.NewMsgServerImpl(am.keeper) + types.RegisterMsgServer(cfg.MsgServer(), msgServer) +} + +func (am AppModule) ConsensusVersion() uint64 { + return 1 +} + +func (am AppModule) BeginBlock(ctx sdk.Context, _ abci.RequestBeginBlock) { + BeginBlocker(ctx, am.keeper) +} + +func (am AppModule) EndBlock(ctx sdk.Context, _ abci.RequestEndBlock) []abci.ValidatorUpdate { + return EndBlocker(ctx, am.keeper) +} + +// NewAppModule creates a new AppModule Object +func NewAppModule(k keeper.Keeper) AppModule { + return AppModule{ + AppModuleBasic: AppModuleBasic{}, + keeper: k, + } +} diff --git a/x/nameservice/types/codec.go b/x/nameservice/types/codec.go new file mode 100644 index 00000000..fc97b989 --- /dev/null +++ b/x/nameservice/types/codec.go @@ -0,0 +1,53 @@ +package types + +import ( + "github.com/cosmos/cosmos-sdk/codec" + "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/msgservice" +) + +// RegisterLegacyAminoCodec registers the necessary x/bond interfaces and concrete types +// on the provided LegacyAmino codec. These types are used for Amino JSON serialization. +func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { + cdc.RegisterConcrete(&MsgSetName{}, "nameservice/SetName", nil) + cdc.RegisterConcrete(&MsgReserveAuthority{}, "nameservice/ReserveAuthority", nil) + cdc.RegisterConcrete(&MsgDeleteNameAuthority{}, "nameservice/DeleteAuthority", nil) + cdc.RegisterConcrete(&MsgSetAuthorityBond{}, "nameservice/SetAuthorityBond", nil) + + cdc.RegisterConcrete(&MsgSetRecord{}, "nameservice/SetRecord", nil) + cdc.RegisterConcrete(&MsgRenewRecord{}, "nameservice/RenewRecord", nil) + cdc.RegisterConcrete(&MsgAssociateBond{}, "nameservice/AssociateBond", nil) + cdc.RegisterConcrete(&MsgDissociateBond{}, "nameservice/DissociateBond", nil) + cdc.RegisterConcrete(&MsgDissociateRecords{}, "nameservice/DissociateRecords", nil) + cdc.RegisterConcrete(&MsgReAssociateRecords{}, "nameservice/ReassociateRecords", nil) +} + +func RegisterInterfaces(registry types.InterfaceRegistry) { + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgSetName{}, + &MsgReserveAuthority{}, + &MsgDeleteNameAuthority{}, + &MsgSetAuthorityBond{}, + + &MsgSetRecord{}, + &MsgRenewRecord{}, + &MsgAssociateBond{}, + &MsgDissociateBond{}, + &MsgDissociateRecords{}, + &MsgReAssociateRecords{}, + ) + msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) +} + +var ( + amino = codec.NewLegacyAmino() + ModuleCdc = codec.NewAminoCodec(amino) +) + +func init() { + RegisterLegacyAminoCodec(amino) + cryptocodec.RegisterCrypto(amino) + amino.Seal() +} diff --git a/x/nameservice/types/events.go b/x/nameservice/types/events.go new file mode 100644 index 00000000..a93683a7 --- /dev/null +++ b/x/nameservice/types/events.go @@ -0,0 +1,25 @@ +package types + +const ( + EventTypeSetRecord = "set" + EventTypeDeleteName = "delete-name" + EventTypeReserveNameAuthority = "reserve-authority" + EventTypeAuthorityBond = "authority-bond" + EventTypeRenewRecord = "renew-record" + EventTypeAssociateBond = "associate-bond" + EventTypeDissociateBond = "dissociate-bond" + EventTypeDissociateRecords = "dissociate-record" + EventTypeReAssociateRecords = "re-associate-records" + + AttributeKeySigner = "signer" + AttributeKeyOwner = "owner" + AttributeKeyBondId = "bond-id" + AttributeKeyPayload = "payload" + AttributeKeyOldBondId = "old-bond-id" + AttributeKeyNewBondId = "new-bond-id" + AttributeKeyCID = "cid" + AttributeKeyName = "name" + AttributeKeyWRN = "wrn" + AttributeKeyRecordId = "record-id" + AttributeValueCategory = ModuleName +) diff --git a/x/nameservice/types/genesis.go b/x/nameservice/types/genesis.go new file mode 100644 index 00000000..b49d2a95 --- /dev/null +++ b/x/nameservice/types/genesis.go @@ -0,0 +1,27 @@ +package types + +func NewGenesisState(params Params, records []Record, authorities []AuthorityEntry, names []NameEntry) GenesisState { + return GenesisState{ + Params: params, + Records: records, + Authorities: authorities, + Names: names, + } +} + +// DefaultGenesisState sets default evm genesis state with empty accounts and default params and +// chain config values. +func DefaultGenesisState() *GenesisState { + return &GenesisState{ + Params: DefaultParams(), + } +} + +func ValidateGenesis(data GenesisState) error { + err := data.Params.Validate() + if err != nil { + return err + } + + return nil +} diff --git a/x/nameservice/types/genesis.pb.go b/x/nameservice/types/genesis.pb.go new file mode 100644 index 00000000..b6ea3a41 --- /dev/null +++ b/x/nameservice/types/genesis.pb.go @@ -0,0 +1,522 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vulcanize/nameservice/v1beta1/genesis.proto + +package types + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// GenesisState defines the nameservice module's genesis state. +type GenesisState struct { + // params defines all the params of nameservice module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // records + Records []Record `protobuf:"bytes,2,rep,name=records,proto3" json:"records" json:"records" yaml:"records"` + // authorities + Authorities []AuthorityEntry `protobuf:"bytes,3,rep,name=authorities,proto3" json:"authorities" json:"authorities" yaml:"authorities"` + // names + Names []NameEntry `protobuf:"bytes,4,rep,name=names,proto3" json:"names" json:"names" yaml:"names"` +} + +func (m *GenesisState) Reset() { *m = GenesisState{} } +func (m *GenesisState) String() string { return proto.CompactTextString(m) } +func (*GenesisState) ProtoMessage() {} +func (*GenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_fe7037a2b22e67ef, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetRecords() []Record { + if m != nil { + return m.Records + } + return nil +} + +func (m *GenesisState) GetAuthorities() []AuthorityEntry { + if m != nil { + return m.Authorities + } + return nil +} + +func (m *GenesisState) GetNames() []NameEntry { + if m != nil { + return m.Names + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "vulcanize.nameservice.v1beta1.GenesisState") +} + +func init() { + proto.RegisterFile("vulcanize/nameservice/v1beta1/genesis.proto", fileDescriptor_fe7037a2b22e67ef) +} + +var fileDescriptor_fe7037a2b22e67ef = []byte{ + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0xd2, 0xb1, 0x4a, 0xfb, 0x40, + 0x1c, 0x07, 0xf0, 0xe4, 0xdf, 0xfe, 0x2b, 0xa4, 0x4e, 0xc1, 0x21, 0x16, 0x9a, 0xd6, 0x42, 0xa1, + 0x20, 0xcd, 0x59, 0xdd, 0xdc, 0x8c, 0x88, 0xe0, 0x20, 0x12, 0x37, 0xb7, 0x6b, 0xfc, 0x99, 0x9c, + 0x34, 0xb9, 0x72, 0xf7, 0x6b, 0x31, 0x0e, 0x3e, 0x83, 0x4f, 0xe0, 0xf3, 0x74, 0xec, 0xe8, 0x54, + 0xa4, 0x7d, 0x03, 0x9f, 0x40, 0x7a, 0x97, 0x68, 0x5c, 0x5a, 0xb7, 0x5c, 0xf8, 0x7e, 0xbf, 0x9f, + 0x40, 0xce, 0x3a, 0x9c, 0x4e, 0x46, 0x21, 0x4d, 0xd9, 0x33, 0x90, 0x94, 0x26, 0x20, 0x41, 0x4c, + 0x59, 0x08, 0x64, 0x3a, 0x18, 0x02, 0xd2, 0x01, 0x89, 0x20, 0x05, 0xc9, 0xa4, 0x37, 0x16, 0x1c, + 0xb9, 0xdd, 0xfc, 0x0e, 0x7b, 0xa5, 0xb0, 0x97, 0x87, 0x1b, 0x7b, 0x11, 0x8f, 0xb8, 0x4a, 0x92, + 0xf5, 0x93, 0x2e, 0x35, 0xc8, 0x66, 0xa1, 0x3c, 0xa4, 0x0a, 0x9d, 0xb7, 0x8a, 0xb5, 0x7b, 0xa9, + 0xdd, 0x5b, 0xa4, 0x08, 0xf6, 0xb9, 0x55, 0x1b, 0x53, 0x41, 0x13, 0xe9, 0x98, 0x6d, 0xb3, 0x57, + 0x3f, 0xee, 0x7a, 0x1b, 0xbf, 0xc3, 0xbb, 0x51, 0x61, 0xbf, 0x3a, 0x5b, 0xb4, 0x8c, 0x20, 0xaf, + 0xda, 0x0f, 0xd6, 0x8e, 0x80, 0x90, 0x8b, 0x7b, 0xe9, 0xfc, 0x6b, 0x57, 0xfe, 0xb0, 0x12, 0xa8, + 0xb4, 0xdf, 0x5d, 0xaf, 0x7c, 0x2e, 0x5a, 0xcd, 0x47, 0xc9, 0xd3, 0xd3, 0x4e, 0xbe, 0xd1, 0x69, + 0x67, 0x34, 0x19, 0xfd, 0x1c, 0x83, 0x62, 0xdc, 0x7e, 0xb1, 0xea, 0x74, 0x82, 0x31, 0x17, 0x0c, + 0x19, 0x48, 0xa7, 0xa2, 0xac, 0xfe, 0x16, 0xeb, 0x2c, 0x6f, 0x64, 0x17, 0x29, 0x8a, 0xcc, 0xef, + 0xe7, 0x66, 0x57, 0x9b, 0xa5, 0xbd, 0xc2, 0x2d, 0xbf, 0x0a, 0xca, 0xa0, 0x4d, 0xad, 0xff, 0x4a, + 0x70, 0xaa, 0x4a, 0xee, 0x6d, 0x91, 0xaf, 0x69, 0x02, 0x1a, 0x3d, 0xc8, 0xd1, 0x7d, 0x8d, 0xaa, + 0x70, 0xc1, 0xe9, 0x43, 0xa0, 0x97, 0xfd, 0xab, 0xd9, 0xd2, 0x35, 0xe7, 0x4b, 0xd7, 0xfc, 0x58, + 0xba, 0xe6, 0xeb, 0xca, 0x35, 0xe6, 0x2b, 0xd7, 0x78, 0x5f, 0xb9, 0xc6, 0xdd, 0x51, 0xc4, 0x30, + 0x9e, 0x0c, 0xbd, 0x90, 0x27, 0x04, 0x63, 0x2a, 0x24, 0x93, 0x04, 0x30, 0x06, 0x91, 0xb0, 0x14, + 0xc9, 0xd3, 0xaf, 0x0b, 0x80, 0xd9, 0x18, 0xe4, 0xb0, 0xa6, 0xfe, 0xf9, 0xc9, 0x57, 0x00, 0x00, + 0x00, 0xff, 0xff, 0xbe, 0x6b, 0x6e, 0x5b, 0x88, 0x02, 0x00, 0x00, +} + +func (m *GenesisState) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Names[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Authorities) > 0 { + for iNdEx := len(m.Authorities) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Authorities[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Records[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Authorities) > 0 { + for _, e := range m.Authorities { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.Names) > 0 { + for _, e := range m.Names { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Records = append(m.Records, Record{}) + if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authorities", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Authorities = append(m.Authorities, AuthorityEntry{}) + if err := m.Authorities[len(m.Authorities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Names = append(m.Names, NameEntry{}) + if err := m.Names[len(m.Names)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowGenesis + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/nameservice/types/keys.go b/x/nameservice/types/keys.go new file mode 100644 index 00000000..5e142cab --- /dev/null +++ b/x/nameservice/types/keys.go @@ -0,0 +1,21 @@ +package types + +const ( + // ModuleName is the name of the staking module + ModuleName = "nameservice" + + // RecordRentModuleAccountName is the name of the module account that keeps track of record rents paid. + RecordRentModuleAccountName = "record_rent" + + // AuthorityRentModuleAccountName is the name of the module account that keeps track of authority rents paid. + AuthorityRentModuleAccountName = "authority_rent" + + // StoreKey is the string store representation + StoreKey = ModuleName + + // QuerierRoute is the querier route for the staking module + QuerierRoute = ModuleName + + // RouterKey is the msg router key for the staking module + RouterKey = ModuleName +) diff --git a/x/nameservice/types/msg.go b/x/nameservice/types/msg.go new file mode 100644 index 00000000..ee710f14 --- /dev/null +++ b/x/nameservice/types/msg.go @@ -0,0 +1,188 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "net/url" +) + +var ( + _ sdk.Msg = &MsgSetName{} + _ sdk.Msg = &MsgReserveAuthority{} + _ sdk.Msg = &MsgSetAuthorityBond{} + _ sdk.Msg = &MsgDeleteNameAuthority{} +) + +// NewMsgSetName is the constructor function for MsgSetName. +func NewMsgSetName(wrn string, cid string, signer sdk.AccAddress) MsgSetName { + return MsgSetName{ + Wrn: wrn, + Cid: cid, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgSetName) Route() string { return RouterKey } + +// Type Implements Msg. +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.Cid == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "CID is required.") + } + + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer") + } + + return nil +} + +// GetSignBytes gets the sign bytes for the msg MsgSetName +func (msg MsgSetName) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgSetName) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgReserveAuthority is the constructor function for MsgReserveName. +func NewMsgReserveAuthority(name string, signer sdk.AccAddress, owner sdk.AccAddress) MsgReserveAuthority { + return MsgReserveAuthority{ + Name: name, + Owner: owner.String(), + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgReserveAuthority) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgReserveAuthority) Type() string { return "reserve-authority" } + +// ValidateBasic Implements Msg. +func (msg MsgReserveAuthority) ValidateBasic() error { + + if len(msg.Name) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name is required.") + } + + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer") + } + + return nil +} + +// GetSignBytes gets the sign bytes for the msg MsgSetName +func (msg MsgReserveAuthority) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgReserveAuthority) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgSetAuthorityBond is the constructor function for MsgSetAuthorityBond. +func NewMsgSetAuthorityBond(name string, bondId string, signer sdk.AccAddress) MsgSetAuthorityBond { + return MsgSetAuthorityBond{ + Name: name, + Signer: signer.String(), + BondId: bondId, + } +} + +// Route Implements Msg. +func (msg MsgSetAuthorityBond) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgSetAuthorityBond) Type() string { return "authority-bond" } + +// ValidateBasic Implements Msg. +func (msg MsgSetAuthorityBond) ValidateBasic() error { + if len(msg.Name) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "name is required.") + } + + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + if len(msg.BondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "bond id is required.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for the msg MsgSetName +func (msg MsgSetAuthorityBond) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgSetAuthorityBond) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgDeleteNameAuthority is the constructor function for MsgDeleteNameAuthority. +func NewMsgDeleteNameAuthority(wrn string, signer sdk.AccAddress) MsgDeleteNameAuthority { + return MsgDeleteNameAuthority{ + Wrn: wrn, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgDeleteNameAuthority) Route() string { return RouterKey } + +// Type Implements Msg. +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.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + _, err := url.Parse(msg.Wrn) + if err != nil { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "invalid wrn.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for the msg MsgSetName +func (msg MsgDeleteNameAuthority) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgDeleteNameAuthority) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} diff --git a/x/nameservice/types/nameservice.pb.go b/x/nameservice/types/nameservice.pb.go new file mode 100644 index 00000000..00fe593c --- /dev/null +++ b/x/nameservice/types/nameservice.pb.go @@ -0,0 +1,3633 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vulcanize/nameservice/v1beta1/nameservice.proto + +package types + +import ( + fmt "fmt" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Params defines the nameservice module parameters +type Params struct { + RecordRent types.Coin `protobuf:"bytes,1,opt,name=record_rent,json=recordRent,proto3" json:"record_rent" json:"record_rent" yaml:"record_rent"` + RecordRentDuration time.Duration `protobuf:"bytes,2,opt,name=record_rent_duration,json=recordRentDuration,proto3,stdduration" json:"record_rent_duration" json:"record_rent_duration" yaml:"record_rent_duration"` + AuthorityRent types.Coin `protobuf:"bytes,3,opt,name=authority_rent,json=authorityRent,proto3" json:"authority_rent" json:"authority_rent" yaml:"authority_rent"` + AuthorityRentDuration time.Duration `protobuf:"bytes,4,opt,name=authority_rent_duration,json=authorityRentDuration,proto3,stdduration" json:"authority_rent_duration" json:"authority_rent_duration" yaml:"authority_rent_duration"` + AuthorityGracePeriod time.Duration `protobuf:"bytes,5,opt,name=authority_grace_period,json=authorityGracePeriod,proto3,stdduration" json:"authority_grace_period" json:"authority_grace_period" yaml:"authority_grace_period"` + AuthorityAuctionEnabled bool `protobuf:"varint,6,opt,name=authority_auction_enabled,json=authorityAuctionEnabled,proto3" json:"authority_auction_enabled,omitempty" json:"authority_auction_enabled" yaml:"authority_auction_enabled"` + AuthorityAuctionCommitsDuration time.Duration `protobuf:"bytes,7,opt,name=authority_auction_commits_duration,json=authorityAuctionCommitsDuration,proto3,stdduration" json:"authority_auction_commits_duration" json:"authority_auction_commits_duration" yaml:"authority_auction_commits_duration"` + AuthorityAuctionRevealsDuration time.Duration `protobuf:"bytes,8,opt,name=authority_auction_reveals_duration,json=authorityAuctionRevealsDuration,proto3,stdduration" json:"authority_auction_reveals_duration" json:"authority_auction_reveals_duration" yaml:"authority_auction_reveals_duration"` + AuthorityAuctionCommitFee types.Coin `protobuf:"bytes,9,opt,name=authority_auction_commit_fee,json=authorityAuctionCommitFee,proto3" json:"authority_auction_commit_fee" json:"authority_auction_commit_fee" yaml:"authority_auction_commit_fee"` + AuthorityAuctionRevealFee types.Coin `protobuf:"bytes,10,opt,name=authority_auction_reveal_fee,json=authorityAuctionRevealFee,proto3" json:"authority_auction_reveal_fee" json:"authority_auction_reveal_fee" yaml:"authority_auction_reveal_fee"` + AuthorityAuctionMinimumBid types.Coin `protobuf:"bytes,11,opt,name=authority_auction_minimum_bid,json=authorityAuctionMinimumBid,proto3" json:"authority_auction_minimum_bid" json:"authority_auction_minimum_bid" yaml:"authority_auction_minimum_bid"` +} + +func (m *Params) Reset() { *m = Params{} } +func (m *Params) String() string { return proto.CompactTextString(m) } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetRecordRent() types.Coin { + if m != nil { + return m.RecordRent + } + return types.Coin{} +} + +func (m *Params) GetRecordRentDuration() time.Duration { + if m != nil { + return m.RecordRentDuration + } + return 0 +} + +func (m *Params) GetAuthorityRent() types.Coin { + if m != nil { + return m.AuthorityRent + } + return types.Coin{} +} + +func (m *Params) GetAuthorityRentDuration() time.Duration { + if m != nil { + return m.AuthorityRentDuration + } + return 0 +} + +func (m *Params) GetAuthorityGracePeriod() time.Duration { + if m != nil { + return m.AuthorityGracePeriod + } + return 0 +} + +func (m *Params) GetAuthorityAuctionEnabled() bool { + if m != nil { + return m.AuthorityAuctionEnabled + } + return false +} + +func (m *Params) GetAuthorityAuctionCommitsDuration() time.Duration { + if m != nil { + return m.AuthorityAuctionCommitsDuration + } + return 0 +} + +func (m *Params) GetAuthorityAuctionRevealsDuration() time.Duration { + if m != nil { + return m.AuthorityAuctionRevealsDuration + } + return 0 +} + +func (m *Params) GetAuthorityAuctionCommitFee() types.Coin { + if m != nil { + return m.AuthorityAuctionCommitFee + } + return types.Coin{} +} + +func (m *Params) GetAuthorityAuctionRevealFee() types.Coin { + if m != nil { + return m.AuthorityAuctionRevealFee + } + return types.Coin{} +} + +func (m *Params) GetAuthorityAuctionMinimumBid() types.Coin { + if m != nil { + return m.AuthorityAuctionMinimumBid + } + return 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"` +} + +func (m *Record) Reset() { *m = Record{} } +func (m *Record) String() string { return proto.CompactTextString(m) } +func (*Record) ProtoMessage() {} +func (*Record) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{1} +} +func (m *Record) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Record) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Record.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 *Record) XXX_Merge(src proto.Message) { + xxx_messageInfo_Record.Merge(m, src) +} +func (m *Record) XXX_Size() int { + return m.Size() +} +func (m *Record) XXX_DiscardUnknown() { + xxx_messageInfo_Record.DiscardUnknown(m) +} + +var xxx_messageInfo_Record proto.InternalMessageInfo + +func (m *Record) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *Record) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *Record) GetCreateTime() time.Time { + if m != nil { + return m.CreateTime + } + return time.Time{} +} + +func (m *Record) GetExpiryTime() time.Time { + if m != nil { + return m.ExpiryTime + } + return time.Time{} +} + +func (m *Record) GetDeleted() bool { + if m != nil { + return m.Deleted + } + return false +} + +func (m *Record) GetOwners() []string { + if m != nil { + return m.Owners + } + return nil +} + +func (m *Record) GetAttributes() []byte { + if m != nil { + return m.Attributes + } + return nil +} + +// AuthorityEntry defines the nameservice module AuthorityEntries +type AuthorityEntry struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Entry *NameAuthority `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` +} + +func (m *AuthorityEntry) Reset() { *m = AuthorityEntry{} } +func (m *AuthorityEntry) String() string { return proto.CompactTextString(m) } +func (*AuthorityEntry) ProtoMessage() {} +func (*AuthorityEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{2} +} +func (m *AuthorityEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuthorityEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuthorityEntry.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 *AuthorityEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuthorityEntry.Merge(m, src) +} +func (m *AuthorityEntry) XXX_Size() int { + return m.Size() +} +func (m *AuthorityEntry) XXX_DiscardUnknown() { + xxx_messageInfo_AuthorityEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_AuthorityEntry proto.InternalMessageInfo + +func (m *AuthorityEntry) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *AuthorityEntry) GetEntry() *NameAuthority { + if m != nil { + return m.Entry + } + return nil +} + +// NameAuthority +type NameAuthority struct { + // Owner public key. + OwnerPublicKey string `protobuf:"bytes,1,opt,name=owner_public_key,json=ownerPublicKey,proto3" json:"owner_public_key,omitempty" json:"ownerPublicKey" yaml:"ownerPublicKey"` + // Owner address. + OwnerAddress string `protobuf:"bytes,2,opt,name=owner_address,json=ownerAddress,proto3" json:"owner_address,omitempty" json:"ownerAddress" yaml:"ownerAddress"` + // height at which name/authority was created. + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Status string `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + AuctionId string `protobuf:"bytes,5,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auctionID" yaml:"auctionID"` + BondId string `protobuf:"bytes,6,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondID" yaml:"bondID"` + ExpiryTime time.Time `protobuf:"bytes,7,opt,name=expiry_time,json=expiryTime,proto3,stdtime" json:"expiry_time" json:"expiryTime" yaml:"expiryTime"` +} + +func (m *NameAuthority) Reset() { *m = NameAuthority{} } +func (m *NameAuthority) String() string { return proto.CompactTextString(m) } +func (*NameAuthority) ProtoMessage() {} +func (*NameAuthority) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{3} +} +func (m *NameAuthority) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NameAuthority) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NameAuthority.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 *NameAuthority) XXX_Merge(src proto.Message) { + xxx_messageInfo_NameAuthority.Merge(m, src) +} +func (m *NameAuthority) XXX_Size() int { + return m.Size() +} +func (m *NameAuthority) XXX_DiscardUnknown() { + xxx_messageInfo_NameAuthority.DiscardUnknown(m) +} + +var xxx_messageInfo_NameAuthority proto.InternalMessageInfo + +func (m *NameAuthority) GetOwnerPublicKey() string { + if m != nil { + return m.OwnerPublicKey + } + return "" +} + +func (m *NameAuthority) GetOwnerAddress() string { + if m != nil { + return m.OwnerAddress + } + return "" +} + +func (m *NameAuthority) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *NameAuthority) GetStatus() string { + if m != nil { + return m.Status + } + return "" +} + +func (m *NameAuthority) GetAuctionId() string { + if m != nil { + return m.AuctionId + } + return "" +} + +func (m *NameAuthority) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *NameAuthority) GetExpiryTime() time.Time { + if m != nil { + return m.ExpiryTime + } + return time.Time{} +} + +// NameEntry +type NameEntry struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Entry *NameRecord `protobuf:"bytes,2,opt,name=entry,proto3" json:"entry,omitempty"` +} + +func (m *NameEntry) Reset() { *m = NameEntry{} } +func (m *NameEntry) String() string { return proto.CompactTextString(m) } +func (*NameEntry) ProtoMessage() {} +func (*NameEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{4} +} +func (m *NameEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NameEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NameEntry.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 *NameEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_NameEntry.Merge(m, src) +} +func (m *NameEntry) XXX_Size() int { + return m.Size() +} +func (m *NameEntry) XXX_DiscardUnknown() { + xxx_messageInfo_NameEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_NameEntry proto.InternalMessageInfo + +func (m *NameEntry) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *NameEntry) GetEntry() *NameRecord { + if m != nil { + return m.Entry + } + return nil +} + +// NameRecord +type NameRecord struct { + Latest *NameRecordEntry `protobuf:"bytes,1,opt,name=latest,proto3" json:"latest,omitempty"` + History []*NameRecordEntry `protobuf:"bytes,2,rep,name=history,proto3" json:"history,omitempty"` +} + +func (m *NameRecord) Reset() { *m = NameRecord{} } +func (m *NameRecord) String() string { return proto.CompactTextString(m) } +func (*NameRecord) ProtoMessage() {} +func (*NameRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{5} +} +func (m *NameRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NameRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NameRecord.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 *NameRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_NameRecord.Merge(m, src) +} +func (m *NameRecord) XXX_Size() int { + return m.Size() +} +func (m *NameRecord) XXX_DiscardUnknown() { + xxx_messageInfo_NameRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_NameRecord proto.InternalMessageInfo + +func (m *NameRecord) GetLatest() *NameRecordEntry { + if m != nil { + return m.Latest + } + return nil +} + +func (m *NameRecord) GetHistory() []*NameRecordEntry { + if m != nil { + return m.History + } + return nil +} + +// NameRecordEntry +type NameRecordEntry struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *NameRecordEntry) Reset() { *m = NameRecordEntry{} } +func (m *NameRecordEntry) String() string { return proto.CompactTextString(m) } +func (*NameRecordEntry) ProtoMessage() {} +func (*NameRecordEntry) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{6} +} +func (m *NameRecordEntry) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *NameRecordEntry) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_NameRecordEntry.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 *NameRecordEntry) XXX_Merge(src proto.Message) { + xxx_messageInfo_NameRecordEntry.Merge(m, src) +} +func (m *NameRecordEntry) XXX_Size() int { + return m.Size() +} +func (m *NameRecordEntry) XXX_DiscardUnknown() { + xxx_messageInfo_NameRecordEntry.DiscardUnknown(m) +} + +var xxx_messageInfo_NameRecordEntry proto.InternalMessageInfo + +func (m *NameRecordEntry) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *NameRecordEntry) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +// Signature +type Signature struct { + Sig string `protobuf:"bytes,1,opt,name=sig,proto3" json:"sig,omitempty" json:"sig" yaml:"sig"` + PubKey string `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty" json:"pubKey" yaml:"pubKey"` +} + +func (m *Signature) Reset() { *m = Signature{} } +func (m *Signature) String() string { return proto.CompactTextString(m) } +func (*Signature) ProtoMessage() {} +func (*Signature) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{7} +} +func (m *Signature) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Signature) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Signature.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 *Signature) XXX_Merge(src proto.Message) { + xxx_messageInfo_Signature.Merge(m, src) +} +func (m *Signature) XXX_Size() int { + return m.Size() +} +func (m *Signature) XXX_DiscardUnknown() { + xxx_messageInfo_Signature.DiscardUnknown(m) +} + +var xxx_messageInfo_Signature proto.InternalMessageInfo + +func (m *Signature) GetSig() string { + if m != nil { + return m.Sig + } + return "" +} + +func (m *Signature) GetPubKey() string { + if m != nil { + return m.PubKey + } + return "" +} + +// BlockChangeSet +type BlockChangeSet struct { + Height int64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + Records []string `protobuf:"bytes,2,rep,name=records,proto3" json:"records,omitempty"` + Auctions []string `protobuf:"bytes,3,rep,name=auctions,proto3" json:"auctions,omitempty"` + AuctionBids []*AuctionBidInfo `protobuf:"bytes,4,rep,name=auction_bids,json=auctionBids,proto3" json:"auction_bids,omitempty" json:"auctionBids" yaml:"auctionBids"` + Authorities []string `protobuf:"bytes,5,rep,name=authorities,proto3" json:"authorities,omitempty"` + Names []string `protobuf:"bytes,6,rep,name=names,proto3" json:"names,omitempty"` +} + +func (m *BlockChangeSet) Reset() { *m = BlockChangeSet{} } +func (m *BlockChangeSet) String() string { return proto.CompactTextString(m) } +func (*BlockChangeSet) ProtoMessage() {} +func (*BlockChangeSet) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{8} +} +func (m *BlockChangeSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockChangeSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockChangeSet.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 *BlockChangeSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockChangeSet.Merge(m, src) +} +func (m *BlockChangeSet) XXX_Size() int { + return m.Size() +} +func (m *BlockChangeSet) XXX_DiscardUnknown() { + xxx_messageInfo_BlockChangeSet.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockChangeSet proto.InternalMessageInfo + +func (m *BlockChangeSet) GetHeight() int64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *BlockChangeSet) GetRecords() []string { + if m != nil { + return m.Records + } + return nil +} + +func (m *BlockChangeSet) GetAuctions() []string { + if m != nil { + return m.Auctions + } + return nil +} + +func (m *BlockChangeSet) GetAuctionBids() []*AuctionBidInfo { + if m != nil { + return m.AuctionBids + } + return nil +} + +func (m *BlockChangeSet) GetAuthorities() []string { + if m != nil { + return m.Authorities + } + return nil +} + +func (m *BlockChangeSet) GetNames() []string { + if m != nil { + return m.Names + } + return nil +} + +// AuctionBidInfo +type AuctionBidInfo struct { + AuctionId string `protobuf:"bytes,1,opt,name=auction_id,json=auctionId,proto3" json:"auction_id,omitempty" json:"auctionID" yaml:"auctionID"` + BidderAddress string `protobuf:"bytes,2,opt,name=bidder_address,json=bidderAddress,proto3" json:"bidder_address,omitempty" json:"bidderAddress" yaml:"bidderAddress"` +} + +func (m *AuctionBidInfo) Reset() { *m = AuctionBidInfo{} } +func (m *AuctionBidInfo) String() string { return proto.CompactTextString(m) } +func (*AuctionBidInfo) ProtoMessage() {} +func (*AuctionBidInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_c2009c2df775dbad, []int{9} +} +func (m *AuctionBidInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AuctionBidInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AuctionBidInfo.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 *AuctionBidInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_AuctionBidInfo.Merge(m, src) +} +func (m *AuctionBidInfo) XXX_Size() int { + return m.Size() +} +func (m *AuctionBidInfo) XXX_DiscardUnknown() { + xxx_messageInfo_AuctionBidInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_AuctionBidInfo proto.InternalMessageInfo + +func (m *AuctionBidInfo) GetAuctionId() string { + if m != nil { + return m.AuctionId + } + return "" +} + +func (m *AuctionBidInfo) GetBidderAddress() string { + if m != nil { + return m.BidderAddress + } + return "" +} + +func init() { + proto.RegisterType((*Params)(nil), "vulcanize.nameservice.v1beta1.Params") + proto.RegisterType((*Record)(nil), "vulcanize.nameservice.v1beta1.Record") + proto.RegisterType((*AuthorityEntry)(nil), "vulcanize.nameservice.v1beta1.AuthorityEntry") + proto.RegisterType((*NameAuthority)(nil), "vulcanize.nameservice.v1beta1.NameAuthority") + proto.RegisterType((*NameEntry)(nil), "vulcanize.nameservice.v1beta1.NameEntry") + proto.RegisterType((*NameRecord)(nil), "vulcanize.nameservice.v1beta1.NameRecord") + proto.RegisterType((*NameRecordEntry)(nil), "vulcanize.nameservice.v1beta1.NameRecordEntry") + proto.RegisterType((*Signature)(nil), "vulcanize.nameservice.v1beta1.Signature") + proto.RegisterType((*BlockChangeSet)(nil), "vulcanize.nameservice.v1beta1.BlockChangeSet") + proto.RegisterType((*AuctionBidInfo)(nil), "vulcanize.nameservice.v1beta1.AuctionBidInfo") +} + +func init() { + proto.RegisterFile("vulcanize/nameservice/v1beta1/nameservice.proto", fileDescriptor_c2009c2df775dbad) +} + +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, 0x39, 0xa7, 0x2e, 0x61, 0x1c, 0xbb, 0x03, 0xa5, 0xb0, 0xd6, 0xf5, 0xbb, 0xbe, 0xf8, 0x34, + 0xa2, 0x2f, 0xc5, 0x6d, 0xda, 0x3e, 0x73, 0x7d, 0x66, 0x58, 0x98, 0xa5, 0xe0, 0x6c, 0x9f, 0x2a, + 0xb7, 0xad, 0xbf, 0x56, 0x41, 0xf9, 0x08, 0x07, 0xd8, 0x65, 0x90, 0x82, 0x5a, 0x40, 0x6c, 0x3f, + 0x70, 0x3a, 0x01, 0xf1, 0x78, 0x43, 0xdb, 0xd4, 0x6e, 0xd6, 0xde, 0x5e, 0x6f, 0x4b, 0x07, 0xed, + 0xc8, 0x41, 0x0c, 0xb6, 0xbd, 0xeb, 0x53, 0xcf, 0xdc, 0x7e, 0x3c, 0xd2, 0x17, 0xc6, 0x23, 0xfd, + 0xfa, 0x37, 0xcc, 0xf7, 0xde, 0x6b, 0x65, 0x6c, 0x5b, 0x9b, 0x43, 0xec, 0xf6, 0xf3, 0x2c, 0x04, + 0x24, 0x85, 0x88, 0xc7, 0xe1, 0x99, 0x06, 0xd6, 0x32, 0xc2, 0x4e, 0x9c, 0x6b, 0x63, 0x51, 0x05, + 0x95, 0xc9, 0xb6, 0xe3, 0x64, 0xdb, 0x7b, 0x4a, 0xc1, 0xdc, 0x55, 0x41, 0xef, 0x4e, 0x04, 0x4d, + 0x9c, 0x4c, 0x89, 0x9e, 0xca, 0x1e, 0xfd, 0xad, 0x6b, 0x08, 0xa6, 0x50, 0x62, 0xc7, 0x30, 0x04, + 0x75, 0x1c, 0xf2, 0x9e, 0x1f, 0x50, 0x3e, 0x94, 0x05, 0x28, 0xcd, 0x2b, 0xc0, 0x1d, 0x85, 0x65, + 0x4b, 0x62, 0xc9, 0x9b, 0xc7, 0x28, 0x0a, 0x5c, 0xb4, 0x9a, 0x30, 0x44, 0x25, 0x7e, 0xd2, 0xc0, + 0xd5, 0xbc, 0x4a, 0x5a, 0x8c, 0xa5, 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, 0x3c, 0xfd, + 0x34, 0x22, 0x67, 0xf3, 0xce, 0x41, 0xe8, 0xa0, 0xf5, 0xe9, 0xd5, 0xbf, 0x47, 0xc8, 0x0c, 0xb4, + 0x32, 0x75, 0x81, 0x16, 0xbc, 0x30, 0xda, 0xd4, 0xd9, 0xbc, 0x5a, 0xcf, 0x40, 0x2b, 0x2b, 0x1c, + 0xa1, 0xfd, 0x4d, 0x03, 0xd7, 0x26, 0x8d, 0x5d, 0xea, 0x51, 0x37, 0x74, 0x3b, 0x16, 0x75, 0x1a, + 0xb5, 0x79, 0x70, 0xbf, 0x50, 0x70, 0x0f, 0x67, 0xc1, 0xcd, 0x78, 0x9b, 0x8d, 0x37, 0xab, 0x84, + 0x36, 0x8a, 0x80, 0x3f, 0x95, 0x52, 0x93, 0x3a, 0xad, 0x8b, 0x12, 0x28, 0x23, 0xb1, 0xed, 0xe1, + 0x0d, 0xb0, 0x48, 0x1d, 0x71, 0xad, 0x55, 0xcd, 0xab, 0xe3, 0x91, 0xfe, 0x8a, 0x44, 0x90, 0x86, + 0x89, 0x7c, 0x2d, 0x52, 0x07, 0xbe, 0x03, 0x2a, 0x96, 0xef, 0x39, 0x1d, 0xea, 0x88, 0xfb, 0xa8, + 0x6a, 0xea, 0xe3, 0x91, 0xfe, 0xaa, 0xd4, 0x8e, 0x04, 0x87, 0x89, 0x85, 0xa2, 0x50, 0x59, 0x7e, + 0xc0, 0x3e, 0xa8, 0xd9, 0x01, 0xc1, 0x9c, 0x74, 0xa2, 0xdb, 0x59, 0xdd, 0x20, 0x1b, 0x13, 0xd3, + 0x72, 0x3f, 0xbe, 0xba, 0x4d, 0x43, 0x55, 0xe3, 0x0d, 0xe9, 0x5d, 0x1a, 0x47, 0xe2, 0x38, 0x42, + 0x86, 0x73, 0x16, 0xb5, 0x3f, 0x48, 0x19, 0x51, 0x34, 0xf2, 0x70, 0x40, 0x83, 0xa1, 0x8c, 0xb6, + 0xf4, 0x5f, 0xa3, 0x49, 0xe3, 0x6c, 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, 0xe3, 0xc7, 0x45, 0x50, 0x37, 0xfb, 0xbe, 0xfd, 0x60, 0xb7, + 0x87, 0xbd, 0x2e, 0x39, 0x26, 0x3c, 0x03, 0x2f, 0x0a, 0x5e, 0x4a, 0x5a, 0xbc, 0x01, 0x2a, 0xf2, + 0xd9, 0xcf, 0x44, 0x8d, 0xaa, 0x28, 0x26, 0xe1, 0x06, 0x58, 0x51, 0xbd, 0xca, 0x1a, 0x25, 0x21, + 0x4a, 0x68, 0xf8, 0x3d, 0xb8, 0x14, 0x0f, 0x80, 0x45, 0x9d, 0x68, 0x3c, 0xa2, 0xf2, 0x6e, 0xcf, + 0x29, 0xaf, 0xba, 0x87, 0x4c, 0xea, 0x1c, 0x7a, 0x27, 0xbe, 0x79, 0x2b, 0xfd, 0x4b, 0xc2, 0x89, + 0x84, 0x15, 0x66, 0x46, 0xb0, 0x50, 0x2d, 0x43, 0xc1, 0x4d, 0x50, 0x8b, 0xaf, 0x36, 0x4a, 0x58, + 0x63, 0x59, 0x60, 0xcb, 0xb2, 0xe0, 0x1a, 0x58, 0x16, 0xf1, 0xe5, 0xe6, 0x45, 0x92, 0x68, 0xfd, + 0xaa, 0x45, 0xfb, 0x30, 0x0b, 0xa1, 0x30, 0xc8, 0xda, 0x73, 0x0e, 0xf2, 0x7d, 0x50, 0xb7, 0xa8, + 0xe3, 0x4c, 0x6c, 0xa4, 0xed, 0xf1, 0x48, 0xbf, 0xa5, 0xe6, 0x59, 0xc8, 0x0b, 0x2b, 0x29, 0xcf, + 0x44, 0xab, 0x39, 0xda, 0xfc, 0xf8, 0xf1, 0x79, 0x53, 0x7b, 0x72, 0xde, 0xd4, 0xfe, 0x39, 0x6f, + 0x6a, 0x67, 0x17, 0xcd, 0x85, 0x27, 0x17, 0xcd, 0x85, 0x3f, 0x2e, 0x9a, 0x0b, 0x5f, 0xbd, 0xd5, + 0xa5, 0xbc, 0x17, 0x5a, 0x6d, 0xdb, 0x77, 0x0d, 0xde, 0xc3, 0x01, 0xa3, 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, +} + +func (m *Params) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AuthorityAuctionMinimumBid.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x5a + { + size, err := m.AuthorityAuctionRevealFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x52 + { + size, err := m.AuthorityAuctionCommitFee.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + n4, err4 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.AuthorityAuctionRevealsDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityAuctionRevealsDuration):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintNameservice(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x42 + n5, err5 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.AuthorityAuctionCommitsDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityAuctionCommitsDuration):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintNameservice(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x3a + if m.AuthorityAuctionEnabled { + i-- + if m.AuthorityAuctionEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + n6, err6 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.AuthorityGracePeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityGracePeriod):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintNameservice(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x2a + n7, err7 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.AuthorityRentDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityRentDuration):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintNameservice(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x22 + { + size, err := m.AuthorityRent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + n9, err9 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.RecordRentDuration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.RecordRentDuration):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintNameservice(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x12 + { + size, err := m.RecordRent.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *Record) 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 *Record) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Record) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Attributes) > 0 { + i -= len(m.Attributes) + copy(dAtA[i:], m.Attributes) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Attributes))) + i-- + dAtA[i] = 0x3a + } + if len(m.Owners) > 0 { + for iNdEx := len(m.Owners) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Owners[iNdEx]) + copy(dAtA[i:], m.Owners[iNdEx]) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Owners[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if m.Deleted { + i-- + if m.Deleted { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + 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 + } + 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 + } + 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) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *AuthorityEntry) 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 *AuthorityEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuthorityEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Entry != nil { + { + size, err := m.Entry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NameAuthority) 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 *NameAuthority) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NameAuthority) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 + } + i -= n14 + i = encodeVarintNameservice(dAtA, i, uint64(n14)) + i-- + dAtA[i] = 0x3a + if len(m.BondId) > 0 { + i -= len(m.BondId) + copy(dAtA[i:], m.BondId) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0x32 + } + if len(m.AuctionId) > 0 { + i -= len(m.AuctionId) + copy(dAtA[i:], m.AuctionId) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.AuctionId))) + i-- + dAtA[i] = 0x2a + } + if len(m.Status) > 0 { + i -= len(m.Status) + copy(dAtA[i:], m.Status) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Status))) + i-- + dAtA[i] = 0x22 + } + if m.Height != 0 { + i = encodeVarintNameservice(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + if len(m.OwnerAddress) > 0 { + i -= len(m.OwnerAddress) + copy(dAtA[i:], m.OwnerAddress) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.OwnerAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.OwnerPublicKey) > 0 { + i -= len(m.OwnerPublicKey) + copy(dAtA[i:], m.OwnerPublicKey) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.OwnerPublicKey))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NameEntry) 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 *NameEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NameEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Entry != nil { + { + size, err := m.Entry.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NameRecord) 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 *NameRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NameRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.History) > 0 { + for iNdEx := len(m.History) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.History[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Latest != nil { + { + size, err := m.Latest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *NameRecordEntry) 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 *NameRecordEntry) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *NameRecordEntry) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintNameservice(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.Id) > 0 { + i -= len(m.Id) + copy(dAtA[i:], m.Id) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Id))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *Signature) 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 *Signature) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Signature) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.PubKey) > 0 { + i -= len(m.PubKey) + copy(dAtA[i:], m.PubKey) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.PubKey))) + i-- + dAtA[i] = 0x12 + } + if len(m.Sig) > 0 { + i -= len(m.Sig) + copy(dAtA[i:], m.Sig) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Sig))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BlockChangeSet) 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 *BlockChangeSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockChangeSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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] = 0x32 + } + } + if len(m.Authorities) > 0 { + for iNdEx := len(m.Authorities) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Authorities[iNdEx]) + copy(dAtA[i:], m.Authorities[iNdEx]) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Authorities[iNdEx]))) + i-- + dAtA[i] = 0x2a + } + } + if len(m.AuctionBids) > 0 { + for iNdEx := len(m.AuctionBids) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.AuctionBids[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintNameservice(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.Auctions) > 0 { + for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Auctions[iNdEx]) + copy(dAtA[i:], m.Auctions[iNdEx]) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Auctions[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Records[iNdEx]) + copy(dAtA[i:], m.Records[iNdEx]) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.Records[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if m.Height != 0 { + i = encodeVarintNameservice(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *AuctionBidInfo) 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 *AuctionBidInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AuctionBidInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BidderAddress) > 0 { + i -= len(m.BidderAddress) + copy(dAtA[i:], m.BidderAddress) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.BidderAddress))) + i-- + dAtA[i] = 0x12 + } + if len(m.AuctionId) > 0 { + i -= len(m.AuctionId) + copy(dAtA[i:], m.AuctionId) + i = encodeVarintNameservice(dAtA, i, uint64(len(m.AuctionId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintNameservice(dAtA []byte, offset int, v uint64) int { + offset -= sovNameservice(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.RecordRent.Size() + n += 1 + l + sovNameservice(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.RecordRentDuration) + n += 1 + l + sovNameservice(uint64(l)) + l = m.AuthorityRent.Size() + n += 1 + l + sovNameservice(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityRentDuration) + n += 1 + l + sovNameservice(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityGracePeriod) + n += 1 + l + sovNameservice(uint64(l)) + if m.AuthorityAuctionEnabled { + n += 2 + } + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityAuctionCommitsDuration) + n += 1 + l + sovNameservice(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.AuthorityAuctionRevealsDuration) + n += 1 + l + sovNameservice(uint64(l)) + l = m.AuthorityAuctionCommitFee.Size() + n += 1 + l + sovNameservice(uint64(l)) + l = m.AuthorityAuctionRevealFee.Size() + n += 1 + l + sovNameservice(uint64(l)) + l = m.AuthorityAuctionMinimumBid.Size() + n += 1 + l + sovNameservice(uint64(l)) + return n +} + +func (m *Record) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.BondId) + 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)) + if m.Deleted { + n += 2 + } + if len(m.Owners) > 0 { + for _, s := range m.Owners { + l = len(s) + n += 1 + l + sovNameservice(uint64(l)) + } + } + l = len(m.Attributes) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + return n +} + +func (m *AuthorityEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovNameservice(uint64(l)) + } + return n +} + +func (m *NameAuthority) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OwnerPublicKey) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.OwnerAddress) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovNameservice(uint64(m.Height)) + } + l = len(m.Status) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.AuctionId) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.BondId) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ExpiryTime) + n += 1 + l + sovNameservice(uint64(l)) + return n +} + +func (m *NameEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + if m.Entry != nil { + l = m.Entry.Size() + n += 1 + l + sovNameservice(uint64(l)) + } + return n +} + +func (m *NameRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Latest != nil { + l = m.Latest.Size() + n += 1 + l + sovNameservice(uint64(l)) + } + if len(m.History) > 0 { + for _, e := range m.History { + l = e.Size() + n += 1 + l + sovNameservice(uint64(l)) + } + } + return n +} + +func (m *NameRecordEntry) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Id) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovNameservice(uint64(m.Height)) + } + return n +} + +func (m *Signature) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sig) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.PubKey) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + return n +} + +func (m *BlockChangeSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovNameservice(uint64(m.Height)) + } + if len(m.Records) > 0 { + for _, s := range m.Records { + l = len(s) + n += 1 + l + sovNameservice(uint64(l)) + } + } + if len(m.Auctions) > 0 { + for _, s := range m.Auctions { + l = len(s) + n += 1 + l + sovNameservice(uint64(l)) + } + } + if len(m.AuctionBids) > 0 { + for _, e := range m.AuctionBids { + l = e.Size() + n += 1 + l + sovNameservice(uint64(l)) + } + } + if len(m.Authorities) > 0 { + for _, s := range m.Authorities { + l = len(s) + 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 +} + +func (m *AuctionBidInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AuctionId) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + l = len(m.BidderAddress) + if l > 0 { + n += 1 + l + sovNameservice(uint64(l)) + } + return n +} + +func sovNameservice(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozNameservice(x uint64) (n int) { + return sovNameservice(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordRent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.RecordRent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordRentDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.RecordRentDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityRent", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuthorityRent.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityRentDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.AuthorityRentDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityGracePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.AuthorityGracePeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityAuctionEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.AuthorityAuctionEnabled = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityAuctionCommitsDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.AuthorityAuctionCommitsDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityAuctionRevealsDuration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.AuthorityAuctionRevealsDuration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityAuctionCommitFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuthorityAuctionCommitFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityAuctionRevealFee", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuthorityAuctionRevealFee.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthorityAuctionMinimumBid", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AuthorityAuctionMinimumBid.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Record) 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 ErrIntOverflowNameservice + } + 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: Record: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Record: 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 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.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", 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.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CreateTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + 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 + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + 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 + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Deleted", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Deleted = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owners", 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.Owners = append(m.Owners, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Attributes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + byteLen + 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{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuthorityEntry) 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 ErrIntOverflowNameservice + } + 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: AuthorityEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuthorityEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &NameAuthority{} + } + if err := m.Entry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NameAuthority) 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 ErrIntOverflowNameservice + } + 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: NameAuthority: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NameAuthority: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerPublicKey", 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.OwnerPublicKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OwnerAddress", 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.OwnerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", 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.Status = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", 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.AuctionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", 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.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExpiryTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + 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 + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NameEntry) 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 ErrIntOverflowNameservice + } + 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: NameEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NameEntry: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Entry", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Entry == nil { + m.Entry = &NameRecord{} + } + if err := m.Entry.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NameRecord) 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 ErrIntOverflowNameservice + } + 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: NameRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NameRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Latest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Latest == nil { + m.Latest = &NameRecordEntry{} + } + if err := m.Latest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field History", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.History = append(m.History, &NameRecordEntry{}) + if err := m.History[len(m.History)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *NameRecordEntry) 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 ErrIntOverflowNameservice + } + 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: NameRecordEntry: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: NameRecordEntry: 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 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.Id = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Signature) 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 ErrIntOverflowNameservice + } + 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: Signature: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Signature: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sig", 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.Sig = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", 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.PubKey = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockChangeSet) 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 ErrIntOverflowNameservice + } + 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: BlockChangeSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockChangeSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", 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.Records = append(m.Records, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Auctions", 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.Auctions = append(m.Auctions, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionBids", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowNameservice + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthNameservice + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthNameservice + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuctionBids = append(m.AuctionBids, &AuctionBidInfo{}) + if err := m.AuctionBids[len(m.AuctionBids)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authorities", 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.Authorities = append(m.Authorities, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 6: + 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 + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *AuctionBidInfo) 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 ErrIntOverflowNameservice + } + 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: AuctionBidInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AuctionBidInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuctionId", 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.AuctionId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BidderAddress", 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.BidderAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipNameservice(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthNameservice + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipNameservice(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNameservice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNameservice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowNameservice + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthNameservice + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupNameservice + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthNameservice + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthNameservice = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowNameservice = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupNameservice = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/nameservice/types/params.go b/x/nameservice/types/params.go new file mode 100644 index 00000000..a6aa6b80 --- /dev/null +++ b/x/nameservice/types/params.go @@ -0,0 +1,239 @@ +package types + +import ( + "bytes" + "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" + paramtypes "github.com/cosmos/cosmos-sdk/x/params/types" + "time" +) + +// Default parameter values. +var ( + // DefaultRecordRent is the default record rent for 1 time period (see expiry time). + DefaultRecordRent = sdk.NewInt(1000000) + + // DefaultRecordExpiryTime is the default record expiry time (1 year). + DefaultRecordExpiryTime = time.Hour * 24 * 365 + + DefaultAuthorityRent = sdk.NewInt(1000000) + DefaultAuthorityExpiryTime = time.Hour * 24 * 365 + DefaultAuthorityGracePeriod = time.Hour * 24 * 2 + + DefaultAuthorityAuctionEnabled = false + DefaultCommitsDuration = time.Hour * 24 + DefaultRevealsDuration = time.Hour * 24 + DefaultCommitFee = sdk.NewInt(1000000) + DefaultRevealFee = sdk.NewInt(1000000) + DefaultMinimumBid = sdk.NewInt(5000000) +) + +// Keys for parameter access +var ( + KeyRecordRent = []byte("RecordRent") + KeyRecordRentDuration = []byte("RecordRentDuration") + + KeyAuthorityRent = []byte("AuthorityRent") + KeyAuthorityRentDuration = []byte("AuthorityRentDuration") + KeyAuthorityGracePeriod = []byte("AuthorityGracePeriod") + + KeyAuthorityAuctionEnabled = []byte("AuthorityAuctionEnabled") + KeyCommitsDuration = []byte("AuthorityAuctionCommitsDuration") + KeyRevealsDuration = []byte("AuthorityAuctionRevealsDuration") + KeyCommitFee = []byte("AuthorityAuctionCommitFee") + KeyRevealFee = []byte("AuthorityAuctionRevealFee") + KeyMinimumBid = []byte("AuthorityAuctionMinimumBid") +) + +var _ paramtypes.ParamSet = &Params{} + +// ParamKeyTable ParamTable for staking module +func ParamKeyTable() paramtypes.KeyTable { + return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) +} + +// ParamSetPairs returns the parameter set pairs. +func (p *Params) ParamSetPairs() paramtypes.ParamSetPairs { + return paramtypes.ParamSetPairs{ + paramtypes.NewParamSetPair(KeyRecordRent, &p.RecordRent, validateRecordRent), + paramtypes.NewParamSetPair(KeyRecordRentDuration, &p.RecordRentDuration, validateRecordRentDuration), + + paramtypes.NewParamSetPair(KeyAuthorityRent, &p.AuthorityRent, validateAuthorityRent), + paramtypes.NewParamSetPair(KeyAuthorityRentDuration, &p.AuthorityRentDuration, validateAuthorityRentDuration), + paramtypes.NewParamSetPair(KeyAuthorityGracePeriod, &p.AuthorityGracePeriod, validateAuthorityGracePeriod), + + paramtypes.NewParamSetPair(KeyAuthorityAuctionEnabled, &p.AuthorityAuctionEnabled, validateAuthorityAuctionEnabled), + paramtypes.NewParamSetPair(KeyCommitsDuration, &p.AuthorityAuctionCommitsDuration, validateCommitsDuration), + paramtypes.NewParamSetPair(KeyRevealsDuration, &p.AuthorityAuctionRevealsDuration, validateRevealsDuration), + paramtypes.NewParamSetPair(KeyCommitFee, &p.AuthorityAuctionCommitFee, validateCommitFee), + paramtypes.NewParamSetPair(KeyRevealFee, &p.AuthorityAuctionRevealFee, validateRevealFee), + paramtypes.NewParamSetPair(KeyMinimumBid, &p.AuthorityAuctionMinimumBid, validateMinimumBid), + } +} + +// NewParams creates a new Params instance +func NewParams(recordRent sdk.Coin, recordRentDuration time.Duration, + authorityRent sdk.Coin, authorityRentDuration time.Duration, authorityGracePeriod time.Duration, + authorityAuctionEnabled bool, commitsDuration time.Duration, revealsDuration time.Duration, + commitFee sdk.Coin, revealFee sdk.Coin, minimumBid sdk.Coin) Params { + + return Params{ + RecordRent: recordRent, + RecordRentDuration: recordRentDuration, + + AuthorityRent: authorityRent, + AuthorityRentDuration: authorityRentDuration, + AuthorityGracePeriod: authorityGracePeriod, + + AuthorityAuctionEnabled: authorityAuctionEnabled, + AuthorityAuctionCommitsDuration: commitsDuration, + AuthorityAuctionRevealsDuration: revealsDuration, + AuthorityAuctionCommitFee: commitFee, + AuthorityAuctionRevealFee: revealFee, + AuthorityAuctionMinimumBid: minimumBid, + } +} + +// Equal returns a boolean determining if two Params types are identical. +func (p Params) Equal(p2 Params) bool { + bz1 := ModuleCdc.MustMarshalLengthPrefixed(&p) + bz2 := ModuleCdc.MustMarshalLengthPrefixed(&p2) + return bytes.Equal(bz1, bz2) +} + +// DefaultParams returns a default set of parameters. +func DefaultParams() Params { + return NewParams( + sdk.NewCoin(sdk.DefaultBondDenom, DefaultRecordRent), DefaultRecordExpiryTime, + sdk.NewCoin(sdk.DefaultBondDenom, DefaultAuthorityRent), + DefaultAuthorityExpiryTime, DefaultAuthorityGracePeriod, DefaultAuthorityAuctionEnabled, DefaultCommitsDuration, + DefaultRevealsDuration, + sdk.NewCoin(sdk.DefaultBondDenom, DefaultCommitFee), + sdk.NewCoin(sdk.DefaultBondDenom, DefaultRevealFee), + sdk.NewCoin(sdk.DefaultBondDenom, DefaultMinimumBid), + ) +} + +func validateAmount(name string, i interface{}) error { + v, ok := i.(sdk.Coin) + if !ok { + return fmt.Errorf("invalid parameter type: %T", i) + } + + if v.Amount.IsNegative() { + return fmt.Errorf("%s can't be negative", name) + } + + return nil +} + +func validateDuration(name string, i interface{}) error { + v, ok := i.(time.Duration) + if !ok { + return fmt.Errorf("%s invalid parameter type: %T", name, i) + } + + if v <= 0 { + return fmt.Errorf("%s must be a positive integer", name) + } + + return nil +} + +func validateRecordRent(i interface{}) error { + return validateAmount("RecordRent", i) +} + +func validateRecordRentDuration(i interface{}) error { + return validateDuration("RecordRentDuration", i) +} + +func validateAuthorityRent(i interface{}) error { + return validateAmount("AuthorityRent", i) +} + +func validateAuthorityRentDuration(i interface{}) error { + return validateDuration("AuthorityRentDuration", i) +} + +func validateAuthorityGracePeriod(i interface{}) error { + return validateDuration("AuthorityGracePeriod", i) +} + +func validateAuthorityAuctionEnabled(i interface{}) error { + _, ok := i.(bool) + if !ok { + return fmt.Errorf("%s invalid parameter type: %T", "AuthorityAuctionEnabled", i) + } + + return nil +} + +func validateCommitsDuration(i interface{}) error { + return validateDuration("AuthorityCommitsDuration", i) +} + +func validateRevealsDuration(i interface{}) error { + return validateDuration("AuthorityRevealsDuration", i) +} + +func validateCommitFee(i interface{}) error { + return validateAmount("AuthorityCommitFee", i) +} + +func validateRevealFee(i interface{}) error { + return validateAmount("AuthorityRevealFee", i) +} + +func validateMinimumBid(i interface{}) error { + return validateAmount("AuthorityMinimumBid", i) +} + +// Validate a set of params. +func (p Params) Validate() error { + if err := validateRecordRent(p.RecordRent); err != nil { + return err + } + + if err := validateRecordRentDuration(p.RecordRentDuration); err != nil { + return err + } + + if err := validateAuthorityRent(p.AuthorityRent); err != nil { + return err + } + + if err := validateAuthorityRentDuration(p.AuthorityRentDuration); err != nil { + return err + } + + if err := validateAuthorityGracePeriod(p.AuthorityGracePeriod); err != nil { + return err + } + + if err := validateAuthorityAuctionEnabled(p.AuthorityAuctionEnabled); err != nil { + return err + } + + if err := validateCommitsDuration(p.AuthorityAuctionCommitsDuration); err != nil { + return err + } + + if err := validateRevealsDuration(p.AuthorityAuctionRevealsDuration); err != nil { + return err + } + + if err := validateCommitFee(p.AuthorityAuctionCommitFee); err != nil { + return err + } + + if err := validateRevealFee(p.AuthorityAuctionRevealFee); err != nil { + return err + } + + if err := validateMinimumBid(p.AuthorityAuctionMinimumBid); err != nil { + return err + } + + return nil +} diff --git a/x/nameservice/types/query.pb.go b/x/nameservice/types/query.pb.go new file mode 100644 index 00000000..609d2993 --- /dev/null +++ b/x/nameservice/types/query.pb.go @@ -0,0 +1,5307 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vulcanize/nameservice/v1beta1/query.proto + +package types + +import ( + context "context" + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + _ "google.golang.org/genproto/googleapis/api/annotations" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// QueryParamsRequest is request type for nameservice params +type QueryParamsRequest struct { +} + +func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } +func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryParamsRequest) ProtoMessage() {} +func (*QueryParamsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for nameservice params +type QueryParamsResponse struct { + Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"` +} + +func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } +func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryParamsResponse) ProtoMessage() {} +func (*QueryParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() *Params { + if m != nil { + return m.Params + } + return nil +} + +// QueryListRecordsRequest is request type for nameservice records list +type QueryListRecordsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryListRecordsRequest) Reset() { *m = QueryListRecordsRequest{} } +func (m *QueryListRecordsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsRequest) ProtoMessage() {} +func (*QueryListRecordsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{2} +} +func (m *QueryListRecordsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsRequest.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) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsRequest.Merge(m, src) +} +func (m *QueryListRecordsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsRequest proto.InternalMessageInfo + +func (m *QueryListRecordsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryListRecordsResponse is response type for nameservice records list +type QueryListRecordsResponse struct { + Records []Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryListRecordsResponse) Reset() { *m = QueryListRecordsResponse{} } +func (m *QueryListRecordsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryListRecordsResponse) ProtoMessage() {} +func (*QueryListRecordsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{3} +} +func (m *QueryListRecordsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListRecordsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListRecordsResponse.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 *QueryListRecordsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListRecordsResponse.Merge(m, src) +} +func (m *QueryListRecordsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryListRecordsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListRecordsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListRecordsResponse proto.InternalMessageInfo + +func (m *QueryListRecordsResponse) GetRecords() []Record { + if m != nil { + return m.Records + } + return nil +} + +func (m *QueryListRecordsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +//QueryRecordByIdRequest is request type for nameservice records by id +type QueryRecordByIdRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` +} + +func (m *QueryRecordByIdRequest) Reset() { *m = QueryRecordByIdRequest{} } +func (m *QueryRecordByIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRecordByIdRequest) ProtoMessage() {} +func (*QueryRecordByIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{4} +} +func (m *QueryRecordByIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRecordByIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRecordByIdRequest.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 *QueryRecordByIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRecordByIdRequest.Merge(m, src) +} +func (m *QueryRecordByIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRecordByIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRecordByIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRecordByIdRequest proto.InternalMessageInfo + +func (m *QueryRecordByIdRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +// QueryRecordByIdResponse is response type for nameservice records by id +type QueryRecordByIdResponse struct { + Record Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record"` +} + +func (m *QueryRecordByIdResponse) Reset() { *m = QueryRecordByIdResponse{} } +func (m *QueryRecordByIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRecordByIdResponse) ProtoMessage() {} +func (*QueryRecordByIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{5} +} +func (m *QueryRecordByIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRecordByIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRecordByIdResponse.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 *QueryRecordByIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRecordByIdResponse.Merge(m, src) +} +func (m *QueryRecordByIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRecordByIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRecordByIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRecordByIdResponse proto.InternalMessageInfo + +func (m *QueryRecordByIdResponse) GetRecord() Record { + if m != nil { + return m.Record + } + return Record{} +} + +// QueryRecordByBondIdRequest is request type for get the records by bond-id +type QueryRecordByBondIdRequest struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryRecordByBondIdRequest) Reset() { *m = QueryRecordByBondIdRequest{} } +func (m *QueryRecordByBondIdRequest) String() string { return proto.CompactTextString(m) } +func (*QueryRecordByBondIdRequest) ProtoMessage() {} +func (*QueryRecordByBondIdRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{6} +} +func (m *QueryRecordByBondIdRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRecordByBondIdRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRecordByBondIdRequest.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 *QueryRecordByBondIdRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRecordByBondIdRequest.Merge(m, src) +} +func (m *QueryRecordByBondIdRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryRecordByBondIdRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRecordByBondIdRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRecordByBondIdRequest proto.InternalMessageInfo + +func (m *QueryRecordByBondIdRequest) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *QueryRecordByBondIdRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryRecordByBondIdResponse is response type for records list by bond-id +type QueryRecordByBondIdResponse struct { + Records []Record `protobuf:"bytes,1,rep,name=records,proto3" json:"records"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryRecordByBondIdResponse) Reset() { *m = QueryRecordByBondIdResponse{} } +func (m *QueryRecordByBondIdResponse) String() string { return proto.CompactTextString(m) } +func (*QueryRecordByBondIdResponse) ProtoMessage() {} +func (*QueryRecordByBondIdResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{7} +} +func (m *QueryRecordByBondIdResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryRecordByBondIdResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryRecordByBondIdResponse.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 *QueryRecordByBondIdResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryRecordByBondIdResponse.Merge(m, src) +} +func (m *QueryRecordByBondIdResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryRecordByBondIdResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryRecordByBondIdResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryRecordByBondIdResponse proto.InternalMessageInfo + +func (m *QueryRecordByBondIdResponse) GetRecords() []Record { + if m != nil { + return m.Records + } + return nil +} + +func (m *QueryRecordByBondIdResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// GetNameServiceModuleBalanceRequest is request type for nameservice module accounts balance +type GetNameServiceModuleBalanceRequest struct { +} + +func (m *GetNameServiceModuleBalanceRequest) Reset() { *m = GetNameServiceModuleBalanceRequest{} } +func (m *GetNameServiceModuleBalanceRequest) String() string { return proto.CompactTextString(m) } +func (*GetNameServiceModuleBalanceRequest) ProtoMessage() {} +func (*GetNameServiceModuleBalanceRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{8} +} +func (m *GetNameServiceModuleBalanceRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNameServiceModuleBalanceRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNameServiceModuleBalanceRequest.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 *GetNameServiceModuleBalanceRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNameServiceModuleBalanceRequest.Merge(m, src) +} +func (m *GetNameServiceModuleBalanceRequest) XXX_Size() int { + return m.Size() +} +func (m *GetNameServiceModuleBalanceRequest) XXX_DiscardUnknown() { + xxx_messageInfo_GetNameServiceModuleBalanceRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNameServiceModuleBalanceRequest proto.InternalMessageInfo + +// GetNameServiceModuleBalanceResponse is response type for nameservice module accounts balance +type GetNameServiceModuleBalanceResponse struct { + Balances []*AccountBalance `protobuf:"bytes,1,rep,name=balances,proto3" json:"balances,omitempty"` +} + +func (m *GetNameServiceModuleBalanceResponse) Reset() { *m = GetNameServiceModuleBalanceResponse{} } +func (m *GetNameServiceModuleBalanceResponse) String() string { return proto.CompactTextString(m) } +func (*GetNameServiceModuleBalanceResponse) ProtoMessage() {} +func (*GetNameServiceModuleBalanceResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{9} +} +func (m *GetNameServiceModuleBalanceResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GetNameServiceModuleBalanceResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GetNameServiceModuleBalanceResponse.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 *GetNameServiceModuleBalanceResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_GetNameServiceModuleBalanceResponse.Merge(m, src) +} +func (m *GetNameServiceModuleBalanceResponse) XXX_Size() int { + return m.Size() +} +func (m *GetNameServiceModuleBalanceResponse) XXX_DiscardUnknown() { + xxx_messageInfo_GetNameServiceModuleBalanceResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_GetNameServiceModuleBalanceResponse proto.InternalMessageInfo + +func (m *GetNameServiceModuleBalanceResponse) GetBalances() []*AccountBalance { + if m != nil { + return m.Balances + } + return nil +} + +// AccountBalance is nameservice module account balance +type AccountBalance struct { + AccountName string `protobuf:"bytes,1,opt,name=account_name,json=accountName,proto3" json:"account_name,omitempty" json:"accountName" yaml:"accountName"` + Balance github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=balance,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"balance" json:"balance" yaml:"balance"` +} + +func (m *AccountBalance) Reset() { *m = AccountBalance{} } +func (m *AccountBalance) String() string { return proto.CompactTextString(m) } +func (*AccountBalance) ProtoMessage() {} +func (*AccountBalance) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{10} +} +func (m *AccountBalance) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *AccountBalance) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_AccountBalance.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 *AccountBalance) XXX_Merge(src proto.Message) { + xxx_messageInfo_AccountBalance.Merge(m, src) +} +func (m *AccountBalance) XXX_Size() int { + return m.Size() +} +func (m *AccountBalance) XXX_DiscardUnknown() { + xxx_messageInfo_AccountBalance.DiscardUnknown(m) +} + +var xxx_messageInfo_AccountBalance proto.InternalMessageInfo + +func (m *AccountBalance) GetAccountName() string { + if m != nil { + return m.AccountName + } + return "" +} + +func (m *AccountBalance) GetBalance() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Balance + } + return nil +} + +// QueryListNameRecordsRequest is request type for nameservice names records +type QueryListNameRecordsRequest struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryListNameRecordsRequest) Reset() { *m = QueryListNameRecordsRequest{} } +func (m *QueryListNameRecordsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryListNameRecordsRequest) ProtoMessage() {} +func (*QueryListNameRecordsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{11} +} +func (m *QueryListNameRecordsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListNameRecordsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListNameRecordsRequest.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 *QueryListNameRecordsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListNameRecordsRequest.Merge(m, src) +} +func (m *QueryListNameRecordsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryListNameRecordsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListNameRecordsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListNameRecordsRequest proto.InternalMessageInfo + +func (m *QueryListNameRecordsRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryListNameRecordsResponse is response type for nameservice names records +type QueryListNameRecordsResponse struct { + Names []NameEntry `protobuf:"bytes,1,rep,name=names,proto3" json:"names"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryListNameRecordsResponse) Reset() { *m = QueryListNameRecordsResponse{} } +func (m *QueryListNameRecordsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryListNameRecordsResponse) ProtoMessage() {} +func (*QueryListNameRecordsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{12} +} +func (m *QueryListNameRecordsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryListNameRecordsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryListNameRecordsResponse.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 *QueryListNameRecordsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryListNameRecordsResponse.Merge(m, src) +} +func (m *QueryListNameRecordsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryListNameRecordsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryListNameRecordsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryListNameRecordsResponse proto.InternalMessageInfo + +func (m *QueryListNameRecordsResponse) GetNames() []NameEntry { + if m != nil { + return m.Names + } + return nil +} + +func (m *QueryListNameRecordsResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryWhoisRequest is request type for Get NameAuthority +type QueryWhoisRequest struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` +} + +func (m *QueryWhoisRequest) Reset() { *m = QueryWhoisRequest{} } +func (m *QueryWhoisRequest) String() string { return proto.CompactTextString(m) } +func (*QueryWhoisRequest) ProtoMessage() {} +func (*QueryWhoisRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{13} +} +func (m *QueryWhoisRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryWhoisRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryWhoisRequest.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 *QueryWhoisRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryWhoisRequest.Merge(m, src) +} +func (m *QueryWhoisRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryWhoisRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryWhoisRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryWhoisRequest proto.InternalMessageInfo + +func (m *QueryWhoisRequest) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +// QueryWhoisResponse is response type for whois request +type QueryWhoisResponse struct { + NameAuthority NameAuthority `protobuf:"bytes,1,opt,name=name_authority,json=nameAuthority,proto3" json:"name_authority" json:"nameAuthority" yaml:"nameAuthority"` +} + +func (m *QueryWhoisResponse) Reset() { *m = QueryWhoisResponse{} } +func (m *QueryWhoisResponse) String() string { return proto.CompactTextString(m) } +func (*QueryWhoisResponse) ProtoMessage() {} +func (*QueryWhoisResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{14} +} +func (m *QueryWhoisResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryWhoisResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryWhoisResponse.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 *QueryWhoisResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryWhoisResponse.Merge(m, src) +} +func (m *QueryWhoisResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryWhoisResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryWhoisResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryWhoisResponse proto.InternalMessageInfo + +func (m *QueryWhoisResponse) GetNameAuthority() NameAuthority { + if m != nil { + return m.NameAuthority + } + return NameAuthority{} +} + +// QueryLookupWrn is request type for LookupWrn +type QueryLookupWrn struct { + Wrn string `protobuf:"bytes,1,opt,name=wrn,proto3" json:"wrn,omitempty"` +} + +func (m *QueryLookupWrn) Reset() { *m = QueryLookupWrn{} } +func (m *QueryLookupWrn) String() string { return proto.CompactTextString(m) } +func (*QueryLookupWrn) ProtoMessage() {} +func (*QueryLookupWrn) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{15} +} +func (m *QueryLookupWrn) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLookupWrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLookupWrn.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 *QueryLookupWrn) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLookupWrn.Merge(m, src) +} +func (m *QueryLookupWrn) XXX_Size() int { + return m.Size() +} +func (m *QueryLookupWrn) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLookupWrn.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLookupWrn proto.InternalMessageInfo + +func (m *QueryLookupWrn) GetWrn() string { + if m != nil { + return m.Wrn + } + return "" +} + +// QueryLookupWrnResponse is response type for QueryLookupWrn +type QueryLookupWrnResponse 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) { + return fileDescriptor_73d2465766c8f876, []int{16} +} +func (m *QueryLookupWrnResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryLookupWrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryLookupWrnResponse.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 *QueryLookupWrnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryLookupWrnResponse.Merge(m, src) +} +func (m *QueryLookupWrnResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryLookupWrnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryLookupWrnResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryLookupWrnResponse proto.InternalMessageInfo + +func (m *QueryLookupWrnResponse) 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"` +} + +func (m *QueryResolveWrn) Reset() { *m = QueryResolveWrn{} } +func (m *QueryResolveWrn) String() string { return proto.CompactTextString(m) } +func (*QueryResolveWrn) ProtoMessage() {} +func (*QueryResolveWrn) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{17} +} +func (m *QueryResolveWrn) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResolveWrn) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResolveWrn.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 *QueryResolveWrn) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResolveWrn.Merge(m, src) +} +func (m *QueryResolveWrn) XXX_Size() int { + return m.Size() +} +func (m *QueryResolveWrn) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResolveWrn.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResolveWrn proto.InternalMessageInfo + +func (m *QueryResolveWrn) GetWrn() string { + if m != nil { + return m.Wrn + } + return "" +} + +// QueryResolveWrnResponse is response type for QueryResolveWrn +type QueryResolveWrnResponse 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) { + return fileDescriptor_73d2465766c8f876, []int{18} +} +func (m *QueryResolveWrnResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryResolveWrnResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryResolveWrnResponse.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 *QueryResolveWrnResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryResolveWrnResponse.Merge(m, src) +} +func (m *QueryResolveWrnResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryResolveWrnResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryResolveWrnResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryResolveWrnResponse proto.InternalMessageInfo + +func (m *QueryResolveWrnResponse) GetRecord() *Record { + if m != nil { + return m.Record + } + return nil +} + +// QueryGetRecordExpiryQueue +type QueryGetRecordExpiryQueue struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGetRecordExpiryQueue) Reset() { *m = QueryGetRecordExpiryQueue{} } +func (m *QueryGetRecordExpiryQueue) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecordExpiryQueue) ProtoMessage() {} +func (*QueryGetRecordExpiryQueue) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{19} +} +func (m *QueryGetRecordExpiryQueue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecordExpiryQueue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecordExpiryQueue.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 *QueryGetRecordExpiryQueue) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecordExpiryQueue.Merge(m, src) +} +func (m *QueryGetRecordExpiryQueue) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecordExpiryQueue) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecordExpiryQueue.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRecordExpiryQueue proto.InternalMessageInfo + +func (m *QueryGetRecordExpiryQueue) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGetRecordExpiryQueueResponse +type QueryGetRecordExpiryQueueResponse struct { + Records []*ExpiryQueueRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGetRecordExpiryQueueResponse) Reset() { *m = QueryGetRecordExpiryQueueResponse{} } +func (m *QueryGetRecordExpiryQueueResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRecordExpiryQueueResponse) ProtoMessage() {} +func (*QueryGetRecordExpiryQueueResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{20} +} +func (m *QueryGetRecordExpiryQueueResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRecordExpiryQueueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRecordExpiryQueueResponse.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 *QueryGetRecordExpiryQueueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRecordExpiryQueueResponse.Merge(m, src) +} +func (m *QueryGetRecordExpiryQueueResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRecordExpiryQueueResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRecordExpiryQueueResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRecordExpiryQueueResponse proto.InternalMessageInfo + +func (m *QueryGetRecordExpiryQueueResponse) GetRecords() []*ExpiryQueueRecord { + if m != nil { + return m.Records + } + return nil +} + +func (m *QueryGetRecordExpiryQueueResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +// ExpiryQueueRecord +type ExpiryQueueRecord struct { + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` + Value []string `protobuf:"bytes,2,rep,name=value,proto3" json:"value,omitempty"` +} + +func (m *ExpiryQueueRecord) Reset() { *m = ExpiryQueueRecord{} } +func (m *ExpiryQueueRecord) String() string { return proto.CompactTextString(m) } +func (*ExpiryQueueRecord) ProtoMessage() {} +func (*ExpiryQueueRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{21} +} +func (m *ExpiryQueueRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ExpiryQueueRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ExpiryQueueRecord.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 *ExpiryQueueRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_ExpiryQueueRecord.Merge(m, src) +} +func (m *ExpiryQueueRecord) XXX_Size() int { + return m.Size() +} +func (m *ExpiryQueueRecord) XXX_DiscardUnknown() { + xxx_messageInfo_ExpiryQueueRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_ExpiryQueueRecord proto.InternalMessageInfo + +func (m *ExpiryQueueRecord) GetId() string { + if m != nil { + return m.Id + } + return "" +} + +func (m *ExpiryQueueRecord) GetValue() []string { + if m != nil { + return m.Value + } + return nil +} + +// QueryGetAuthorityExpiryQueue +type QueryGetAuthorityExpiryQueue struct { + // pagination defines an optional pagination for the request. + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGetAuthorityExpiryQueue) Reset() { *m = QueryGetAuthorityExpiryQueue{} } +func (m *QueryGetAuthorityExpiryQueue) String() string { return proto.CompactTextString(m) } +func (*QueryGetAuthorityExpiryQueue) ProtoMessage() {} +func (*QueryGetAuthorityExpiryQueue) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{22} +} +func (m *QueryGetAuthorityExpiryQueue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetAuthorityExpiryQueue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetAuthorityExpiryQueue.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 *QueryGetAuthorityExpiryQueue) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAuthorityExpiryQueue.Merge(m, src) +} +func (m *QueryGetAuthorityExpiryQueue) XXX_Size() int { + return m.Size() +} +func (m *QueryGetAuthorityExpiryQueue) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAuthorityExpiryQueue.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetAuthorityExpiryQueue proto.InternalMessageInfo + +func (m *QueryGetAuthorityExpiryQueue) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// QueryGetAuthorityExpiryQueueResponse +type QueryGetAuthorityExpiryQueueResponse struct { + Authorities []*ExpiryQueueRecord `protobuf:"bytes,1,rep,name=authorities,proto3" json:"authorities,omitempty"` + // pagination defines the pagination in the response. + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryGetAuthorityExpiryQueueResponse) Reset() { *m = QueryGetAuthorityExpiryQueueResponse{} } +func (m *QueryGetAuthorityExpiryQueueResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetAuthorityExpiryQueueResponse) ProtoMessage() {} +func (*QueryGetAuthorityExpiryQueueResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_73d2465766c8f876, []int{23} +} +func (m *QueryGetAuthorityExpiryQueueResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetAuthorityExpiryQueueResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetAuthorityExpiryQueueResponse.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 *QueryGetAuthorityExpiryQueueResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetAuthorityExpiryQueueResponse.Merge(m, src) +} +func (m *QueryGetAuthorityExpiryQueueResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetAuthorityExpiryQueueResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetAuthorityExpiryQueueResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetAuthorityExpiryQueueResponse proto.InternalMessageInfo + +func (m *QueryGetAuthorityExpiryQueueResponse) GetAuthorities() []*ExpiryQueueRecord { + if m != nil { + return m.Authorities + } + return nil +} + +func (m *QueryGetAuthorityExpiryQueueResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +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((*QueryListRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.QueryListRecordsResponse") + proto.RegisterType((*QueryRecordByIdRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIdRequest") + proto.RegisterType((*QueryRecordByIdResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByIdResponse") + proto.RegisterType((*QueryRecordByBondIdRequest)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByBondIdRequest") + proto.RegisterType((*QueryRecordByBondIdResponse)(nil), "vulcanize.nameservice.v1beta1.QueryRecordByBondIdResponse") + proto.RegisterType((*GetNameServiceModuleBalanceRequest)(nil), "vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceRequest") + proto.RegisterType((*GetNameServiceModuleBalanceResponse)(nil), "vulcanize.nameservice.v1beta1.GetNameServiceModuleBalanceResponse") + proto.RegisterType((*AccountBalance)(nil), "vulcanize.nameservice.v1beta1.AccountBalance") + proto.RegisterType((*QueryListNameRecordsRequest)(nil), "vulcanize.nameservice.v1beta1.QueryListNameRecordsRequest") + 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((*QueryGetRecordExpiryQueue)(nil), "vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueue") + proto.RegisterType((*QueryGetRecordExpiryQueueResponse)(nil), "vulcanize.nameservice.v1beta1.QueryGetRecordExpiryQueueResponse") + proto.RegisterType((*ExpiryQueueRecord)(nil), "vulcanize.nameservice.v1beta1.ExpiryQueueRecord") + proto.RegisterType((*QueryGetAuthorityExpiryQueue)(nil), "vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueue") + proto.RegisterType((*QueryGetAuthorityExpiryQueueResponse)(nil), "vulcanize.nameservice.v1beta1.QueryGetAuthorityExpiryQueueResponse") +} + +func init() { + proto.RegisterFile("vulcanize/nameservice/v1beta1/query.proto", fileDescriptor_73d2465766c8f876) +} + +var fileDescriptor_73d2465766c8f876 = []byte{ + // 1227 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x58, 0xcf, 0x6f, 0xdc, 0x44, + 0x14, 0xce, 0x6c, 0x9a, 0x94, 0xbc, 0x40, 0x42, 0x86, 0x88, 0xa6, 0x6e, 0xbb, 0x49, 0x9c, 0xb6, + 0xd9, 0xad, 0xba, 0x76, 0x36, 0x55, 0x0b, 0x49, 0x85, 0x44, 0x36, 0x84, 0xa8, 0x55, 0x41, 0xc4, + 0x20, 0x05, 0x71, 0xa0, 0xf2, 0xae, 0x87, 0x8d, 0xe9, 0xae, 0x67, 0xeb, 0x1f, 0x49, 0x97, 0x28, + 0x17, 0x0e, 0x3d, 0x23, 0x71, 0x42, 0x82, 0x03, 0x07, 0x0e, 0x44, 0xea, 0x89, 0x0b, 0xf7, 0x0a, + 0xa9, 0xb7, 0x56, 0xe2, 0xc2, 0x29, 0xa0, 0x04, 0x89, 0x7b, 0xff, 0x02, 0xe4, 0x99, 0xb1, 0x63, + 0xef, 0x4f, 0xef, 0x36, 0x95, 0x7a, 0x8a, 0x3d, 0xf3, 0xbe, 0xf7, 0xbe, 0xf7, 0xde, 0xcc, 0xf3, + 0xb7, 0x81, 0xec, 0xb6, 0x57, 0x29, 0xe9, 0x96, 0xf9, 0x0d, 0x51, 0x2d, 0xbd, 0x4a, 0x1c, 0x62, + 0x6f, 0x9b, 0x25, 0xa2, 0x6e, 0xe7, 0x8b, 0xc4, 0xd5, 0xf3, 0xea, 0x7d, 0x8f, 0xd8, 0x75, 0xa5, + 0x66, 0x53, 0x97, 0xe2, 0x0b, 0xa1, 0xa9, 0x12, 0x31, 0x55, 0x84, 0xa9, 0xa4, 0x76, 0xf6, 0x14, + 0x85, 0x30, 0x7f, 0xd2, 0xf9, 0x32, 0xa5, 0xe5, 0x0a, 0x51, 0xf5, 0x9a, 0xa9, 0xea, 0x96, 0x45, + 0x5d, 0xdd, 0x35, 0xa9, 0xe5, 0x88, 0xdd, 0x2b, 0x25, 0xea, 0x54, 0xa9, 0xa3, 0x16, 0x75, 0x87, + 0x70, 0x1a, 0xa1, 0xab, 0x9a, 0x5e, 0x36, 0x2d, 0x66, 0x2c, 0x6c, 0x27, 0xcb, 0xb4, 0x4c, 0xd9, + 0xa3, 0xea, 0x3f, 0x89, 0xd5, 0x74, 0xd4, 0x43, 0x80, 0x2d, 0x51, 0x53, 0xa0, 0xe4, 0x49, 0xc0, + 0x1b, 0xbe, 0xdf, 0x4f, 0x74, 0x5b, 0xaf, 0x3a, 0x1a, 0xb9, 0xef, 0x11, 0xc7, 0x95, 0x3f, 0x83, + 0xb7, 0x62, 0xab, 0x4e, 0x8d, 0x5a, 0x0e, 0xc1, 0xef, 0xc1, 0x70, 0x8d, 0xad, 0x4c, 0xa1, 0x19, + 0x94, 0x19, 0x5d, 0xbc, 0xa4, 0x74, 0xac, 0x86, 0x22, 0xe0, 0x02, 0x24, 0xeb, 0x70, 0x86, 0x79, + 0xbd, 0x63, 0x3a, 0xae, 0x46, 0x4a, 0xd4, 0x36, 0x82, 0x80, 0xf8, 0x43, 0x80, 0xe3, 0x84, 0x84, + 0xf7, 0xcb, 0x0a, 0xe7, 0xae, 0xf8, 0xdc, 0x15, 0xde, 0x84, 0x63, 0xcf, 0x65, 0x22, 0xb0, 0x5a, + 0x04, 0x29, 0xef, 0x23, 0x98, 0x6a, 0x8e, 0x21, 0xe8, 0xaf, 0xc1, 0x69, 0x9b, 0x2f, 0x4d, 0xa1, + 0x99, 0xc1, 0x04, 0xfc, 0xb9, 0x83, 0xc2, 0xa9, 0x27, 0x07, 0xd3, 0x03, 0x5a, 0x80, 0xc5, 0xeb, + 0x31, 0xae, 0x29, 0xc6, 0x75, 0xbe, 0x2b, 0x57, 0xce, 0x21, 0x46, 0x36, 0x03, 0x6f, 0x33, 0xae, + 0x22, 0x4c, 0xfd, 0x96, 0x11, 0x94, 0x63, 0x0c, 0x52, 0xa6, 0xc1, 0xca, 0x30, 0xa2, 0xa5, 0x4c, + 0x43, 0xfe, 0x52, 0x54, 0x2e, 0x6a, 0x29, 0x92, 0x5a, 0x85, 0x61, 0x4e, 0x2c, 0x61, 0x4f, 0x62, + 0x39, 0x09, 0xa8, 0xec, 0x82, 0x14, 0xf3, 0x5f, 0xa0, 0x96, 0xd1, 0x96, 0x4d, 0x43, 0xb3, 0x52, + 0x7d, 0x37, 0xeb, 0x11, 0x82, 0x73, 0x2d, 0xc3, 0xbe, 0xa2, 0xfd, 0xba, 0x08, 0xf2, 0x3a, 0x71, + 0x3f, 0xd6, 0xab, 0xe4, 0x53, 0x1e, 0xf8, 0x23, 0x6a, 0x78, 0x15, 0x52, 0xd0, 0x2b, 0xba, 0x55, + 0x0a, 0x32, 0x94, 0x6b, 0x30, 0xd7, 0xd1, 0x4a, 0x24, 0x77, 0x0b, 0x5e, 0x2b, 0xf2, 0xa5, 0x20, + 0xbb, 0x5c, 0x97, 0xec, 0x56, 0x4a, 0x25, 0xea, 0x59, 0x6e, 0xe0, 0x28, 0x84, 0xcb, 0xff, 0x21, + 0x18, 0x8b, 0x6f, 0xe2, 0x3b, 0xf0, 0xba, 0xce, 0x57, 0xee, 0xfa, 0xae, 0x78, 0xf3, 0x0a, 0xd9, + 0xe7, 0x07, 0xd3, 0x97, 0xbe, 0x76, 0xa8, 0xb5, 0x2c, 0x8b, 0x5d, 0x9f, 0xa6, 0x3c, 0x53, 0xd7, + 0xab, 0x95, 0xf8, 0x92, 0x36, 0x1a, 0x79, 0xc3, 0x0f, 0x11, 0x9c, 0x16, 0xd1, 0xa6, 0x06, 0x19, + 0xd7, 0xb3, 0xb1, 0xfa, 0x05, 0x0c, 0x57, 0xa9, 0x69, 0x15, 0x36, 0xfc, 0xea, 0x3f, 0x3f, 0x98, + 0xbe, 0xc0, 0x03, 0x09, 0x5c, 0x10, 0x24, 0x78, 0xdd, 0xff, 0x7b, 0x3a, 0x53, 0x36, 0xdd, 0x2d, + 0xaf, 0xa8, 0x94, 0x68, 0x55, 0x15, 0x53, 0x8a, 0xff, 0xc9, 0x39, 0xc6, 0x3d, 0xd5, 0xad, 0xd7, + 0x88, 0xc3, 0x3c, 0x3a, 0x5a, 0x10, 0x5c, 0x26, 0xe2, 0xc0, 0xf8, 0xb7, 0xdb, 0x67, 0xf6, 0x92, + 0xa6, 0xc8, 0x23, 0x04, 0xe7, 0x5b, 0xc7, 0x11, 0xcd, 0xfb, 0x00, 0x86, 0x58, 0x87, 0x44, 0xe7, + 0x32, 0x5d, 0x3a, 0xe7, 0xbb, 0x58, 0xb3, 0x5c, 0xbb, 0x2e, 0x8e, 0x26, 0x07, 0x9f, 0xdc, 0xc1, + 0x9c, 0x87, 0x09, 0x46, 0x77, 0x73, 0x8b, 0x9a, 0x61, 0x31, 0x30, 0x9c, 0x3a, 0x6e, 0xbd, 0xc6, + 0x9e, 0xe5, 0x9f, 0x90, 0x18, 0xf7, 0xc2, 0x52, 0xa4, 0xf3, 0x10, 0xc1, 0x98, 0xbf, 0x7f, 0x57, + 0xf7, 0xdc, 0x2d, 0x6a, 0x9b, 0x6e, 0x5d, 0x14, 0xef, 0x6a, 0x82, 0xc4, 0x56, 0x02, 0x4c, 0x21, + 0x2f, 0x3a, 0x9f, 0xe5, 0x9d, 0xb7, 0xa2, 0x9b, 0x41, 0xff, 0xe3, 0x8b, 0xda, 0x1b, 0xf1, 0x77, + 0x19, 0xc6, 0x78, 0xdd, 0x29, 0xbd, 0xe7, 0xd5, 0x36, 0x6d, 0x0b, 0xbf, 0x09, 0x83, 0x3b, 0xb6, + 0x25, 0x92, 0xf0, 0x1f, 0xe5, 0x4d, 0x31, 0x35, 0x43, 0x9b, 0xc8, 0xe7, 0xe9, 0x38, 0xe3, 0xd1, + 0xc5, 0x6c, 0x02, 0xee, 0xbc, 0xaf, 0xa2, 0x38, 0x73, 0x30, 0x2e, 0xa6, 0x91, 0x43, 0x2b, 0xdb, + 0xa4, 0x75, 0xf4, 0xcf, 0xc3, 0x49, 0x1c, 0x18, 0x45, 0xbf, 0x8e, 0x7d, 0x4c, 0xe2, 0x70, 0x06, + 0x97, 0xe0, 0x2c, 0xf3, 0xbc, 0x4e, 0xc4, 0x87, 0x6b, 0xed, 0x41, 0xcd, 0xb4, 0xeb, 0x1b, 0x1e, + 0xf1, 0xc8, 0x89, 0x9d, 0xec, 0xdf, 0x11, 0xcc, 0xb6, 0x8d, 0x12, 0x66, 0x72, 0xbb, 0x71, 0xf0, + 0x2e, 0x74, 0x49, 0x25, 0xe6, 0x84, 0x65, 0x75, 0xf2, 0xd3, 0x77, 0x09, 0x26, 0x9a, 0xc2, 0x34, + 0x7d, 0x9a, 0x26, 0x61, 0x68, 0x5b, 0xaf, 0x78, 0x64, 0x2a, 0x35, 0x33, 0x98, 0x19, 0xd1, 0xf8, + 0x8b, 0xfc, 0x95, 0xb8, 0xce, 0xeb, 0xc4, 0x0d, 0xcf, 0xda, 0xcb, 0xa8, 0xee, 0x63, 0x04, 0x17, + 0x3b, 0x05, 0x0a, 0x0b, 0xac, 0xc1, 0x68, 0x70, 0xd5, 0x4c, 0xd2, 0x7f, 0x91, 0xa3, 0x4e, 0x4e, + 0xac, 0xd0, 0x8b, 0x4f, 0xc7, 0x61, 0x88, 0x65, 0x81, 0x7f, 0x40, 0x30, 0xcc, 0x35, 0x1c, 0xce, + 0x77, 0x21, 0xd7, 0x2c, 0x22, 0xa5, 0xc5, 0x5e, 0x20, 0x9c, 0x87, 0x9c, 0xf9, 0xf6, 0xcf, 0x7f, + 0xbf, 0x4f, 0xc9, 0x78, 0x46, 0x25, 0xee, 0x16, 0xb1, 0xab, 0xa6, 0xe5, 0x36, 0x08, 0x69, 0x95, + 0x8b, 0x49, 0xfc, 0x2b, 0x82, 0xd1, 0x88, 0xc8, 0xc3, 0x37, 0x92, 0x44, 0x6b, 0x56, 0x9e, 0xd2, + 0x3b, 0x3d, 0xe3, 0x04, 0xd5, 0x2c, 0xa3, 0x3a, 0x87, 0x67, 0xdb, 0x53, 0x0d, 0xee, 0xc0, 0x3e, + 0x82, 0x91, 0xf0, 0xc2, 0xe1, 0xeb, 0x49, 0x22, 0x36, 0x69, 0x42, 0xe9, 0x46, 0xaf, 0x30, 0xc1, + 0x53, 0x61, 0x3c, 0x33, 0xf8, 0x72, 0x57, 0x9e, 0xea, 0xae, 0x69, 0xec, 0xe1, 0x3f, 0x10, 0x4c, + 0x84, 0x64, 0x03, 0x4d, 0x86, 0x97, 0x7a, 0x89, 0x1e, 0x93, 0x8f, 0xd2, 0x72, 0x3f, 0x50, 0x41, + 0x7e, 0x89, 0x91, 0xbf, 0x86, 0xf3, 0x5d, 0xc9, 0xe7, 0x8a, 0xf5, 0x5c, 0x91, 0x5a, 0x46, 0xce, + 0x34, 0x78, 0x1e, 0x4f, 0x11, 0x9c, 0xeb, 0x20, 0xc4, 0xf0, 0x4a, 0x17, 0x5a, 0xdd, 0xa5, 0x9e, + 0x54, 0x78, 0x11, 0x17, 0xc9, 0x8f, 0x91, 0x50, 0x3f, 0xf8, 0x37, 0x04, 0xe3, 0x0d, 0x8a, 0x04, + 0x2f, 0x27, 0x3d, 0xbe, 0xcd, 0x72, 0x49, 0xba, 0xd9, 0x17, 0x56, 0xf0, 0x9e, 0x67, 0xbc, 0x67, + 0xf1, 0x74, 0x7b, 0xde, 0x5c, 0xe5, 0xfc, 0x88, 0x60, 0x88, 0xc9, 0x0d, 0xbc, 0x90, 0x24, 0x5e, + 0x54, 0xc3, 0x48, 0xf9, 0x1e, 0x10, 0xc9, 0x8f, 0xfb, 0x8e, 0x0f, 0x50, 0x77, 0xfd, 0xd5, 0x3d, + 0xfc, 0x33, 0x82, 0x91, 0x63, 0xb9, 0x91, 0x4b, 0x54, 0x92, 0xc0, 0x5c, 0xba, 0xde, 0x93, 0x79, + 0x2f, 0x1c, 0x2b, 0x0c, 0xa4, 0xee, 0xee, 0xd8, 0xd6, 0x1e, 0xfe, 0x05, 0x01, 0x44, 0x54, 0x89, + 0x92, 0xec, 0x42, 0x05, 0xf6, 0x49, 0x27, 0x47, 0xa3, 0xa0, 0x91, 0x55, 0x46, 0x33, 0x8b, 0xe7, + 0x3b, 0x5d, 0x3e, 0x86, 0x12, 0x3c, 0x1f, 0x23, 0x98, 0x6c, 0x29, 0x5f, 0xde, 0x4d, 0xc2, 0xa0, + 0x15, 0x52, 0x7a, 0xbf, 0x5f, 0x64, 0x6f, 0x59, 0xf8, 0xe0, 0x1c, 0x61, 0x68, 0x7f, 0x70, 0x9c, + 0x69, 0xa7, 0x14, 0x6e, 0x26, 0xa4, 0xd3, 0x0a, 0x2c, 0xad, 0xbe, 0x00, 0x38, 0x4c, 0x67, 0x91, + 0xa5, 0x73, 0x15, 0x5f, 0x69, 0x9f, 0x4e, 0xa8, 0xe2, 0x45, 0x46, 0x85, 0xdb, 0x4f, 0x0e, 0xd3, + 0xe8, 0xd9, 0x61, 0x1a, 0xfd, 0x73, 0x98, 0x46, 0xdf, 0x1d, 0xa5, 0x07, 0x9e, 0x1d, 0xa5, 0x07, + 0xfe, 0x3a, 0x4a, 0x0f, 0x7c, 0xb1, 0x10, 0xf9, 0x0d, 0xe6, 0x6e, 0xe9, 0xb6, 0x63, 0x3a, 0x11, + 0xbf, 0x0f, 0x62, 0x9e, 0xd9, 0x2f, 0xb2, 0xe2, 0x30, 0xfb, 0xbf, 0xd1, 0xb5, 0xff, 0x03, 0x00, + 0x00, 0xff, 0xff, 0x64, 0xd6, 0x54, 0x09, 0x34, 0x13, 0x00, 0x00, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Params queries the nameservice module params. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // List records + ListRecords(ctx context.Context, in *QueryListRecordsRequest, opts ...grpc.CallOption) (*QueryListRecordsResponse, error) + // Get record by id + GetRecord(ctx context.Context, in *QueryRecordByIdRequest, opts ...grpc.CallOption) (*QueryRecordByIdResponse, error) + // Get records by bond id + GetRecordByBondId(ctx context.Context, in *QueryRecordByBondIdRequest, opts ...grpc.CallOption) (*QueryRecordByBondIdResponse, error) + // Get nameservice module balance + GetNameServiceModuleBalance(ctx context.Context, in *GetNameServiceModuleBalanceRequest, opts ...grpc.CallOption) (*GetNameServiceModuleBalanceResponse, error) + // List name records + 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) + // GetRecordExpiryQueue + GetRecordExpiryQueue(ctx context.Context, in *QueryGetRecordExpiryQueue, opts ...grpc.CallOption) (*QueryGetRecordExpiryQueueResponse, error) + // GetAuthorityExpiryQueue + GetAuthorityExpiryQueue(ctx context.Context, in *QueryGetAuthorityExpiryQueue, opts ...grpc.CallOption) (*QueryGetAuthorityExpiryQueueResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListRecords(ctx context.Context, in *QueryListRecordsRequest, opts ...grpc.CallOption) (*QueryListRecordsResponse, error) { + out := new(QueryListRecordsResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/ListRecords", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetRecord(ctx context.Context, in *QueryRecordByIdRequest, opts ...grpc.CallOption) (*QueryRecordByIdResponse, error) { + out := new(QueryRecordByIdResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetRecordByBondId(ctx context.Context, in *QueryRecordByBondIdRequest, opts ...grpc.CallOption) (*QueryRecordByBondIdResponse, error) { + out := new(QueryRecordByBondIdResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecordByBondId", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetNameServiceModuleBalance(ctx context.Context, in *GetNameServiceModuleBalanceRequest, opts ...grpc.CallOption) (*GetNameServiceModuleBalanceResponse, error) { + out := new(GetNameServiceModuleBalanceResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetNameServiceModuleBalance", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) ListNameRecords(ctx context.Context, in *QueryListNameRecordsRequest, opts ...grpc.CallOption) (*QueryListNameRecordsResponse, error) { + out := new(QueryListNameRecordsResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/ListNameRecords", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Whois(ctx context.Context, in *QueryWhoisRequest, opts ...grpc.CallOption) (*QueryWhoisResponse, error) { + out := new(QueryWhoisResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/Whois", in, out, opts...) + if err != nil { + return nil, err + } + 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...) + 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...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetRecordExpiryQueue(ctx context.Context, in *QueryGetRecordExpiryQueue, opts ...grpc.CallOption) (*QueryGetRecordExpiryQueueResponse, error) { + out := new(QueryGetRecordExpiryQueueResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetRecordExpiryQueue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetAuthorityExpiryQueue(ctx context.Context, in *QueryGetAuthorityExpiryQueue, opts ...grpc.CallOption) (*QueryGetAuthorityExpiryQueueResponse, error) { + out := new(QueryGetAuthorityExpiryQueueResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Query/GetAuthorityExpiryQueue", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// QueryServer is the server API for Query service. +type QueryServer interface { + // Params queries the nameservice module params. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // List records + ListRecords(context.Context, *QueryListRecordsRequest) (*QueryListRecordsResponse, error) + // Get record by id + GetRecord(context.Context, *QueryRecordByIdRequest) (*QueryRecordByIdResponse, error) + // Get records by bond id + GetRecordByBondId(context.Context, *QueryRecordByBondIdRequest) (*QueryRecordByBondIdResponse, error) + // Get nameservice module balance + GetNameServiceModuleBalance(context.Context, *GetNameServiceModuleBalanceRequest) (*GetNameServiceModuleBalanceResponse, error) + // List name records + 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) + // GetRecordExpiryQueue + GetRecordExpiryQueue(context.Context, *QueryGetRecordExpiryQueue) (*QueryGetRecordExpiryQueueResponse, error) + // GetAuthorityExpiryQueue + GetAuthorityExpiryQueue(context.Context, *QueryGetAuthorityExpiryQueue) (*QueryGetAuthorityExpiryQueueResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) ListRecords(ctx context.Context, req *QueryListRecordsRequest) (*QueryListRecordsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListRecords not implemented") +} +func (*UnimplementedQueryServer) GetRecord(ctx context.Context, req *QueryRecordByIdRequest) (*QueryRecordByIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRecord not implemented") +} +func (*UnimplementedQueryServer) GetRecordByBondId(ctx context.Context, req *QueryRecordByBondIdRequest) (*QueryRecordByBondIdResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRecordByBondId not implemented") +} +func (*UnimplementedQueryServer) GetNameServiceModuleBalance(ctx context.Context, req *GetNameServiceModuleBalanceRequest) (*GetNameServiceModuleBalanceResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNameServiceModuleBalance not implemented") +} +func (*UnimplementedQueryServer) ListNameRecords(ctx context.Context, req *QueryListNameRecordsRequest) (*QueryListNameRecordsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ListNameRecords not implemented") +} +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) ResolveWrn(ctx context.Context, req *QueryResolveWrn) (*QueryResolveWrnResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ResolveWrn not implemented") +} +func (*UnimplementedQueryServer) GetRecordExpiryQueue(ctx context.Context, req *QueryGetRecordExpiryQueue) (*QueryGetRecordExpiryQueueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetRecordExpiryQueue not implemented") +} +func (*UnimplementedQueryServer) GetAuthorityExpiryQueue(ctx context.Context, req *QueryGetAuthorityExpiryQueue) (*QueryGetAuthorityExpiryQueueResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetAuthorityExpiryQueue not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryListRecordsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListRecords(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/ListRecords", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListRecords(ctx, req.(*QueryListRecordsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRecordByIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetRecord(ctx, req.(*QueryRecordByIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetRecordByBondId_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryRecordByBondIdRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetRecordByBondId(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecordByBondId", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetRecordByBondId(ctx, req.(*QueryRecordByBondIdRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetNameServiceModuleBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(GetNameServiceModuleBalanceRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetNameServiceModuleBalance(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetNameServiceModuleBalance", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetNameServiceModuleBalance(ctx, req.(*GetNameServiceModuleBalanceRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_ListNameRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryListNameRecordsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ListNameRecords(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/ListNameRecords", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ListNameRecords(ctx, req.(*QueryListNameRecordsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Whois_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryWhoisRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Whois(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/Whois", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Whois(ctx, req.(*QueryWhoisRequest)) + } + 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) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LookupWrn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/LookupWrn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LookupWrn(ctx, req.(*QueryLookupWrn)) + } + 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) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ResolveWrn(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/ResolveWrn", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ResolveWrn(ctx, req.(*QueryResolveWrn)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetRecordExpiryQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRecordExpiryQueue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetRecordExpiryQueue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetRecordExpiryQueue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetRecordExpiryQueue(ctx, req.(*QueryGetRecordExpiryQueue)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetAuthorityExpiryQueue_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetAuthorityExpiryQueue) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetAuthorityExpiryQueue(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Query/GetAuthorityExpiryQueue", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetAuthorityExpiryQueue(ctx, req.(*QueryGetAuthorityExpiryQueue)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "vulcanize.nameservice.v1beta1.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "ListRecords", + Handler: _Query_ListRecords_Handler, + }, + { + MethodName: "GetRecord", + Handler: _Query_GetRecord_Handler, + }, + { + MethodName: "GetRecordByBondId", + Handler: _Query_GetRecordByBondId_Handler, + }, + { + MethodName: "GetNameServiceModuleBalance", + Handler: _Query_GetNameServiceModuleBalance_Handler, + }, + { + MethodName: "ListNameRecords", + Handler: _Query_ListNameRecords_Handler, + }, + { + MethodName: "Whois", + Handler: _Query_Whois_Handler, + }, + { + MethodName: "LookupWrn", + Handler: _Query_LookupWrn_Handler, + }, + { + MethodName: "ResolveWrn", + Handler: _Query_ResolveWrn_Handler, + }, + { + MethodName: "GetRecordExpiryQueue", + Handler: _Query_GetRecordExpiryQueue_Handler, + }, + { + MethodName: "GetAuthorityExpiryQueue", + Handler: _Query_GetAuthorityExpiryQueue_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "vulcanize/nameservice/v1beta1/query.proto", +} + +func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Params != nil { + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryListRecordsRequest) 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) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.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 *QueryListRecordsResponse) 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 *QueryListRecordsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Records[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 *QueryRecordByIdRequest) 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 *QueryRecordByIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRecordByIdRequest) 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 *QueryRecordByIdResponse) 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 *QueryRecordByIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRecordByIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Record.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 *QueryRecordByBondIdRequest) 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 *QueryRecordByBondIdRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRecordByBondIdRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + 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 *QueryRecordByBondIdResponse) 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 *QueryRecordByBondIdResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryRecordByBondIdResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Records[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 *GetNameServiceModuleBalanceRequest) 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 *GetNameServiceModuleBalanceRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNameServiceModuleBalanceRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *GetNameServiceModuleBalanceResponse) 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 *GetNameServiceModuleBalanceResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GetNameServiceModuleBalanceResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balances) > 0 { + for iNdEx := len(m.Balances) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balances[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 *AccountBalance) 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 *AccountBalance) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *AccountBalance) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Balance) > 0 { + for iNdEx := len(m.Balance) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Balance[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.AccountName) > 0 { + i -= len(m.AccountName) + copy(dAtA[i:], m.AccountName) + i = encodeVarintQuery(dAtA, i, uint64(len(m.AccountName))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryListNameRecordsRequest) 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 *QueryListNameRecordsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListNameRecordsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.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 *QueryListNameRecordsResponse) 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 *QueryListNameRecordsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryListNameRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Names) > 0 { + for iNdEx := len(m.Names) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Names[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 *QueryWhoisRequest) 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 *QueryWhoisRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryWhoisRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryWhoisResponse) 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 *QueryWhoisResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryWhoisResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.NameAuthority.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 *QueryLookupWrn) 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 *QueryLookupWrn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLookupWrn) 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryLookupWrnResponse) 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 *QueryLookupWrnResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryLookupWrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Name != nil { + { + size, err := m.Name.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 *QueryResolveWrn) 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 *QueryResolveWrn) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResolveWrn) 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryResolveWrnResponse) 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 *QueryResolveWrnResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryResolveWrnResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Record != nil { + { + size, err := m.Record.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 *QueryGetRecordExpiryQueue) 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 *QueryGetRecordExpiryQueue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecordExpiryQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.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 *QueryGetRecordExpiryQueueResponse) 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 *QueryGetRecordExpiryQueueResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRecordExpiryQueueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Records) > 0 { + for iNdEx := len(m.Records) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Records[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 *ExpiryQueueRecord) 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 *ExpiryQueueRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ExpiryQueueRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Value) > 0 { + for iNdEx := len(m.Value) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Value[iNdEx]) + copy(dAtA[i:], m.Value[iNdEx]) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Value[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + 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 *QueryGetAuthorityExpiryQueue) 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 *QueryGetAuthorityExpiryQueue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetAuthorityExpiryQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.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 *QueryGetAuthorityExpiryQueueResponse) 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 *QueryGetAuthorityExpiryQueueResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetAuthorityExpiryQueueResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Authorities) > 0 { + for iNdEx := len(m.Authorities) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Authorities[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 encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Params != nil { + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryListRecordsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryListRecordsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRecordByIdRequest) 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 *QueryRecordByIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Record.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryRecordByBondIdRequest) 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)) + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryRecordByBondIdResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *GetNameServiceModuleBalanceRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *GetNameServiceModuleBalanceResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Balances) > 0 { + for _, e := range m.Balances { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *AccountBalance) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AccountName) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if len(m.Balance) > 0 { + for _, e := range m.Balance { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryListNameRecordsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryListNameRecordsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Names) > 0 { + for _, e := range m.Names { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWhoisRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryWhoisResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.NameAuthority.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryLookupWrn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Wrn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryLookupWrnResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Name != nil { + l = m.Name.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryResolveWrn) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Wrn) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryResolveWrnResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Record != nil { + l = m.Record.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRecordExpiryQueue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRecordExpiryQueueResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Records) > 0 { + for _, e := range m.Records { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *ExpiryQueueRecord) 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)) + } + if len(m.Value) > 0 { + for _, s := range m.Value { + l = len(s) + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryGetAuthorityExpiryQueue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetAuthorityExpiryQueueResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Authorities) > 0 { + for _, e := range m.Authorities { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Params == nil { + m.Params = &Params{} + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryListRecordsRequest) 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: QueryListRecordsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListRecordsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 + 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: QueryListRecordsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListRecordsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", 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.Records = append(m.Records, Record{}) + if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryRecordByIdRequest) 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: QueryRecordByIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRecordByIdRequest: 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 *QueryRecordByIdResponse) 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: QueryRecordByIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRecordByIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Record.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 *QueryRecordByBondIdRequest) 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: QueryRecordByBondIdRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRecordByBondIdRequest: 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryRecordByBondIdResponse) 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: QueryRecordByBondIdResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryRecordByBondIdResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", 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.Records = append(m.Records, Record{}) + if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *GetNameServiceModuleBalanceRequest) 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: GetNameServiceModuleBalanceRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNameServiceModuleBalanceRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GetNameServiceModuleBalanceResponse) 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: GetNameServiceModuleBalanceResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GetNameServiceModuleBalanceResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balances", 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.Balances = append(m.Balances, &AccountBalance{}) + if err := m.Balances[len(m.Balances)-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 *AccountBalance) 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: AccountBalance: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: AccountBalance: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AccountName", 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.AccountName = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Balance", 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.Balance = append(m.Balance, types.Coin{}) + if err := m.Balance[len(m.Balance)-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 *QueryListNameRecordsRequest) 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: QueryListNameRecordsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListNameRecordsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryListNameRecordsResponse) 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: QueryListNameRecordsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryListNameRecordsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Names", 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.Names = append(m.Names, NameEntry{}) + if err := m.Names[len(m.Names)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *QueryWhoisRequest) 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: QueryWhoisRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryWhoisRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 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.Name = 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 *QueryWhoisResponse) 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: QueryWhoisResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryWhoisResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NameAuthority", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.NameAuthority.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 *QueryLookupWrn) 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: QueryLookupWrn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLookupWrn: 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) + } + 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.Wrn = 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 *QueryLookupWrnResponse) 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: QueryLookupWrnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryLookupWrnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var 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.Name == nil { + m.Name = &NameRecord{} + } + if err := m.Name.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 *QueryResolveWrn) 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: QueryResolveWrn: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResolveWrn: 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) + } + 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.Wrn = 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 *QueryResolveWrnResponse) 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: QueryResolveWrnResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryResolveWrnResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", 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.Record == nil { + m.Record = &Record{} + } + if err := m.Record.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 *QueryGetRecordExpiryQueue) 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: QueryGetRecordExpiryQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRecordExpiryQueue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryGetRecordExpiryQueueResponse) 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: QueryGetRecordExpiryQueueResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRecordExpiryQueueResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Records", 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.Records = append(m.Records, &ExpiryQueueRecord{}) + if err := m.Records[len(m.Records)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.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 *ExpiryQueueRecord) 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: ExpiryQueueRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ExpiryQueueRecord: 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Value", 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.Value = append(m.Value, 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 *QueryGetAuthorityExpiryQueue) 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: QueryGetAuthorityExpiryQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetAuthorityExpiryQueue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.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 *QueryGetAuthorityExpiryQueueResponse) 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: QueryGetAuthorityExpiryQueueResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetAuthorityExpiryQueueResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Authorities", 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.Authorities = append(m.Authorities, &ExpiryQueueRecord{}) + if err := m.Authorities[len(m.Authorities)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", 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.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipQuery(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/nameservice/types/query.pb.gw.go b/x/nameservice/types/query.pb.gw.go new file mode 100644 index 00000000..40e83954 --- /dev/null +++ b/x/nameservice/types/query.pb.gw.go @@ -0,0 +1,1038 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: vulcanize/nameservice/v1beta1/query.proto + +/* +Package types is a reverse proxy. + +It translates gRPC into RESTful JSON APIs. +*/ +package types + +import ( + "context" + "io" + "net/http" + + "github.com/golang/protobuf/descriptor" + "github.com/golang/protobuf/proto" + "github.com/grpc-ecosystem/grpc-gateway/runtime" + "github.com/grpc-ecosystem/grpc-gateway/utilities" + "google.golang.org/grpc" + "google.golang.org/grpc/codes" + "google.golang.org/grpc/grpclog" + "google.golang.org/grpc/status" +) + +// Suppress "imported and not used" errors +var _ codes.Code +var _ io.Reader +var _ status.Status +var _ = runtime.String +var _ = utilities.NewDoubleArray +var _ = descriptor.ForMessage + +func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryParamsRequest + var metadata runtime.ServerMetadata + + msg, err := server.Params(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ListRecords_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ListRecords_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListRecordsRequest + 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_ListRecords_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListRecords(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ListRecords_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListRecordsRequest + 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_ListRecords_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListRecords(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRecordByIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := client.GetRecord(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetRecord_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRecordByIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + msg, err := server.GetRecord(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GetRecordByBondId_0 = &utilities.DoubleArray{Encoding: map[string]int{"id": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_GetRecordByBondId_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRecordByBondIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRecordByBondId_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRecordByBondId(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetRecordByBondId_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryRecordByBondIdRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id") + } + + protoReq.Id, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_GetRecordByBondId_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRecordByBondId(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_GetNameServiceModuleBalance_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNameServiceModuleBalanceRequest + var metadata runtime.ServerMetadata + + msg, err := client.GetNameServiceModuleBalance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetNameServiceModuleBalance_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq GetNameServiceModuleBalanceRequest + var metadata runtime.ServerMetadata + + msg, err := server.GetNameServiceModuleBalance(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_ListNameRecords_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_ListNameRecords_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListNameRecordsRequest + 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_ListNameRecords_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.ListNameRecords(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ListNameRecords_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryListNameRecordsRequest + 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_ListNameRecords_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.ListNameRecords(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_Whois_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryWhoisRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := client.Whois(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Whois_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryWhoisRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["name"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name") + } + + protoReq.Name, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err) + } + + msg, err := server.Whois(ctx, &protoReq) + return msg, metadata, err + +} + +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 + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["wrn"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "wrn") + } + + protoReq.Wrn, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "wrn", err) + } + + msg, err := client.LookupWrn(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 + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["wrn"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "wrn") + } + + protoReq.Wrn, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "wrn", err) + } + + msg, err := server.LookupWrn(ctx, &protoReq) + return msg, metadata, err + +} + +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 + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["wrn"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "wrn") + } + + protoReq.Wrn, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "wrn", err) + } + + msg, err := client.ResolveWrn(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 + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["wrn"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "wrn") + } + + protoReq.Wrn, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "wrn", err) + } + + msg, err := server.ResolveWrn(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GetRecordExpiryQueue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetRecordExpiryQueue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecordExpiryQueue + 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_GetRecordExpiryQueue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetRecordExpiryQueue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetRecordExpiryQueue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRecordExpiryQueue + 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_GetRecordExpiryQueue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetRecordExpiryQueue(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_GetAuthorityExpiryQueue_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_GetAuthorityExpiryQueue_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAuthorityExpiryQueue + 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_GetAuthorityExpiryQueue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.GetAuthorityExpiryQueue(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_GetAuthorityExpiryQueue_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetAuthorityExpiryQueue + 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_GetAuthorityExpiryQueue_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.GetAuthorityExpiryQueue(ctx, &protoReq) + return msg, metadata, err + +} + +// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". +// UnaryRPC :call QueryServer directly. +// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. +// Note that using this registration option will cause many gRPC library features (such as grpc.SendHeader, etc) to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. +func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ListRecords_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ListRecords_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_ListRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetRecord_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_GetRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetRecordByBondId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetRecordByBondId_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_GetRecordByBondId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetNameServiceModuleBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetNameServiceModuleBalance_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_GetNameServiceModuleBalance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ListNameRecords_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ListNameRecords_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_ListNameRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Whois_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_Whois_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_Whois_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LookupWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_LookupWrn_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()...) + + }) + + mux.Handle("GET", pattern_Query_ResolveWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ResolveWrn_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()...) + + }) + + mux.Handle("GET", pattern_Query_GetRecordExpiryQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetRecordExpiryQueue_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_GetRecordExpiryQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetAuthorityExpiryQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_GetAuthorityExpiryQueue_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_GetAuthorityExpiryQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but +// automatically dials to "endpoint" and closes the connection when "ctx" gets done. +func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { + conn, err := grpc.Dial(endpoint, opts...) + if err != nil { + return err + } + defer func() { + if err != nil { + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + return + } + go func() { + <-ctx.Done() + if cerr := conn.Close(); cerr != nil { + grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) + } + }() + }() + + return RegisterQueryHandler(ctx, mux, conn) +} + +// RegisterQueryHandler registers the http handlers for service Query to "mux". +// The handlers forward requests to the grpc endpoint over "conn". +func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { + return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) +} + +// RegisterQueryHandlerClient registers the http handlers for service Query +// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". +// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" +// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in +// "QueryClient" to call the correct interceptors. +func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { + + mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ListRecords_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ListRecords_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_ListRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetRecord_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetRecord_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_GetRecord_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetRecordByBondId_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetRecordByBondId_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_GetRecordByBondId_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetNameServiceModuleBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetNameServiceModuleBalance_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_GetNameServiceModuleBalance_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_ListNameRecords_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ListNameRecords_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_ListNameRecords_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_Whois_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_Whois_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_Whois_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LookupWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_LookupWrn_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()...) + + }) + + mux.Handle("GET", pattern_Query_ResolveWrn_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ResolveWrn_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()...) + + }) + + mux.Handle("GET", pattern_Query_GetRecordExpiryQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetRecordExpiryQueue_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_GetRecordExpiryQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_GetAuthorityExpiryQueue_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_GetAuthorityExpiryQueue_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_GetAuthorityExpiryQueue_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + return nil +} + +var ( + pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "nameservice", "v1", "params"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ListRecords_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "nameservice", "v1", "records"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_GetRecord_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "nameservice", "v1", "records", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_GetRecordByBondId_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "nameservice", "v1", "records-by-bond-id", "id"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_GetNameServiceModuleBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "nameservice", "v1", "balance"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ListNameRecords_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "nameservice", "v1", "names"}, "", runtime.AssumeColonVerbOpt(true))) + + 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{"ethermint", "nameservice", "v1", "whois", "name"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_LookupWrn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "nameservice", "v1", "lookup", "wrn"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_ResolveWrn_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"ethermint", "nameservice", "v1", "resolve", "wrn"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_GetRecordExpiryQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "nameservice", "v1", "record-expiry"}, "", runtime.AssumeColonVerbOpt(true))) + + pattern_Query_GetAuthorityExpiryQueue_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"ethermint", "nameservice", "v1", "authority-expiry"}, "", runtime.AssumeColonVerbOpt(true))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_ListRecords_0 = runtime.ForwardResponseMessage + + forward_Query_GetRecord_0 = runtime.ForwardResponseMessage + + forward_Query_GetRecordByBondId_0 = runtime.ForwardResponseMessage + + forward_Query_GetNameServiceModuleBalance_0 = runtime.ForwardResponseMessage + + forward_Query_ListNameRecords_0 = runtime.ForwardResponseMessage + + forward_Query_Whois_0 = runtime.ForwardResponseMessage + + forward_Query_LookupWrn_0 = runtime.ForwardResponseMessage + + forward_Query_ResolveWrn_0 = runtime.ForwardResponseMessage + + forward_Query_GetRecordExpiryQueue_0 = runtime.ForwardResponseMessage + + forward_Query_GetAuthorityExpiryQueue_0 = runtime.ForwardResponseMessage +) diff --git a/x/nameservice/types/record_msg.go b/x/nameservice/types/record_msg.go new file mode 100644 index 00000000..15f73492 --- /dev/null +++ b/x/nameservice/types/record_msg.go @@ -0,0 +1,251 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var ( + _ sdk.Msg = &MsgSetRecord{} + _ sdk.Msg = &MsgRenewRecord{} + _ sdk.Msg = &MsgAssociateBond{} + _ sdk.Msg = &MsgDissociateBond{} + _ sdk.Msg = &MsgDissociateRecords{} + _ sdk.Msg = &MsgReAssociateRecords{} +) + +// NewMsgSetRecord is the constructor function for MsgSetRecord. +func NewMsgSetRecord(payload Payload, bondID string, signer sdk.AccAddress) MsgSetRecord { + return MsgSetRecord{ + Payload: payload, + BondId: bondID, + Signer: signer.String(), + } +} + +func (msg MsgSetRecord) ValidateBasic() error { + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, msg.Signer) + } + owners := msg.Payload.Record.Owners + for _, owner := range owners { + if owner == "" { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "Record owner not set.") + } + } + + if len(msg.BondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrUnauthorized, "Bond ID is required.") + } + return nil +} + +func (msg MsgSetRecord) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// GetSignBytes gets the sign bytes for the msg MsgCreateBond +func (msg MsgSetRecord) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// NewMsgRenewRecord is the constructor function for MsgRenewRecord. +func NewMsgRenewRecord(recordId string, signer sdk.AccAddress) MsgRenewRecord { + return MsgRenewRecord{ + RecordId: recordId, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgRenewRecord) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgRenewRecord) Type() string { return "renew-record" } + +// ValidateBasic Implements Msg. +func (msg MsgRenewRecord) ValidateBasic() error { + if len(msg.RecordId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "record id is required.") + } + + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for Msg +func (msg MsgRenewRecord) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgRenewRecord) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgAssociateBond is the constructor function for MsgAssociateBond. +func NewMsgAssociateBond(recordId, bondId string, signer sdk.AccAddress) MsgAssociateBond { + return MsgAssociateBond{ + BondId: bondId, + RecordId: recordId, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgAssociateBond) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgAssociateBond) Type() string { return "associate-bond" } + +// ValidateBasic Implements Msg. +func (msg MsgAssociateBond) ValidateBasic() error { + if len(msg.RecordId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "record id is required.") + } + if len(msg.BondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "bond id is required.") + } + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for Msg +func (msg MsgAssociateBond) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgAssociateBond) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgDissociateBond is the constructor function for MsgDissociateBond. +func NewMsgDissociateBond(recordId string, signer sdk.AccAddress) MsgDissociateBond { + return MsgDissociateBond{ + RecordId: recordId, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgDissociateBond) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgDissociateBond) Type() string { return "dissociate-bond" } + +// ValidateBasic Implements Msg. +func (msg MsgDissociateBond) ValidateBasic() error { + if len(msg.RecordId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "record id is required.") + } + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for Msg +func (msg MsgDissociateBond) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgDissociateBond) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgDissociateRecords is the constructor function for MsgDissociateRecords. +func NewMsgDissociateRecords(bondId string, signer sdk.AccAddress) MsgDissociateRecords { + return MsgDissociateRecords{ + BondId: bondId, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgDissociateRecords) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgDissociateRecords) Type() string { return "dissociate-records" } + +// ValidateBasic Implements Msg. +func (msg MsgDissociateRecords) ValidateBasic() error { + if len(msg.BondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "bond id is required.") + } + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for Msg +func (msg MsgDissociateRecords) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgDissociateRecords) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} + +// NewMsgReAssociateRecords is the constructor function for MsgReAssociateRecords. +func NewMsgReAssociateRecords(oldBondId, newBondId string, signer sdk.AccAddress) MsgReAssociateRecords { + return MsgReAssociateRecords{ + OldBondId: oldBondId, + NewBondId: newBondId, + Signer: signer.String(), + } +} + +// Route Implements Msg. +func (msg MsgReAssociateRecords) Route() string { return RouterKey } + +// Type Implements Msg. +func (msg MsgReAssociateRecords) Type() string { return "reassociate-records" } + +// ValidateBasic Implements Msg. +func (msg MsgReAssociateRecords) ValidateBasic() error { + if len(msg.OldBondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "old-bond-id is required.") + } + if len(msg.NewBondId) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidRequest, "new-bond-id is required.") + } + if len(msg.Signer) == 0 { + return sdkerrors.Wrap(sdkerrors.ErrInvalidAddress, "invalid signer.") + } + + return nil +} + +// GetSignBytes gets the sign bytes for Msg +func (msg MsgReAssociateRecords) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(&msg) + return sdk.MustSortJSON(bz) +} + +// GetSigners Implements Msg. +func (msg MsgReAssociateRecords) GetSigners() []sdk.AccAddress { + accAddr, _ := sdk.AccAddressFromBech32(msg.Signer) + return []sdk.AccAddress{accAddr} +} diff --git a/x/nameservice/types/tx.pb.go b/x/nameservice/types/tx.pb.go new file mode 100644 index 00000000..909f765b --- /dev/null +++ b/x/nameservice/types/tx.pb.go @@ -0,0 +1,4592 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: vulcanize/nameservice/v1beta1/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// MsgSetRecord +type MsgSetRecord struct { + BondId string `protobuf:"bytes,1,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + Payload Payload `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload"` +} + +func (m *MsgSetRecord) Reset() { *m = MsgSetRecord{} } +func (m *MsgSetRecord) String() string { return proto.CompactTextString(m) } +func (*MsgSetRecord) ProtoMessage() {} +func (*MsgSetRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{0} +} +func (m *MsgSetRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetRecord.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 *MsgSetRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetRecord.Merge(m, src) +} +func (m *MsgSetRecord) XXX_Size() int { + return m.Size() +} +func (m *MsgSetRecord) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetRecord proto.InternalMessageInfo + +func (m *MsgSetRecord) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *MsgSetRecord) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgSetRecord) GetPayload() Payload { + if m != nil { + return m.Payload + } + return Payload{} +} + +// MsgSetRecordResponse +type MsgSetRecordResponse struct { +} + +func (m *MsgSetRecordResponse) Reset() { *m = MsgSetRecordResponse{} } +func (m *MsgSetRecordResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetRecordResponse) ProtoMessage() {} +func (*MsgSetRecordResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{1} +} +func (m *MsgSetRecordResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetRecordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetRecordResponse.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 *MsgSetRecordResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetRecordResponse.Merge(m, src) +} +func (m *MsgSetRecordResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetRecordResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetRecordResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetRecordResponse proto.InternalMessageInfo + +// Payload +type Payload struct { + Record *Record `protobuf:"bytes,1,opt,name=record,proto3" json:"record,omitempty"` + Signatures []Signature `protobuf:"bytes,2,rep,name=signatures,proto3" json:"signatures" json:"signatures" yaml:"signatures"` +} + +func (m *Payload) Reset() { *m = Payload{} } +func (m *Payload) String() string { return proto.CompactTextString(m) } +func (*Payload) ProtoMessage() {} +func (*Payload) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{2} +} +func (m *Payload) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Payload) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Payload.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 *Payload) XXX_Merge(src proto.Message) { + xxx_messageInfo_Payload.Merge(m, src) +} +func (m *Payload) XXX_Size() int { + return m.Size() +} +func (m *Payload) XXX_DiscardUnknown() { + xxx_messageInfo_Payload.DiscardUnknown(m) +} + +var xxx_messageInfo_Payload proto.InternalMessageInfo + +func (m *Payload) GetRecord() *Record { + if m != nil { + return m.Record + } + return nil +} + +func (m *Payload) GetSignatures() []Signature { + if m != nil { + return m.Signatures + } + return nil +} + +// MsgSetName +type MsgSetName struct { + Wrn string `protobuf:"bytes,1,opt,name=wrn,proto3" json:"wrn,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"` +} + +func (m *MsgSetName) Reset() { *m = MsgSetName{} } +func (m *MsgSetName) String() string { return proto.CompactTextString(m) } +func (*MsgSetName) ProtoMessage() {} +func (*MsgSetName) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{3} +} +func (m *MsgSetName) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetName) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetName.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 *MsgSetName) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetName.Merge(m, src) +} +func (m *MsgSetName) XXX_Size() int { + return m.Size() +} +func (m *MsgSetName) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetName.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetName proto.InternalMessageInfo + +func (m *MsgSetName) GetWrn() string { + if m != nil { + return m.Wrn + } + return "" +} + +func (m *MsgSetName) GetCid() string { + if m != nil { + return m.Cid + } + return "" +} + +func (m *MsgSetName) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgSetNameResponse +type MsgSetNameResponse struct { +} + +func (m *MsgSetNameResponse) Reset() { *m = MsgSetNameResponse{} } +func (m *MsgSetNameResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetNameResponse) ProtoMessage() {} +func (*MsgSetNameResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{4} +} +func (m *MsgSetNameResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetNameResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetNameResponse.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 *MsgSetNameResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetNameResponse.Merge(m, src) +} +func (m *MsgSetNameResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetNameResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetNameResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetNameResponse proto.InternalMessageInfo + +// MsgReserveName +type MsgReserveAuthority struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` + // if creating a sub-authority. + Owner string `protobuf:"bytes,3,opt,name=owner,proto3" json:"owner,omitempty"` +} + +func (m *MsgReserveAuthority) Reset() { *m = MsgReserveAuthority{} } +func (m *MsgReserveAuthority) String() string { return proto.CompactTextString(m) } +func (*MsgReserveAuthority) ProtoMessage() {} +func (*MsgReserveAuthority) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{5} +} +func (m *MsgReserveAuthority) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReserveAuthority) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReserveAuthority.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 *MsgReserveAuthority) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReserveAuthority.Merge(m, src) +} +func (m *MsgReserveAuthority) XXX_Size() int { + return m.Size() +} +func (m *MsgReserveAuthority) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReserveAuthority.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReserveAuthority proto.InternalMessageInfo + +func (m *MsgReserveAuthority) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgReserveAuthority) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +func (m *MsgReserveAuthority) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +// MsgReserveNameResponse +type MsgReserveAuthorityResponse struct { +} + +func (m *MsgReserveAuthorityResponse) Reset() { *m = MsgReserveAuthorityResponse{} } +func (m *MsgReserveAuthorityResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReserveAuthorityResponse) ProtoMessage() {} +func (*MsgReserveAuthorityResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{6} +} +func (m *MsgReserveAuthorityResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReserveAuthorityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReserveAuthorityResponse.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 *MsgReserveAuthorityResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReserveAuthorityResponse.Merge(m, src) +} +func (m *MsgReserveAuthorityResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReserveAuthorityResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReserveAuthorityResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReserveAuthorityResponse proto.InternalMessageInfo + +// MsgSetAuthorityBond is SDK message for SetAuthorityBond +type MsgSetAuthorityBond struct { + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgSetAuthorityBond) Reset() { *m = MsgSetAuthorityBond{} } +func (m *MsgSetAuthorityBond) String() string { return proto.CompactTextString(m) } +func (*MsgSetAuthorityBond) ProtoMessage() {} +func (*MsgSetAuthorityBond) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{7} +} +func (m *MsgSetAuthorityBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetAuthorityBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetAuthorityBond.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 *MsgSetAuthorityBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetAuthorityBond.Merge(m, src) +} +func (m *MsgSetAuthorityBond) XXX_Size() int { + return m.Size() +} +func (m *MsgSetAuthorityBond) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetAuthorityBond.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSetAuthorityBond proto.InternalMessageInfo + +func (m *MsgSetAuthorityBond) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgSetAuthorityBond) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *MsgSetAuthorityBond) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgSetAuthorityBondResponse +type MsgSetAuthorityBondResponse struct { +} + +func (m *MsgSetAuthorityBondResponse) Reset() { *m = MsgSetAuthorityBondResponse{} } +func (m *MsgSetAuthorityBondResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSetAuthorityBondResponse) ProtoMessage() {} +func (*MsgSetAuthorityBondResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{8} +} +func (m *MsgSetAuthorityBondResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSetAuthorityBondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSetAuthorityBondResponse.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 *MsgSetAuthorityBondResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSetAuthorityBondResponse.Merge(m, src) +} +func (m *MsgSetAuthorityBondResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSetAuthorityBondResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSetAuthorityBondResponse.DiscardUnknown(m) +} + +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"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgDeleteNameAuthority) Reset() { *m = MsgDeleteNameAuthority{} } +func (m *MsgDeleteNameAuthority) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteNameAuthority) ProtoMessage() {} +func (*MsgDeleteNameAuthority) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{9} +} +func (m *MsgDeleteNameAuthority) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteNameAuthority) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteNameAuthority.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 *MsgDeleteNameAuthority) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteNameAuthority.Merge(m, src) +} +func (m *MsgDeleteNameAuthority) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteNameAuthority) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteNameAuthority.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteNameAuthority proto.InternalMessageInfo + +func (m *MsgDeleteNameAuthority) GetWrn() string { + if m != nil { + return m.Wrn + } + return "" +} + +func (m *MsgDeleteNameAuthority) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgDeleteNameAuthorityResponse +type MsgDeleteNameAuthorityResponse struct { +} + +func (m *MsgDeleteNameAuthorityResponse) Reset() { *m = MsgDeleteNameAuthorityResponse{} } +func (m *MsgDeleteNameAuthorityResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDeleteNameAuthorityResponse) ProtoMessage() {} +func (*MsgDeleteNameAuthorityResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{10} +} +func (m *MsgDeleteNameAuthorityResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDeleteNameAuthorityResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDeleteNameAuthorityResponse.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 *MsgDeleteNameAuthorityResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDeleteNameAuthorityResponse.Merge(m, src) +} +func (m *MsgDeleteNameAuthorityResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDeleteNameAuthorityResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDeleteNameAuthorityResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDeleteNameAuthorityResponse proto.InternalMessageInfo + +//MsgRenewRecord is SDK message for Renew a record +type MsgRenewRecord struct { + RecordId string `protobuf:"bytes,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty" json:"recordId" yaml:"recordId"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgRenewRecord) Reset() { *m = MsgRenewRecord{} } +func (m *MsgRenewRecord) String() string { return proto.CompactTextString(m) } +func (*MsgRenewRecord) ProtoMessage() {} +func (*MsgRenewRecord) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{11} +} +func (m *MsgRenewRecord) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRenewRecord) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRenewRecord.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 *MsgRenewRecord) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRenewRecord.Merge(m, src) +} +func (m *MsgRenewRecord) XXX_Size() int { + return m.Size() +} +func (m *MsgRenewRecord) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRenewRecord.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRenewRecord proto.InternalMessageInfo + +func (m *MsgRenewRecord) GetRecordId() string { + if m != nil { + return m.RecordId + } + return "" +} + +func (m *MsgRenewRecord) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgRenewRecordResponse +type MsgRenewRecordResponse struct { +} + +func (m *MsgRenewRecordResponse) Reset() { *m = MsgRenewRecordResponse{} } +func (m *MsgRenewRecordResponse) String() string { return proto.CompactTextString(m) } +func (*MsgRenewRecordResponse) ProtoMessage() {} +func (*MsgRenewRecordResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{12} +} +func (m *MsgRenewRecordResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgRenewRecordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgRenewRecordResponse.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 *MsgRenewRecordResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgRenewRecordResponse.Merge(m, src) +} +func (m *MsgRenewRecordResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgRenewRecordResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgRenewRecordResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgRenewRecordResponse proto.InternalMessageInfo + +// MsgAssociateBond +type MsgAssociateBond struct { + RecordId string `protobuf:"bytes,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty" json:"recordId" yaml:"recordId"` + BondId string `protobuf:"bytes,2,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgAssociateBond) Reset() { *m = MsgAssociateBond{} } +func (m *MsgAssociateBond) String() string { return proto.CompactTextString(m) } +func (*MsgAssociateBond) ProtoMessage() {} +func (*MsgAssociateBond) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{13} +} +func (m *MsgAssociateBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAssociateBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAssociateBond.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 *MsgAssociateBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAssociateBond.Merge(m, src) +} +func (m *MsgAssociateBond) XXX_Size() int { + return m.Size() +} +func (m *MsgAssociateBond) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAssociateBond.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAssociateBond proto.InternalMessageInfo + +func (m *MsgAssociateBond) GetRecordId() string { + if m != nil { + return m.RecordId + } + return "" +} + +func (m *MsgAssociateBond) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *MsgAssociateBond) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgAssociateBondResponse +type MsgAssociateBondResponse struct { +} + +func (m *MsgAssociateBondResponse) Reset() { *m = MsgAssociateBondResponse{} } +func (m *MsgAssociateBondResponse) String() string { return proto.CompactTextString(m) } +func (*MsgAssociateBondResponse) ProtoMessage() {} +func (*MsgAssociateBondResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{14} +} +func (m *MsgAssociateBondResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgAssociateBondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgAssociateBondResponse.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 *MsgAssociateBondResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgAssociateBondResponse.Merge(m, src) +} +func (m *MsgAssociateBondResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgAssociateBondResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgAssociateBondResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgAssociateBondResponse proto.InternalMessageInfo + +// MsgDissociateBond is SDK message for Msg/DissociateBond +type MsgDissociateBond struct { + RecordId string `protobuf:"bytes,1,opt,name=record_id,json=recordId,proto3" json:"record_id,omitempty" json:"recordId" yaml:"recordId"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgDissociateBond) Reset() { *m = MsgDissociateBond{} } +func (m *MsgDissociateBond) String() string { return proto.CompactTextString(m) } +func (*MsgDissociateBond) ProtoMessage() {} +func (*MsgDissociateBond) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{15} +} +func (m *MsgDissociateBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDissociateBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDissociateBond.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 *MsgDissociateBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDissociateBond.Merge(m, src) +} +func (m *MsgDissociateBond) XXX_Size() int { + return m.Size() +} +func (m *MsgDissociateBond) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDissociateBond.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDissociateBond proto.InternalMessageInfo + +func (m *MsgDissociateBond) GetRecordId() string { + if m != nil { + return m.RecordId + } + return "" +} + +func (m *MsgDissociateBond) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgDissociateBondResponse is response type for MsgDissociateBond +type MsgDissociateBondResponse struct { +} + +func (m *MsgDissociateBondResponse) Reset() { *m = MsgDissociateBondResponse{} } +func (m *MsgDissociateBondResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDissociateBondResponse) ProtoMessage() {} +func (*MsgDissociateBondResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{16} +} +func (m *MsgDissociateBondResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDissociateBondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDissociateBondResponse.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 *MsgDissociateBondResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDissociateBondResponse.Merge(m, src) +} +func (m *MsgDissociateBondResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDissociateBondResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDissociateBondResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDissociateBondResponse proto.InternalMessageInfo + +// MsgDissociateRecords is SDK message for Msg/DissociateRecords +type MsgDissociateRecords struct { + BondId string `protobuf:"bytes,1,opt,name=bond_id,json=bondId,proto3" json:"bond_id,omitempty" json:"bondId" yaml:"bondId"` + Signer string `protobuf:"bytes,2,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgDissociateRecords) Reset() { *m = MsgDissociateRecords{} } +func (m *MsgDissociateRecords) String() string { return proto.CompactTextString(m) } +func (*MsgDissociateRecords) ProtoMessage() {} +func (*MsgDissociateRecords) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{17} +} +func (m *MsgDissociateRecords) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDissociateRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDissociateRecords.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 *MsgDissociateRecords) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDissociateRecords.Merge(m, src) +} +func (m *MsgDissociateRecords) XXX_Size() int { + return m.Size() +} +func (m *MsgDissociateRecords) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDissociateRecords.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDissociateRecords proto.InternalMessageInfo + +func (m *MsgDissociateRecords) GetBondId() string { + if m != nil { + return m.BondId + } + return "" +} + +func (m *MsgDissociateRecords) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgDissociateRecordsResponse is response type for MsgDissociateRecords +type MsgDissociateRecordsResponse struct { +} + +func (m *MsgDissociateRecordsResponse) Reset() { *m = MsgDissociateRecordsResponse{} } +func (m *MsgDissociateRecordsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgDissociateRecordsResponse) ProtoMessage() {} +func (*MsgDissociateRecordsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{18} +} +func (m *MsgDissociateRecordsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDissociateRecordsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDissociateRecordsResponse.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 *MsgDissociateRecordsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDissociateRecordsResponse.Merge(m, src) +} +func (m *MsgDissociateRecordsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDissociateRecordsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDissociateRecordsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDissociateRecordsResponse proto.InternalMessageInfo + +// MsgReAssociateRecords is SDK message for Msg/ReAssociateRecords +type MsgReAssociateRecords struct { + NewBondId string `protobuf:"bytes,1,opt,name=new_bond_id,json=newBondId,proto3" json:"new_bond_id,omitempty" json:"newBondId" yaml:"newBondId"` + OldBondId string `protobuf:"bytes,2,opt,name=old_bond_id,json=oldBondId,proto3" json:"old_bond_id,omitempty" json:"oldBondId" yaml:"oldBondId"` + Signer string `protobuf:"bytes,3,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (m *MsgReAssociateRecords) Reset() { *m = MsgReAssociateRecords{} } +func (m *MsgReAssociateRecords) String() string { return proto.CompactTextString(m) } +func (*MsgReAssociateRecords) ProtoMessage() {} +func (*MsgReAssociateRecords) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{19} +} +func (m *MsgReAssociateRecords) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReAssociateRecords) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReAssociateRecords.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 *MsgReAssociateRecords) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReAssociateRecords.Merge(m, src) +} +func (m *MsgReAssociateRecords) XXX_Size() int { + return m.Size() +} +func (m *MsgReAssociateRecords) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReAssociateRecords.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReAssociateRecords proto.InternalMessageInfo + +func (m *MsgReAssociateRecords) GetNewBondId() string { + if m != nil { + return m.NewBondId + } + return "" +} + +func (m *MsgReAssociateRecords) GetOldBondId() string { + if m != nil { + return m.OldBondId + } + return "" +} + +func (m *MsgReAssociateRecords) GetSigner() string { + if m != nil { + return m.Signer + } + return "" +} + +// MsgReAssociateRecordsResponse is response type for MsgReAssociateRecords +type MsgReAssociateRecordsResponse struct { +} + +func (m *MsgReAssociateRecordsResponse) Reset() { *m = MsgReAssociateRecordsResponse{} } +func (m *MsgReAssociateRecordsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgReAssociateRecordsResponse) ProtoMessage() {} +func (*MsgReAssociateRecordsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_b66a805dda801ce9, []int{20} +} +func (m *MsgReAssociateRecordsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgReAssociateRecordsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgReAssociateRecordsResponse.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 *MsgReAssociateRecordsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgReAssociateRecordsResponse.Merge(m, src) +} +func (m *MsgReAssociateRecordsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgReAssociateRecordsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgReAssociateRecordsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgReAssociateRecordsResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgSetRecord)(nil), "vulcanize.nameservice.v1beta1.MsgSetRecord") + proto.RegisterType((*MsgSetRecordResponse)(nil), "vulcanize.nameservice.v1beta1.MsgSetRecordResponse") + proto.RegisterType((*Payload)(nil), "vulcanize.nameservice.v1beta1.Payload") + proto.RegisterType((*MsgSetName)(nil), "vulcanize.nameservice.v1beta1.MsgSetName") + proto.RegisterType((*MsgSetNameResponse)(nil), "vulcanize.nameservice.v1beta1.MsgSetNameResponse") + proto.RegisterType((*MsgReserveAuthority)(nil), "vulcanize.nameservice.v1beta1.MsgReserveAuthority") + proto.RegisterType((*MsgReserveAuthorityResponse)(nil), "vulcanize.nameservice.v1beta1.MsgReserveAuthorityResponse") + proto.RegisterType((*MsgSetAuthorityBond)(nil), "vulcanize.nameservice.v1beta1.MsgSetAuthorityBond") + proto.RegisterType((*MsgSetAuthorityBondResponse)(nil), "vulcanize.nameservice.v1beta1.MsgSetAuthorityBondResponse") + proto.RegisterType((*MsgDeleteNameAuthority)(nil), "vulcanize.nameservice.v1beta1.MsgDeleteNameAuthority") + proto.RegisterType((*MsgDeleteNameAuthorityResponse)(nil), "vulcanize.nameservice.v1beta1.MsgDeleteNameAuthorityResponse") + proto.RegisterType((*MsgRenewRecord)(nil), "vulcanize.nameservice.v1beta1.MsgRenewRecord") + proto.RegisterType((*MsgRenewRecordResponse)(nil), "vulcanize.nameservice.v1beta1.MsgRenewRecordResponse") + proto.RegisterType((*MsgAssociateBond)(nil), "vulcanize.nameservice.v1beta1.MsgAssociateBond") + proto.RegisterType((*MsgAssociateBondResponse)(nil), "vulcanize.nameservice.v1beta1.MsgAssociateBondResponse") + proto.RegisterType((*MsgDissociateBond)(nil), "vulcanize.nameservice.v1beta1.MsgDissociateBond") + proto.RegisterType((*MsgDissociateBondResponse)(nil), "vulcanize.nameservice.v1beta1.MsgDissociateBondResponse") + proto.RegisterType((*MsgDissociateRecords)(nil), "vulcanize.nameservice.v1beta1.MsgDissociateRecords") + proto.RegisterType((*MsgDissociateRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.MsgDissociateRecordsResponse") + proto.RegisterType((*MsgReAssociateRecords)(nil), "vulcanize.nameservice.v1beta1.MsgReAssociateRecords") + proto.RegisterType((*MsgReAssociateRecordsResponse)(nil), "vulcanize.nameservice.v1beta1.MsgReAssociateRecordsResponse") +} + +func init() { + proto.RegisterFile("vulcanize/nameservice/v1beta1/tx.proto", fileDescriptor_b66a805dda801ce9) +} + +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, 0x00, 0xf1, 0x3b, + 0x03, 0xd7, 0x8a, 0x44, 0xdb, 0x47, 0x96, 0x8c, 0xca, 0xd8, 0x54, 0xd9, 0x6d, 0x88, 0x97, 0xb0, + 0xa1, 0x1e, 0xe8, 0x6a, 0x9a, 0xc9, 0x30, 0xd9, 0x44, 0x41, 0xe8, 0xb4, 0x85, 0xa5, 0x43, 0x82, + 0x8d, 0x1d, 0xd1, 0x5e, 0x78, 0xa9, 0x8a, 0x99, 0x96, 0x52, 0xab, 0xfa, 0x5f, 0x72, 0xcc, 0x1d, + 0xb0, 0x8b, 0x10, 0x23, 0xba, 0x66, 0x20, 0x33, 0x3d, 0x63, 0x03, 0x65, 0xef, 0x8b, 0x7d, 0x0e, + 0xf1, 0xba, 0xd2, 0xaa, 0x62, 0x45, 0x4d, 0x47, 0x33, 0x4c, 0x36, 0x99, 0x5f, 0xcb, 0x5d, 0x5a, + 0x5a, 0xee, 0x8d, 0x1b, 0x5d, 0x98, 0x3d, 0x6d, 0x0b, 0x11, 0xb9, 0x0b, 0x16, 0x17, 0x21, 0x45, + 0x2b, 0x95, 0x11, 0xa9, 0x63, 0x83, 0x20, 0xf1, 0x27, 0x03, 0x71, 0x0f, 0xc2, 0xee, 0x42, 0xcc, + 0x74, 0x56, 0x1d, 0xf1, 0xc9, 0xfc, 0xea, 0x08, 0x2a, 0x2f, 0x95, 0x07, 0x62, 0x1b, 0x00, 0xb6, + 0x68, 0xc5, 0x6a, 0x98, 0x88, 0xa4, 0x67, 0x32, 0xd1, 0x6c, 0x32, 0x9f, 0x1d, 0x91, 0x62, 0xbf, + 0x0b, 0x28, 0xac, 0xdb, 0x7a, 0x3b, 0x6d, 0x61, 0xc5, 0x75, 0x2b, 0xc8, 0xd4, 0x75, 0x8c, 0x9a, + 0x91, 0x29, 0x22, 0xf1, 0x05, 0x80, 0x5b, 0xd9, 0x6b, 0xa5, 0x86, 0xd8, 0x79, 0x88, 0x36, 0x4d, + 0xc3, 0x75, 0x5f, 0xb6, 0x87, 0xf6, 0x4c, 0x59, 0x57, 0x3d, 0x5b, 0xed, 0x21, 0xe5, 0x75, 0x94, + 0xf6, 0x5a, 0x4c, 0x01, 0x1b, 0x64, 0xf2, 0x1d, 0x7a, 0x0b, 0x37, 0x8a, 0x44, 0x93, 0x1d, 0xe9, + 0x68, 0xaf, 0x61, 0x55, 0xb0, 0xa9, 0x5b, 0x2d, 0x96, 0x85, 0x59, 0xbb, 0x20, 0x8f, 0xc9, 0x19, + 0x0f, 0xdd, 0xc4, 0x14, 0xfc, 0x87, 0x9b, 0x01, 0x9f, 0xfb, 0x21, 0x2e, 0xc3, 0xd2, 0x80, 0xc4, + 0x3e, 0xef, 0x89, 0xc3, 0xbb, 0x8f, 0x2c, 0x7f, 0xa9, 0x80, 0x0d, 0x75, 0x20, 0x2f, 0x75, 0xec, + 0x66, 0xa6, 0x3d, 0x76, 0x61, 0x2b, 0x5c, 0x6d, 0xbd, 0xe4, 0xbe, 0xb6, 0x02, 0x2c, 0x16, 0x89, + 0xf6, 0x14, 0x55, 0x91, 0x85, 0x6c, 0xb3, 0x02, 0x5b, 0xfa, 0xfd, 0x1f, 0x62, 0x8a, 0x98, 0x01, + 0x7e, 0x70, 0x0e, 0x9f, 0xe5, 0x10, 0xe6, 0x1c, 0x83, 0x0c, 0xd4, 0xf4, 0xfa, 0xeb, 0x09, 0x24, + 0xdc, 0xc3, 0x16, 0x74, 0xd8, 0x4a, 0xa7, 0x2d, 0x08, 0x6e, 0xa9, 0xee, 0x52, 0x50, 0xac, 0xff, + 0x2d, 0xff, 0xdf, 0x1d, 0x0e, 0x55, 0x93, 0x76, 0x2a, 0xa2, 0xb8, 0x7c, 0x15, 0xdf, 0x18, 0x98, + 0x2f, 0x12, 0x6d, 0x8f, 0x10, 0x5c, 0xd6, 0x15, 0x0b, 0x39, 0xbb, 0xf0, 0xef, 0x42, 0xae, 0x7e, + 0xcf, 0x38, 0x48, 0xf7, 0xea, 0xf4, 0x8b, 0xa8, 0xc1, 0x82, 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, +} + +// Reference imports to suppress errors if they are not otherwise used. +var _ context.Context +var _ grpc.ClientConn + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the grpc package it is being compiled against. +const _ = grpc.SupportPackageIsVersion4 + +// MsgClient is the client API for Msg service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type MsgClient interface { + // SetRecord will records a new record with given payload and bond id + SetRecord(ctx context.Context, in *MsgSetRecord, opts ...grpc.CallOption) (*MsgSetRecordResponse, error) + // Renew Record will renew the expire record + RenewRecord(ctx context.Context, in *MsgRenewRecord, opts ...grpc.CallOption) (*MsgRenewRecordResponse, error) + // AssociateBond + AssociateBond(ctx context.Context, in *MsgAssociateBond, opts ...grpc.CallOption) (*MsgAssociateBondResponse, error) + // DissociateBond + DissociateBond(ctx context.Context, in *MsgDissociateBond, opts ...grpc.CallOption) (*MsgDissociateBondResponse, error) + // DissociateRecords + 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(ctx context.Context, in *MsgSetName, opts ...grpc.CallOption) (*MsgSetNameResponse, error) + // Reserve name + ReserveName(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error) + // Delete Name method will remove authority name + DeleteName(ctx context.Context, in *MsgDeleteNameAuthority, opts ...grpc.CallOption) (*MsgDeleteNameAuthorityResponse, error) + // SetAuthorityBond + SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBond, opts ...grpc.CallOption) (*MsgSetAuthorityBondResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) SetRecord(ctx context.Context, in *MsgSetRecord, opts ...grpc.CallOption) (*MsgSetRecordResponse, error) { + out := new(MsgSetRecordResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/SetRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) RenewRecord(ctx context.Context, in *MsgRenewRecord, opts ...grpc.CallOption) (*MsgRenewRecordResponse, error) { + out := new(MsgRenewRecordResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/RenewRecord", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) AssociateBond(ctx context.Context, in *MsgAssociateBond, opts ...grpc.CallOption) (*MsgAssociateBondResponse, error) { + out := new(MsgAssociateBondResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/AssociateBond", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DissociateBond(ctx context.Context, in *MsgDissociateBond, opts ...grpc.CallOption) (*MsgDissociateBondResponse, error) { + out := new(MsgDissociateBondResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/DissociateBond", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DissociateRecords(ctx context.Context, in *MsgDissociateRecords, opts ...grpc.CallOption) (*MsgDissociateRecordsResponse, error) { + out := new(MsgDissociateRecordsResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/DissociateRecords", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ReAssociateRecords(ctx context.Context, in *MsgReAssociateRecords, opts ...grpc.CallOption) (*MsgReAssociateRecordsResponse, error) { + out := new(MsgReAssociateRecordsResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/ReAssociateRecords", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetName(ctx context.Context, in *MsgSetName, opts ...grpc.CallOption) (*MsgSetNameResponse, error) { + out := new(MsgSetNameResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/SetName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) ReserveName(ctx context.Context, in *MsgReserveAuthority, opts ...grpc.CallOption) (*MsgReserveAuthorityResponse, error) { + out := new(MsgReserveAuthorityResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/ReserveName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) DeleteName(ctx context.Context, in *MsgDeleteNameAuthority, opts ...grpc.CallOption) (*MsgDeleteNameAuthorityResponse, error) { + out := new(MsgDeleteNameAuthorityResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/DeleteName", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) SetAuthorityBond(ctx context.Context, in *MsgSetAuthorityBond, opts ...grpc.CallOption) (*MsgSetAuthorityBondResponse, error) { + out := new(MsgSetAuthorityBondResponse) + err := c.cc.Invoke(ctx, "/vulcanize.nameservice.v1beta1.Msg/SetAuthorityBond", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + // SetRecord will records a new record with given payload and bond id + SetRecord(context.Context, *MsgSetRecord) (*MsgSetRecordResponse, error) + // Renew Record will renew the expire record + RenewRecord(context.Context, *MsgRenewRecord) (*MsgRenewRecordResponse, error) + // AssociateBond + AssociateBond(context.Context, *MsgAssociateBond) (*MsgAssociateBondResponse, error) + // DissociateBond + DissociateBond(context.Context, *MsgDissociateBond) (*MsgDissociateBondResponse, error) + // DissociateRecords + DissociateRecords(context.Context, *MsgDissociateRecords) (*MsgDissociateRecordsResponse, error) + // ReAssociateRecords + ReAssociateRecords(context.Context, *MsgReAssociateRecords) (*MsgReAssociateRecordsResponse, error) + // SetName will store the name with given wrn and name + SetName(context.Context, *MsgSetName) (*MsgSetNameResponse, error) + // Reserve name + ReserveName(context.Context, *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error) + // Delete Name method will remove authority name + DeleteName(context.Context, *MsgDeleteNameAuthority) (*MsgDeleteNameAuthorityResponse, error) + // SetAuthorityBond + SetAuthorityBond(context.Context, *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) SetRecord(ctx context.Context, req *MsgSetRecord) (*MsgSetRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetRecord not implemented") +} +func (*UnimplementedMsgServer) RenewRecord(ctx context.Context, req *MsgRenewRecord) (*MsgRenewRecordResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RenewRecord not implemented") +} +func (*UnimplementedMsgServer) AssociateBond(ctx context.Context, req *MsgAssociateBond) (*MsgAssociateBondResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AssociateBond not implemented") +} +func (*UnimplementedMsgServer) DissociateBond(ctx context.Context, req *MsgDissociateBond) (*MsgDissociateBondResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DissociateBond not implemented") +} +func (*UnimplementedMsgServer) DissociateRecords(ctx context.Context, req *MsgDissociateRecords) (*MsgDissociateRecordsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DissociateRecords not implemented") +} +func (*UnimplementedMsgServer) ReAssociateRecords(ctx context.Context, req *MsgReAssociateRecords) (*MsgReAssociateRecordsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReAssociateRecords not implemented") +} +func (*UnimplementedMsgServer) SetName(ctx context.Context, req *MsgSetName) (*MsgSetNameResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetName not implemented") +} +func (*UnimplementedMsgServer) ReserveName(ctx context.Context, req *MsgReserveAuthority) (*MsgReserveAuthorityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ReserveName not implemented") +} +func (*UnimplementedMsgServer) DeleteName(ctx context.Context, req *MsgDeleteNameAuthority) (*MsgDeleteNameAuthorityResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method DeleteName not implemented") +} +func (*UnimplementedMsgServer) SetAuthorityBond(ctx context.Context, req *MsgSetAuthorityBond) (*MsgSetAuthorityBondResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SetAuthorityBond not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_SetRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetRecord) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/SetRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetRecord(ctx, req.(*MsgSetRecord)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_RenewRecord_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgRenewRecord) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).RenewRecord(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/RenewRecord", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).RenewRecord(ctx, req.(*MsgRenewRecord)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_AssociateBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgAssociateBond) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).AssociateBond(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/AssociateBond", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).AssociateBond(ctx, req.(*MsgAssociateBond)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DissociateBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDissociateBond) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DissociateBond(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/DissociateBond", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DissociateBond(ctx, req.(*MsgDissociateBond)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DissociateRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDissociateRecords) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DissociateRecords(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/DissociateRecords", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DissociateRecords(ctx, req.(*MsgDissociateRecords)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ReAssociateRecords_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReAssociateRecords) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReAssociateRecords(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/ReAssociateRecords", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReAssociateRecords(ctx, req.(*MsgReAssociateRecords)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetName) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/SetName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetName(ctx, req.(*MsgSetName)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_ReserveName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgReserveAuthority) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ReserveName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/ReserveName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ReserveName(ctx, req.(*MsgReserveAuthority)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_DeleteName_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgDeleteNameAuthority) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).DeleteName(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/DeleteName", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).DeleteName(ctx, req.(*MsgDeleteNameAuthority)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_SetAuthorityBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSetAuthorityBond) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SetAuthorityBond(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/vulcanize.nameservice.v1beta1.Msg/SetAuthorityBond", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SetAuthorityBond(ctx, req.(*MsgSetAuthorityBond)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "vulcanize.nameservice.v1beta1.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "SetRecord", + Handler: _Msg_SetRecord_Handler, + }, + { + MethodName: "RenewRecord", + Handler: _Msg_RenewRecord_Handler, + }, + { + MethodName: "AssociateBond", + Handler: _Msg_AssociateBond_Handler, + }, + { + MethodName: "DissociateBond", + Handler: _Msg_DissociateBond_Handler, + }, + { + MethodName: "DissociateRecords", + Handler: _Msg_DissociateRecords_Handler, + }, + { + MethodName: "ReAssociateRecords", + Handler: _Msg_ReAssociateRecords_Handler, + }, + { + MethodName: "SetName", + Handler: _Msg_SetName_Handler, + }, + { + MethodName: "ReserveName", + Handler: _Msg_ReserveName_Handler, + }, + { + MethodName: "DeleteName", + Handler: _Msg_DeleteName_Handler, + }, + { + MethodName: "SetAuthorityBond", + Handler: _Msg_SetAuthorityBond_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "vulcanize/nameservice/v1beta1/tx.proto", +} + +func (m *MsgSetRecord) 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 *MsgSetRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Payload.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.BondId) > 0 { + i -= len(m.BondId) + copy(dAtA[i:], m.BondId) + i = encodeVarintTx(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetRecordResponse) 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 *MsgSetRecordResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *Payload) 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 *Payload) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Payload) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signatures) > 0 { + for iNdEx := len(m.Signatures) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Signatures[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.Record != nil { + { + size, err := m.Record.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetName) 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 *MsgSetName) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetName) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.Cid) > 0 { + i -= len(m.Cid) + copy(dAtA[i:], m.Cid) + i = encodeVarintTx(dAtA, i, uint64(len(m.Cid))) + 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetNameResponse) 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 *MsgSetNameResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetNameResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgReserveAuthority) 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 *MsgReserveAuthority) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReserveAuthority) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x1a + } + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReserveAuthorityResponse) 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 *MsgReserveAuthorityResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReserveAuthorityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgSetAuthorityBond) 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 *MsgSetAuthorityBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetAuthorityBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.BondId) > 0 { + i -= len(m.BondId) + copy(dAtA[i:], m.BondId) + i = encodeVarintTx(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Name) > 0 { + i -= len(m.Name) + copy(dAtA[i:], m.Name) + i = encodeVarintTx(dAtA, i, uint64(len(m.Name))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgSetAuthorityBondResponse) 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 *MsgSetAuthorityBondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSetAuthorityBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDeleteNameAuthority) 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 *MsgDeleteNameAuthority) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteNameAuthority) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + 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))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDeleteNameAuthorityResponse) 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 *MsgDeleteNameAuthorityResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDeleteNameAuthorityResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgRenewRecord) 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 *MsgRenewRecord) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRenewRecord) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.RecordId) > 0 { + i -= len(m.RecordId) + copy(dAtA[i:], m.RecordId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RecordId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgRenewRecordResponse) 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 *MsgRenewRecordResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgRenewRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgAssociateBond) 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 *MsgAssociateBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAssociateBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.BondId) > 0 { + i -= len(m.BondId) + copy(dAtA[i:], m.BondId) + i = encodeVarintTx(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0x12 + } + if len(m.RecordId) > 0 { + i -= len(m.RecordId) + copy(dAtA[i:], m.RecordId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RecordId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgAssociateBondResponse) 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 *MsgAssociateBondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgAssociateBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDissociateBond) 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 *MsgDissociateBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDissociateBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.RecordId) > 0 { + i -= len(m.RecordId) + copy(dAtA[i:], m.RecordId) + i = encodeVarintTx(dAtA, i, uint64(len(m.RecordId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDissociateBondResponse) 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 *MsgDissociateBondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDissociateBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDissociateRecords) 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 *MsgDissociateRecords) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDissociateRecords) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x12 + } + if len(m.BondId) > 0 { + i -= len(m.BondId) + copy(dAtA[i:], m.BondId) + i = encodeVarintTx(dAtA, i, uint64(len(m.BondId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgDissociateRecordsResponse) 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 *MsgDissociateRecordsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDissociateRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgReAssociateRecords) 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 *MsgReAssociateRecords) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReAssociateRecords) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signer) > 0 { + i -= len(m.Signer) + copy(dAtA[i:], m.Signer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signer))) + i-- + dAtA[i] = 0x1a + } + if len(m.OldBondId) > 0 { + i -= len(m.OldBondId) + copy(dAtA[i:], m.OldBondId) + i = encodeVarintTx(dAtA, i, uint64(len(m.OldBondId))) + i-- + dAtA[i] = 0x12 + } + if len(m.NewBondId) > 0 { + i -= len(m.NewBondId) + copy(dAtA[i:], m.NewBondId) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewBondId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgReAssociateRecordsResponse) 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 *MsgReAssociateRecordsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgReAssociateRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgSetRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BondId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Payload.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgSetRecordResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *Payload) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Record != nil { + l = m.Record.Size() + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Signatures) > 0 { + for _, e := range m.Signatures { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgSetName) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Wrn) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Cid) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetNameResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgReserveAuthority) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgReserveAuthorityResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgSetAuthorityBond) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BondId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSetAuthorityBondResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDeleteNameAuthority) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Wrn) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDeleteNameAuthorityResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgRenewRecord) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RecordId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgRenewRecordResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgAssociateBond) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RecordId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.BondId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgAssociateBondResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDissociateBond) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RecordId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDissociateBondResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDissociateRecords) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.BondId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgDissociateRecordsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgReAssociateRecords) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NewBondId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.OldBondId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgReAssociateRecordsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSetRecord) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", 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.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Payload", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Payload.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetRecordResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetRecordResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Payload) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Payload: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Payload: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Record", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Record == nil { + m.Record = &Record{} + } + if err := m.Record.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signatures", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signatures = append(m.Signatures, Signature{}) + if err := m.Signatures[len(m.Signatures)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetName) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetName: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetName: 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) + } + 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.Wrn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Cid", 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.Cid = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetNameResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetNameResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetNameResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReserveAuthority) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReserveAuthority: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReserveAuthority: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReserveAuthorityResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReserveAuthorityResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReserveAuthorityResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetAuthorityBond) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetAuthorityBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetAuthorityBond: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Name", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Name = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", 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.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSetAuthorityBondResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSetAuthorityBondResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSetAuthorityBondResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteNameAuthority) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDeleteNameAuthority: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteNameAuthority: 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) + } + 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.Wrn = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDeleteNameAuthorityResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDeleteNameAuthorityResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDeleteNameAuthorityResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRenewRecord) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRenewRecord: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRenewRecord: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", 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.RecordId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgRenewRecordResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgRenewRecordResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgRenewRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAssociateBond) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssociateBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssociateBond: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", 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.RecordId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", 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.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgAssociateBondResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgAssociateBondResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgAssociateBondResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDissociateBond) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDissociateBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDissociateBond: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RecordId", 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.RecordId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDissociateBondResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDissociateBondResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDissociateBondResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDissociateRecords) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDissociateRecords: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDissociateRecords: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondId", 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.BondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgDissociateRecordsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgDissociateRecordsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDissociateRecordsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReAssociateRecords) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReAssociateRecords: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReAssociateRecords: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewBondId", 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.NewBondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OldBondId", 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.OldBondId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signer", 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.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgReAssociateRecordsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgReAssociateRecordsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgReAssociateRecordsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/x/nameservice/types/types.go b/x/nameservice/types/types.go new file mode 100644 index 00000000..d2baba1d --- /dev/null +++ b/x/nameservice/types/types.go @@ -0,0 +1,132 @@ +package types + +import ( + "crypto/sha256" + canonicalJson "github.com/gibson042/canonicaljson-go" + "github.com/tharsis/ethermint/x/nameservice/helpers" + "time" +) + +const ( + AuthorityActive = "active" + AuthorityExpired = "expired" + AuthorityUnderAuction = "auction" +) + +// PayloadType represents a signed record payload that can be serialized from/to YAML. +type PayloadType struct { + Record map[string]interface{} `json:"record"` + Signatures []Signature `json:"signatures"` +} + +// ToPayload converts PayloadType to Payload object. +// Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. +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), + }, + Signatures: payloadObj.Signatures, + } + return payload +} + +// ToReadablePayload converts Payload to PayloadType +// It will unmarshal with record attributes +func (payload Payload) ToReadablePayload() PayloadType { + var payloadType PayloadType + + payloadType.Record = helpers.UnMarshalMapFromJSONBytes(payload.Record.Attributes) + + payloadType.Signatures = payload.Signatures + + return payloadType +} + +// Record to Record Type for human-readable attributes + +func (r *Record) ToRecordType() RecordType { + var resourceObj RecordType + + resourceObj.Id = r.Id + resourceObj.BondId = r.BondId + resourceObj.CreateTime = r.CreateTime + resourceObj.ExpiryTime = r.ExpiryTime + resourceObj.Deleted = r.Deleted + resourceObj.Owners = r.Owners + resourceObj.Attributes = helpers.UnMarshalMapFromJSONBytes(r.Attributes) + + return resourceObj +} + +// RecordType represents a WNS record. +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"` + Deleted bool `json:"deleted,omitempty"` + Owners []string `json:"owners,omitempty"` + Attributes map[string]interface{} `json:"attributes,omitempty"` +} + +// ToRecordObj converts Record to RecordObj. +// Why? Because go-amino can't handle maps: https://github.com/tendermint/go-amino/issues/4. +func (r *RecordType) ToRecordObj() Record { + var resourceObj Record + + resourceObj.Id = r.Id + resourceObj.BondId = r.BondId + resourceObj.CreateTime = r.CreateTime + resourceObj.ExpiryTime = r.ExpiryTime + resourceObj.Deleted = r.Deleted + resourceObj.Owners = r.Owners + resourceObj.Attributes = helpers.MarshalMapToJSONBytes(r.Attributes) + + return resourceObj +} + +// CanonicalJSON returns the canonical JSON representation of the record. +func (r *RecordType) CanonicalJSON() []byte { + bytes, err := canonicalJson.Marshal(r.Attributes) + if err != nil { + panic("Record marshal error.") + } + + return bytes +} + +// GetSignBytes generates a record hash to be signed. +func (r *RecordType) GetSignBytes() ([]byte, []byte) { + // Double SHA256 hash. + + // Input to the first round of hashing. + bytes := r.CanonicalJSON() + + // First round. + first := sha256.New() + first.Write(bytes) + firstHash := first.Sum(nil) + + // Second round of hashing takes as input the output of the first round. + second := sha256.New() + second.Write(firstHash) + secondHash := second.Sum(nil) + + return secondHash, bytes +} + +// GetCID gets the record CID. +func (r *RecordType) GetCID() (string, error) { + id, err := helpers.GetCid(r.CanonicalJSON()) + if err != nil { + return "", err + } + + return id, nil +}