diff --git a/go.mod b/go.mod index 7ae7ded..72235d5 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/tendermint/tendermint v0.34.19 github.com/tendermint/tm-db v0.6.6 golang.org/x/exp v0.0.0-20220609121020-a51bd0440498 - google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb + google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 google.golang.org/grpc v1.45.0 google.golang.org/protobuf v1.27.1 ) @@ -114,9 +114,9 @@ require ( github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.6 // indirect golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 // indirect - golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b // indirect - golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 // indirect - golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect + golang.org/x/net v0.0.0-20220225172249-27dd8689420f // indirect + golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86 // indirect + golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 // indirect golang.org/x/text v0.3.7 // indirect gopkg.in/ini.v1 v1.66.2 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect diff --git a/go.sum b/go.sum index 782b195..fb50973 100644 --- a/go.sum +++ b/go.sum @@ -1389,8 +1389,9 @@ golang.org/x/net v0.0.0-20210614182718-04defd469f4e/go.mod h1:9nx3DQGgdP8bBQD5qx golang.org/x/net v0.0.0-20210813160813-60bc85c4be6d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210903162142-ad29c8ab022f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20210917221730-978cfadd31cf/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b h1:MWaHNqZy3KTpuTMAGvv+Kw+ylsEpmyJZizz1dqxnu28= golang.org/x/net v0.0.0-20211208012354-db4efeb81f4b/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f h1:oA4XRj0qtSt8Yo1Zms0CUlsT3KG69V2UGQWPBxujDmc= +golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1522,11 +1523,13 @@ golang.org/x/sys v0.0.0-20211116061358-0a5406a5449c/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20211124211545-fe61309f8881/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211205182925-97ca703d548d/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211210111614-af8b64212486/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86 h1:A9i04dxx7Cribqbs8jf3FQLogkL/CV2YN7hj9KWJCkc= +golang.org/x/sys v0.0.0-20220315194320-039c03cc5b86/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= -golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -1769,8 +1772,8 @@ google.golang.org/genproto v0.0.0-20211028162531-8db9c33dc351/go.mod h1:5CzLGKJ6 google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211206160659-862468c7d6e0/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= -google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb h1:ZrsicilzPCS/Xr8qtBZZLpy4P9TYXAfl49ctG1/5tgw= -google.golang.org/genproto v0.0.0-20211223182754-3ac035c7e7cb/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106 h1:ErU+UA6wxadoU8nWrsy5MZUVBs75K17zUCsUCIfrXCE= +google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= google.golang.org/grpc v1.33.2 h1:EQyQC3sa8M+p6Ulc8yy9SWSS2GVwyRc83gAbG8lrl4o= google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= diff --git a/proto/marketplace/v1beta1/auction.proto b/proto/marketplace/v1beta1/auction.proto index 25ae0f1..779040d 100644 --- a/proto/marketplace/v1beta1/auction.proto +++ b/proto/marketplace/v1beta1/auction.proto @@ -20,6 +20,7 @@ message AuctionListing { (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coin" ]; google.protobuf.Timestamp start_time = 5 [ + (gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"start_time\"" ]; diff --git a/proto/marketplace/v1beta1/tx.proto b/proto/marketplace/v1beta1/tx.proto index dc2fddf..fa8433a 100644 --- a/proto/marketplace/v1beta1/tx.proto +++ b/proto/marketplace/v1beta1/tx.proto @@ -78,6 +78,7 @@ message MsgCreateAuction { string nft_id = 1; string denom_id = 2; google.protobuf.Timestamp start_time = 3 [ + (gogoproto.nullable) = false, (gogoproto.stdtime) = true, (gogoproto.moretags) = "yaml:\"start_time\"" ]; diff --git a/x/marketplace/keeper/auction.go b/x/marketplace/keeper/auction.go index 663f4e9..66f6129 100644 --- a/x/marketplace/keeper/auction.go +++ b/x/marketplace/keeper/auction.go @@ -230,7 +230,7 @@ func (k Keeper) UpdateAuctionStatusesAndProcessBids(ctx sdk.Context) error { k.RemoveAuctionListing(ctx, auction.GetId()) k.removeAuctionEvent(ctx, auction) } else if !found && auction.EndTime == nil && - ctx.BlockTime().Sub(*auction.StartTime).Seconds() > k.GetBidCloseDuration(ctx).Seconds() { + ctx.BlockTime().Sub(auction.StartTime).Seconds() > k.GetBidCloseDuration(ctx).Seconds() { err := k.nftKeeper.TransferOwnership(ctx, auction.GetDenomId(), auction.GetNftId(), k.accountKeeper.GetModuleAddress(types.ModuleName), auction.GetOwner()) if err != nil { diff --git a/x/marketplace/types/auction.go b/x/marketplace/types/auction.go index e9767a5..e515a58 100644 --- a/x/marketplace/types/auction.go +++ b/x/marketplace/types/auction.go @@ -12,7 +12,7 @@ var ( _ exported.AuctionListingI = &AuctionListing{} ) -func NewAuctionListing(id uint64, nftId, denomId string, startTime, endTime *time.Time, startPrice sdk.Coin, incrementPercentage sdk.Dec, +func NewAuctionListing(id uint64, nftId, denomId string, startTime time.Time, endTime *time.Time, startPrice sdk.Coin, incrementPercentage sdk.Dec, owner sdk.AccAddress, whitelistAccounts []string, splitShares []WeightedAddress) AuctionListing { return AuctionListing{ Id: id, @@ -40,7 +40,7 @@ func (al AuctionListing) GetNftId() string { return al.NftId } func (al AuctionListing) GetStartTime() time.Time { - return *al.StartTime + return al.StartTime } func (al AuctionListing) GetStartPrice() sdk.Coin { diff --git a/x/marketplace/types/auction.pb.go b/x/marketplace/types/auction.pb.go index e180c93..787750d 100644 --- a/x/marketplace/types/auction.pb.go +++ b/x/marketplace/types/auction.pb.go @@ -62,7 +62,7 @@ type AuctionListing struct { NftId string `protobuf:"bytes,2,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty" yaml:"nft_id"` DenomId string `protobuf:"bytes,3,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty" yaml:"denom_id"` StartPrice types.Coin `protobuf:"bytes,4,opt,name=start_price,json=startPrice,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"start_price" yaml:"start_price"` - StartTime *time.Time `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty" yaml:"start_time"` + StartTime time.Time `protobuf:"bytes,5,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` EndTime *time.Time `protobuf:"bytes,6,opt,name=end_time,json=endTime,proto3,stdtime" json:"end_time,omitempty" yaml:"end_time"` Owner string `protobuf:"bytes,7,opt,name=owner,proto3" json:"owner,omitempty"` IncrementPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,8,opt,name=increment_percentage,json=incrementPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"increment_percentage" yaml:"increment_percentage"` @@ -152,54 +152,54 @@ func init() { func init() { proto.RegisterFile("marketplace/v1beta1/auction.proto", fileDescriptor_05488866ddad330f) } var fileDescriptor_05488866ddad330f = []byte{ - // 746 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0x4f, 0x4f, 0xe3, 0x46, - 0x14, 0x8f, 0xf3, 0x8f, 0x64, 0x52, 0x28, 0x0c, 0x50, 0x9c, 0x50, 0xd9, 0xc1, 0x87, 0x36, 0xaa, - 0x84, 0x2d, 0xa0, 0x52, 0x2b, 0x6e, 0x71, 0x08, 0x92, 0xa5, 0x36, 0x44, 0x4e, 0xd2, 0x4a, 0xbd, - 0x58, 0x8e, 0x67, 0x70, 0x46, 0xc4, 0x76, 0x64, 0x4f, 0x4a, 0xb9, 0x75, 0xbf, 0x01, 0x1f, 0x61, - 0xcf, 0xfb, 0x49, 0x38, 0xec, 0x81, 0xe3, 0x6a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, 0x6b, 0x59, 0xf8, 0xc5, - 0x05, 0xcb, 0xc9, 0x3a, 0x77, 0xa8, 0x4d, 0xc7, 0x11, 0x94, 0x40, 0xa5, 0xde, 0x6b, 0x74, 0x8d, - 0x93, 0x96, 0xd5, 0xe9, 0xd6, 0xbb, 0xbd, 0x8e, 0xd5, 0x6b, 0x75, 0xda, 0xcd, 0x86, 0x71, 0x6c, - 0x34, 0x8f, 0x56, 0x53, 0x70, 0x1b, 0x6c, 0x3d, 0xaa, 0x1b, 0xad, 0x7a, 0xa3, 0x6b, 0xfc, 0xd5, - 0x5c, 0x15, 0x60, 0x19, 0x6c, 0x3e, 0x2a, 0x26, 0xa5, 0xb4, 0xde, 0xbb, 0xba, 0x95, 0x52, 0xd7, - 0xb7, 0x52, 0xea, 0xea, 0x4e, 0x12, 0xae, 0xef, 0x24, 0xe1, 0xc3, 0x9d, 0x24, 0x5c, 0xde, 0x4b, - 0xa9, 0xeb, 0x7b, 0x29, 0xf5, 0xee, 0x5e, 0x4a, 0xfd, 0x73, 0xb0, 0x60, 0xbb, 0xd9, 0xe3, 0x69, - 0x8b, 0xff, 0x48, 0x5f, 0x46, 0xcc, 0x87, 0xfd, 0x3c, 0xbb, 0xe9, 0xc1, 0xe7, 0x00, 0x00, 0x00, - 0xff, 0xff, 0xde, 0xb7, 0xff, 0x73, 0x53, 0x05, 0x00, 0x00, + // 743 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x54, 0xc1, 0x4e, 0xeb, 0x46, + 0x14, 0x8d, 0x93, 0x10, 0x92, 0x49, 0xa1, 0x30, 0x40, 0x31, 0xa1, 0xb5, 0x83, 0x17, 0x6d, 0x54, + 0x09, 0x5b, 0x40, 0xa5, 0x56, 0xec, 0xe2, 0x10, 0x24, 0x4b, 0x6d, 0x88, 0x9c, 0xa4, 0xad, 0xba, + 0xb1, 0x1c, 0xcf, 0xe0, 0x8c, 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0x40, 0x9e, 0x0d, 0x4d, 0xfe, 0xcd, 0xa1, 0x29, + 0xa6, 0x7d, 0x6c, 0x4a, 0x58, 0xc7, 0x71, 0xfe, 0xbf, 0x3f, 0x54, 0xe9, 0x4b, 0x1f, 0xac, 0x88, + 0x95, 0xee, 0x50, 0x97, 0x8e, 0x13, 0xa8, 0x80, 0x4a, 0xbd, 0xd7, 0xe8, 0x5a, 0x67, 0x2d, 0xa7, + 0xd3, 0xad, 0x77, 0x7b, 0x1d, 0xa7, 0xd7, 0xea, 0xb4, 0x9b, 0x0d, 0xeb, 0xd4, 0x6a, 0x9e, 0xac, + 0x65, 0xe0, 0x2e, 0xd8, 0x7e, 0x56, 0xb7, 0x5a, 0xf5, 0x46, 0xd7, 0xfa, 0xbe, 0xb9, 0x26, 0xc1, + 0x1d, 0xb0, 0xf5, 0xac, 0x28, 0x4a, 0x59, 0xb3, 0x77, 0x73, 0xaf, 0x64, 0x6e, 0xef, 0x95, 0xcc, + 0xcd, 0x83, 0x22, 0xdd, 0x3e, 0x28, 0xd2, 0xbf, 0x0f, 0x8a, 0x74, 0xfd, 0xa8, 0x64, 0x6e, 0x1f, + 0x95, 0xcc, 0xdf, 0x8f, 0x4a, 0xe6, 0xa7, 0xa3, 0x85, 0xb1, 0x9b, 0x3d, 0x9e, 0xb1, 0xf8, 0x55, + 0x7a, 0x37, 0x62, 0x73, 0xd8, 0x2f, 0xb0, 0x9b, 0x1e, 0xfd, 0x1f, 0x00, 0x00, 0xff, 0xff, 0x3a, + 0x95, 0x5b, 0xe2, 0x57, 0x05, 0x00, 0x00, } func (this *Bid) Equal(that interface{}) bool { @@ -305,16 +305,14 @@ func (m *AuctionListing) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x32 } - if m.StartTime != nil { - n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime):]) - if err2 != nil { - return 0, err2 - } - i -= n2 - i = encodeVarintAuction(dAtA, i, uint64(n2)) - i-- - dAtA[i] = 0x2a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err2 != nil { + return 0, err2 } + i -= n2 + i = encodeVarintAuction(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x2a { size, err := m.StartPrice.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -430,10 +428,8 @@ func (m *AuctionListing) Size() (n int) { } l = m.StartPrice.Size() n += 1 + l + sovAuction(uint64(l)) - if m.StartTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime) - n += 1 + l + sovAuction(uint64(l)) - } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovAuction(uint64(l)) if m.EndTime != nil { l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndTime) n += 1 + l + sovAuction(uint64(l)) @@ -659,10 +655,7 @@ func (m *AuctionListing) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StartTime == nil { - m.StartTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/marketplace/types/msgs.go b/x/marketplace/types/msgs.go index fa36e3c..5875d09 100644 --- a/x/marketplace/types/msgs.go +++ b/x/marketplace/types/msgs.go @@ -208,8 +208,8 @@ func NewMsgCreateAuction(denomId, nftId string, startTime time.Time, duration *t NftId: nftId, DenomId: denomId, Duration: duration, - StartTime: &startTime, - StartPrice: startPrice, + StartTime: startTime, + StartPrice: startPrice, Owner: owner.String(), IncrementPercentage: incrementPercentage, WhitelistAccounts: whitelistAccounts, diff --git a/x/marketplace/types/params.go b/x/marketplace/types/params.go index d88fe5b..5fcffbd 100644 --- a/x/marketplace/types/params.go +++ b/x/marketplace/types/params.go @@ -10,13 +10,13 @@ import ( // Default period for closing bids for an auction const ( - DefaultBidClosePeriod time.Duration = time.Minute * 12 // 12 Minutes + DefaultBidClosePeriod time.Duration = time.Hour * 12 // 12 Hours ) // Parameter keys var ( - ParamStoreKeySaleCommission = []byte("SaleCommission") - ParamStoreKeyDistribution = []byte("MarketplaceDistribution") + ParamStoreKeySaleCommission = []byte("SaleCommission") + ParamStoreKeyDistribution = []byte("MarketplaceDistribution") ParamStoreKeyBidCloseDuration = []byte("BidCloseDuration") ) @@ -27,10 +27,10 @@ func ParamKeyTable() paramtypes.KeyTable { return paramtypes.NewKeyTable().RegisterParamSet(&Params{}) } -func NewMarketplaceParams( saleCommission sdk.Dec, distribution Distribution, bidCloseDuration time.Duration) Params { +func NewMarketplaceParams(saleCommission sdk.Dec, distribution Distribution, bidCloseDuration time.Duration) Params { return Params{ - SaleCommission: saleCommission, - Distribution: distribution, + SaleCommission: saleCommission, + Distribution: distribution, BidCloseDuration: bidCloseDuration, } } @@ -156,4 +156,4 @@ func validateBidCloseDuration(i interface{}) error { } return nil -} \ No newline at end of file +} diff --git a/x/marketplace/types/tx.pb.go b/x/marketplace/types/tx.pb.go index 5e1796a..da2a89f 100644 --- a/x/marketplace/types/tx.pb.go +++ b/x/marketplace/types/tx.pb.go @@ -340,7 +340,7 @@ var xxx_messageInfo_MsgBuyNFTResponse proto.InternalMessageInfo type MsgCreateAuction struct { NftId string `protobuf:"bytes,1,opt,name=nft_id,json=nftId,proto3" json:"nft_id,omitempty"` DenomId string `protobuf:"bytes,2,opt,name=denom_id,json=denomId,proto3" json:"denom_id,omitempty"` - StartTime *time.Time `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time,omitempty" yaml:"start_time"` + StartTime time.Time `protobuf:"bytes,3,opt,name=start_time,json=startTime,proto3,stdtime" json:"start_time" yaml:"start_time"` StartPrice types.Coin `protobuf:"bytes,4,opt,name=start_price,json=startPrice,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coin" json:"start_price" yaml:"start_price"` Duration *time.Duration `protobuf:"bytes,5,opt,name=duration,proto3,stdduration" json:"duration,omitempty"` IncrementPercentage github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,6,opt,name=increment_percentage,json=incrementPercentage,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"increment_percentage" yaml:"increment_percentage"` @@ -588,68 +588,68 @@ func init() { func init() { proto.RegisterFile("marketplace/v1beta1/tx.proto", fileDescriptor_f73de1bb07ce97a8) } var fileDescriptor_f73de1bb07ce97a8 = []byte{ - // 968 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x3f, 0x6f, 0xdb, 0x46, - 0x14, 0x17, 0x25, 0x4b, 0xb6, 0x9e, 0xd2, 0xa0, 0xa6, 0x65, 0x83, 0x66, 0x02, 0xca, 0xe1, 0xd0, - 0xa8, 0x45, 0x42, 0xd6, 0x8a, 0xd1, 0xa1, 0x9d, 0xcc, 0x38, 0x06, 0x0c, 0x44, 0xad, 0xab, 0x1a, - 0x28, 0xd0, 0xa1, 0x2a, 0xff, 0x9c, 0xa9, 0x83, 0x45, 0x52, 0xe5, 0x9d, 0xea, 0x78, 0x6b, 0xf7, - 0x0e, 0x01, 0xba, 0xe4, 0x33, 0x74, 0xcf, 0xdc, 0xd5, 0x63, 0xc6, 0xa2, 0x83, 0xd2, 0xda, 0xdf, - 0xc0, 0x9f, 0xa0, 0xe0, 0x1d, 0x79, 0xa2, 0xfc, 0x47, 0x92, 0x0b, 0xb8, 0x93, 0xf5, 0xee, 0x7e, - 0xef, 0xf7, 0xfe, 0xf0, 0xfd, 0xde, 0x19, 0x1e, 0x06, 0x76, 0x7c, 0x84, 0xe8, 0xa0, 0x6f, 0xbb, - 0xc8, 0xfc, 0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x14, 0x02, 0xab, 0xb6, 0xe6, 0xc7, 0x8a, 0x60, - 0x0e, 0x54, 0xd2, 0x67, 0xe6, 0xf1, 0x4c, 0x6f, 0x0e, 0x54, 0xcd, 0x39, 0x81, 0x22, 0xc6, 0x31, - 0x7c, 0x30, 0xf9, 0x3e, 0x18, 0x33, 0x19, 0x26, 0xf0, 0xea, 0x67, 0xb7, 0xc3, 0x4f, 0x04, 0x9e, - 0x50, 0xdf, 0x1c, 0x81, 0xf3, 0xf8, 0x79, 0x02, 0x5f, 0xa7, 0x3e, 0xb9, 0x07, 0x4b, 0x42, 0x79, - 0x1f, 0xcf, 0xe4, 0xc8, 0xa0, 0xea, 0xe6, 0xdc, 0xd0, 0x2c, 0x92, 0xf5, 0xf5, 0xe9, 0x3f, 0x5a, - 0xe1, 0xf4, 0x4c, 0x93, 0xde, 0x9d, 0x69, 0xd2, 0xdf, 0x67, 0x9a, 0xf4, 0xfa, 0x5c, 0x2b, 0xbc, - 0x3b, 0xd7, 0x0a, 0x7f, 0x9e, 0x6b, 0x85, 0xef, 0x9e, 0xe5, 0xc4, 0x98, 0x51, 0x9b, 0xf9, 0xff, - 0x93, 0x27, 0x2d, 0xa6, 0x4e, 0xa7, 0xc2, 0xde, 0xa5, 0x67, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, - 0x0d, 0xb8, 0xba, 0xa5, 0xd0, 0x0b, 0x00, 0x00, + // 969 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0x4f, 0x73, 0xdb, 0x44, + 0x14, 0xb7, 0xec, 0xd8, 0x89, 0x9f, 0x4b, 0x87, 0x6c, 0x9c, 0x8c, 0xa3, 0x16, 0x39, 0xd5, 0x81, + 0x1a, 0xa6, 0x95, 0x88, 0x9b, 0xe1, 0x00, 0xa7, 0xa8, 0x69, 0x66, 0x32, 0x53, 0x43, 0x30, 0x9d, + 0x81, 0xe1, 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, 0xdf, 0x00, 0x00, 0x00, 0xff, + 0xff, 0xc4, 0x37, 0x55, 0x7d, 0xd4, 0x0b, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1326,16 +1326,14 @@ func (m *MsgCreateAuction) MarshalToSizedBuffer(dAtA []byte) (int, error) { } i-- dAtA[i] = 0x22 - if m.StartTime != nil { - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime):]) - if err6 != nil { - return 0, err6 - } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) - i-- - dAtA[i] = 0x1a + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime):]) + if err6 != nil { + return 0, err6 } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x1a if len(m.DenomId) > 0 { i -= len(m.DenomId) copy(dAtA[i:], m.DenomId) @@ -1663,10 +1661,8 @@ func (m *MsgCreateAuction) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.StartTime != nil { - l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartTime) - n += 1 + l + sovTx(uint64(l)) - } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTime) + n += 1 + l + sovTx(uint64(l)) l = m.StartPrice.Size() n += 1 + l + sovTx(uint64(l)) if m.Duration != nil { @@ -2740,10 +2736,7 @@ func (m *MsgCreateAuction) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.StartTime == nil { - m.StartTime = new(time.Time) - } - if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.StartTime, dAtA[iNdEx:postIndex]); err != nil { + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTime, dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex diff --git a/x/marketplace/types/validation.go b/x/marketplace/types/validation.go index 55cc47d..50de6c5 100644 --- a/x/marketplace/types/validation.go +++ b/x/marketplace/types/validation.go @@ -1,9 +1,11 @@ package types import ( + "fmt" sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "strings" + "time" ) var ( @@ -42,6 +44,14 @@ func ValidatePrice(price sdk.Coin) error { return nil } +func ValidateTimeStamp(t interface{}) error { + _, ok := t.(time.Duration) + if !ok { + return fmt.Errorf("invalid value for start time: %T", t) + } + return nil +} + func ValidateId(id string) error { id = strings.TrimSpace(id) if len(id) < MinListingIdLength || len(id) > MaxListingIdLength { @@ -142,4 +152,4 @@ func ValidateBid(bid Bid) error { return sdkerrors.Wrapf(ErrInvalidTime, "invalid time (%s)", bid.Time.String()) } return nil -} \ No newline at end of file +}