From c9548c28379a79605e1aab9c308b302c21498e31 Mon Sep 17 00:00:00 2001 From: tarumi Date: Thu, 9 Nov 2023 16:07:41 +0100 Subject: [PATCH] format proto --- buf.yaml | 7 +++ proto/mycel/epochs/epoch_info.proto | 17 +++--- proto/mycel/epochs/genesis.proto | 3 +- proto/mycel/epochs/params.proto | 1 - proto/mycel/epochs/query.proto | 24 +++----- proto/mycel/epochs/tx.proto | 2 +- proto/mycel/furnace/burn_amount.proto | 14 ++--- proto/mycel/furnace/epoch_burn_config.proto | 3 +- proto/mycel/furnace/genesis.proto | 12 ++-- proto/mycel/furnace/params.proto | 1 - proto/mycel/furnace/query.proto | 33 +++++------ proto/mycel/furnace/tx.proto | 2 +- proto/mycel/registry/domain_ownership.proto | 3 +- proto/mycel/registry/genesis.proto | 11 ++-- proto/mycel/registry/network_name.proto | 12 ++-- proto/mycel/registry/query.proto | 56 ++++++++----------- proto/mycel/registry/role.proto | 2 +- .../mycel/registry/second_level_domain.proto | 9 ++- proto/mycel/registry/subdomain_config.proto | 1 - proto/mycel/registry/top_level_domain.proto | 10 ++-- proto/mycel/registry/tx.proto | 53 +++++++++--------- proto/mycel/resolver/params.proto | 1 - proto/mycel/resolver/query.proto | 37 +++++------- proto/mycel/resolver/tx.proto | 2 +- 24 files changed, 139 insertions(+), 177 deletions(-) create mode 100644 buf.yaml diff --git a/buf.yaml b/buf.yaml new file mode 100644 index 00000000..1a519456 --- /dev/null +++ b/buf.yaml @@ -0,0 +1,7 @@ +version: v1 +breaking: + use: + - FILE +lint: + use: + - DEFAULT diff --git a/proto/mycel/epochs/epoch_info.proto b/proto/mycel/epochs/epoch_info.proto index 5635f448..1d0a98c8 100644 --- a/proto/mycel/epochs/epoch_info.proto +++ b/proto/mycel/epochs/epoch_info.proto @@ -8,25 +8,24 @@ import "google/protobuf/timestamp.proto"; option go_package = "github.com/mycel-domain/mycel/x/epochs/types"; message EpochInfo { - string identifier = 1; + string identifier = 1; google.protobuf.Timestamp startTime = 2 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"start_time\"" ]; - google.protobuf.Duration duration = 3[ + google.protobuf.Duration duration = 3 [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true, (gogoproto.jsontag) = "duration,omitempty", (gogoproto.moretags) = "yaml:\"duration\"" - ]; - int64 currentEpoch = 4; - google.protobuf.Timestamp currentEpochStartTime = 5[ + ]; + int64 currentEpoch = 4; + google.protobuf.Timestamp currentEpochStartTime = 5 [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"current_epoch_start_time\"" - ]; - bool epochCountingStarted = 6; - int64 currentEpochStartHeight = 7; + ]; + bool epochCountingStarted = 6; + int64 currentEpochStartHeight = 7; } - diff --git a/proto/mycel/epochs/genesis.proto b/proto/mycel/epochs/genesis.proto index b29ecc79..83d042a4 100644 --- a/proto/mycel/epochs/genesis.proto +++ b/proto/mycel/epochs/genesis.proto @@ -2,8 +2,8 @@ syntax = "proto3"; package mycel.epochs; import "gogoproto/gogo.proto"; -import "mycel/epochs/params.proto"; import "mycel/epochs/epoch_info.proto"; +import "mycel/epochs/params.proto"; option go_package = "github.com/mycel-domain/mycel/x/epochs/types"; @@ -11,4 +11,3 @@ option go_package = "github.com/mycel-domain/mycel/x/epochs/types"; message GenesisState { repeated EpochInfo epochs = 1 [(gogoproto.nullable) = false]; } - diff --git a/proto/mycel/epochs/params.proto b/proto/mycel/epochs/params.proto index 359761d1..70723e5b 100644 --- a/proto/mycel/epochs/params.proto +++ b/proto/mycel/epochs/params.proto @@ -8,5 +8,4 @@ option go_package = "github.com/mycel-domain/mycel/x/epochs/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - } diff --git a/proto/mycel/epochs/query.proto b/proto/mycel/epochs/query.proto index add884ab..63b1d77b 100644 --- a/proto/mycel/epochs/query.proto +++ b/proto/mycel/epochs/query.proto @@ -1,40 +1,35 @@ syntax = "proto3"; - package mycel.epochs; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "mycel/epochs/params.proto"; import "mycel/epochs/epoch_info.proto"; +import "mycel/epochs/params.proto"; option go_package = "github.com/mycel-domain/mycel/x/epochs/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/mycel/epochs/params"; - } - + // Queries a list of EpochInfo items. - rpc EpochInfo (QueryGetEpochInfoRequest) returns (QueryGetEpochInfoResponse) { + rpc EpochInfo(QueryGetEpochInfoRequest) returns (QueryGetEpochInfoResponse) { option (google.api.http).get = "/mycel/epochs/epoch_info/{identifier}"; - } - rpc EpochInfoAll (QueryAllEpochInfoRequest) returns (QueryAllEpochInfoResponse) { + rpc EpochInfoAll(QueryAllEpochInfoRequest) returns (QueryAllEpochInfoResponse) { option (google.api.http).get = "/mycel/epochs/epoch_info"; - } } + // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } @@ -52,7 +47,6 @@ message QueryAllEpochInfoRequest { } message QueryAllEpochInfoResponse { - repeated EpochInfo epochInfo = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated EpochInfo epochInfo = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } - diff --git a/proto/mycel/epochs/tx.proto b/proto/mycel/epochs/tx.proto index 0af4c662..296243af 100644 --- a/proto/mycel/epochs/tx.proto +++ b/proto/mycel/epochs/tx.proto @@ -4,4 +4,4 @@ package mycel.epochs; option go_package = "github.com/mycel-domain/mycel/x/epochs/types"; // Msg defines the Msg service. -service Msg {} \ No newline at end of file +service Msg {} diff --git a/proto/mycel/furnace/burn_amount.proto b/proto/mycel/furnace/burn_amount.proto index 67b14d55..9cca7c6e 100644 --- a/proto/mycel/furnace/burn_amount.proto +++ b/proto/mycel/furnace/burn_amount.proto @@ -1,16 +1,16 @@ syntax = "proto3"; package mycel.furnace; +import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; + option go_package = "github.com/mycel-domain/mycel/x/furnace/types"; -import "gogoproto/gogo.proto"; -import "cosmos/base/v1beta1/coin.proto"; message BurnAmount { - uint64 index = 1; - bool burnStarted = 2; + uint64 index = 1; + bool burnStarted = 2; uint64 totalEpochs = 3; uint64 currentEpoch = 4; - cosmos.base.v1beta1.Coin totalBurnAmount = 5 [(gogoproto.nullable) = false]; - cosmos.base.v1beta1.Coin cumulativeBurntAmount = 6 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin totalBurnAmount = 5 [(gogoproto.nullable) = false]; + cosmos.base.v1beta1.Coin cumulativeBurntAmount = 6 [(gogoproto.nullable) = false]; } - diff --git a/proto/mycel/furnace/epoch_burn_config.proto b/proto/mycel/furnace/epoch_burn_config.proto index 3bbcfb43..fffba7a0 100644 --- a/proto/mycel/furnace/epoch_burn_config.proto +++ b/proto/mycel/furnace/epoch_burn_config.proto @@ -1,7 +1,6 @@ syntax = "proto3"; package mycel.furnace; - import "gogoproto/gogo.proto"; import "google/protobuf/duration.proto"; import "google/protobuf/timestamp.proto"; @@ -9,7 +8,7 @@ import "google/protobuf/timestamp.proto"; option go_package = "github.com/mycel-domain/mycel/x/furnace/types"; message EpochBurnConfig { - string epochIdentifier = 1; + string epochIdentifier = 1; uint64 currentBurnAmountIndex = 2; uint64 defaultTotalEpochs = 3; google.protobuf.Timestamp startTime = 4 [ diff --git a/proto/mycel/furnace/genesis.proto b/proto/mycel/furnace/genesis.proto index 3b247ec6..f8e0601c 100644 --- a/proto/mycel/furnace/genesis.proto +++ b/proto/mycel/furnace/genesis.proto @@ -1,18 +1,16 @@ syntax = "proto3"; - package mycel.furnace; import "gogoproto/gogo.proto"; -import "mycel/furnace/params.proto"; -import "mycel/furnace/epoch_burn_config.proto"; import "mycel/furnace/burn_amount.proto"; +import "mycel/furnace/epoch_burn_config.proto"; +import "mycel/furnace/params.proto"; option go_package = "github.com/mycel-domain/mycel/x/furnace/types"; // GenesisState defines the furnace module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - EpochBurnConfig epochBurnConfig = 2 [(gogoproto.nullable) = false]; - repeated BurnAmount burnAmounts = 3 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false]; + EpochBurnConfig epochBurnConfig = 2 [(gogoproto.nullable) = false]; + repeated BurnAmount burnAmounts = 3 [(gogoproto.nullable) = false]; } - diff --git a/proto/mycel/furnace/params.proto b/proto/mycel/furnace/params.proto index 5fbdc34f..668cb7cc 100644 --- a/proto/mycel/furnace/params.proto +++ b/proto/mycel/furnace/params.proto @@ -8,5 +8,4 @@ option go_package = "github.com/mycel-domain/mycel/x/furnace/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - } diff --git a/proto/mycel/furnace/query.proto b/proto/mycel/furnace/query.proto index 05f8fa3d..93533168 100644 --- a/proto/mycel/furnace/query.proto +++ b/proto/mycel/furnace/query.proto @@ -1,48 +1,42 @@ syntax = "proto3"; - package mycel.furnace; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "mycel/furnace/params.proto"; -import "mycel/furnace/epoch_burn_config.proto"; import "mycel/furnace/burn_amount.proto"; -import "cosmos/base/v1beta1/coin.proto"; +import "mycel/furnace/epoch_burn_config.proto"; +import "mycel/furnace/params.proto"; option go_package = "github.com/mycel-domain/mycel/x/furnace/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/mycel-domain/mycel/furnace/params"; - } - + // Queries a EpochBurnConfig by index. - rpc EpochBurnConfig (QueryGetEpochBurnConfigRequest) returns (QueryGetEpochBurnConfigResponse) { + rpc EpochBurnConfig(QueryGetEpochBurnConfigRequest) returns (QueryGetEpochBurnConfigResponse) { option (google.api.http).get = "/mycel-domain/mycel/furnace/epoch_burn_config"; - } - + // Queries a list of BurnAmount items. - rpc BurnAmount (QueryGetBurnAmountRequest) returns (QueryGetBurnAmountResponse) { + rpc BurnAmount(QueryGetBurnAmountRequest) returns (QueryGetBurnAmountResponse) { option (google.api.http).get = "/mycel-domain/mycel/furnace/burn_amount/{index}"; - } - rpc BurnAmountAll (QueryAllBurnAmountRequest) returns (QueryAllBurnAmountResponse) { + rpc BurnAmountAll(QueryAllBurnAmountRequest) returns (QueryAllBurnAmountResponse) { option (google.api.http).get = "/mycel-domain/mycel/furnace/burn_amount"; - } } + // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } @@ -66,7 +60,6 @@ message QueryAllBurnAmountRequest { } message QueryAllBurnAmountResponse { - repeated BurnAmount burnAmount = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated BurnAmount burnAmount = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } - diff --git a/proto/mycel/furnace/tx.proto b/proto/mycel/furnace/tx.proto index 8f2c7dea..220d8237 100644 --- a/proto/mycel/furnace/tx.proto +++ b/proto/mycel/furnace/tx.proto @@ -4,4 +4,4 @@ package mycel.furnace; option go_package = "github.com/mycel-domain/mycel/x/furnace/types"; // Msg defines the Msg service. -service Msg {} \ No newline at end of file +service Msg {} diff --git a/proto/mycel/registry/domain_ownership.proto b/proto/mycel/registry/domain_ownership.proto index 34e5f6bc..baea7772 100644 --- a/proto/mycel/registry/domain_ownership.proto +++ b/proto/mycel/registry/domain_ownership.proto @@ -1,9 +1,10 @@ syntax = "proto3"; package mycel.registry; -option go_package = "github.com/mycel-domain/mycel/x/registry/types"; import "cosmos_proto/cosmos.proto"; +option go_package = "github.com/mycel-domain/mycel/x/registry/types"; + message OwnedDomain { string name = 1; string parent = 2; diff --git a/proto/mycel/registry/genesis.proto b/proto/mycel/registry/genesis.proto index 8b67c43f..2fa17500 100644 --- a/proto/mycel/registry/genesis.proto +++ b/proto/mycel/registry/genesis.proto @@ -1,19 +1,18 @@ syntax = "proto3"; - package mycel.registry; import "gogoproto/gogo.proto"; +import "mycel/registry/domain_ownership.proto"; import "mycel/registry/params.proto"; -import "mycel/registry/top_level_domain.proto"; import "mycel/registry/second_level_domain.proto"; -import "mycel/registry/domain_ownership.proto"; +import "mycel/registry/top_level_domain.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; // GenesisState defines the registry module's genesis state. message GenesisState { - Params params = 1 [(gogoproto.nullable) = false]; - repeated TopLevelDomain topLevelDomains = 2 [(gogoproto.nullable) = false]; + Params params = 1 [(gogoproto.nullable) = false]; + repeated TopLevelDomain topLevelDomains = 2 [(gogoproto.nullable) = false]; repeated SecondLevelDomain secondLevelDomains = 3 [(gogoproto.nullable) = false]; - repeated DomainOwnership domainOwnerships = 4 [(gogoproto.nullable) = false]; + repeated DomainOwnership domainOwnerships = 4 [(gogoproto.nullable) = false]; } diff --git a/proto/mycel/registry/network_name.proto b/proto/mycel/registry/network_name.proto index 6bff472e..e748ff82 100644 --- a/proto/mycel/registry/network_name.proto +++ b/proto/mycel/registry/network_name.proto @@ -38,24 +38,20 @@ enum NetworkName { //Shardeum // SHARDEUM_MAINNET_ = 20015; // SHARDEUM_TESTNET_ = 20016; - SHARDEUM_BETANET_SPHINX= 20017; + SHARDEUM_BETANET_SPHINX = 20017; // Zetachain // ZETA_MAINNET_MAINNET = 20018; ZETA_TESTNET_ATHENS = 20019; - - // MOVE 3xxxx //Aptos APTOS_MAINNET_MAINNET = 30000; - APTOS_TESTNET_TESTNET = 30001; + APTOS_TESTNET_TESTNET = 30001; // Sui SUI_MAINNET_MAINNET = 30002; - SUI_TESTNET_TESTNET = 30003; + SUI_TESTNET_TESTNET = 30003; // SOLANA 4xxxx SOLANA_MAINNET_MAINNET = 40000; - SOLANA_TESTNET_TESTNET = 40001; + SOLANA_TESTNET_TESTNET = 40001; } - - diff --git a/proto/mycel/registry/query.proto b/proto/mycel/registry/query.proto index 8f20cd68..e3ddefb0 100644 --- a/proto/mycel/registry/query.proto +++ b/proto/mycel/registry/query.proto @@ -1,70 +1,60 @@ syntax = "proto3"; - package mycel.registry; +import "cosmos/base/query/v1beta1/pagination.proto"; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; -import "google/protobuf/timestamp.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; +import "google/protobuf/timestamp.proto"; +import "mycel/registry/domain_ownership.proto"; import "mycel/registry/params.proto"; -import "mycel/registry/top_level_domain.proto"; import "mycel/registry/second_level_domain.proto"; -import "mycel/registry/domain_ownership.proto"; -import "cosmos/base/v1beta1/coin.proto"; +import "mycel/registry/top_level_domain.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/mycel/registry/params"; - } // Queries a list of TopLevelDomain items. - rpc TopLevelDomain (QueryGetTopLevelDomainRequest) returns (QueryGetTopLevelDomainResponse) { + rpc TopLevelDomain(QueryGetTopLevelDomainRequest) returns (QueryGetTopLevelDomainResponse) { option (google.api.http).get = "/mycel-domain/mycel/registry/top_level_domain/{name}"; - } - rpc TopLevelDomainAll (QueryAllTopLevelDomainRequest) returns (QueryAllTopLevelDomainResponse) { + rpc TopLevelDomainAll(QueryAllTopLevelDomainRequest) returns (QueryAllTopLevelDomainResponse) { option (google.api.http).get = "/mycel-domain/mycel/registry/top_level_domain"; - } // Queries a list of SecondLevelDomain items. - rpc SecondLevelDomain (QueryGetSecondLevelDomainRequest) returns (QueryGetSecondLevelDomainResponse) { + rpc SecondLevelDomain(QueryGetSecondLevelDomainRequest) returns (QueryGetSecondLevelDomainResponse) { option (google.api.http).get = "/mycel/registry/second_level_domain/{name}/{parent}"; - } - rpc SecondLevelDomainAll (QueryAllSecondLevelDomainRequest) returns (QueryAllSecondLevelDomainResponse) { + rpc SecondLevelDomainAll(QueryAllSecondLevelDomainRequest) returns (QueryAllSecondLevelDomainResponse) { option (google.api.http).get = "/mycel/registry/second_level_domain"; - } // Queries a list of DomainOwnership items. - rpc DomainOwnership (QueryGetDomainOwnershipRequest) returns (QueryGetDomainOwnershipResponse) { + rpc DomainOwnership(QueryGetDomainOwnershipRequest) returns (QueryGetDomainOwnershipResponse) { option (google.api.http).get = "/mycel-domain/mycel/registry/domain_ownership/{owner}"; - } - rpc DomainOwnershipAll (QueryAllDomainOwnershipRequest) returns (QueryAllDomainOwnershipResponse) { + rpc DomainOwnershipAll(QueryAllDomainOwnershipRequest) returns (QueryAllDomainOwnershipResponse) { option (google.api.http).get = "/mycel-domain/mycel/registry/domain_ownership"; - } // Queries a list of DomainRegistrationFee items. - rpc DomainRegistrationFee (QueryDomainRegistrationFeeRequest) returns (QueryDomainRegistrationFeeResponse) { + rpc DomainRegistrationFee(QueryDomainRegistrationFeeRequest) returns (QueryDomainRegistrationFeeResponse) { option (google.api.http).get = "/mycel-domain/mycel/registry/domain_registration_fee/{name}/{parent}"; - } } + // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } @@ -82,17 +72,17 @@ message QueryAllTopLevelDomainRequest { } message QueryAllTopLevelDomainResponse { - repeated TopLevelDomain topLevelDomain = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated TopLevelDomain topLevelDomain = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetSecondLevelDomainRequest { - string name = 1; + string name = 1; string parent = 2; } message SecondLevelDomainResponse { - string name = 1; + string name = 1; string parent = 2; google.protobuf.Timestamp expirationDate = 3 [ (gogoproto.stdtime) = true, @@ -109,8 +99,8 @@ message QueryAllSecondLevelDomainRequest { } message QueryAllSecondLevelDomainResponse { - repeated SecondLevelDomainResponse secondLevelDomain = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated SecondLevelDomainResponse secondLevelDomain = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryGetDomainOwnershipRequest { @@ -126,12 +116,12 @@ message QueryAllDomainOwnershipRequest { } message QueryAllDomainOwnershipResponse { - repeated DomainOwnership domainOwnership = 1 [(gogoproto.nullable) = false]; - cosmos.base.query.v1beta1.PageResponse pagination = 2; + repeated DomainOwnership domainOwnership = 1 [(gogoproto.nullable) = false]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; } message QueryDomainRegistrationFeeRequest { - string name = 1; + string name = 1; string parent = 2; uint64 registrationPeriodInYear = 3; } diff --git a/proto/mycel/registry/role.proto b/proto/mycel/registry/role.proto index f5f51611..ffd63e97 100644 --- a/proto/mycel/registry/role.proto +++ b/proto/mycel/registry/role.proto @@ -7,4 +7,4 @@ enum DomainRole { NO_ROLE = 0; OWNER = 1; EDITOR = 2; -} \ No newline at end of file +} diff --git a/proto/mycel/registry/second_level_domain.proto b/proto/mycel/registry/second_level_domain.proto index 3f5c8368..ed5397ee 100644 --- a/proto/mycel/registry/second_level_domain.proto +++ b/proto/mycel/registry/second_level_domain.proto @@ -9,7 +9,6 @@ import "mycel/registry/role.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; - message DnsRecord { DnsRecordType dnsRecordType = 1; string value = 2; @@ -26,10 +25,10 @@ message Metadata { } message Record { -oneof record { - DnsRecord dnsRecord = 1; - WalletRecord walletRecord = 2; - Metadata metadata = 3; + oneof record { + DnsRecord dnsRecord = 1; + WalletRecord walletRecord = 2; + Metadata metadata = 3; } } diff --git a/proto/mycel/registry/subdomain_config.proto b/proto/mycel/registry/subdomain_config.proto index a6cd835f..df8b388e 100644 --- a/proto/mycel/registry/subdomain_config.proto +++ b/proto/mycel/registry/subdomain_config.proto @@ -5,7 +5,6 @@ import "cosmos/base/v1beta1/coin.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; - message SubdomainRegistrationFees { map feeByLength = 1; map feeByName = 2; diff --git a/proto/mycel/registry/top_level_domain.proto b/proto/mycel/registry/top_level_domain.proto index a5defcbc..7c9e4887 100644 --- a/proto/mycel/registry/top_level_domain.proto +++ b/proto/mycel/registry/top_level_domain.proto @@ -1,11 +1,11 @@ syntax = "proto3"; package mycel.registry; +import "cosmos/base/v1beta1/coin.proto"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; -import "cosmos/base/v1beta1/coin.proto"; -import "mycel/registry/subdomain_config.proto"; import "mycel/registry/role.proto"; +import "mycel/registry/subdomain_config.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; @@ -25,14 +25,13 @@ message TopLevelDomain { ]; } - message TopLevelDomainFee { repeated cosmos.base.v1beta1.Coin totalFee = 1 [ (gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" ]; - string burnWeight = 2; - cosmos.base.v1beta1.Coin feeToBurn = 3 [ + string burnWeight = 2; + cosmos.base.v1beta1.Coin feeToBurn = 3 [ (gogoproto.nullable) = false, (gogoproto.castvalue) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; @@ -40,5 +39,4 @@ message TopLevelDomainFee { (gogoproto.nullable) = false, (gogoproto.castvalue) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; - } diff --git a/proto/mycel/registry/tx.proto b/proto/mycel/registry/tx.proto index ba2bad70..da664c24 100644 --- a/proto/mycel/registry/tx.proto +++ b/proto/mycel/registry/tx.proto @@ -1,54 +1,53 @@ syntax = "proto3"; - package mycel.registry; -import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "gogoproto/gogo.proto"; import "mycel/registry/top_level_domain.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; // Msg defines the Msg service. service Msg { - rpc UpdateWalletRecord (MsgUpdateWalletRecord ) returns (MsgUpdateWalletRecordResponse ); - rpc UpdateDnsRecord (MsgUpdateDnsRecord ) returns (MsgUpdateDnsRecordResponse ); - rpc RegisterSecondLevelDomain (MsgRegisterSecondLevelDomain ) returns (MsgRegisterSecondLevelDomainResponse ); - rpc RegisterTopLevelDomain (MsgRegisterTopLevelDomain ) returns (MsgRegisterTopLevelDomainResponse ); - rpc WithdrawRegistrationFee (MsgWithdrawRegistrationFee ) returns (MsgWithdrawRegistrationFeeResponse ); - rpc ExtendTopLevelDomainExpirationDate (MsgExtendTopLevelDomainExpirationDate) returns (MsgExtendTopLevelDomainExpirationDateResponse); + rpc UpdateWalletRecord(MsgUpdateWalletRecord) returns (MsgUpdateWalletRecordResponse); + rpc UpdateDnsRecord(MsgUpdateDnsRecord) returns (MsgUpdateDnsRecordResponse); + rpc RegisterSecondLevelDomain(MsgRegisterSecondLevelDomain) returns (MsgRegisterSecondLevelDomainResponse); + rpc RegisterTopLevelDomain(MsgRegisterTopLevelDomain) returns (MsgRegisterTopLevelDomainResponse); + rpc WithdrawRegistrationFee(MsgWithdrawRegistrationFee) returns (MsgWithdrawRegistrationFeeResponse); + rpc ExtendTopLevelDomainExpirationDate(MsgExtendTopLevelDomainExpirationDate) returns (MsgExtendTopLevelDomainExpirationDateResponse); } message MsgUpdateWalletRecord { - string creator = 1; - string name = 2; - string parent = 3; + string creator = 1; + string name = 2; + string parent = 3; string walletRecordType = 4; - string value = 5; + string value = 5; } message MsgUpdateWalletRecordResponse {} message MsgUpdateDnsRecord { - string creator = 1; - string name = 2; - string parent = 3; + string creator = 1; + string name = 2; + string parent = 3; string dnsRecordType = 4; - string value = 5; + string value = 5; } message MsgUpdateDnsRecordResponse {} message MsgRegisterSecondLevelDomain { - string creator = 1; - string name = 2; - string parent = 3; + string creator = 1; + string name = 2; + string parent = 3; uint64 registrationPeriodInYear = 4; } message MsgRegisterSecondLevelDomainResponse {} message MsgRegisterTopLevelDomain { - string creator = 1; - string name = 2; + string creator = 1; + string name = 2; uint64 registrationPeriodInYear = 3; } @@ -59,16 +58,19 @@ message MsgRegisterTopLevelDomainResponse { message MsgWithdrawRegistrationFee { string creator = 1; - string name = 2; + string name = 2; } message MsgWithdrawRegistrationFeeResponse { - repeated cosmos.base.v1beta1.Coin registrationFee = 7 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; + repeated cosmos.base.v1beta1.Coin registrationFee = 7 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; } message MsgExtendTopLevelDomainExpirationDate { - string creator = 1; - string name = 2; + string creator = 1; + string name = 2; uint64 extensionPeriodInYear = 3; } @@ -76,4 +78,3 @@ message MsgExtendTopLevelDomainExpirationDateResponse { TopLevelDomain topLevelDomain = 1; TopLevelDomainFee fee = 2; } - diff --git a/proto/mycel/resolver/params.proto b/proto/mycel/resolver/params.proto index 62761a99..d651423e 100644 --- a/proto/mycel/resolver/params.proto +++ b/proto/mycel/resolver/params.proto @@ -8,5 +8,4 @@ option go_package = "github.com/mycel-domain/mycel/x/resolver/types"; // Params defines the parameters for the module. message Params { option (gogoproto.goproto_stringer) = false; - } diff --git a/proto/mycel/resolver/query.proto b/proto/mycel/resolver/query.proto index a5e1dcce..d997f682 100644 --- a/proto/mycel/resolver/query.proto +++ b/proto/mycel/resolver/query.proto @@ -1,55 +1,49 @@ syntax = "proto3"; - package mycel.resolver; +import "cosmos/base/query/v1beta1/pagination.proto"; import "gogoproto/gogo.proto"; import "google/api/annotations.proto"; -import "cosmos/base/query/v1beta1/pagination.proto"; -import "mycel/resolver/params.proto"; import "mycel/registry/second_level_domain.proto"; +import "mycel/resolver/params.proto"; option go_package = "github.com/mycel-domain/mycel/x/resolver/types"; // Query defines the gRPC querier service. service Query { - // Parameters queries the parameters of the module. - rpc Params (QueryParamsRequest) returns (QueryParamsResponse) { + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) { option (google.api.http).get = "/mycel-domain/mycel/resolver/params"; - } - + // Queries a list of QueryWalletRecord items. - rpc WalletRecord (QueryWalletRecordRequest) returns (QueryWalletRecordResponse) { + rpc WalletRecord(QueryWalletRecordRequest) returns (QueryWalletRecordResponse) { option (google.api.http).get = "/mycel-domain/mycel/resolver/wallet_record/{domainName}/{domainParent}/{walletRecordType}"; - } - + // Queries a list of DnsRecord items. - rpc DnsRecord (QueryDnsRecordRequest) returns (QueryDnsRecordResponse) { + rpc DnsRecord(QueryDnsRecordRequest) returns (QueryDnsRecordResponse) { option (google.api.http).get = "/mycel-domain/mycel/resolver/dns_record/{domainName}/{domainParent}/{dnsRecordType}"; - } - + // Queries a list of AllRecord items. - rpc AllRecords (QueryAllRecordsRequest) returns (QueryAllRecordsResponse) { + rpc AllRecords(QueryAllRecordsRequest) returns (QueryAllRecordsResponse) { option (google.api.http).get = "/mycel-domain/mycel/resolver/all_records/{domainName}/{domainParent}"; - } } + // QueryParamsRequest is request type for the Query/Params RPC method. message QueryParamsRequest {} // QueryParamsResponse is response type for the Query/Params RPC method. message QueryParamsResponse { - // params holds all the parameters of this module. Params params = 1 [(gogoproto.nullable) = false]; } message QueryWalletRecordRequest { - string domainName = 1; - string domainParent = 2; + string domainName = 1; + string domainParent = 2; string walletRecordType = 3; } @@ -58,8 +52,8 @@ message QueryWalletRecordResponse { } message QueryDnsRecordRequest { - string domainName = 1; - string domainParent = 2; + string domainName = 1; + string domainParent = 2; string dnsRecordType = 3; } @@ -68,11 +62,10 @@ message QueryDnsRecordResponse { } message QueryAllRecordsRequest { - string domainName = 1; + string domainName = 1; string domainParent = 2; } message QueryAllRecordsResponse { map values = 1; } - diff --git a/proto/mycel/resolver/tx.proto b/proto/mycel/resolver/tx.proto index 2cbf8307..15538b84 100644 --- a/proto/mycel/resolver/tx.proto +++ b/proto/mycel/resolver/tx.proto @@ -4,4 +4,4 @@ package mycel.resolver; option go_package = "github.com/mycel-domain/mycel/x/resolver/types"; // Msg defines the Msg service. -service Msg {} \ No newline at end of file +service Msg {}