diff --git a/docs/static/openapi.yml b/docs/static/openapi.yml index af1279aa..2fe8a355 100644 --- a/docs/static/openapi.yml +++ b/docs/static/openapi.yml @@ -50303,7 +50303,7 @@ paths: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: @@ -50531,7 +50531,7 @@ paths: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: @@ -81193,7 +81193,7 @@ definitions: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: @@ -81361,7 +81361,7 @@ definitions: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: @@ -81653,7 +81653,7 @@ definitions: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: @@ -81838,7 +81838,7 @@ definitions: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: @@ -82107,7 +82107,7 @@ definitions: properties: name: type: string - expirationDate: + expirationDateInUnixNano: type: string format: int64 metadata: diff --git a/proto/mycel/registry/top_level_domain.proto b/proto/mycel/registry/top_level_domain.proto index 068e01ac..a03082d6 100644 --- a/proto/mycel/registry/top_level_domain.proto +++ b/proto/mycel/registry/top_level_domain.proto @@ -10,7 +10,7 @@ option go_package = "github.com/mycel-domain/mycel/x/registry/types"; message TopLevelDomain { string name = 1; - int64 expirationDate = 2; + int64 expirationDateInUnixNano = 2; map metadata = 3; SubdomainConfig subdomainConfig = 4; uint64 subdomainCount = 5; diff --git a/x/registry/keeper/events.go b/x/registry/keeper/events.go index 4d4fa598..ce6adf87 100644 --- a/x/registry/keeper/events.go +++ b/x/registry/keeper/events.go @@ -1,7 +1,9 @@ package keeper import ( + "time" "fmt" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/mycel-domain/mycel/x/registry/types" "strconv" @@ -9,11 +11,12 @@ import ( // Register top-level-domain event func EmitRegisterTopLevelDomainEvent(ctx sdk.Context, domain types.TopLevelDomain, fee types.TopLevelDomainFee) { + expirationDate := time.Unix(0, domain.ExpirationDateInUnixNano) ctx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeRegisterTopLevelDomain, sdk.NewAttribute(types.AttributeRegisterTopLevelDomainEventName, domain.Name), - sdk.NewAttribute(types.AttributeRegisterTopLevelDomainEventExpirationDate, fmt.Sprintf("%d", domain.ExpirationDate)), + sdk.NewAttribute(types.AttributeRegisterTopLevelDomainEventExpirationDate, expirationDate.String()), sdk.NewAttribute(types.AttributeRegisterTopLevelDomainEventMaxSubdomainRegistrations, fmt.Sprintf("%d", domain.SubdomainConfig.MaxSubdomainRegistrations)), sdk.NewAttribute(types.AttributeRegisterTopLevelDomainEventTotalRegistrationFee, fee.TotalFee.String()), sdk.NewAttribute(types.AttributeRegisterTopLevelDomainEventBurnWeight, fee.BurnWeight), @@ -71,10 +74,11 @@ func EmitWithdrawRegistrationFeeEvent(ctx sdk.Context, msg types.MsgWithdrawRegi // Extend top-level-domain expiration date event func EmitExtendTopLevelDomainExpirationDateEvent(ctx sdk.Context, domain types.TopLevelDomain, fee types.TopLevelDomainFee) { + expirationDate := time.Unix(0, domain.ExpirationDateInUnixNano) ctx.EventManager().EmitEvent( sdk.NewEvent(types.EventTypeExtendTopLevelDomainExpirationDate, sdk.NewAttribute(types.AttributeExtendTopLevelDomainExpirationDateEventDomainName, domain.Name), - sdk.NewAttribute(types.AttributeExtendTopLevelDomainExpirationDateEventExpirationDate, fmt.Sprintf("%d", domain.ExpirationDate)), + sdk.NewAttribute(types.AttributeExtendTopLevelDomainExpirationDateEventExpirationDate, expirationDate.String()), sdk.NewAttribute(types.AttributeExtendTopLevelDomainExpirationDateEventTotalRegistrationFee, fee.TotalFee.String()), sdk.NewAttribute(types.AttributeExtendTopLevelDomainExpirationDateEventBurnWeight, fee.BurnWeight), sdk.NewAttribute(types.AttributeExtendTopLevelDomainExpirationDateEventRegistrationFeeToBurn, fee.FeeToBurn.String()), diff --git a/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go b/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go index 3a3e766f..1cc7d733 100644 --- a/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go +++ b/x/registry/keeper/msg_server_extend_top_level_domain_expiration_date_test.go @@ -51,8 +51,7 @@ func (suite *KeeperTestSuite) TestExtendTopLevelDomain() { suite.Require().Nil(err) beforeDomain, found := suite.app.RegistryKeeper.GetTopLevelDomain(suite.ctx, name) suite.Require().True(found) - beforeExpirationDate := time.Unix(0, beforeDomain.ExpirationDate) - _ = beforeExpirationDate + beforeExpirationDate := time.Unix(0, beforeDomain.ExpirationDateInUnixNano) // Run test case function tc.fn() @@ -78,14 +77,14 @@ func (suite *KeeperTestSuite) TestExtendTopLevelDomain() { suite.Require().Nil(err) // Evaluate if domain is extended // Response - registerExpirationDate := time.Unix(0, registerRsp.TopLevelDomain.ExpirationDate) - extendExpirationDate := time.Unix(0, extendRsp.TopLevelDomain.ExpirationDate) + registerExpirationDate := time.Unix(0, registerRsp.TopLevelDomain.ExpirationDateInUnixNano) + extendExpirationDate := time.Unix(0, extendRsp.TopLevelDomain.ExpirationDateInUnixNano) suite.Require().Equal(registerExpirationDate.AddDate(0, 0, int(tc.extensionPeriodInYear)*params.OneYearInDays), extendExpirationDate) // Store afterDomain, found := suite.app.RegistryKeeper.GetTopLevelDomain(suite.ctx, name) suite.Require().True(found) expAfterExpirationDate := beforeExpirationDate.AddDate(0, 0, int(tc.extensionPeriodInYear)*params.OneYearInDays) - afterExpirationDate := time.Unix(0, afterDomain.ExpirationDate) + afterExpirationDate := time.Unix(0, afterDomain.ExpirationDateInUnixNano) suite.Require().Equal(expAfterExpirationDate, afterExpirationDate) // Evalute events 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 612d6172..6a395f6b 100644 --- a/x/registry/keeper/msg_server_register_top_level_domain.go +++ b/x/registry/keeper/msg_server_register_top_level_domain.go @@ -25,12 +25,12 @@ 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, - TotalWithdrawalAmount: sdk.NewCoins(), + Name: msg.Name, + ExpirationDateInUnixNano: expirationDate.UnixNano(), + Metadata: nil, + SubdomainConfig: &defaultRegistrationConfig, + AccessControl: accessControl, + TotalWithdrawalAmount: sdk.NewCoins(), } fee, err := k.Keeper.RegisterTopLevelDomain(ctx, domain, msg.Creator, msg.RegistrationPeriodInYear) diff --git a/x/registry/keeper/top_level_domain.go b/x/registry/keeper/top_level_domain.go index 6659a6ba..8fcf83d0 100644 --- a/x/registry/keeper/top_level_domain.go +++ b/x/registry/keeper/top_level_domain.go @@ -85,8 +85,8 @@ func (k Keeper) GetValidTopLevelDomain(ctx sdk.Context, name string) (topLevelDo } // Check if domain is not expired - expirationDate := time.Unix(0, topLevelDomain.ExpirationDate) - if ctx.BlockTime().After(expirationDate) && topLevelDomain.ExpirationDate != 0 { + expirationDate := time.Unix(0, topLevelDomain.ExpirationDateInUnixNano) + if ctx.BlockTime().After(expirationDate) && topLevelDomain.ExpirationDateInUnixNano != 0 { return topLevelDomain, errorsmod.Wrapf(types.ErrDomainExpired, "%s", name) } @@ -219,7 +219,7 @@ func (k Keeper) ExtendTopLevelDomainExpirationDate(ctx sdk.Context, creator stri } // Update domain store - currentExpirationDate := time.Unix(0, domain.ExpirationDate) + currentExpirationDate := time.Unix(0, domain.ExpirationDateInUnixNano) domain.ExtendExpirationDate(currentExpirationDate, extensionPeriodInYear) k.SetTopLevelDomain(ctx, *domain) diff --git a/x/registry/keeper/top_level_domain_test.go b/x/registry/keeper/top_level_domain_test.go index 01e11941..2c087136 100644 --- a/x/registry/keeper/top_level_domain_test.go +++ b/x/registry/keeper/top_level_domain_test.go @@ -73,21 +73,21 @@ func (suite *KeeperTestSuite) TestGetValidTopLevelDomain() { { topLevelDomain: types.TopLevelDomain{ Name: "test", - ExpirationDate: suite.ctx.BlockTime().AddDate(0, 0, 20).UnixNano(), + ExpirationDateInUnixNano: suite.ctx.BlockTime().AddDate(0, 0, 20).UnixNano(), }, expErr: nil, }, { topLevelDomain: types.TopLevelDomain{ Name: "test", - ExpirationDate: 0, + ExpirationDateInUnixNano: 0, }, expErr: nil, }, { topLevelDomain: types.TopLevelDomain{ Name: "test", - ExpirationDate: suite.ctx.BlockTime().AddDate(0, 0, -20).UnixNano(), + ExpirationDateInUnixNano: suite.ctx.BlockTime().AddDate(0, 0, -20).UnixNano(), }, expErr: errorsmod.Wrapf(types.ErrDomainExpired, "test"), }, diff --git a/x/registry/types/top_level_domain.go b/x/registry/types/top_level_domain.go index 68385282..ba5164c4 100644 --- a/x/registry/types/top_level_domain.go +++ b/x/registry/types/top_level_domain.go @@ -56,7 +56,7 @@ func (topLevelDomain TopLevelDomain) IsEditable(sender string) (isEditable bool, func (topLevelDomain *TopLevelDomain) ExtendExpirationDate(from time.Time, extensionPeriodInYear uint64) (expirationDateInUnixNano int64) { newExpirationDate := from.AddDate(0, 0, params.OneYearInDays*int(extensionPeriodInYear)) expirationDateInUnixNano = newExpirationDate.UnixNano() - topLevelDomain.ExpirationDate = expirationDateInUnixNano + topLevelDomain.ExpirationDateInUnixNano = expirationDateInUnixNano return expirationDateInUnixNano } diff --git a/x/registry/types/top_level_domain.pb.go b/x/registry/types/top_level_domain.pb.go index 592fcff9..ba9fbd0e 100644 --- a/x/registry/types/top_level_domain.pb.go +++ b/x/registry/types/top_level_domain.pb.go @@ -26,13 +26,13 @@ var _ = math.Inf const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package type TopLevelDomain struct { - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - ExpirationDate int64 `protobuf:"varint,2,opt,name=expirationDate,proto3" json:"expirationDate,omitempty"` - Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` - SubdomainConfig *SubdomainConfig `protobuf:"bytes,4,opt,name=subdomainConfig,proto3" json:"subdomainConfig,omitempty"` - SubdomainCount uint64 `protobuf:"varint,5,opt,name=subdomainCount,proto3" json:"subdomainCount,omitempty"` - AccessControl map[string]DomainRole `protobuf:"bytes,6,rep,name=accessControl,proto3" json:"accessControl,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=mycel.registry.DomainRole"` - TotalWithdrawalAmount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=totalWithdrawalAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"totalWithdrawalAmount"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + ExpirationDateInUnixNano int64 `protobuf:"varint,2,opt,name=expirationDateInUnixNano,proto3" json:"expirationDateInUnixNano,omitempty"` + Metadata map[string]string `protobuf:"bytes,3,rep,name=metadata,proto3" json:"metadata,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"bytes,2,opt,name=value,proto3"` + SubdomainConfig *SubdomainConfig `protobuf:"bytes,4,opt,name=subdomainConfig,proto3" json:"subdomainConfig,omitempty"` + SubdomainCount uint64 `protobuf:"varint,5,opt,name=subdomainCount,proto3" json:"subdomainCount,omitempty"` + AccessControl map[string]DomainRole `protobuf:"bytes,6,rep,name=accessControl,proto3" json:"accessControl,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3,enum=mycel.registry.DomainRole"` + TotalWithdrawalAmount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,7,rep,name=totalWithdrawalAmount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"totalWithdrawalAmount"` } func (m *TopLevelDomain) Reset() { *m = TopLevelDomain{} } @@ -75,9 +75,9 @@ func (m *TopLevelDomain) GetName() string { return "" } -func (m *TopLevelDomain) GetExpirationDate() int64 { +func (m *TopLevelDomain) GetExpirationDateInUnixNano() int64 { if m != nil { - return m.ExpirationDate + return m.ExpirationDateInUnixNano } return 0 } @@ -197,43 +197,44 @@ func init() { } var fileDescriptor_0136e389ac8054f7 = []byte{ - // 573 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0x31, 0x6f, 0xd3, 0x40, - 0x14, 0x8e, 0x9b, 0xa4, 0x34, 0x57, 0x25, 0xc0, 0xa9, 0x48, 0xae, 0x07, 0x27, 0xaa, 0x04, 0x78, - 0xa0, 0x76, 0x13, 0x16, 0x04, 0x53, 0x93, 0x52, 0x15, 0x09, 0x16, 0x13, 0x29, 0x12, 0x42, 0x8a, - 0xce, 0xce, 0xab, 0x63, 0xd5, 0xf6, 0x59, 0xe7, 0x73, 0xa8, 0xc7, 0xae, 0x4c, 0xfc, 0x0e, 0x7e, - 0x49, 0xc7, 0x8e, 0x4c, 0x14, 0x25, 0x7f, 0x82, 0x11, 0xf9, 0xec, 0x06, 0xdb, 0x54, 0xc0, 0xd0, - 0x29, 0x77, 0xcf, 0xdf, 0xfb, 0xbe, 0xf7, 0xbd, 0xf7, 0x72, 0xe8, 0xb1, 0x9f, 0xd8, 0xe0, 0x19, - 0x0c, 0x1c, 0x37, 0xe2, 0x2c, 0x31, 0x38, 0x0d, 0xa7, 0x1e, 0x2c, 0xc0, 0x9b, 0xce, 0xa8, 0x4f, - 0xdc, 0x40, 0x0f, 0x19, 0xe5, 0x14, 0x77, 0x04, 0x4c, 0xbf, 0x81, 0x29, 0x3b, 0x0e, 0x75, 0xa8, - 0xf8, 0x64, 0xa4, 0xa7, 0x0c, 0xa5, 0xa8, 0x36, 0x8d, 0x7c, 0x1a, 0x19, 0x16, 0x89, 0xc0, 0x58, - 0xf4, 0x2d, 0x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52, 0xad, - 0x2c, 0x30, 0x3c, 0xb9, 0x5c, 0xaa, 0xd2, 0xd5, 0x52, 0x95, 0x7e, 0x2c, 0x55, 0xe9, 0xcb, 0x4a, - 0xad, 0x5d, 0xad, 0xd4, 0xda, 0xb7, 0x95, 0x5a, 0xfb, 0xa0, 0x17, 0x18, 0xc5, 0x14, 0xf7, 0xb3, - 0xbf, 0x4a, 0x76, 0x31, 0xce, 0x0b, 0x2f, 0x5c, 0xca, 0x6e, 0x6d, 0x8a, 0xf7, 0xe4, 0xf9, 0xaf, - 0x00, 0x00, 0x00, 0xff, 0xff, 0x52, 0x79, 0xab, 0x18, 0x00, 0x05, 0x00, 0x00, + // 587 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x54, 0xcd, 0x6e, 0xd3, 0x4c, + 0x14, 0x8d, 0xf3, 0xd3, 0xaf, 0x99, 0x2a, 0xf9, 0x60, 0x54, 0x24, 0xd7, 0x0b, 0x27, 0xaa, 0x04, + 0x78, 0x41, 0xed, 0x26, 0x6c, 0x50, 0x59, 0x35, 0x29, 0x55, 0x2b, 0x01, 0x0b, 0x13, 0x14, 0x09, + 0x21, 0x45, 0x63, 0x67, 0xea, 0x58, 0xb5, 0x67, 0xac, 0xf1, 0x38, 0xc4, 0x4b, 0xb6, 0xac, 0xd8, + 0xf0, 0x12, 0x3c, 0x49, 0x97, 0x5d, 0xb2, 0xa2, 0x28, 0x79, 0x09, 0x96, 0xc8, 0x63, 0x37, 0xd8, + 0xa6, 0xfc, 0x2c, 0xba, 0xf2, 0xfc, 0x9c, 0x7b, 0xee, 0x3d, 0xf7, 0x5c, 0x0f, 0xb8, 0xef, 0xc7, + 0x36, 0xf6, 0x0c, 0x86, 0x1d, 0x37, 0xe4, 0x2c, 0x36, 0x38, 0x0d, 0x26, 0x1e, 0x9e, 0x63, 0x6f, + 0x32, 0xa5, 0x3e, 0x72, 0x89, 0x1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0xce, 0x40, 0xf3, 0x0c, 0xe3, 0x11, 0x1d, 0x44, 0x8c, 0xc8, 0x35, 0x31, 0x83, + 0x7f, 0xa8, 0xc4, 0x48, 0x2a, 0xf9, 0x70, 0xd5, 0x79, 0xf8, 0x8f, 0x95, 0x98, 0x3f, 0xc9, 0x61, + 0x00, 0x5a, 0x62, 0x33, 0x62, 0x18, 0x85, 0x11, 0x8b, 0xb3, 0x89, 0xbf, 0xcd, 0x6c, 0xc5, 0x04, + 0x83, 0x93, 0x8b, 0xa5, 0x2a, 0x5d, 0x2e, 0x55, 0xe9, 0xdb, 0x52, 0x95, 0x3e, 0xae, 0xd4, 0xca, + 0xe5, 0x4a, 0xad, 0x7c, 0x59, 0xa9, 0x95, 0x37, 0x7a, 0x8e, 0x51, 0xb8, 0xb8, 0x97, 0xfe, 0x2a, + 0xe9, 0xc6, 0x58, 0xe4, 0x5e, 0xbd, 0x84, 0xdd, 0xda, 0x10, 0x6f, 0xcc, 0xe3, 0x1f, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xa0, 0xff, 0x47, 0xe6, 0x14, 0x05, 0x00, 0x00, } func (m *TopLevelDomain) Marshal() (dAtA []byte, err error) { @@ -323,8 +324,8 @@ func (m *TopLevelDomain) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0x1a } } - if m.ExpirationDate != 0 { - i = encodeVarintTopLevelDomain(dAtA, i, uint64(m.ExpirationDate)) + if m.ExpirationDateInUnixNano != 0 { + i = encodeVarintTopLevelDomain(dAtA, i, uint64(m.ExpirationDateInUnixNano)) i-- dAtA[i] = 0x10 } @@ -423,8 +424,8 @@ func (m *TopLevelDomain) Size() (n int) { if l > 0 { n += 1 + l + sovTopLevelDomain(uint64(l)) } - if m.ExpirationDate != 0 { - n += 1 + sovTopLevelDomain(uint64(m.ExpirationDate)) + if m.ExpirationDateInUnixNano != 0 { + n += 1 + sovTopLevelDomain(uint64(m.ExpirationDateInUnixNano)) } if len(m.Metadata) > 0 { for k, v := range m.Metadata { @@ -550,9 +551,9 @@ func (m *TopLevelDomain) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 0 { - return fmt.Errorf("proto: wrong wireType = %d for field ExpirationDate", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field ExpirationDateInUnixNano", wireType) } - m.ExpirationDate = 0 + m.ExpirationDateInUnixNano = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTopLevelDomain @@ -562,7 +563,7 @@ func (m *TopLevelDomain) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - m.ExpirationDate |= int64(b&0x7F) << shift + m.ExpirationDateInUnixNano |= int64(b&0x7F) << shift if b < 0x80 { break } diff --git a/x/registry/types/top_level_domain_test.go b/x/registry/types/top_level_domain_test.go index fa94f2f0..aa3a93d9 100644 --- a/x/registry/types/top_level_domain_test.go +++ b/x/registry/types/top_level_domain_test.go @@ -68,7 +68,7 @@ func TestExtendExpirationDate(t *testing.T) { Name: "myc", } extendExpirationDateInUnixNano := domain.ExtendExpirationDate(tc.from, tc.extensionPeriodInYear) - require.Equal(t, tc.expectedExpirationDate.UnixNano(), domain.ExpirationDate) + require.Equal(t, tc.expectedExpirationDate.UnixNano(), domain.ExpirationDateInUnixNano) require.Equal(t, tc.expectedExpirationDate.UnixNano(), extendExpirationDateInUnixNano) } }