From 6415c147cef4e0c1166a53a633d8eededf84e64c Mon Sep 17 00:00:00 2001 From: tarumi Date: Thu, 2 Nov 2023 13:55:51 +0100 Subject: [PATCH] scaffold extend message --- app/app.go | 2 +- app/params/config.go | 2 +- docs/static/openapi.yml | 2 + proto/mycel/registry/tx.proto | 24 +- x/furnace/keeper/hooks_test.go | 4 +- x/furnace/types/errors.go | 2 +- x/registry/client/cli/tx.go | 1 + .../tx_extend_top_level_domain_expiration.go | 48 ++ x/registry/keeper/keeper.go | 6 +- ...rver_extend_top_level_domain_expiration.go | 17 + .../msg_server_register_top_level_domain.go | 10 +- .../keeper/msg_server_update_dns_record.go | 1 - .../keeper/msg_server_update_wallet_record.go | 1 - x/registry/module_simulation.go | 15 + .../extend_top_level_domain_expiration.go | 29 + x/registry/types/codec.go | 4 + ...sage_extend_top_level_domain_expiration.go | 47 ++ ...extend_top_level_domain_expiration_test.go | 40 ++ .../message_withdraw_registration_fee.go | 2 +- x/registry/types/top_level_domain.go | 2 +- x/registry/types/tx.pb.go | 494 ++++++++++++++++-- 21 files changed, 689 insertions(+), 64 deletions(-) create mode 100644 x/registry/client/cli/tx_extend_top_level_domain_expiration.go create mode 100644 x/registry/keeper/msg_server_extend_top_level_domain_expiration.go create mode 100644 x/registry/simulation/extend_top_level_domain_expiration.go create mode 100644 x/registry/types/message_extend_top_level_domain_expiration.go create mode 100644 x/registry/types/message_extend_top_level_domain_expiration_test.go diff --git a/app/app.go b/app/app.go index 81c73b68..6ff3469c 100644 --- a/app/app.go +++ b/app/app.go @@ -327,7 +327,7 @@ type App struct { RegistryKeeper registrymodulekeeper.Keeper EpochsKeeper epochsmodulekeeper.Keeper ResolverKeeper resolvermodulekeeper.Keeper - FurnaceKeeper furnacemodulekeeper.Keeper + FurnaceKeeper furnacemodulekeeper.Keeper // this line is used by starport scaffolding # stargate/app/keeperDeclaration // mm is the module manager diff --git a/app/params/config.go b/app/params/config.go index 869283b1..e11accda 100644 --- a/app/params/config.go +++ b/app/params/config.go @@ -16,7 +16,7 @@ const ( Bech32PrefixAccAddr = "mycel" - OneYearInDays = 365 + OneYearInDays = 365 ) var ( diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index 37ec88c8..a7095965 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -81185,6 +81185,8 @@ definitions: NOTE: The amount field is an Int which implements the custom method signatures required by gogoproto. + mycel.registry.MsgExtendTopLevelDomainExpirationResponse: + type: object mycel.registry.MsgRegisterSecondLevelDomainResponse: type: object mycel.registry.MsgRegisterTopLevelDomainResponse: diff --git a/proto/mycel/registry/tx.proto b/proto/mycel/registry/tx.proto index 88194e26..e0f31b99 100644 --- a/proto/mycel/registry/tx.proto +++ b/proto/mycel/registry/tx.proto @@ -9,11 +9,12 @@ 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 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 ExtendTopLevelDomainExpiration (MsgExtendTopLevelDomainExpiration) returns (MsgExtendTopLevelDomainExpirationResponse); } message MsgUpdateWalletRecord { string creator = 1; @@ -58,9 +59,14 @@ message MsgWithdrawRegistrationFee { } 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 MsgExtendTopLevelDomainExpiration { + string creator = 1; + string name = 2; + int64 registrationPeriodInYear = 3; +} + +message MsgExtendTopLevelDomainExpirationResponse {} + diff --git a/x/furnace/keeper/hooks_test.go b/x/furnace/keeper/hooks_test.go index e7ee5881..1b7705be 100644 --- a/x/furnace/keeper/hooks_test.go +++ b/x/furnace/keeper/hooks_test.go @@ -27,7 +27,7 @@ type ExpCreateBurnAmountEvent struct { var ( now = time.Now() oneDayDuration = time.Hour*24 + time.Second - defaultConfig = types.GetDefaultEpochBurnConfig() + defaultConfig = types.GetDefaultEpochBurnConfig() ) func (suite *KeeperTestSuite) TestAfterEpochEndCreateBurnAmount() { @@ -45,7 +45,7 @@ func (suite *KeeperTestSuite) TestAfterEpochEndCreateBurnAmount() { }, }, { - epochsCount: int64(defaultConfig.DefaultTotalEpochs+1), + epochsCount: int64(defaultConfig.DefaultTotalEpochs + 1), expectedEvents: []ExpCreateBurnAmountEvent{ { BurnAmountIndex: "1", diff --git a/x/furnace/types/errors.go b/x/furnace/types/errors.go index 7d45999e..1485e8dd 100644 --- a/x/furnace/types/errors.go +++ b/x/furnace/types/errors.go @@ -8,6 +8,6 @@ import ( // x/furnace module sentinel errors var ( - ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") + ErrSample = sdkerrors.Register(ModuleName, 1100, "sample error") ErrInvalidRegistrationPeriod = sdkerrors.Register(ModuleName, 1101, "invalid registration period") ) diff --git a/x/registry/client/cli/tx.go b/x/registry/client/cli/tx.go index c0eb95fc..88782a01 100644 --- a/x/registry/client/cli/tx.go +++ b/x/registry/client/cli/tx.go @@ -35,6 +35,7 @@ func GetTxCmd() *cobra.Command { cmd.AddCommand(CmdRegisterDomain()) cmd.AddCommand(CmdRegisterTopLevelDomain()) cmd.AddCommand(CmdWithdrawRegistrationFee()) + cmd.AddCommand(CmdExtendTopLevelDomainExpiration()) // this line is used by starport scaffolding # 1 return cmd diff --git a/x/registry/client/cli/tx_extend_top_level_domain_expiration.go b/x/registry/client/cli/tx_extend_top_level_domain_expiration.go new file mode 100644 index 00000000..9c20f7c4 --- /dev/null +++ b/x/registry/client/cli/tx_extend_top_level_domain_expiration.go @@ -0,0 +1,48 @@ +package cli + +import ( + "strconv" + + "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" + "github.com/spf13/cast" + "github.com/spf13/cobra" +) + +var _ = strconv.Itoa(0) + +func CmdExtendTopLevelDomainExpiration() *cobra.Command { + cmd := &cobra.Command{ + Use: "extend-top-level-domain-expiration [name] [registration-period-in-year]", + Short: "Broadcast message extendTopLevelDomainExpiration", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) (err error) { + argName := args[0] + argRegistrationPeriodInYear, err := cast.ToInt32E(args[1]) + if err != nil { + return err + } + + clientCtx, err := client.GetClientTxContext(cmd) + if err != nil { + return err + } + + msg := types.NewMsgExtendTopLevelDomainExpiration( + clientCtx.GetFromAddress().String(), + argName, + argRegistrationPeriodInYear, + ) + 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/keeper.go b/x/registry/keeper/keeper.go index e0ef32e2..dc6ed31f 100644 --- a/x/registry/keeper/keeper.go +++ b/x/registry/keeper/keeper.go @@ -48,10 +48,10 @@ func NewKeeper( memKey: memKey, paramstore: ps, - bankKeeper: bankKeeper, + bankKeeper: bankKeeper, distributionKeeper: distributionKeeper, - mintKeeper: mintKeeper, - furnaceKeeper: furnaceKeeper, + mintKeeper: mintKeeper, + furnaceKeeper: furnaceKeeper, } } diff --git a/x/registry/keeper/msg_server_extend_top_level_domain_expiration.go b/x/registry/keeper/msg_server_extend_top_level_domain_expiration.go new file mode 100644 index 00000000..021ade1d --- /dev/null +++ b/x/registry/keeper/msg_server_extend_top_level_domain_expiration.go @@ -0,0 +1,17 @@ +package keeper + +import ( + "context" + + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/mycel-domain/mycel/x/registry/types" +) + +func (k msgServer) ExtendTopLevelDomainExpiration(goCtx context.Context, msg *types.MsgExtendTopLevelDomainExpiration) (*types.MsgExtendTopLevelDomainExpirationResponse, error) { + ctx := sdk.UnwrapSDKContext(goCtx) + + // TODO: Handling the message + _ = ctx + + return &types.MsgExtendTopLevelDomainExpirationResponse{}, nil +} diff --git a/x/registry/keeper/msg_server_register_top_level_domain.go b/x/registry/keeper/msg_server_register_top_level_domain.go index 26835803..a0f31dc8 100644 --- a/x/registry/keeper/msg_server_register_top_level_domain.go +++ b/x/registry/keeper/msg_server_register_top_level_domain.go @@ -30,11 +30,11 @@ func (k msgServer) RegisterTopLevelDomain(goCtx context.Context, msg *types.MsgR defaultRegistrationConfig := types.GetDefaultSubdomainConfig(3030) domain := types.TopLevelDomain{ - Name: msg.Name, - ExpirationDate: expirationDate.UnixNano(), - Metadata: nil, - SubdomainConfig: &defaultRegistrationConfig, - AccessControl: accessControl, + Name: msg.Name, + ExpirationDate: expirationDate.UnixNano(), + Metadata: nil, + SubdomainConfig: &defaultRegistrationConfig, + AccessControl: accessControl, TotalWithdrawalAmount: sdk.NewCoins(), } diff --git a/x/registry/keeper/msg_server_update_dns_record.go b/x/registry/keeper/msg_server_update_dns_record.go index 163948e9..2b7faff6 100644 --- a/x/registry/keeper/msg_server_update_dns_record.go +++ b/x/registry/keeper/msg_server_update_dns_record.go @@ -32,6 +32,5 @@ func (k msgServer) UpdateDnsRecord(goCtx context.Context, msg *types.MsgUpdateDn // Emit event EmitUpdateDnsRecordEvent(ctx, *msg) - return &types.MsgUpdateDnsRecordResponse{}, nil } diff --git a/x/registry/keeper/msg_server_update_wallet_record.go b/x/registry/keeper/msg_server_update_wallet_record.go index 2f8f67d3..6132da64 100644 --- a/x/registry/keeper/msg_server_update_wallet_record.go +++ b/x/registry/keeper/msg_server_update_wallet_record.go @@ -32,6 +32,5 @@ func (k msgServer) UpdateWalletRecord(goCtx context.Context, msg *types.MsgUpdat // Emit event EmitUpdateWalletRecordEvent(ctx, *msg) - return &types.MsgUpdateWalletRecordResponse{}, nil } diff --git a/x/registry/module_simulation.go b/x/registry/module_simulation.go index 7dd05afc..128f37d2 100644 --- a/x/registry/module_simulation.go +++ b/x/registry/module_simulation.go @@ -39,6 +39,10 @@ const ( // TODO: Determine the simulation weight value defaultWeightMsgWithdrawRegistrationFee int = 100 + opWeightMsgExtendTopLevelDomainExpiration = "op_weight_msg_extend_top_level_domain_expiration" + // TODO: Determine the simulation weight value + defaultWeightMsgExtendTopLevelDomainExpiration int = 100 + // this line is used by starport scaffolding # simapp/module/const ) @@ -111,6 +115,17 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp registrysimulation.SimulateMsgWithdrawRegistrationFee(am.accountKeeper, am.bankKeeper, am.keeper), )) + var weightMsgExtendTopLevelDomainExpiration int + simState.AppParams.GetOrGenerate(simState.Cdc, opWeightMsgExtendTopLevelDomainExpiration, &weightMsgExtendTopLevelDomainExpiration, nil, + func(_ *rand.Rand) { + weightMsgExtendTopLevelDomainExpiration = defaultWeightMsgExtendTopLevelDomainExpiration + }, + ) + operations = append(operations, simulation.NewWeightedOperation( + weightMsgExtendTopLevelDomainExpiration, + registrysimulation.SimulateMsgExtendTopLevelDomainExpiration(am.accountKeeper, am.bankKeeper, am.keeper), + )) + // this line is used by starport scaffolding # simapp/module/operation return operations diff --git a/x/registry/simulation/extend_top_level_domain_expiration.go b/x/registry/simulation/extend_top_level_domain_expiration.go new file mode 100644 index 00000000..e0f3ddab --- /dev/null +++ b/x/registry/simulation/extend_top_level_domain_expiration.go @@ -0,0 +1,29 @@ +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 SimulateMsgExtendTopLevelDomainExpiration( + 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.MsgExtendTopLevelDomainExpiration{ + Creator: simAccount.Address.String(), + } + + // TODO: Handling the ExtendTopLevelDomainExpiration simulation + + return simtypes.NoOpMsg(types.ModuleName, msg.Type(), "ExtendTopLevelDomainExpiration simulation not implemented"), nil, nil + } +} diff --git a/x/registry/types/codec.go b/x/registry/types/codec.go index 12dd4af1..6eaccd81 100644 --- a/x/registry/types/codec.go +++ b/x/registry/types/codec.go @@ -12,6 +12,7 @@ func RegisterCodec(cdc *codec.LegacyAmino) { cdc.RegisterConcrete(&MsgRegisterSecondLevelDomain{}, "registry/RegisterSecondLevelDomain", nil) cdc.RegisterConcrete(&MsgRegisterTopLevelDomain{}, "registry/RegisterTopLevelDomain", nil) cdc.RegisterConcrete(&MsgWithdrawRegistrationFee{}, "registry/WithdrawRegistrationFee", nil) + cdc.RegisterConcrete(&MsgExtendTopLevelDomainExpiration{}, "registry/ExtendTopLevelDomainExpiration", nil) // this line is used by starport scaffolding # 2 } @@ -28,6 +29,9 @@ func RegisterInterfaces(registry cdctypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgWithdrawRegistrationFee{}, ) + registry.RegisterImplementations((*sdk.Msg)(nil), + &MsgExtendTopLevelDomainExpiration{}, + ) // this line is used by starport scaffolding # 3 msgservice.RegisterMsgServiceDesc(registry, &_Msg_serviceDesc) diff --git a/x/registry/types/message_extend_top_level_domain_expiration.go b/x/registry/types/message_extend_top_level_domain_expiration.go new file mode 100644 index 00000000..8397c74d --- /dev/null +++ b/x/registry/types/message_extend_top_level_domain_expiration.go @@ -0,0 +1,47 @@ +package types + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +const TypeMsgExtendTopLevelDomainExpiration = "extend_top_level_domain_expiration" + +var _ sdk.Msg = &MsgExtendTopLevelDomainExpiration{} + +func NewMsgExtendTopLevelDomainExpiration(creator string, name string, registrationPeriodInYear int32) *MsgExtendTopLevelDomainExpiration { + return &MsgExtendTopLevelDomainExpiration{ + Creator: creator, + Name: name, + RegistrationPeriodInYear: registrationPeriodInYear, + } +} + +func (msg *MsgExtendTopLevelDomainExpiration) Route() string { + return RouterKey +} + +func (msg *MsgExtendTopLevelDomainExpiration) Type() string { + return TypeMsgExtendTopLevelDomainExpiration +} + +func (msg *MsgExtendTopLevelDomainExpiration) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgExtendTopLevelDomainExpiration) GetSignBytes() []byte { + bz := ModuleCdc.MustMarshalJSON(msg) + return sdk.MustSortJSON(bz) +} + +func (msg *MsgExtendTopLevelDomainExpiration) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return sdkerrors.Wrapf(sdkerrors.ErrInvalidAddress, "invalid creator address (%s)", err) + } + return nil +} diff --git a/x/registry/types/message_extend_top_level_domain_expiration_test.go b/x/registry/types/message_extend_top_level_domain_expiration_test.go new file mode 100644 index 00000000..e6de5f55 --- /dev/null +++ b/x/registry/types/message_extend_top_level_domain_expiration_test.go @@ -0,0 +1,40 @@ +package types + +import ( + "testing" + + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/mycel-domain/mycel/testutil/sample" + "github.com/stretchr/testify/require" +) + +func TestMsgExtendTopLevelDomainExpiration_ValidateBasic(t *testing.T) { + tests := []struct { + name string + msg MsgExtendTopLevelDomainExpiration + err error + }{ + { + name: "invalid address", + msg: MsgExtendTopLevelDomainExpiration{ + Creator: "invalid_address", + }, + err: sdkerrors.ErrInvalidAddress, + }, { + name: "valid address", + msg: MsgExtendTopLevelDomainExpiration{ + 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/message_withdraw_registration_fee.go b/x/registry/types/message_withdraw_registration_fee.go index ce631723..3d632ef7 100644 --- a/x/registry/types/message_withdraw_registration_fee.go +++ b/x/registry/types/message_withdraw_registration_fee.go @@ -1,9 +1,9 @@ package types import ( + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" - errorsmod "cosmossdk.io/errors" ) const TypeMsgWithdrawRegistrationFee = "withdraw_registration_fee" diff --git a/x/registry/types/top_level_domain.go b/x/registry/types/top_level_domain.go index cdeaa8b2..ff7b9ee5 100644 --- a/x/registry/types/top_level_domain.go +++ b/x/registry/types/top_level_domain.go @@ -8,7 +8,7 @@ import ( type TopLevelDomainRegistrationFee struct { TotalRegistrationFee sdk.Coins - BurnWeight math.LegacyDec + BurnWeight math.LegacyDec RegistrationFeeToBurn sdk.Coin RegistrationFeeToTreasury sdk.Coin } diff --git a/x/registry/types/tx.pb.go b/x/registry/types/tx.pb.go index 455a46c4..b6d3943b 100644 --- a/x/registry/types/tx.pb.go +++ b/x/registry/types/tx.pb.go @@ -550,6 +550,106 @@ func (m *MsgWithdrawRegistrationFeeResponse) GetRegistrationFee() github_com_cos return nil } +type MsgExtendTopLevelDomainExpiration 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"` + RegistrationPeriodInYear int64 `protobuf:"varint,3,opt,name=registrationPeriodInYear,proto3" json:"registrationPeriodInYear,omitempty"` +} + +func (m *MsgExtendTopLevelDomainExpiration) Reset() { *m = MsgExtendTopLevelDomainExpiration{} } +func (m *MsgExtendTopLevelDomainExpiration) String() string { return proto.CompactTextString(m) } +func (*MsgExtendTopLevelDomainExpiration) ProtoMessage() {} +func (*MsgExtendTopLevelDomainExpiration) Descriptor() ([]byte, []int) { + return fileDescriptor_7a4e7619dfc6612f, []int{10} +} +func (m *MsgExtendTopLevelDomainExpiration) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExtendTopLevelDomainExpiration) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExtendTopLevelDomainExpiration.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 *MsgExtendTopLevelDomainExpiration) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExtendTopLevelDomainExpiration.Merge(m, src) +} +func (m *MsgExtendTopLevelDomainExpiration) XXX_Size() int { + return m.Size() +} +func (m *MsgExtendTopLevelDomainExpiration) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExtendTopLevelDomainExpiration.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExtendTopLevelDomainExpiration proto.InternalMessageInfo + +func (m *MsgExtendTopLevelDomainExpiration) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgExtendTopLevelDomainExpiration) GetName() string { + if m != nil { + return m.Name + } + return "" +} + +func (m *MsgExtendTopLevelDomainExpiration) GetRegistrationPeriodInYear() int64 { + if m != nil { + return m.RegistrationPeriodInYear + } + return 0 +} + +type MsgExtendTopLevelDomainExpirationResponse struct { +} + +func (m *MsgExtendTopLevelDomainExpirationResponse) Reset() { + *m = MsgExtendTopLevelDomainExpirationResponse{} +} +func (m *MsgExtendTopLevelDomainExpirationResponse) String() string { + return proto.CompactTextString(m) +} +func (*MsgExtendTopLevelDomainExpirationResponse) ProtoMessage() {} +func (*MsgExtendTopLevelDomainExpirationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_7a4e7619dfc6612f, []int{11} +} +func (m *MsgExtendTopLevelDomainExpirationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgExtendTopLevelDomainExpirationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgExtendTopLevelDomainExpirationResponse.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 *MsgExtendTopLevelDomainExpirationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgExtendTopLevelDomainExpirationResponse.Merge(m, src) +} +func (m *MsgExtendTopLevelDomainExpirationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgExtendTopLevelDomainExpirationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgExtendTopLevelDomainExpirationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgExtendTopLevelDomainExpirationResponse proto.InternalMessageInfo + func init() { proto.RegisterType((*MsgUpdateWalletRecord)(nil), "mycel.registry.MsgUpdateWalletRecord") proto.RegisterType((*MsgUpdateWalletRecordResponse)(nil), "mycel.registry.MsgUpdateWalletRecordResponse") @@ -561,49 +661,54 @@ func init() { proto.RegisterType((*MsgRegisterTopLevelDomainResponse)(nil), "mycel.registry.MsgRegisterTopLevelDomainResponse") proto.RegisterType((*MsgWithdrawRegistrationFee)(nil), "mycel.registry.MsgWithdrawRegistrationFee") proto.RegisterType((*MsgWithdrawRegistrationFeeResponse)(nil), "mycel.registry.MsgWithdrawRegistrationFeeResponse") + proto.RegisterType((*MsgExtendTopLevelDomainExpiration)(nil), "mycel.registry.MsgExtendTopLevelDomainExpiration") + proto.RegisterType((*MsgExtendTopLevelDomainExpirationResponse)(nil), "mycel.registry.MsgExtendTopLevelDomainExpirationResponse") } func init() { proto.RegisterFile("mycel/registry/tx.proto", fileDescriptor_7a4e7619dfc6612f) } var fileDescriptor_7a4e7619dfc6612f = []byte{ - // 579 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x41, 0x6f, 0xd3, 0x4c, - 0x10, 0x8d, 0xbf, 0xa4, 0xad, 0xbe, 0x41, 0x50, 0xb4, 0x2a, 0xad, 0x6b, 0x15, 0xb7, 0x98, 0x82, - 0x42, 0x45, 0x6c, 0x12, 0x38, 0x71, 0x2c, 0x15, 0x02, 0x44, 0x24, 0x64, 0x8a, 0x2a, 0xb8, 0x6d, - 0xec, 0x91, 0x6b, 0x48, 0xbc, 0xd6, 0xee, 0x26, 0x6d, 0x4e, 0x9c, 0xb8, 0x73, 0xe2, 0xc2, 0x01, - 0xce, 0xfc, 0x92, 0x1c, 0x7b, 0xe4, 0x04, 0x28, 0xf9, 0x23, 0x28, 0xeb, 0xc4, 0x72, 0xda, 0x38, - 0x4d, 0x51, 0x4f, 0xd9, 0x99, 0x79, 0x79, 0xf3, 0x26, 0x3b, 0x2f, 0x0b, 0x6b, 0xad, 0xae, 0x87, - 0x4d, 0x87, 0x63, 0x10, 0x0a, 0xc9, 0xbb, 0x8e, 0x3c, 0xb6, 0x63, 0xce, 0x24, 0x23, 0xd7, 0x54, - 0xc1, 0x1e, 0x17, 0x8c, 0x95, 0x80, 0x05, 0x4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 0x22, 0xe8, 0x54, 0x40, 0x07, 0x56, 0x73, 0x56, 0xfd, 0xde, 0x0c, 0xbe, - 0x49, 0xa8, 0x51, 0x9d, 0x1b, 0x9a, 0xf6, 0xed, 0xc2, 0x5a, 0xde, 0xda, 0x4e, 0xfb, 0xfd, 0x72, - 0xb0, 0x46, 0x6d, 0x7e, 0xec, 0xb8, 0xf5, 0xee, 0xb3, 0x5e, 0xdf, 0xd4, 0x4e, 0xfa, 0xa6, 0xf6, - 0xa7, 0x6f, 0x6a, 0x9f, 0x07, 0x66, 0xe1, 0x64, 0x60, 0x16, 0x7e, 0x0e, 0xcc, 0xc2, 0x3b, 0x3b, - 0xb3, 0x9f, 0x8a, 0xb7, 0xe2, 0x2b, 0xd5, 0x49, 0xe0, 0x1c, 0x67, 0x5e, 0xae, 0xe1, 0xae, 0x36, - 0x16, 0xd5, 0xbb, 0xf3, 0xf0, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7a, 0x61, 0x5d, 0xde, 0xd8, - 0x06, 0x00, 0x00, + // 630 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4f, 0x6f, 0xd3, 0x4e, + 0x10, 0xcd, 0xfe, 0xd2, 0x3f, 0xfa, 0x0d, 0x82, 0x22, 0xab, 0xb4, 0xae, 0x55, 0xdc, 0x62, 0x0a, + 0x6a, 0x0b, 0xb5, 0x69, 0xe1, 0x02, 0xc7, 0xd2, 0x22, 0x40, 0x54, 0x42, 0xa6, 0xa8, 0x82, 0xdb, + 0xc6, 0x1e, 0xb9, 0x86, 0xc4, 0x6b, 0xed, 0x6e, 0xd3, 0xe4, 0xc4, 0x89, 0x23, 0x88, 0x13, 0x17, + 0x0e, 0x70, 0xe6, 0x93, 0xf4, 0xd8, 0x23, 0x5c, 0x00, 0xb5, 0x5f, 0x04, 0x75, 0x1d, 0x5b, 0x4e, + 0x6b, 0x27, 0x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reference imports to suppress errors if they are not otherwise used. @@ -623,6 +728,7 @@ type MsgClient interface { RegisterSecondLevelDomain(ctx context.Context, in *MsgRegisterSecondLevelDomain, opts ...grpc.CallOption) (*MsgRegisterSecondLevelDomainResponse, error) RegisterTopLevelDomain(ctx context.Context, in *MsgRegisterTopLevelDomain, opts ...grpc.CallOption) (*MsgRegisterTopLevelDomainResponse, error) WithdrawRegistrationFee(ctx context.Context, in *MsgWithdrawRegistrationFee, opts ...grpc.CallOption) (*MsgWithdrawRegistrationFeeResponse, error) + ExtendTopLevelDomainExpiration(ctx context.Context, in *MsgExtendTopLevelDomainExpiration, opts ...grpc.CallOption) (*MsgExtendTopLevelDomainExpirationResponse, error) } type msgClient struct { @@ -678,6 +784,15 @@ func (c *msgClient) WithdrawRegistrationFee(ctx context.Context, in *MsgWithdraw return out, nil } +func (c *msgClient) ExtendTopLevelDomainExpiration(ctx context.Context, in *MsgExtendTopLevelDomainExpiration, opts ...grpc.CallOption) (*MsgExtendTopLevelDomainExpirationResponse, error) { + out := new(MsgExtendTopLevelDomainExpirationResponse) + err := c.cc.Invoke(ctx, "/mycel.registry.Msg/ExtendTopLevelDomainExpiration", 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) @@ -685,6 +800,7 @@ type MsgServer interface { RegisterSecondLevelDomain(context.Context, *MsgRegisterSecondLevelDomain) (*MsgRegisterSecondLevelDomainResponse, error) RegisterTopLevelDomain(context.Context, *MsgRegisterTopLevelDomain) (*MsgRegisterTopLevelDomainResponse, error) WithdrawRegistrationFee(context.Context, *MsgWithdrawRegistrationFee) (*MsgWithdrawRegistrationFeeResponse, error) + ExtendTopLevelDomainExpiration(context.Context, *MsgExtendTopLevelDomainExpiration) (*MsgExtendTopLevelDomainExpirationResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -706,6 +822,9 @@ func (*UnimplementedMsgServer) RegisterTopLevelDomain(ctx context.Context, req * func (*UnimplementedMsgServer) WithdrawRegistrationFee(ctx context.Context, req *MsgWithdrawRegistrationFee) (*MsgWithdrawRegistrationFeeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method WithdrawRegistrationFee not implemented") } +func (*UnimplementedMsgServer) ExtendTopLevelDomainExpiration(ctx context.Context, req *MsgExtendTopLevelDomainExpiration) (*MsgExtendTopLevelDomainExpirationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ExtendTopLevelDomainExpiration not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -801,6 +920,24 @@ func _Msg_WithdrawRegistrationFee_Handler(srv interface{}, ctx context.Context, return interceptor(ctx, in, info, handler) } +func _Msg_ExtendTopLevelDomainExpiration_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgExtendTopLevelDomainExpiration) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).ExtendTopLevelDomainExpiration(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/mycel.registry.Msg/ExtendTopLevelDomainExpiration", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).ExtendTopLevelDomainExpiration(ctx, req.(*MsgExtendTopLevelDomainExpiration)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "mycel.registry.Msg", HandlerType: (*MsgServer)(nil), @@ -825,6 +962,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "WithdrawRegistrationFee", Handler: _Msg_WithdrawRegistrationFee_Handler, }, + { + MethodName: "ExtendTopLevelDomainExpiration", + Handler: _Msg_ExtendTopLevelDomainExpiration_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "mycel/registry/tx.proto", @@ -1203,6 +1344,71 @@ func (m *MsgWithdrawRegistrationFeeResponse) MarshalToSizedBuffer(dAtA []byte) ( return len(dAtA) - i, nil } +func (m *MsgExtendTopLevelDomainExpiration) 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 *MsgExtendTopLevelDomainExpiration) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExtendTopLevelDomainExpiration) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RegistrationPeriodInYear != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.RegistrationPeriodInYear)) + i-- + dAtA[i] = 0x18 + } + 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 *MsgExtendTopLevelDomainExpirationResponse) 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 *MsgExtendTopLevelDomainExpirationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgExtendTopLevelDomainExpirationResponse) 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 @@ -1384,6 +1590,35 @@ func (m *MsgWithdrawRegistrationFeeResponse) Size() (n int) { return n } +func (m *MsgExtendTopLevelDomainExpiration) 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)) + } + if m.RegistrationPeriodInYear != 0 { + n += 1 + sovTx(uint64(m.RegistrationPeriodInYear)) + } + return n +} + +func (m *MsgExtendTopLevelDomainExpirationResponse) 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 } @@ -2506,6 +2741,189 @@ func (m *MsgWithdrawRegistrationFeeResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgExtendTopLevelDomainExpiration) 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: MsgExtendTopLevelDomainExpiration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExtendTopLevelDomainExpiration: 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RegistrationPeriodInYear", wireType) + } + m.RegistrationPeriodInYear = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.RegistrationPeriodInYear |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *MsgExtendTopLevelDomainExpirationResponse) 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: MsgExtendTopLevelDomainExpirationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgExtendTopLevelDomainExpirationResponse: 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