diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 7f4296f7..40452509 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -50443,6 +50443,12 @@ paths: custom method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE pagination: type: object properties: @@ -50687,6 +50693,12 @@ paths: custom method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE default: description: An unexpected error response. schema: @@ -81472,6 +81484,12 @@ definitions: method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE fee: type: object properties: @@ -81657,6 +81675,12 @@ definitions: method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE fee: type: object properties: @@ -81713,6 +81737,8 @@ definitions: type: object mycel.registry.MsgUpdateTextRecordResponse: type: object + mycel.registry.MsgUpdateTopLevelDomainRegistrationPolicyResponse: + type: object mycel.registry.MsgUpdateWalletRecordResponse: type: object mycel.registry.MsgWithdrawRegistrationFeeResponse: @@ -81968,6 +81994,12 @@ definitions: method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE pagination: type: object properties: @@ -82182,6 +82214,12 @@ definitions: method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE mycel.registry.QueryParamsResponse: type: object properties: @@ -82201,6 +82239,12 @@ definitions: properties: role: type: string + mycel.registry.RegistrationPolicyType: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE mycel.registry.SecondLevelDomainResponse: type: object properties: @@ -82482,6 +82526,12 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + registrationPolicy: + type: string + enum: + - PRIVATE + - PUBLIC + default: PRIVATE mycel.registry.TopLevelDomainFee: type: object properties: diff --git a/proto/mycel/registry/query.proto b/proto/mycel/registry/query.proto index 37c41039..6b5f75d3 100644 --- a/proto/mycel/registry/query.proto +++ b/proto/mycel/registry/query.proto @@ -16,53 +16,58 @@ 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) { - option (google.api.http).get = "/mycel-domain/mycel/registry/top_level_domain/{name}"; - + rpc TopLevelDomain(QueryGetTopLevelDomainRequest) + returns (QueryGetTopLevelDomainResponse) { + option (google.api.http).get = + "/mycel-domain/mycel/registry/top_level_domain/{name}"; } - rpc TopLevelDomainAll (QueryAllTopLevelDomainRequest) returns (QueryAllTopLevelDomainResponse) { - option (google.api.http).get = "/mycel-domain/mycel/registry/top_level_domain"; - + 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) { - option (google.api.http).get = "/mycel/registry/second_level_domain/{name}/{parent}"; - + 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) { - option (google.api.http).get = "/mycel-domain/mycel/registry/domain_ownership/{owner}"; - + rpc DomainOwnership(QueryGetDomainOwnershipRequest) + returns (QueryGetDomainOwnershipResponse) { + option (google.api.http).get = + "/mycel-domain/mycel/registry/domain_ownership/{owner}"; } - rpc DomainOwnershipAll (QueryAllDomainOwnershipRequest) returns (QueryAllDomainOwnershipResponse) { - option (google.api.http).get = "/mycel-domain/mycel/registry/domain_ownership"; - + 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) { - option (google.api.http).get = "/mycel-domain/mycel/registry/domain_registration_fee/{name}/{parent}"; - + rpc DomainRegistrationFee(QueryDomainRegistrationFeeRequest) + returns (QueryDomainRegistrationFeeResponse) { + option (google.api.http).get = + "/mycel-domain/mycel/registry/domain_registration_fee/{name}/{parent}/{registerer}"; } - + // Queries a list of Role items. - rpc Role (QueryRoleRequest) returns (QueryRoleResponse) { - option (google.api.http).get = "/mycel-domain/mycel/registry/role/{domainName}/{address}"; - + rpc Role(QueryRoleRequest) returns (QueryRoleResponse) { + option (google.api.http).get = + "/mycel-domain/mycel/registry/role/{domainName}/{address}"; } } // QueryParamsRequest is request type for the Query/Params RPC method. @@ -70,17 +75,15 @@ 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]; + Params params = 1 [ (gogoproto.nullable) = false ]; } -message QueryGetTopLevelDomainRequest { - string name = 1; -} +message QueryGetTopLevelDomainRequest { string name = 1; } message QueryGetTopLevelDomainResponse { - TopLevelDomain topLevelDomain = 1 [(gogoproto.nullable) = false]; + TopLevelDomain topLevelDomain = 1 [ (gogoproto.nullable) = false ]; } message QueryAllTopLevelDomainRequest { @@ -88,23 +91,25 @@ 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 parent = 2; - google.protobuf.Timestamp expirationDate = 3 [(gogoproto.stdtime) = true, (gogoproto.nullable) = false]; + string name = 1; + string parent = 2; + google.protobuf.Timestamp expirationDate = 3 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; } message QueryGetSecondLevelDomainResponse { - SecondLevelDomainResponse secondLevelDomain = 1 [(gogoproto.nullable) = false]; + SecondLevelDomainResponse secondLevelDomain = 1 + [ (gogoproto.nullable) = false ]; } message QueryAllSecondLevelDomainRequest { @@ -112,16 +117,15 @@ 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 { - string owner = 1; -} +message QueryGetDomainOwnershipRequest { string owner = 1; } message QueryGetDomainOwnershipResponse { - DomainOwnership domainOwnership = 1 [(gogoproto.nullable) = false]; + DomainOwnership domainOwnership = 1 [ (gogoproto.nullable) = false ]; } message QueryAllDomainOwnershipRequest { @@ -129,30 +133,31 @@ 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 parent = 2; + string name = 1; + string parent = 2; uint64 registrationPeriodInYear = 3; + string registerer = 4; } message QueryDomainRegistrationFeeResponse { - bool isRegistrable = 1; - repeated cosmos.base.v1beta1.Coin fee = 2 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; - uint64 registrationPeriodInYear = 3; - uint64 maxSubDomainRegistrations = 4; - string errorMessage = 5; + bool isRegistrable = 1; + repeated cosmos.base.v1beta1.Coin fee = 2 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + uint64 registrationPeriodInYear = 3; + uint64 maxSubDomainRegistrations = 4; + string errorMessage = 5; } message QueryRoleRequest { string domainName = 1; - string address = 2; -} - -message QueryRoleResponse { - string role = 1; + string address = 2; } +message QueryRoleResponse { string role = 1; } diff --git a/proto/mycel/registry/subdomain_config.proto b/proto/mycel/registry/subdomain_config.proto index 30e2c78d..e75e03b5 100644 --- a/proto/mycel/registry/subdomain_config.proto +++ b/proto/mycel/registry/subdomain_config.proto @@ -6,6 +6,11 @@ import "mycel/registry/access_control.proto"; option go_package = "github.com/mycel-domain/mycel/x/registry/types"; +enum RegistrationPolicyType { + PRIVATE = 0; + PUBLIC = 1; +} + message SubdomainRegistrationFees { repeated FeeByLength feeByLength = 1; repeated FeeByName feeByName = 2; @@ -30,4 +35,5 @@ message SubdomainConfig { bool isRegistrable = 3; DomainRole registrableRole = 4; bool customExpirationDate = 5; + RegistrationPolicyType registrationPolicy = 6; } diff --git a/proto/mycel/registry/top_level_domain.proto b/proto/mycel/registry/top_level_domain.proto index a489963f..466a32e8 100644 --- a/proto/mycel/registry/top_level_domain.proto +++ b/proto/mycel/registry/top_level_domain.proto @@ -11,10 +11,8 @@ option go_package = "github.com/mycel-domain/mycel/x/registry/types"; message TopLevelDomain { string name = 1; - google.protobuf.Timestamp expirationDate = 2 [ - (gogoproto.stdtime) = true, - (gogoproto.nullable) = false - ]; + google.protobuf.Timestamp expirationDate = 2 + [ (gogoproto.stdtime) = true, (gogoproto.nullable) = false ]; SubdomainConfig subdomainConfig = 3; uint64 subdomainCount = 4; repeated AccessControl accessControl = 5; diff --git a/proto/mycel/registry/tx.proto b/proto/mycel/registry/tx.proto index 53bb8a68..7a2ec14c 100644 --- a/proto/mycel/registry/tx.proto +++ b/proto/mycel/registry/tx.proto @@ -10,13 +10,14 @@ 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 UpdateTextRecord (MsgUpdateTextRecord ) returns (MsgUpdateTextRecordResponse ); + 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 UpdateTextRecord (MsgUpdateTextRecord ) returns (MsgUpdateTextRecordResponse ); + rpc UpdateTopLevelDomainRegistrationPolicy (MsgUpdateTopLevelDomainRegistrationPolicy) returns (MsgUpdateTopLevelDomainRegistrationPolicyResponse); } message MsgUpdateWalletRecord { string creator = 1; @@ -88,3 +89,11 @@ message MsgUpdateTextRecord { message MsgUpdateTextRecordResponse {} +message MsgUpdateTopLevelDomainRegistrationPolicy { + string creator = 1; + string name = 2; + string registrationPolicy = 3; +} + +message MsgUpdateTopLevelDomainRegistrationPolicyResponse {} + diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index c51bdfac..727d7dcd 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -36,6 +36,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdWithdrawRegistrationFee()) cmd.AddCommand(CmdExtendTopLevelDomainExpirationDate()) cmd.AddCommand(CmdUpdateTextRecord()) + cmd.AddCommand(CmdUpdateTopLevelDomainRegistrationPolicy()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/registry/client/cli/tx_update_top_level_domain_registration_policy.go b/x/registry/client/cli/tx_update_top_level_domain_registration_policy.go new file mode 100644 index 00000000..ed778850 --- /dev/null +++ b/x/registry/client/cli/tx_update_top_level_domain_registration_policy.go @@ -0,0 +1,46 @@ +package cli + +import ( + "strconv" + + "github.com/spf13/cobra" + + "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" + "github.com/cosmos/cosmos-sdk/client/tx" + + "github.com/mycel-domain/mycel/x/registry/types" +) + +var _ = strconv.Itoa(0) + +func CmdUpdateTopLevelDomainRegistrationPolicy() *cobra.Command { + cmd := &cobra.Command{ + Use: "update-top-level-domain-registration-policy [name] [registration-policy]", + Short: "Broadcast message update-top-level-domain-registration-policy", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argName := args[0] + argRegistrationPolicy := args[1] + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgUpdateTopLevelDomainRegistrationPolicy( + clientCtx.GetFromAddress().String(), + argName, + argRegistrationPolicy, + ) + if err := msg.ValidateBasic(); err != nil { + return err + } + return tx.GenerateOrBroadcastTxCLI(clientCtx, cmd.Flags(), msg) + }, + } + + flags.AddTxFlagsToCmd(cmd) + + return cmd +} diff --git a/x/registry/keeper/events.go b/x/registry/keeper/events.go index ec6f830f..8be2aef7 100644 --- a/x/registry/keeper/events.go +++ b/x/registry/keeper/events.go @@ -95,3 +95,13 @@ func EmitExtendTopLevelDomainExpirationDateEvent(ctx sdk.Context, domain types.T ), ) } + +// Update top-level-domain registration policy +func EmitUpdateTopLevelDomainRegistrationPolicyEvent(ctx sdk.Context, domain types.TopLevelDomain) { + ctx.EventManager().EmitEvent( + sdk.NewEvent(types.EventTypeUpdateTopLevelDomainRegistrationPolicy, + sdk.NewAttribute(types.AttributeUpdateTopLevelDomainRegistrationPolicyEventDomainName, domain.Name), + sdk.NewAttribute(types.AttributeUpdateTopLevelDomainRegistrationPolicyEventRegistrationPolicy, domain.SubdomainConfig.RegistrationPolicy.String()), + ), + ) +} diff --git a/x/registry/keeper/msg_server_register_second_level_domain_test.go b/x/registry/keeper/msg_server_register_second_level_domain_test.go index 102a3ba1..071cdaa6 100644 --- a/x/registry/keeper/msg_server_register_second_level_domain_test.go +++ b/x/registry/keeper/msg_server_register_second_level_domain_test.go @@ -73,6 +73,23 @@ func (suite *KeeperTestSuite) TestRegisterSecondLevelDomain() { fn: func() { }, }, + { + creator: testutil.Bob, + name: "foo", + parent: "alice", + registrationPeriodInYear: 1, + domainOwnership: types.DomainOwnership{ + Owner: testutil.Alice, + Domains: []*types.OwnedDomain{{Name: "foo", Parent: "alice"}}, + }, + expErr: errorsmod.Wrapf(types.ErrNotAllowedRegisterDomain, "alice"), + fn: func() { + owner := testutil.Alice + // Create .bob TLD by Alice + _, _, err := suite.app.RegistryKeeper.RegisterTopLevelDomain(suite.ctx, owner, "alice", 1) + suite.Require().Nil(err) + }, + }, } for i, tc := range testCases { diff --git a/x/registry/keeper/msg_server_update_top_level_domain_registration_policy.go b/x/registry/keeper/msg_server_update_top_level_domain_registration_policy.go new file mode 100644 index 00000000..86f5fbb5 --- /dev/null +++ b/x/registry/keeper/msg_server_update_top_level_domain_registration_policy.go @@ -0,0 +1,20 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + + "github.com/mycel-domain/mycel/x/registry/types" +) + +func (k msgServer) UpdateTopLevelDomainRegistrationPolicy(goCtx context.Context, msg *types.MsgUpdateTopLevelDomainRegistrationPolicy) (*types.MsgUpdateTopLevelDomainRegistrationPolicyResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + err := k.Keeper.UpdateTopLevelDomainRegistrationPolicy(ctx, msg.Creator, msg.Name, msg.RegistrationPolicy) + if err != nil { + return nil, err + } + + return &types.MsgUpdateTopLevelDomainRegistrationPolicyResponse{}, nil +} diff --git a/x/registry/keeper/msg_server_update_top_level_domain_registration_policy_test.go b/x/registry/keeper/msg_server_update_top_level_domain_registration_policy_test.go new file mode 100644 index 00000000..cdeb4eb0 --- /dev/null +++ b/x/registry/keeper/msg_server_update_top_level_domain_registration_policy_test.go @@ -0,0 +1,101 @@ +package keeper_test + +import ( + "fmt" + + errorsmod "cosmossdk.io/errors" + + "github.com/mycel-domain/mycel/testutil" + "github.com/mycel-domain/mycel/x/registry/types" +) + +func (suite *KeeperTestSuite) TestUpdateTopLevelDomainRegistrationPolicy() { + testCases := []struct { + creator string + name string + registrationPolicy string + expErr error + fn func() + }{ + { + creator: testutil.Alice, + name: "tcel", + registrationPolicy: "PUBLIC", + expErr: nil, + fn: func() {}, + }, + { + creator: testutil.Alice, + name: "tcel", + registrationPolicy: "PRIVATE", + expErr: nil, + fn: func() {}, + }, + { + creator: testutil.Alice, + name: "tcel", + registrationPolicy: "INVALID", + expErr: errorsmod.Wrapf(types.ErrInvalidRegistrationPolicy, "INVALID"), + fn: func() {}, + }, + { + creator: testutil.Alice, + name: "invalid", + registrationPolicy: "PUBLIC", + expErr: errorsmod.Wrapf(types.ErrTopLevelDomainNotFound, "invalid"), + fn: func() {}, + }, + { + creator: testutil.Bob, + name: "tcel", + registrationPolicy: "PUBLIC", + expErr: errorsmod.Wrapf(types.ErrTopLevelDomainNotEditable, "%s", testutil.Bob), + fn: func() {}, + }, + } + for i, tc := range testCases { + suite.Run(fmt.Sprintf("Case %d", i), func() { + suite.SetupTest() + + // Register top level domain + registerTopLevelDomainMsg := &types.MsgRegisterTopLevelDomain{ + Creator: testutil.Alice, + Name: tc.name, + RegistrationPeriodInYear: 1, + } + if tc.name != "invalid" { + _, err := suite.msgServer.RegisterTopLevelDomain(suite.ctx, registerTopLevelDomainMsg) + suite.Require().Nil(err) + } + + // Run test case function + tc.fn() + + // Update dns record + msgUpdateTopLevelDomainRegistrationPolicy := &types.MsgUpdateTopLevelDomainRegistrationPolicy{ + Creator: tc.creator, + Name: tc.name, + RegistrationPolicy: tc.registrationPolicy, + } + + _, err := suite.msgServer.UpdateTopLevelDomainRegistrationPolicy(suite.ctx, msgUpdateTopLevelDomainRegistrationPolicy) + + if tc.expErr == nil { + // Check if the record is updated + suite.Require().Nil(err) + res, _ := suite.app.RegistryKeeper.GetTopLevelDomain(suite.ctx, tc.name) + suite.Require().Equal(tc.registrationPolicy, res.GetSubdomainConfig().RegistrationPolicy.String()) + // Evalute events + events, found := testutil.FindEventsByType(suite.ctx.EventManager().Events(), types.EventTypeUpdateTopLevelDomainRegistrationPolicy) + suite.Require().True(found) + + for _, event := range events { + suite.Require().Equal(tc.name, event.Attributes[0].Value) + suite.Require().Equal(tc.registrationPolicy, event.Attributes[1].Value) + } + } else { + suite.Require().EqualError(err, tc.expErr.Error()) + } + }) + } +} diff --git a/x/registry/keeper/msg_server_withdraw_registration_fee_test.go b/x/registry/keeper/msg_server_withdraw_registration_fee_test.go index 35bfaaaa..b3ff7618 100644 --- a/x/registry/keeper/msg_server_withdraw_registration_fee_test.go +++ b/x/registry/keeper/msg_server_withdraw_registration_fee_test.go @@ -34,7 +34,7 @@ func (suite *KeeperTestSuite) TestWithdrawRegistrationFee() { suite.Run(fmt.Sprintf("Case %d", i), func() { suite.SetupTest() - // Register top level domain + // Register top-level-domain registerTopLevelDomainMsg := &types.MsgRegisterTopLevelDomain{ Creator: testutil.Alice, Name: tc.topLevelDomainName, @@ -42,8 +42,10 @@ func (suite *KeeperTestSuite) TestWithdrawRegistrationFee() { } _, err := suite.msgServer.RegisterTopLevelDomain(suite.ctx, registerTopLevelDomainMsg) suite.Require().Nil(err) + err = suite.app.RegistryKeeper.UpdateTopLevelDomainRegistrationPolicy(suite.ctx, testutil.Alice, tc.topLevelDomainName, types.RegistrationPolicyType_PUBLIC.String()) + suite.Require().Nil(err) - // Register second level domain + // Register second-level-domain registerSecondLevelDomainMsg := &types.MsgRegisterSecondLevelDomain{ Creator: testutil.Bob, Name: "foo", diff --git a/x/registry/keeper/query_domain_registration_fee.go b/x/registry/keeper/query_domain_registration_fee.go index c31a7f62..83749fb9 100644 --- a/x/registry/keeper/query_domain_registration_fee.go +++ b/x/registry/keeper/query_domain_registration_fee.go @@ -45,7 +45,7 @@ func (k Keeper) DomainRegistrationFee(goCtx context.Context, req *types.QueryDom return &types.QueryDomainRegistrationFeeResponse{ IsRegistrable: true, Fee: fee.TotalFee, - RegistrationPeriodInYear: 1, + RegistrationPeriodInYear: req.RegistrationPeriodInYear, MaxSubDomainRegistrations: config.MaxSubdomainRegistrations, ErrorMessage: "", }, nil @@ -53,7 +53,11 @@ func (k Keeper) DomainRegistrationFee(goCtx context.Context, req *types.QueryDom // Second level domain domain := types.SecondLevelDomain{Name: req.Name, Parent: req.Parent} - err := k.ValidateSecondLevelDomainIsRegistrable(ctx, domain) + registerer, err := sdk.AccAddressFromBech32(req.Registerer) + if err != nil { + return nil, err + } + err = k.ValidateSecondLevelDomainIsRegistrable(ctx, domain, registerer) if err != nil { return createErrorResponse(err), nil } @@ -65,7 +69,7 @@ func (k Keeper) DomainRegistrationFee(goCtx context.Context, req *types.QueryDom return &types.QueryDomainRegistrationFeeResponse{ IsRegistrable: true, Fee: sdk.NewCoins(fee), - RegistrationPeriodInYear: 1, + RegistrationPeriodInYear: req.RegistrationPeriodInYear, MaxSubDomainRegistrations: 0, ErrorMessage: "", }, nil diff --git a/x/registry/keeper/query_domain_registration_fee_test.go b/x/registry/keeper/query_domain_registration_fee_test.go new file mode 100644 index 00000000..7149edd6 --- /dev/null +++ b/x/registry/keeper/query_domain_registration_fee_test.go @@ -0,0 +1,100 @@ +package keeper_test + +import ( + errorsmod "cosmossdk.io/errors" + + "github.com/mycel-domain/mycel/testutil" + "github.com/mycel-domain/mycel/x/registry/types" +) + +func (suite *KeeperTestSuite) TestQueryDomainRegistrationFee() { + config := types.GetDefaultSubdomainConfig(1) + tcs := []struct { + desc string + req *types.QueryDomainRegistrationFeeRequest + resp *types.QueryDomainRegistrationFeeResponse + expErr error + fn func() + }{ + { + desc: "Should register top-level-domain", + req: &types.QueryDomainRegistrationFeeRequest{ + Name: "first", + Parent: "", + RegistrationPeriodInYear: 1, + Registerer: testutil.Alice, + }, + resp: &types.QueryDomainRegistrationFeeResponse{ + IsRegistrable: true, + RegistrationPeriodInYear: 1, + MaxSubDomainRegistrations: config.MaxSubdomainRegistrations, + ErrorMessage: "", + }, + expErr: nil, + fn: func() {}, + }, + { + desc: "Should register second-level-domain", + req: &types.QueryDomainRegistrationFeeRequest{ + Name: "first", + Parent: "cel", + RegistrationPeriodInYear: 1, + Registerer: testutil.Alice, + }, + resp: &types.QueryDomainRegistrationFeeResponse{ + IsRegistrable: true, + RegistrationPeriodInYear: 1, + MaxSubDomainRegistrations: 0, + ErrorMessage: "", + }, + expErr: nil, + fn: func() {}, + }, + { + desc: "Should not register second-level-domain because of registration policy", + req: &types.QueryDomainRegistrationFeeRequest{ + Name: "first", + Parent: "private", + RegistrationPeriodInYear: 1, + Registerer: testutil.Bob, + }, + resp: &types.QueryDomainRegistrationFeeResponse{ + IsRegistrable: false, + RegistrationPeriodInYear: 0, + MaxSubDomainRegistrations: 0, + ErrorMessage: errorsmod.Wrapf(types.ErrNotAllowedRegisterDomain, "private").Error(), + }, + expErr: nil, + fn: func() { + _, _, err := suite.app.RegistryKeeper.RegisterTopLevelDomain(suite.ctx, testutil.Alice, "private", 1) + suite.Require().Nil(err) + }, + }, + } + for _, tc := range tcs { + suite.Run(tc.desc, func() { + // Setup + suite.SetupTest() + tc.fn() + + // Calculate fee + k := suite.app.RegistryKeeper + + // Get DomainRegistrationFee + resp, err := k.DomainRegistrationFee(suite.ctx, tc.req) + suite.Require().Nil(err) + + if tc.expErr == nil { + suite.Require().Nil(err) + suite.Require().Equal(tc.resp.IsRegistrable, resp.IsRegistrable) + suite.Require().Equal(tc.resp.RegistrationPeriodInYear, resp.RegistrationPeriodInYear) + suite.Require().Equal(tc.resp.MaxSubDomainRegistrations, resp.MaxSubDomainRegistrations) + // suite.Require().Equal(tc.resp.Fee, resp.Fee) + // suite.Require().Equal(tc.resp, resp) + } else { + suite.Require().NotNil(err) + suite.Require().Equal(tc.expErr.Error(), err.Error()) + } + }) + } +} diff --git a/x/registry/keeper/second_level_domain.go b/x/registry/keeper/second_level_domain.go index 16c22611..a7d08580 100644 --- a/x/registry/keeper/second_level_domain.go +++ b/x/registry/keeper/second_level_domain.go @@ -175,7 +175,7 @@ func (k Keeper) PaySecondLevelDomainRegstrationFee(ctx sdk.Context, payer sdk.Ac } // Validate second-level-domain is registrable -func (k Keeper) ValidateSecondLevelDomainIsRegistrable(ctx sdk.Context, secondLevelDomain types.SecondLevelDomain) error { +func (k Keeper) ValidateSecondLevelDomainIsRegistrable(ctx sdk.Context, secondLevelDomain types.SecondLevelDomain, sldOwner sdk.AccAddress) error { // Validate second-level-domain err := secondLevelDomain.Validate() if err != nil { @@ -193,6 +193,14 @@ func (k Keeper) ValidateSecondLevelDomainIsRegistrable(ctx sdk.Context, secondLe return errorsmod.Wrapf(types.ErrSecondLevelDomainParentDoesNotExist, "%s", secondLevelDomain.Parent) } + // Check if the registering domain is allowed or not + isPrivate := parentDomain.SubdomainConfig.RegistrationPolicy == types.RegistrationPolicyType_PRIVATE + isOwner := parentDomain.GetRole(sldOwner.String()) == types.DomainRole_OWNER + + if isPrivate && !isOwner { + return errorsmod.Wrapf(types.ErrNotAllowedRegisterDomain, "%s", parentDomain.Name) + } + // Check if parent domain has subdomain registration config if parentDomain.SubdomainConfig.MaxSubdomainRegistrations <= parentDomain.SubdomainCount { return errorsmod.Wrapf(types.ErrTopLevelDomainMaxSubdomainCountReached, "%d", parentDomain.SubdomainCount) @@ -204,7 +212,7 @@ func (k Keeper) ValidateSecondLevelDomainIsRegistrable(ctx sdk.Context, secondLe // Register second level domain func (k Keeper) RegisterSecondLevelDomain(ctx sdk.Context, secondLevelDomain types.SecondLevelDomain, owner sdk.AccAddress, registrationPeriodIYear uint64) (err error) { // Validate second-level-domain is registrable - err = k.ValidateSecondLevelDomainIsRegistrable(ctx, secondLevelDomain) + err = k.ValidateSecondLevelDomainIsRegistrable(ctx, secondLevelDomain, owner) if err != nil { return err } diff --git a/x/registry/keeper/top_level_domain.go b/x/registry/keeper/top_level_domain.go index f6af0c94..6308ae52 100644 --- a/x/registry/keeper/top_level_domain.go +++ b/x/registry/keeper/top_level_domain.go @@ -240,3 +240,32 @@ func (k Keeper) ExtendTopLevelDomainExpirationDate(ctx sdk.Context, creator stri return topLevelDomain, fee, err } + +func (k Keeper) UpdateTopLevelDomainRegistrationPolicy(ctx sdk.Context, creator string, domainName string, registrationPolicy string) (err error) { + // Get domain + topLevelDomain, found := k.GetTopLevelDomain(ctx, domainName) + if !found { + return errorsmod.Wrapf(types.ErrTopLevelDomainNotFound, "%s", domainName) + } + + // Check if the domain is editable + _, err = topLevelDomain.IsEditable(creator) + if err != nil { + return err + } + + // Validate registrationPolicy + rp, err := topLevelDomain.ValidateTopLevelDomainRegistrationPolicy(registrationPolicy) + if err != nil { + return err + } + + // Update domain store + topLevelDomain.UpdateRegistrationPolicy(rp) + k.SetTopLevelDomain(ctx, topLevelDomain) + + // Emit event + EmitUpdateTopLevelDomainRegistrationPolicyEvent(ctx, topLevelDomain) + + return nil +} diff --git a/x/registry/module_simulation.go b/x/registry/module_simulation.go index c3f2453a..e609d9ff 100644 --- a/x/registry/module_simulation.go +++ b/x/registry/module_simulation.go @@ -48,6 +48,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgUpdateTextRecord int = 100 + opWeightMsgUpdateTopLevelDomainRegistrationPolicy = "op_weight_msg_update_top_level_domain_registration_policy" //#nosec G101 + // TODO: Determine the simulation weight value + defaultWeightMsgUpdateTopLevelDomainRegistrationPolicy int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -142,6 +146,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp registrysimulation.SimulateMsgUpdateTextRecord(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgUpdateTopLevelDomainRegistrationPolicy int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgUpdateTopLevelDomainRegistrationPolicy, &weightMsgUpdateTopLevelDomainRegistrationPolicy, nil, + func(_ *rand.Rand) { + weightMsgUpdateTopLevelDomainRegistrationPolicy = defaultWeightMsgUpdateTopLevelDomainRegistrationPolicy + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgUpdateTopLevelDomainRegistrationPolicy, + registrysimulation.SimulateMsgUpdateTopLevelDomainRegistrationPolicy(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/registry/simulation/update_top_level_domain_registration_policy.go b/x/registry/simulation/update_top_level_domain_registration_policy.go new file mode 100644 index 00000000..c2e6fb83 --- /dev/null +++ b/x/registry/simulation/update_top_level_domain_registration_policy.go @@ -0,0 +1,30 @@ +package simulation + +import ( + "math/rand" + + "github.com/cosmos/cosmos-sdk/baseapp" + sdk "github.com/cosmos/cosmos-sdk/types" + simtypes "github.com/cosmos/cosmos-sdk/types/simulation" + + "github.com/mycel-domain/mycel/x/registry/keeper" + "github.com/mycel-domain/mycel/x/registry/types" +) + +func SimulateMsgUpdateTopLevelDomainRegistrationPolicy( + ak types.AccountKeeper, + bk types.BankKeeper, + k keeper.Keeper, +) simtypes.Operation { + return func(r *rand.Rand, app *baseapp.BaseApp, ctx sdk.Context, accs []simtypes.Account, chainID string, + ) (simtypes.OperationMsg, []simtypes.FutureOperation, error) { + simAccount, _ := simtypes.RandomAcc(r, accs) + msg := &types.MsgUpdateTopLevelDomainRegistrationPolicy{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the UpdateTopLevelDomainRegistrationPolicy simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "UpdateTopLevelDomainRegistrationPolicy simulation not implemented"), nil, nil + } +} diff --git a/x/registry/types/codec.go b/x/registry/types/codec.go index 65fb969b..bf6d6381 100644 --- a/x/registry/types/codec.go +++ b/x/registry/types/codec.go @@ -14,6 +14,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgWithdrawRegistrationFee{}, "registry/WithdrawRegistrationFee", nil) cdc.RegisterConcrete(&MsgExtendTopLevelDomainExpirationDate{}, "registry/ExtendTopLevelDomainExpirationDate", nil) cdc.RegisterConcrete(&MsgUpdateTextRecord{}, "registry/UpdateTextRecord", nil) + cdc.RegisterConcrete(&MsgUpdateTopLevelDomainRegistrationPolicy{}, "registry/UpdateTopLevelDomainRegistrationPolicy", nil) // this line is used by starport scaffolding # 2 } @@ -36,6 +37,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgUpdateTextRecord{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgUpdateTopLevelDomainRegistrationPolicy{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/registry/types/errors.go b/x/registry/types/errors.go index d8f5ee9d..02d1b591 100644 --- a/x/registry/types/errors.go +++ b/x/registry/types/errors.go @@ -47,3 +47,9 @@ var ( ErrNoWithdrawalAmountToWithdraw = errorsmod.Register(ModuleName, 1302, "no registration fee to withdraw") ErrInvalidDenom = errorsmod.Register(ModuleName, 1303, "invalid denom") ) + +// policy sentinel errors +var ( + ErrInvalidRegistrationPolicy = errorsmod.Register(ModuleName, 1400, "invalid registration policy") + ErrNotAllowedRegisterDomain = errorsmod.Register(ModuleName, 1401, "not allowed to regsiter under private domain") +) diff --git a/x/registry/types/events.go b/x/registry/types/events.go index 7eadb7aa..14b2f4cc 100644 --- a/x/registry/types/events.go +++ b/x/registry/types/events.go @@ -72,3 +72,11 @@ const ( AttributeExtendTopLevelDomainExpirationDateEventRegistrationFeeToBurn = "registration-fee-to-burn" AttributeExtendTopLevelDomainExpirationDateEventRegistrationFeeToTreasury = "registration-fee-to-treasury" ) + +// Update top-level-domain registration policy +const ( + EventTypeUpdateTopLevelDomainRegistrationPolicy = "update-top-level-domain-registration-policy" + + AttributeUpdateTopLevelDomainRegistrationPolicyEventDomainName = "name" + AttributeUpdateTopLevelDomainRegistrationPolicyEventRegistrationPolicy = "registration-policy" +) diff --git a/x/registry/types/genesis.go b/x/registry/types/genesis.go index d1ea2234..543b3ebb 100644 --- a/x/registry/types/genesis.go +++ b/x/registry/types/genesis.go @@ -18,6 +18,7 @@ func GetDefaultTLDNames() []string { func GetDefaultTLDs() (defaultTLDs []TopLevelDomain) { defaultRegistrationConfig := GetDefaultSubdomainConfig(3030) defaultRegistrationConfig.MaxSubdomainRegistrations = math.MaxInt64 + defaultRegistrationConfig.RegistrationPolicy = RegistrationPolicyType_PUBLIC for _, v := range GetDefaultTLDNames() { defaultTLDs = append(defaultTLDs, TopLevelDomain{ Name: v, diff --git a/x/registry/types/message_update_top_level_domain_registration_policy.go b/x/registry/types/message_update_top_level_domain_registration_policy.go new file mode 100644 index 00000000..27e2bb07 --- /dev/null +++ b/x/registry/types/message_update_top_level_domain_registration_policy.go @@ -0,0 +1,49 @@ +package types + +import ( + errorsmod "cosmossdk.io/errors" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgUpdateTopLevelDomainRegistrationPolicy = "update_top_level_domain_registration_policy" + +var _ sdk.Msg = &MsgUpdateTopLevelDomainRegistrationPolicy{} + +func NewMsgUpdateTopLevelDomainRegistrationPolicy(creator string, name string, registrationPolicy string) *MsgUpdateTopLevelDomainRegistrationPolicy { + return &MsgUpdateTopLevelDomainRegistrationPolicy{ + Creator: creator, + Name: name, + RegistrationPolicy: registrationPolicy, + } +} + +func (msg *MsgUpdateTopLevelDomainRegistrationPolicy) Route() string { + return RouterKey +} + +func (msg *MsgUpdateTopLevelDomainRegistrationPolicy) Type() string { + return TypeMsgUpdateTopLevelDomainRegistrationPolicy +} + +func (msg *MsgUpdateTopLevelDomainRegistrationPolicy) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateTopLevelDomainRegistrationPolicy) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgUpdateTopLevelDomainRegistrationPolicy) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/registry/types/message_update_top_level_domain_registration_policy_test.go b/x/registry/types/message_update_top_level_domain_registration_policy_test.go new file mode 100644 index 00000000..88edd0e0 --- /dev/null +++ b/x/registry/types/message_update_top_level_domain_registration_policy_test.go @@ -0,0 +1,42 @@ +package types + +import ( + "testing" + + "github.com/stretchr/testify/require" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + + "github.com/mycel-domain/mycel/testutil/sample" +) + +func TestMsgUpdateTopLevelDomainRegistrationPolicy_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgUpdateTopLevelDomainRegistrationPolicy + err error + }{ + { + name: "invalid address", + msg: MsgUpdateTopLevelDomainRegistrationPolicy{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgUpdateTopLevelDomainRegistrationPolicy{ + Creator: sample.AccAddress(), + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + err := tt.msg.ValidateBasic() + if tt.err != nil { + require.ErrorIs(t, err, tt.err) + return + } + require.NoError(t, err) + }) + } +} diff --git a/x/registry/types/query.pb.go b/x/registry/types/query.pb.go index 4191c27d..c70dd825 100644 --- a/x/registry/types/query.pb.go +++ b/x/registry/types/query.pb.go @@ -743,6 +743,7 @@ type QueryDomainRegistrationFeeRequest struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` Parent string `protobuf:"bytes,2,opt,name=parent,proto3" json:"parent,omitempty"` RegistrationPeriodInYear uint64 `protobuf:"varint,3,opt,name=registrationPeriodInYear,proto3" json:"registrationPeriodInYear,omitempty"` + Registerer string `protobuf:"bytes,4,opt,name=registerer,proto3" json:"registerer,omitempty"` } func (m *QueryDomainRegistrationFeeRequest) Reset() { *m = QueryDomainRegistrationFeeRequest{} } @@ -799,6 +800,13 @@ func (m *QueryDomainRegistrationFeeRequest) GetRegistrationPeriodInYear() uint64 return 0 } +func (m *QueryDomainRegistrationFeeRequest) GetRegisterer() string { + if m != nil { + return m.Registerer + } + return "" +} + type QueryDomainRegistrationFeeResponse struct { IsRegistrable bool `protobuf:"varint,1,opt,name=isRegistrable,proto3" json:"isRegistrable,omitempty"` Fee github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,2,rep,name=fee,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"fee"` @@ -996,79 +1004,80 @@ func init() { func init() { proto.RegisterFile("mycel/registry/query.proto", fileDescriptor_0f2c8f2d33ba1956) } var fileDescriptor_0f2c8f2d33ba1956 = []byte{ - // 1145 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x57, 0x4f, 0x6f, 0xdc, 0x44, - 0x14, 0x8f, 0x93, 0x4d, 0x68, 0x5f, 0x21, 0x25, 0x43, 0x88, 0x36, 0x06, 0xbc, 0xe9, 0x94, 0xd2, - 0x00, 0x8a, 0x27, 0x7f, 0x9a, 0x82, 0x4a, 0x91, 0x48, 0x88, 0x52, 0x10, 0xa1, 0x0d, 0x6e, 0x2f, - 0x20, 0x55, 0x91, 0x77, 0x77, 0xe2, 0x18, 0xbc, 0x1e, 0xc7, 0xe3, 0x2d, 0x89, 0x56, 0x7b, 0xe9, - 0x15, 0x21, 0x55, 0x42, 0x7c, 0x07, 0x40, 0x70, 0xe0, 0x80, 0x38, 0xf0, 0x01, 0xa8, 0x04, 0x87, - 0x4a, 0x5c, 0x38, 0x51, 0x94, 0xf0, 0x2d, 0xb8, 0x20, 0x8f, 0xc7, 0xdd, 0xb5, 0xd7, 0x76, 0x76, - 0xc3, 0x9e, 0xd6, 0x9e, 0xf7, 0x67, 0x7e, 0xef, 0x37, 0x3f, 0xbf, 0x37, 0x0b, 0x6a, 0xe3, 0xb0, - 0x46, 0x1d, 0xe2, 0x53, 0xcb, 0xe6, 0x81, 0x7f, 0x48, 0xf6, 0x9b, 0xd4, 0x3f, 0xd4, 0x3d, 0x9f, - 0x05, 0x0c, 0x4d, 0x0a, 0x9b, 0x1e, 0xdb, 0xd4, 0xd7, 0x6a, 0x8c, 0x37, 0x18, 0x27, 0x55, 0x93, - 0xd3, 0xc8, 0x91, 0xdc, 0x5b, 0xaa, 0xd2, 0xc0, 0x5c, 0x22, 0x9e, 0x69, 0xd9, 0xae, 0x19, 0xd8, - 0xcc, 0x8d, 0x62, 0x55, 0xad, 0xdb, 0x37, 0xf6, 0xaa, 0x31, 0x3b, 0xb6, 0x4f, 0x5b, 0xcc, 0x62, - 0xe2, 0x91, 0x84, 0x4f, 0x72, 0xf5, 0x45, 0x8b, 0x31, 0xcb, 0xa1, 0xc4, 0xf4, 0x6c, 0x62, 0xba, - 0x2e, 0x0b, 0x44, 0x4a, 0x2e, 0xad, 0x15, 0x69, 0x15, 0x6f, 0xd5, 0xe6, 0x2e, 0x09, 0xec, 0x06, - 0xe5, 0x81, 0xd9, 0xf0, 0xa4, 0xc3, 0xa5, 0x54, 0x31, 0x75, 0xd6, 0x30, 0x6d, 0x77, 0x87, 0x7d, - 0xee, 0x52, 0x9f, 0xef, 0xd9, 0xb1, 0xdb, 0x0b, 0x29, 0x37, 0xcf, 0xf4, 0xcd, 0x46, 0xbc, 0xc9, - 0x7c, 0xca, 0xc8, 0x69, 0x8d, 0xb9, 0xf5, 0x1d, 0x87, 0xde, 0xa3, 0xce, 0x4e, 0x94, 0x30, 0x67, - 0xb7, 0x80, 0x79, 0x19, 0x6e, 0x78, 0x1a, 0xd0, 0x47, 0x21, 0x57, 0xdb, 0x62, 0x17, 0x83, 0xee, - 0x37, 0x29, 0x0f, 0xf0, 0x07, 0xf0, 0x5c, 0x62, 0x95, 0x7b, 0xcc, 0xe5, 0x14, 0x5d, 0x81, 0x89, - 0x08, 0x4d, 0x59, 0x99, 0x53, 0xe6, 0xcf, 0x2d, 0xcf, 0xe8, 0xc9, 0x33, 0xd0, 0x23, 0xff, 0xf5, - 0xd2, 0xc3, 0xbf, 0x2a, 0x23, 0x86, 0xf4, 0xc5, 0x2b, 0xf0, 0x92, 0x48, 0x76, 0x83, 0x06, 0x77, - 0x98, 0xb7, 0x15, 0x62, 0xd8, 0x10, 0x10, 0xe4, 0x6e, 0x08, 0x41, 0xc9, 0x35, 0x1b, 0x54, 0x24, - 0x3d, 0x6b, 0x88, 0x67, 0xec, 0x82, 0x96, 0x17, 0x24, 0xc1, 0x6c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2, 0xea, 0x4c, 0x8d, 0x36, 0x69, 0xc9, 0x29, 0xd1, 0x5e, - 0x7f, 0xef, 0xe1, 0x91, 0xa6, 0x3c, 0x3a, 0xd2, 0x94, 0xbf, 0x8f, 0x34, 0xe5, 0xc1, 0xb1, 0x36, - 0xf2, 0xe8, 0x58, 0x1b, 0xf9, 0xf3, 0x58, 0x1b, 0xf9, 0x44, 0xef, 0x9a, 0xad, 0x19, 0xd9, 0x0f, - 0xba, 0x3a, 0x4f, 0x38, 0x67, 0xab, 0x13, 0xe2, 0x7f, 0xc5, 0xca, 0x7f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0xfd, 0x7b, 0x5f, 0x01, 0xa7, 0x10, 0x00, 0x00, + // 1161 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x97, 0xcb, 0x6f, 0xdc, 0x44, + 0x18, 0xc0, 0xe3, 0x64, 0x13, 0xda, 0x8f, 0x92, 0x92, 0x21, 0x44, 0x9b, 0x05, 0xbc, 0xe9, 0x94, + 0xd2, 0x00, 0x8a, 0x27, 0x8f, 0xa6, 0xa0, 0x52, 0x24, 0x12, 0xaa, 0x16, 0x44, 0x68, 0x53, 0xa7, + 0x97, 0x22, 0x55, 0x91, 0x37, 0x3b, 0x71, 0x0c, 0x5e, 0x8f, 0xe3, 0x71, 0x4a, 0xa2, 0xd5, 0x5e, + 0x7a, 0xe2, 0x82, 0x54, 0x09, 0xf1, 0x3f, 0xf0, 0x3c, 0x70, 0x40, 0x1c, 0xf8, 0x03, 0xa8, 0xc4, + 0xa5, 0x12, 0x17, 0xb8, 0x50, 0x94, 0xf0, 0x87, 0x20, 0xcf, 0x8c, 0xbb, 0xb6, 0x63, 0x3b, 0xbb, + 0x21, 0xa7, 0xb5, 0xe7, 0x7b, 0xcc, 0xef, 0x7b, 0x78, 0xbe, 0x59, 0xa8, 0xb5, 0xf6, 0x36, 0xa8, + 0x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, 0xbb, + 0x38, 0x8b, 0x8d, 0xfe, 0xd2, 0xe0, 0xc5, 0xdc, 0xd1, 0x82, 0xf2, 0x8b, 0x5b, 0x36, 0x34, 0x6b, + 0xf3, 0xfd, 0x98, 0x28, 0xee, 0xbb, 0x82, 0x7b, 0x0d, 0xdd, 0xee, 0x85, 0x3b, 0x39, 0x3e, 0xd6, + 0x37, 0x29, 0xcd, 0x36, 0x37, 0x69, 0x77, 0x47, 0x67, 0x07, 0x7d, 0xa9, 0x41, 0x25, 0x3a, 0x9f, + 0xd1, 0x54, 0x2e, 0x57, 0x62, 0x10, 0xd4, 0xce, 0x95, 0x68, 0x28, 0xd0, 0xf7, 0x04, 0xe8, 0x15, + 0xf4, 0x76, 0x29, 0x68, 0x74, 0xe6, 0x93, 0x76, 0x77, 0x84, 0x74, 0x48, 0x5b, 0x8d, 0x8c, 0xce, + 0xf2, 0x07, 0x8f, 0xf6, 0x75, 0xed, 0xf1, 0xbe, 0xae, 0xfd, 0xb3, 0xaf, 0x6b, 0x0f, 0x0f, 0xf4, + 0x81, 0xc7, 0x07, 0xfa, 0xc0, 0x9f, 0x07, 0xfa, 0xc0, 0x27, 0x46, 0x62, 0xd0, 0xe6, 0x78, 0xdf, + 0x4d, 0x1c, 0x43, 0xd1, 0xd0, 0x6d, 0x8c, 0x88, 0x3f, 0x21, 0x0b, 0xff, 0x05, 0x00, 0x00, 0xff, + 0xff, 0xf1, 0x1a, 0xed, 0x4b, 0xd4, 0x10, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -2020,6 +2029,13 @@ func (m *QueryDomainRegistrationFeeRequest) MarshalToSizedBuffer(dAtA []byte) (i _ = i var l int _ = l + if len(m.Registerer) > 0 { + i -= len(m.Registerer) + copy(dAtA[i:], m.Registerer) + i = encodeVarintQuery(dAtA, i, uint64(len(m.Registerer))) + i-- + dAtA[i] = 0x22 + } if m.RegistrationPeriodInYear != 0 { i = encodeVarintQuery(dAtA, i, uint64(m.RegistrationPeriodInYear)) i-- @@ -2412,6 +2428,10 @@ func (m *QueryDomainRegistrationFeeRequest) Size() (n int) { if m.RegistrationPeriodInYear != 0 { n += 1 + sovQuery(uint64(m.RegistrationPeriodInYear)) } + l = len(m.Registerer) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } return n } @@ -4016,6 +4036,38 @@ func (m *QueryDomainRegistrationFeeRequest) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Registerer", 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.Registerer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipQuery(dAtA[iNdEx:]) diff --git a/x/registry/types/query.pb.gw.go b/x/registry/types/query.pb.gw.go index 40d94c7d..ce664946 100644 --- a/x/registry/types/query.pb.gw.go +++ b/x/registry/types/query.pb.gw.go @@ -344,7 +344,7 @@ func local_request_Query_DomainOwnershipAll_0(ctx context.Context, marshaler run } var ( - filter_Query_DomainRegistrationFee_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0, "parent": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} + filter_Query_DomainRegistrationFee_0 = &utilities.DoubleArray{Encoding: map[string]int{"name": 0, "parent": 1, "registerer": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}} ) func request_Query_DomainRegistrationFee_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { @@ -380,6 +380,17 @@ func request_Query_DomainRegistrationFee_0(ctx context.Context, marshaler runtim return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) } + val, ok = pathParams["registerer"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "registerer") + } + + protoReq.Registerer, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "registerer", err) + } + if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -425,6 +436,17 @@ func local_request_Query_DomainRegistrationFee_0(ctx context.Context, marshaler return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "parent", err) } + val, ok = pathParams["registerer"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "registerer") + } + + protoReq.Registerer, err = runtime.String(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "registerer", err) + } + if err := req.ParseForm(); err != nil { return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) } @@ -965,7 +987,7 @@ var ( pattern_Query_DomainOwnershipAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"mycel-domain", "mycel", "registry", "domain_ownership"}, "", runtime.AssumeColonVerbOpt(true))) - pattern_Query_DomainRegistrationFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"mycel-domain", "mycel", "registry", "domain_registration_fee", "name", "parent"}, "", runtime.AssumeColonVerbOpt(true))) + pattern_Query_DomainRegistrationFee_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5, 1, 0, 4, 1, 5, 6}, []string{"mycel-domain", "mycel", "registry", "domain_registration_fee", "name", "parent", "registerer"}, "", runtime.AssumeColonVerbOpt(true))) pattern_Query_Role_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"mycel-domain", "mycel", "registry", "role", "domainName", "address"}, "", runtime.AssumeColonVerbOpt(true))) ) diff --git a/x/registry/types/subdomain_config.go b/x/registry/types/subdomain_config.go index 35127660..18622923 100644 --- a/x/registry/types/subdomain_config.go +++ b/x/registry/types/subdomain_config.go @@ -17,6 +17,7 @@ func GetDefaultSubdomainConfig(baseFee int64) SubdomainConfig { SubdomainRegistrationFees: &SubdomainRegistrationFees{ DefaultFee: &defaultFee, }, + RegistrationPolicy: RegistrationPolicyType_PRIVATE, } } diff --git a/x/registry/types/subdomain_config.pb.go b/x/registry/types/subdomain_config.pb.go index d7f50c2c..88331e5a 100644 --- a/x/registry/types/subdomain_config.pb.go +++ b/x/registry/types/subdomain_config.pb.go @@ -23,6 +23,31 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type RegistrationPolicyType int32 + +const ( + RegistrationPolicyType_PRIVATE RegistrationPolicyType = 0 + RegistrationPolicyType_PUBLIC RegistrationPolicyType = 1 +) + +var RegistrationPolicyType_name = map[int32]string{ + 0: "PRIVATE", + 1: "PUBLIC", +} + +var RegistrationPolicyType_value = map[string]int32{ + "PRIVATE": 0, + "PUBLIC": 1, +} + +func (x RegistrationPolicyType) String() string { + return proto.EnumName(RegistrationPolicyType_name, int32(x)) +} + +func (RegistrationPolicyType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_a1e8e4d1516ffeeb, []int{0} +} + type SubdomainRegistrationFees struct { FeeByLength []*FeeByLength `protobuf:"bytes,1,rep,name=feeByLength,proto3" json:"feeByLength,omitempty"` FeeByName []*FeeByName `protobuf:"bytes,2,rep,name=feeByName,proto3" json:"feeByName,omitempty"` @@ -209,6 +234,7 @@ type SubdomainConfig struct { IsRegistrable bool `protobuf:"varint,3,opt,name=isRegistrable,proto3" json:"isRegistrable,omitempty"` RegistrableRole DomainRole `protobuf:"varint,4,opt,name=registrableRole,proto3,enum=mycel.registry.DomainRole" json:"registrableRole,omitempty"` CustomExpirationDate bool `protobuf:"varint,5,opt,name=customExpirationDate,proto3" json:"customExpirationDate,omitempty"` + RegistrationPolicy RegistrationPolicyType `protobuf:"varint,6,opt,name=registrationPolicy,proto3,enum=mycel.registry.RegistrationPolicyType" json:"registrationPolicy,omitempty"` } func (m *SubdomainConfig) Reset() { *m = SubdomainConfig{} } @@ -279,7 +305,15 @@ func (m *SubdomainConfig) GetCustomExpirationDate() bool { return false } +func (m *SubdomainConfig) GetRegistrationPolicy() RegistrationPolicyType { + if m != nil { + return m.RegistrationPolicy + } + return RegistrationPolicyType_PRIVATE +} + func init() { + proto.RegisterEnum("mycel.registry.RegistrationPolicyType", RegistrationPolicyType_name, RegistrationPolicyType_value) proto.RegisterType((*SubdomainRegistrationFees)(nil), "mycel.registry.SubdomainRegistrationFees") proto.RegisterType((*FeeByLength)(nil), "mycel.registry.FeeByLength") proto.RegisterType((*FeeByName)(nil), "mycel.registry.FeeByName") @@ -291,36 +325,39 @@ func init() { } var fileDescriptor_a1e8e4d1516ffeeb = []byte{ - // 453 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xcf, 0x8a, 0x13, 0x41, - 0x10, 0xc6, 0xd3, 0x9b, 0xb8, 0x98, 0x0a, 0xbb, 0x0b, 0x8d, 0xc8, 0x24, 0xc2, 0x10, 0xa2, 0x42, - 0x44, 0xec, 0x61, 0xe3, 0x41, 0x04, 0xbd, 0xec, 0xc6, 0xe0, 0x41, 0x3c, 0xb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xd6, 0x61, 0xe3, 0x76, 0x1d, 0x36, 0xbe, 0xb2, 0x44, 0xd9, 0xeb, 0x79, - 0xcc, 0xa4, 0xce, 0x22, 0x27, 0xe2, 0x95, 0xb7, 0xe8, 0x83, 0x68, 0xb1, 0x7d, 0x72, 0x76, 0x39, - 0x43, 0x13, 0x1f, 0xbb, 0xa7, 0xf6, 0xfa, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x94, 0x09, 0xc4, - 0x43, 0xe8, 0x03, 0x00, 0x00, + // 511 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0xdf, 0x8a, 0xd3, 0x40, + 0x14, 0xc6, 0x3b, 0x76, 0xad, 0xf6, 0x84, 0xfd, 0xc3, 0x20, 0x4b, 0x5a, 0x21, 0x94, 0xfa, 0x87, + 0xaa, 0x98, 0xd0, 0x7a, 0x21, 0x82, 0x5e, 0xd8, 0x76, 0x8b, 0x0b, 0x8b, 0x94, 0x71, 0xdd, 0x0b, + 0x6f, 0x24, 0xc9, 0x9e, 0x66, 0x07, 0x92, 0x4c, 0xc9, 0x4c, 0xa5, 0x79, 0x0b, 0x1f, 0xc5, 0xc7, + 0xf0, 0x4a, 0xf6, 0xd2, 0x4b, 0x69, 0x5f, 0x44, 0x32, 0xd9, 0x6e, 0xbb, 0xd9, 0x14, 0xbc, 0xf1, + 0xae, 0xa7, 0xf9, 0x9d, 0xf3, 0x7d, 0xdf, 0xcc, 0x19, 0x78, 0x12, 0xa5, 0x3e, 0x86, 0x4e, 0x82, + 0x01, 0x97, 0x2a, 0x49, 0x1d, 0x39, 0xf3, 0xce, 0x45, 0xe4, 0xf2, 0xf8, 0xab, 0x2f, 0xe2, 0x09, + 0x0f, 0xec, 0x69, 0x22, 0x94, 0xa0, 0x7b, 0x1a, 0xb3, 0x57, 0x58, 0xd3, 0xf2, 0x85, 0x8c, 0x84, + 0x74, 0x3c,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 0xe9, 0x57, 0xff, + 0xea, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x17, 0x0c, 0x15, 0xd4, 0x73, 0x04, 0x00, 0x00, } func (m *SubdomainRegistrationFees) Marshal() (dAtA []byte, err error) { @@ -508,6 +545,11 @@ func (m *SubdomainConfig) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.RegistrationPolicy != 0 { + i = encodeVarintSubdomainConfig(dAtA, i, uint64(m.RegistrationPolicy)) + i-- + dAtA[i] = 0x30 + } if m.CustomExpirationDate { i-- if m.CustomExpirationDate { @@ -650,6 +692,9 @@ func (m *SubdomainConfig) Size() (n int) { if m.CustomExpirationDate { n += 2 } + if m.RegistrationPolicy != 0 { + n += 1 + sovSubdomainConfig(uint64(m.RegistrationPolicy)) + } return n } @@ -1219,6 +1264,25 @@ func (m *SubdomainConfig) Unmarshal(dAtA []byte) error { } } m.CustomExpirationDate = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationPolicy", wireType) + } + m.RegistrationPolicy = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSubdomainConfig + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RegistrationPolicy |= RegistrationPolicyType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSubdomainConfig(dAtA[iNdEx:]) diff --git a/x/registry/types/top_level_domain.go b/x/registry/types/top_level_domain.go index c63ee194..34840954 100644 --- a/x/registry/types/top_level_domain.go +++ b/x/registry/types/top_level_domain.go @@ -53,6 +53,10 @@ func (topLevelDomain *TopLevelDomain) ExtendExpirationDate(from time.Time, exten return expirationDate } +func (topLevelDomain *TopLevelDomain) UpdateRegistrationPolicy(rp RegistrationPolicyType) { + topLevelDomain.SubdomainConfig.RegistrationPolicy = rp +} + func (topLevelDomain TopLevelDomain) IsEditable(sender string) (isEditable bool, err error) { role := topLevelDomain.GetRole(sender) if role == DomainRole_NO_ROLE { diff --git a/x/registry/types/tx.pb.go b/x/registry/types/tx.pb.go index 46fa76cf..edfc0bc4 100644 --- a/x/registry/types/tx.pb.go +++ b/x/registry/types/tx.pb.go @@ -794,6 +794,110 @@ func (m *MsgUpdateTextRecordResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateTextRecordResponse proto.InternalMessageInfo +type MsgUpdateTopLevelDomainRegistrationPolicy struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` + RegistrationPolicy string `protobuf:"bytes,3,opt,name=registrationPolicy,proto3" json:"registrationPolicy,omitempty"` +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) Reset() { + *m = MsgUpdateTopLevelDomainRegistrationPolicy{} +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) String() string { + return proto.CompactTextString(m) +} +func (*MsgUpdateTopLevelDomainRegistrationPolicy) ProtoMessage() {} +func (*MsgUpdateTopLevelDomainRegistrationPolicy) Descriptor() ([]byte, []int) { + return fileDescriptor_7a4e7619dfc6612f, []int{14} +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicy.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 *MsgUpdateTopLevelDomainRegistrationPolicy) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicy.Merge(m, src) +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicy.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicy proto.InternalMessageInfo + +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) GetRegistrationPolicy() string { + if m != nil { + return m.RegistrationPolicy + } + return "" +} + +type MsgUpdateTopLevelDomainRegistrationPolicyResponse struct { +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) Reset() { + *m = MsgUpdateTopLevelDomainRegistrationPolicyResponse{} +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgUpdateTopLevelDomainRegistrationPolicyResponse) ProtoMessage() {} +func (*MsgUpdateTopLevelDomainRegistrationPolicyResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7a4e7619dfc6612f, []int{15} +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicyResponse.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 *MsgUpdateTopLevelDomainRegistrationPolicyResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicyResponse.Merge(m, src) +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicyResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateTopLevelDomainRegistrationPolicyResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateWalletRecord)(nil), "mycel.registry.MsgUpdateWalletRecord") proto.RegisterType((*MsgUpdateWalletRecordResponse)(nil), "mycel.registry.MsgUpdateWalletRecordResponse") @@ -809,59 +913,65 @@ func init() { proto.RegisterType((*MsgExtendTopLevelDomainExpirationDateResponse)(nil), "mycel.registry.MsgExtendTopLevelDomainExpirationDateResponse") proto.RegisterType((*MsgUpdateTextRecord)(nil), "mycel.registry.MsgUpdateTextRecord") proto.RegisterType((*MsgUpdateTextRecordResponse)(nil), "mycel.registry.MsgUpdateTextRecordResponse") + proto.RegisterType((*MsgUpdateTopLevelDomainRegistrationPolicy)(nil), "mycel.registry.MsgUpdateTopLevelDomainRegistrationPolicy") + proto.RegisterType((*MsgUpdateTopLevelDomainRegistrationPolicyResponse)(nil), "mycel.registry.MsgUpdateTopLevelDomainRegistrationPolicyResponse") } func init() { proto.RegisterFile("mycel/registry/tx.proto", fileDescriptor_7a4e7619dfc6612f) } var fileDescriptor_7a4e7619dfc6612f = []byte{ - // 748 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0xcf, 0x4f, 0x13, 0x4f, - 0x14, 0xef, 0x7c, 0xcb, 0x8f, 0x7c, 0x1f, 0x11, 0xc8, 0xca, 0x8f, 0x65, 0x85, 0x05, 0x56, 0x30, - 0x88, 0x76, 0x57, 0x0a, 0x5e, 0x4c, 0xbc, 0x20, 0x10, 0x35, 0x36, 0x31, 0x2b, 0x86, 0xe8, 0x85, - 0x6c, 0xbb, 0xcf, 0x65, 0xa5, 0xdd, 0xd9, 0xec, 0x0c, 0xa5, 0x3d, 0x79, 0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, 0xd2, 0x08, 0xf4, 0x96, 0xad, 0xe2, 0x1e, 0xca, 0xbd, 0x02, 0x10, 0x4e, 0xb4, - 0x69, 0x98, 0x8a, 0x15, 0x68, 0x22, 0xf3, 0xa9, 0xc7, 0x50, 0xfb, 0x48, 0x40, 0x8a, 0x10, 0x6b, - 0x1e, 0xbb, 0x54, 0xfd, 0x73, 0x70, 0xc5, 0x6e, 0x50, 0x36, 0x89, 0x6f, 0x5d, 0x4c, 0x50, 0x3e, - 0x09, 0xca, 0x69, 0x5d, 0x91, 0xec, 0x03, 0x02, 0x93, 0x39, 0xe6, 0x98, 0xe2, 0x82, 0x30, 0x78, - 0x86, 0x05, 0xea, 0xd9, 0x4f, 0x6a, 0x37, 0xb4, 0x26, 0x2e, 0xe8, 0x92, 0x0a, 0xb8, 0x07, 0x72, - 0xbd, 0x07, 0x2c, 0xee, 0x52, 0xef, 0x29, 0x06, 0x2e, 0xb5, 0x1f, 0x79, 0x2f, 0xd0, 0x0a, 0x44, - 0x2d, 0x3d, 0x66, 0x62, 0x5c, 0xbb, 0x01, 0x73, 0x9d, 0x14, 0x46, 0xa5, 0xbc, 0x23, 0x30, 0xd1, - 0x04, 0xdc, 0xa4, 0xfe, 0xc5, 0xeb, 0xe8, 0xa4, 0x37, 0x7d, 0x86, 0xde, 0x03, 0x02, 0xb3, 0x89, - 0x3a, 0x1a, 0x6a, 0xa5, 0x0d, 0x18, 0xe4, 0x2d, 0x11, 0x21, 0x6b, 0x20, 0xab, 0xea, 0xad, 0x1f, - 0x9e, 0xde, 0x96, 0xdf, 0x96, 0x25, 0x2d, 0x43, 0xfa, 0x15, 0x86, 0xe2, 0x07, 0xb2, 0xb3, 0x9d, - 0x93, 0x37, 0x10, 0xcd, 0x1a, 0x5a, 0x7b, 0x2c, 0x7a, 0x62, 0xcb, 0xe5, 0x3b, 0x76, 0x60, 0xed, - 0x9b, 0x4d, 0x95, 0x6c, 0x20, 0x9e, 0xef, 0xa8, 0xb4, 0xcf, 0x04,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xb2, 0x29, 0xdf, 0x8e, 0x21, 0x4a, 0x44, 0x2b, 0x2b, 0xe7, 0x41, 0x47, 0x02, 0xca, 0x30, - 0x96, 0x60, 0xa5, 0x37, 0x3b, 0xf0, 0xb5, 0x42, 0x95, 0xa5, 0xae, 0xa1, 0xd1, 0xbe, 0x55, 0x18, - 0x4f, 0x32, 0xa6, 0xb8, 0xf3, 0x4b, 0xc0, 0x2a, 0xd9, 0xee, 0xb1, 0xd1, 0xd6, 0x9f, 0x08, 0x68, - 0x5d, 0x38, 0xc5, 0xdd, 0x18, 0xea, 0xb3, 0xd3, 0x94, 0xfb, 0x17, 0x4a, 0x8b, 0xc4, 0xd9, 0x30, - 0x7c, 0xea, 0x43, 0xbc, 0x9e, 0xd8, 0x50, 0x7f, 0x41, 0xca, 0xad, 0x2e, 0x40, 0x8d, 0x5d, 0x56, - 0x1f, 0x1e, 0x1e, 0xab, 0xe4, 0xe8, 0x58, 0x25, 0xbf, 0x8f, 0x55, 0xf2, 0xe1, 0x44, 0x4d, 0x1d, - 0x9d, 0xa8, 0xa9, 0x1f, 0x27, 0x6a, 0xea, 0xa5, 0xde, 0x64, 0xc2, 0x82, 0x30, 0x13, 0x3e, 0xe1, - 0xc2, 0x89, 0x51, 0x69, 0x7a, 0xe4, 0xd5, 0x0c, 0x39, 0xdf, 0x27, 0x9e, 0x76, 0xcb, 0x7f, 0x02, - 0x00, 0x00, 0xff, 0xff, 0x7a, 0x5b, 0x88, 0x2a, 0x62, 0x0a, 0x00, 0x00, + // 804 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x56, 0x4f, 0x4f, 0xd4, 0x40, + 0x14, 0xdf, 0x71, 0xf9, 0x13, 0x1f, 0x11, 0x48, 0xe5, 0x4f, 0xa9, 0x50, 0xa0, 0x02, 0x01, 0x74, + 0x5b, 0x77, 0xc1, 0x83, 0x26, 0x1e, 0x44, 0x20, 0x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0xee, 0xbc, 0x6d, 0x52, 0xfe, 0x63, 0xd9, 0x9f, 0x48, 0xa5, 0xba, 0xe7, 0x74, 0xa5, 0xf5, + 0xe5, 0xfa, 0xbc, 0x47, 0xf4, 0xca, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x48, 0xd9, 0xd6, 0x2e, + 0xcc, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -883,6 +993,7 @@ type MsgClient interface { WithdrawRegistrationFee(ctx context.Context, in *MsgWithdrawRegistrationFee, opts ...grpc.CallOption) (*MsgWithdrawRegistrationFeeResponse, error) ExtendTopLevelDomainExpirationDate(ctx context.Context, in *MsgExtendTopLevelDomainExpirationDate, opts ...grpc.CallOption) (*MsgExtendTopLevelDomainExpirationDateResponse, error) UpdateTextRecord(ctx context.Context, in *MsgUpdateTextRecord, opts ...grpc.CallOption) (*MsgUpdateTextRecordResponse, error) + UpdateTopLevelDomainRegistrationPolicy(ctx context.Context, in *MsgUpdateTopLevelDomainRegistrationPolicy, opts ...grpc.CallOption) (*MsgUpdateTopLevelDomainRegistrationPolicyResponse, error) } type msgClient struct { @@ -956,6 +1067,15 @@ func (c *msgClient) UpdateTextRecord(ctx context.Context, in *MsgUpdateTextRecor return out, nil } +func (c *msgClient) UpdateTopLevelDomainRegistrationPolicy(ctx context.Context, in *MsgUpdateTopLevelDomainRegistrationPolicy, opts ...grpc.CallOption) (*MsgUpdateTopLevelDomainRegistrationPolicyResponse, error) { + out := new(MsgUpdateTopLevelDomainRegistrationPolicyResponse) + err := c.cc.Invoke(ctx, "/mycel.registry.Msg/UpdateTopLevelDomainRegistrationPolicy", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { UpdateWalletRecord(context.Context, *MsgUpdateWalletRecord) (*MsgUpdateWalletRecordResponse, error) @@ -965,6 +1085,7 @@ type MsgServer interface { WithdrawRegistrationFee(context.Context, *MsgWithdrawRegistrationFee) (*MsgWithdrawRegistrationFeeResponse, error) ExtendTopLevelDomainExpirationDate(context.Context, *MsgExtendTopLevelDomainExpirationDate) (*MsgExtendTopLevelDomainExpirationDateResponse, error) UpdateTextRecord(context.Context, *MsgUpdateTextRecord) (*MsgUpdateTextRecordResponse, error) + UpdateTopLevelDomainRegistrationPolicy(context.Context, *MsgUpdateTopLevelDomainRegistrationPolicy) (*MsgUpdateTopLevelDomainRegistrationPolicyResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -992,6 +1113,9 @@ func (*UnimplementedMsgServer) ExtendTopLevelDomainExpirationDate(ctx context.Co func (*UnimplementedMsgServer) UpdateTextRecord(ctx context.Context, req *MsgUpdateTextRecord) (*MsgUpdateTextRecordResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method UpdateTextRecord not implemented") } +func (*UnimplementedMsgServer) UpdateTopLevelDomainRegistrationPolicy(ctx context.Context, req *MsgUpdateTopLevelDomainRegistrationPolicy) (*MsgUpdateTopLevelDomainRegistrationPolicyResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateTopLevelDomainRegistrationPolicy not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1123,6 +1247,24 @@ func _Msg_UpdateTextRecord_Handler(srv interface{}, ctx context.Context, dec fun return interceptor(ctx, in, info, handler) } +func _Msg_UpdateTopLevelDomainRegistrationPolicy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateTopLevelDomainRegistrationPolicy) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateTopLevelDomainRegistrationPolicy(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mycel.registry.Msg/UpdateTopLevelDomainRegistrationPolicy", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateTopLevelDomainRegistrationPolicy(ctx, req.(*MsgUpdateTopLevelDomainRegistrationPolicy)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "mycel.registry.Msg", HandlerType: (*MsgServer)(nil), @@ -1155,6 +1297,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "UpdateTextRecord", Handler: _Msg_UpdateTextRecord_Handler, }, + { + MethodName: "UpdateTopLevelDomainRegistrationPolicy", + Handler: _Msg_UpdateTopLevelDomainRegistrationPolicy_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "mycel/registry/tx.proto", @@ -1727,6 +1873,73 @@ func (m *MsgUpdateTextRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, er return len(dAtA) - i, nil } +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) 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 *MsgUpdateTopLevelDomainRegistrationPolicy) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RegistrationPolicy) > 0 { + i -= len(m.RegistrationPolicy) + copy(dAtA[i:], m.RegistrationPolicy) + i = encodeVarintTx(dAtA, i, uint64(len(m.RegistrationPolicy))) + i-- + dAtA[i] = 0x1a + } + 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] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) 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 *MsgUpdateTopLevelDomainRegistrationPolicyResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) 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 @@ -1991,6 +2204,36 @@ func (m *MsgUpdateTextRecordResponse) Size() (n int) { return n } +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Name) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RegistrationPolicy) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateTopLevelDomainRegistrationPolicyResponse) 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 } @@ -3700,6 +3943,202 @@ func (m *MsgUpdateTextRecordResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateTopLevelDomainRegistrationPolicy) 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: MsgUpdateTopLevelDomainRegistrationPolicy: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateTopLevelDomainRegistrationPolicy: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", 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.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationPolicy", 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.RegistrationPolicy = 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 *MsgUpdateTopLevelDomainRegistrationPolicyResponse) 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: MsgUpdateTopLevelDomainRegistrationPolicyResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateTopLevelDomainRegistrationPolicyResponse: 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 diff --git a/x/registry/types/validate_top_level_domain.go b/x/registry/types/validate_top_level_domain.go index f9641f2b..69f5c7eb 100644 --- a/x/registry/types/validate_top_level_domain.go +++ b/x/registry/types/validate_top_level_domain.go @@ -19,6 +19,15 @@ func ValidateTopLevelDomainName(name string) (err error) { return err } +func (topLevelDomain TopLevelDomain) ValidateTopLevelDomainRegistrationPolicy(rps string) (RegistrationPolicyType, error) { + i, isFound := RegistrationPolicyType_value[rps] + if !isFound { + err := errorsmod.Wrapf(ErrInvalidRegistrationPolicy, "%s", rps) + return RegistrationPolicyType_PRIVATE, err + } + return RegistrationPolicyType(i), nil +} + func (topLevelDomain TopLevelDomain) ValidateName() (err error) { err = ValidateTopLevelDomainName(topLevelDomain.Name) return err