diff --git a/go.mod b/go.mod index 89d8126a27..cf4ad3c519 100644 --- a/go.mod +++ b/go.mod @@ -120,12 +120,12 @@ require ( github.com/tendermint/go-amino v0.16.0 // indirect github.com/zondax/hid v0.9.0 // indirect go.etcd.io/bbolt v1.3.5 // indirect - golang.org/x/crypto v0.0.0-20211202192323-5770296d904e // indirect + golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b // indirect golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 // indirect golang.org/x/sys v0.0.0-20210903071746-97244b99971b // indirect golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 // indirect golang.org/x/text v0.3.7 // indirect - google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 // indirect + google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa // indirect google.golang.org/grpc v1.40.0 // indirect google.golang.org/protobuf v1.27.1 // indirect gopkg.in/ini.v1 v1.63.2 // indirect diff --git a/go.sum b/go.sum index 18ff09297b..0412fdad19 100644 --- a/go.sum +++ b/go.sum @@ -1134,8 +1134,8 @@ golang.org/x/crypto v0.0.0-20201117144127-c1f2f97bffc9/go.mod h1:jdWPYTVW3xRLrWP golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.0.0-20211202192323-5770296d904e h1:MUP6MR3rJ7Gk9LEia0LP2ytiH6MuCfs7qYz+47jGdD8= -golang.org/x/crypto v0.0.0-20211202192323-5770296d904e/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b h1:QAqMVf3pSa6eeTsuklijukjXBlj7Es2QQplab+/RbQ4= +golang.org/x/crypto v0.0.0-20211209193657-4570a0811e8b/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1544,8 +1544,8 @@ google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9 h1:fU3FNfL/oBU2D5DvGqiuyVqqn40DdxvaTFHq7aivA3k= -google.golang.org/genproto v0.0.0-20211203200212-54befc351ae9/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa h1:I0YcKz0I7OAhddo7ya8kMnvprhcWM045PmkBdMO9zN0= +google.golang.org/genproto v0.0.0-20211208223120-3a66f561d7aa/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc= 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/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= diff --git a/proto/regen/ecocredit/v1alpha2/events.proto b/proto/regen/ecocredit/v1alpha2/events.proto index b125ed15ad..98b93bd74e 100644 --- a/proto/regen/ecocredit/v1alpha2/events.proto +++ b/proto/regen/ecocredit/v1alpha2/events.proto @@ -2,7 +2,9 @@ syntax = "proto3"; package regen.ecocredit.v1alpha2; +import "gogoproto/gogo.proto"; import "cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/timestamp.proto"; option go_package = "github.com/regen-network/regen-ledger/x/ecocredit"; @@ -147,6 +149,10 @@ message EventSell { // buyer to disable auto-retirement in their buy order enabling them to // resell the credits to another buyer. bool disable_auto_retire = 5; + + // expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + google.protobuf.Timestamp expiration = 6 [ (gogoproto.stdtime) = true ]; } // EventUpdateSellOrder is an event emitted when a sell order is updated. @@ -170,6 +176,10 @@ message EventUpdateSellOrder { // disable_auto_retire updates the disable_auto_retire field in the sell order. bool disable_auto_retire = 6; + + // new_expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + google.protobuf.Timestamp new_expiration = 7 [ (gogoproto.stdtime) = true ]; } // EventBuyOrderCreated is an event emitted when a buy order is created. @@ -202,6 +212,10 @@ message EventBuyOrderCreated { // disable_partial_fill disables the default behavior of partially filling // buy orders if the requested quantity is not available. bool disable_partial_fill = 6; + + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + google.protobuf.Timestamp expiration = 7 [ (gogoproto.stdtime) = true ]; } // EventBuyOrderFilled is an event emitted when a buy order is filled. diff --git a/proto/regen/ecocredit/v1alpha2/tx.proto b/proto/regen/ecocredit/v1alpha2/tx.proto index 9ee7595387..1c9f72bb08 100644 --- a/proto/regen/ecocredit/v1alpha2/tx.proto +++ b/proto/regen/ecocredit/v1alpha2/tx.proto @@ -381,6 +381,10 @@ message MsgSell { // buyer to disable auto-retirement in their buy order enabling them to // resell the credits to another buyer. bool disable_auto_retire = 4; + + // expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + google.protobuf.Timestamp expiration = 5 [ (gogoproto.stdtime) = true ]; } } @@ -415,6 +419,10 @@ message MsgUpdateSellOrders { // disable_auto_retire updates the disable_auto_retire field in the sell order. bool disable_auto_retire = 4; + + // new_expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + google.protobuf.Timestamp new_expiration = 5 [ (gogoproto.stdtime) = true ]; } } @@ -475,6 +483,10 @@ message MsgBuy { // disable_partial_fill disables the default behavior of partially filling // buy orders if the requested quantity is not available. bool disable_partial_fill = 5; + + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + google.protobuf.Timestamp expiration = 6 [ (gogoproto.stdtime) = true ]; } } diff --git a/proto/regen/ecocredit/v1alpha2/types.proto b/proto/regen/ecocredit/v1alpha2/types.proto index ce7f89c9e0..abd7f5721b 100644 --- a/proto/regen/ecocredit/v1alpha2/types.proto +++ b/proto/regen/ecocredit/v1alpha2/types.proto @@ -156,6 +156,10 @@ message SellOrder { // buyer to disable auto-retirement in their buy order enabling them to // resell the credits to another buyer. bool disable_auto_retire = 6; + + // expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + google.protobuf.Timestamp expiration = 7 [ (gogoproto.stdtime) = true ]; } // BuyOrder represents the information for a buy order. @@ -209,6 +213,10 @@ message BuyOrder { // disable_partial_fill disables the default behavior of partially filling // buy orders if the requested quantity is not available. bool disable_partial_fill = 7; + + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + google.protobuf.Timestamp expiration = 8 [ (gogoproto.stdtime) = true ]; } // AskDenom represents the information for an ask denom. diff --git a/x/ecocredit/events.pb.go b/x/ecocredit/events.pb.go index 3cb35d9579..7ee16ab4c3 100644 --- a/x/ecocredit/events.pb.go +++ b/x/ecocredit/events.pb.go @@ -6,16 +6,21 @@ package ecocredit import ( fmt "fmt" types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" io "io" math "math" math_bits "math/bits" + time "time" ) // Reference imports to suppress errors if they are not otherwise used. var _ = proto.Marshal var _ = fmt.Errorf var _ = math.Inf +var _ = time.Kitchen // This is a compile-time assertion to ensure that this generated file // is compatible with the proto package it is being compiled against. @@ -514,6 +519,9 @@ type EventSell struct { // buyer to disable auto-retirement in their buy order enabling them to // resell the credits to another buyer. DisableAutoRetire bool `protobuf:"varint,5,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + Expiration *time.Time `protobuf:"bytes,6,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } func (m *EventSell) Reset() { *m = EventSell{} } @@ -584,6 +592,13 @@ func (m *EventSell) GetDisableAutoRetire() bool { return false } +func (m *EventSell) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + // EventUpdateSellOrder is an event emitted when a sell order is updated. type EventUpdateSellOrder struct { // owner is the owner of the sell orders. @@ -599,6 +614,9 @@ type EventUpdateSellOrder struct { NewAskPrice *types.Coin `protobuf:"bytes,5,opt,name=new_ask_price,json=newAskPrice,proto3" json:"new_ask_price,omitempty"` // disable_auto_retire updates the disable_auto_retire field in the sell order. DisableAutoRetire bool `protobuf:"varint,6,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // new_expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + NewExpiration *time.Time `protobuf:"bytes,7,opt,name=new_expiration,json=newExpiration,proto3,stdtime" json:"new_expiration,omitempty"` } func (m *EventUpdateSellOrder) Reset() { *m = EventUpdateSellOrder{} } @@ -676,6 +694,13 @@ func (m *EventUpdateSellOrder) GetDisableAutoRetire() bool { return false } +func (m *EventUpdateSellOrder) GetNewExpiration() *time.Time { + if m != nil { + return m.NewExpiration + } + return nil +} + // EventBuyOrderCreated is an event emitted when a buy order is created. type EventBuyOrderCreated struct { // buy_order_id is the unique ID of buy order. @@ -700,6 +725,9 @@ type EventBuyOrderCreated struct { // disable_partial_fill disables the default behavior of partially filling // buy orders if the requested quantity is not available. DisablePartialFill bool `protobuf:"varint,6,opt,name=disable_partial_fill,json=disablePartialFill,proto3" json:"disable_partial_fill,omitempty"` + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + Expiration *time.Time `protobuf:"bytes,7,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } func (m *EventBuyOrderCreated) Reset() { *m = EventBuyOrderCreated{} } @@ -777,6 +805,13 @@ func (m *EventBuyOrderCreated) GetDisablePartialFill() bool { return false } +func (m *EventBuyOrderCreated) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + // EventBuyOrderFilled is an event emitted when a buy order is filled. type EventBuyOrderFilled struct { // buy_order_id is the unique ID of the buy order. @@ -943,59 +978,64 @@ func init() { } var fileDescriptor_532d83e215c82e56 = []byte{ - // 833 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcd, 0x6e, 0x23, 0x45, - 0x10, 0xc7, 0x33, 0xde, 0x7c, 0xd8, 0x65, 0x7b, 0x77, 0xe9, 0x8d, 0x90, 0x37, 0x02, 0xb3, 0x3b, - 0x68, 0x05, 0x1c, 0x18, 0x93, 0x45, 0xe2, 0x80, 0xc4, 0x21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x73, 0x35, 0x4c, 0x7e, 0xb9, 0x1e, 0x6e, 0x3c, 0xbb, 0x1e, 0x6e, 0xfc, 0x7d, 0x3d, 0xdc, 0xf8, - 0x76, 0xff, 0x84, 0xdb, 0xd3, 0x59, 0x91, 0x95, 0x6a, 0x3a, 0xf2, 0x1f, 0x04, 0xef, 0x4b, 0xb4, - 0x17, 0x4a, 0x9f, 0x45, 0x4b, 0x20, 0x3b, 0x41, 0x3d, 0x7a, 0x3a, 0xff, 0x9c, 0x28, 0xb6, 0xfd, - 0x57, 0xc0, 0x87, 0xff, 0x06, 0x00, 0x00, 0xff, 0xff, 0x14, 0xc6, 0x66, 0x98, 0x68, 0x08, 0x00, + // 913 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x96, 0xcb, 0x6e, 0x23, 0x45, + 0x17, 0xc7, 0x63, 0x4f, 0xe2, 0xcb, 0xb1, 0x9d, 0x99, 0xaf, 0xc7, 0xfa, 0xe4, 0xb1, 0xc0, 0x99, + 0x31, 0x1a, 0x01, 0x0b, 0xba, 0xc9, 0x20, 0xb1, 0x40, 0x42, 0x22, 0xf1, 0x0c, 0x28, 0x02, 0x89, + 0x60, 0x60, 0xc3, 0xa6, 0x55, 0xdd, 0x75, 0xc6, 0x29, 0x52, 0xae, 0x6a, 0xaa, 0xab, 0x73, 0x91, + 0x78, 0x05, 0xa4, 0xe1, 0x61, 0x78, 0x07, 0x16, 0x2c, 0x66, 0x31, 0x0b, 0x76, 0xa0, 0xe4, 0x45, + 0x50, 0x5d, 0xba, 0x1d, 0x3b, 0x33, 0xc4, 0x8a, 0xd8, 0xd5, 0xb9, 0x74, 0x9d, 0x53, 0xbf, 0xfa, + 0xf7, 0xe9, 0x86, 0xc7, 0x0a, 0x67, 0x28, 0x22, 0x4c, 0x65, 0xaa, 0x90, 0x32, 0x1d, 0x9d, 0xec, + 0x12, 0x9e, 0x1d, 0x91, 0x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81, 0x4e, 0x62, 0x72, 0x62, + 0x8a, 0x42, 0xce, 0x7d, 0x43, 0x60, 0x5d, 0x4f, 0x8d, 0xe7, 0x8d, 0x3d, 0x3d, 0x82, 0xae, 0x96, + 0x9a, 0xf0, 0x98, 0xcc, 0x65, 0x21, 0xb4, 0xef, 0xa7, 0x63, 0x7d, 0x7b, 0xd6, 0x65, 0x40, 0xe4, + 0x9a, 0x28, 0x1d, 0x53, 0xa2, 0x71, 0xb0, 0xe5, 0x40, 0x58, 0xcf, 0x53, 0xa2, 0xd1, 0x74, 0x85, + 0x82, 0xba, 0x60, 0xc3, 0x75, 0x85, 0x82, 0xda, 0xd0, 0xeb, 0x0e, 0xdc, 0x7c, 0xed, 0x81, 0x57, + 0x68, 0xb7, 0x56, 0x68, 0x8f, 0x7f, 0xab, 0x41, 0xd7, 0xf2, 0x98, 0x62, 0x8a, 0xec, 0x04, 0xcd, + 0x79, 0x72, 0x14, 0x14, 0x95, 0x27, 0xe1, 0xad, 0xe0, 0x2d, 0x68, 0x2b, 0x4c, 0x59, 0xc6, 0x50, + 0x68, 0x8f, 0x61, 0xe1, 0x58, 0xc5, 0x74, 0xe7, 0x1a, 0xa6, 0x77, 0xe1, 0xae, 0x56, 0x84, 0x92, + 0x84, 0xe3, 0x32, 0x91, 0xed, 0xd2, 0xed, 0xa1, 0x3c, 0x86, 0x6d, 0x85, 0x9a, 0x29, 0xa4, 0x65, + 0x9e, 0x03, 0xd3, 0xf3, 0x5e, 0x97, 0x36, 0xfe, 0x19, 0x3a, 0xbe, 0x6d, 0xe3, 0x0d, 0x06, 0xd0, + 0x74, 0xf1, 0xb2, 0xed, 0xd2, 0x5c, 0xeb, 0x02, 0x7d, 0x21, 0x7f, 0x81, 0xce, 0x0a, 0x86, 0xd0, + 0x5a, 0x11, 0x53, 0x65, 0x8f, 0xa9, 0xaf, 0x3e, 0x21, 0x22, 0x45, 0x6e, 0xd8, 0xa4, 0x76, 0xc5, + 0xab, 0xfa, 0x0b, 0xc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 0x18, 0xd5, + 0xfe, 0xbe, 0x18, 0xd5, 0x5e, 0x5c, 0x8e, 0x36, 0x5e, 0x5e, 0x8e, 0x36, 0xfe, 0xbc, 0x1c, 0x6d, + 0xfc, 0xb0, 0x3b, 0x63, 0xfa, 0xa8, 0x48, 0xc2, 0x54, 0xce, 0x23, 0xfb, 0x53, 0xf4, 0x81, 0x40, + 0x7d, 0x2a, 0xd5, 0xb1, 0xb7, 0x38, 0xd2, 0x19, 0xaa, 0xe8, 0x6c, 0xf1, 0x4b, 0x95, 0x34, 0xec, + 0xb5, 0x7d, 0xf4, 0x4f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x96, 0x99, 0x66, 0x27, 0x6c, 0x09, 0x00, 0x00, } @@ -1339,6 +1379,16 @@ func (m *EventSell) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expiration != nil { + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintEvents(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x32 + } if m.DisableAutoRetire { i-- if m.DisableAutoRetire { @@ -1403,6 +1453,16 @@ func (m *EventUpdateSellOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.NewExpiration != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NewExpiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintEvents(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x3a + } if m.DisableAutoRetire { i-- if m.DisableAutoRetire { @@ -1474,6 +1534,16 @@ func (m *EventBuyOrderCreated) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expiration != nil { + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintEvents(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x3a + } if m.DisablePartialFill { i-- if m.DisablePartialFill { @@ -1820,6 +1890,10 @@ func (m *EventSell) Size() (n int) { if m.DisableAutoRetire { n += 2 } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -1851,6 +1925,10 @@ func (m *EventUpdateSellOrder) Size() (n int) { if m.DisableAutoRetire { n += 2 } + if m.NewExpiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration) + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -1880,6 +1958,10 @@ func (m *EventBuyOrderCreated) Size() (n int) { if m.DisablePartialFill { n += 2 } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovEvents(uint64(l)) + } return n } @@ -3254,6 +3336,42 @@ func (m *EventSell) Unmarshal(dAtA []byte) error { } } m.DisableAutoRetire = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -3478,6 +3596,42 @@ func (m *EventUpdateSellOrder) Unmarshal(dAtA []byte) error { } } m.DisableAutoRetire = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewExpiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewExpiration == nil { + m.NewExpiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.NewExpiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) @@ -3677,6 +3831,42 @@ func (m *EventBuyOrderCreated) Unmarshal(dAtA []byte) error { } } m.DisablePartialFill = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipEvents(dAtA[iNdEx:]) diff --git a/x/ecocredit/expected_keepers.go b/x/ecocredit/expected_keepers.go index 578649addd..9b8ac4a742 100644 --- a/x/ecocredit/expected_keepers.go +++ b/x/ecocredit/expected_keepers.go @@ -27,3 +27,8 @@ type BankKeeper interface { SendCoinsFromAccountToModule(ctx sdk.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error SendCoins(ctx sdk.Context, fromAddr sdk.AccAddress, toAddr sdk.AccAddress, amt sdk.Coins) error } + +// Keeper defines the expected interface needed to prune expired buy and sell orders. +type Keeper interface { + PruneOrders(ctx sdk.Context) error +} diff --git a/x/ecocredit/module/module.go b/x/ecocredit/module/module.go index e9c54ea9e7..5bd9a752cb 100644 --- a/x/ecocredit/module/module.go +++ b/x/ecocredit/module/module.go @@ -17,6 +17,7 @@ import ( "github.com/grpc-ecosystem/grpc-gateway/runtime" restmodule "github.com/regen-network/regen-ledger/types/module/client/grpc_gateway" "github.com/spf13/cobra" + abci "github.com/tendermint/tendermint/abci/types" climodule "github.com/regen-network/regen-ledger/types/module/client/cli" servermodule "github.com/regen-network/regen-ledger/types/module/server" @@ -30,6 +31,7 @@ type Module struct { paramSpace paramtypes.Subspace accountKeeper ecocredit.AccountKeeper bankKeeper ecocredit.BankKeeper + keeper ecocredit.Keeper } // NewModule returns a new Module object. @@ -60,7 +62,7 @@ func (a Module) RegisterInterfaces(registry types.InterfaceRegistry) { } func (a Module) RegisterServices(configurator servermodule.Configurator) { - server.RegisterServices(configurator, a.paramSpace, a.accountKeeper, a.bankKeeper) + a.keeper = server.RegisterServices(configurator, a.paramSpace, a.accountKeeper, a.bankKeeper) } //nolint:errcheck @@ -126,3 +128,8 @@ func (Module) RegisterStoreDecoder(sdr sdk.StoreDecoderRegistry) { func (Module) WeightedOperations(simState module.SimulationState) []simtypes.WeightedOperation { return nil } + +// BeginBlock checks if there are any expired sell or buy orders and removes them from state. +func (a Module) BeginBlock(ctx sdk.Context, req abci.RequestBeginBlock) { + ecocredit.BeginBlocker(ctx, a.keeper, req) +} diff --git a/x/ecocredit/msgs.go b/x/ecocredit/msgs.go index d09eeefe3e..3c1581b3d4 100644 --- a/x/ecocredit/msgs.go +++ b/x/ecocredit/msgs.go @@ -1,6 +1,8 @@ package ecocredit import ( + "time" + sdk "github.com/cosmos/cosmos-sdk/types" sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" "github.com/cosmos/cosmos-sdk/x/auth/legacy/legacytx" @@ -390,31 +392,36 @@ func (m MsgSell) GetSignBytes() []byte { // ValidateBasic does a sanity check on the provided data. func (m *MsgSell) ValidateBasic() error { + now := time.Now() if _, err := sdk.AccAddressFromBech32(m.Owner); err != nil { return sdkerrors.ErrInvalidAddress } - for i := range m.Orders { - if err := ValidateDenom(m.Orders[i].BatchDenom); err != nil { + for _, order := range m.Orders { + if err := ValidateDenom(order.BatchDenom); err != nil { return err } - if _, err := math.NewPositiveDecFromString(m.Orders[i].Quantity); err != nil { - return sdkerrors.Wrapf(err, "quantity must be positive decimal: %s", m.Orders[i].Quantity) + if _, err := math.NewPositiveDecFromString(order.Quantity); err != nil { + return sdkerrors.Wrapf(err, "quantity must be positive decimal: %s", order.Quantity) } - if m.Orders[i].AskPrice == nil { + if order.AskPrice == nil { return sdkerrors.ErrInvalidRequest.Wrap("ask price cannot be empty") } - if err := m.Orders[i].AskPrice.Validate(); err != nil { + if err := order.AskPrice.Validate(); err != nil { return err } - if !m.Orders[i].AskPrice.Amount.IsPositive() { + if !order.AskPrice.Amount.IsPositive() { return sdkerrors.ErrInvalidRequest.Wrap("ask price must be positive amount") } + + if order.Expiration != nil && order.Expiration.Before(now) { + return sdkerrors.ErrInvalidRequest.Wrap("expiration must be in the future") + } } return nil @@ -439,28 +446,33 @@ func (m MsgUpdateSellOrders) GetSignBytes() []byte { // ValidateBasic does a sanity check on the provided data. func (m *MsgUpdateSellOrders) ValidateBasic() error { + now := time.Now() if _, err := sdk.AccAddressFromBech32(m.Owner); err != nil { return sdkerrors.ErrInvalidAddress } - for i := range m.Updates { + for _, update := range m.Updates { - if _, err := math.NewPositiveDecFromString(m.Updates[i].NewQuantity); err != nil { - return sdkerrors.Wrapf(err, "quantity must be positive decimal: %s", m.Updates[i].NewQuantity) + if _, err := math.NewPositiveDecFromString(update.NewQuantity); err != nil { + return sdkerrors.Wrapf(err, "quantity must be positive decimal: %s", update.NewQuantity) } - if m.Updates[i].NewAskPrice == nil { + if update.NewAskPrice == nil { return sdkerrors.ErrInvalidRequest.Wrap("new ask price cannot be empty") } - if err := m.Updates[i].NewAskPrice.Validate(); err != nil { + if err := update.NewAskPrice.Validate(); err != nil { return err } - if !m.Updates[i].NewAskPrice.Amount.IsPositive() { + if !update.NewAskPrice.Amount.IsPositive() { return sdkerrors.ErrInvalidRequest.Wrap("ask price must be positive amount") } + + if update.NewExpiration != nil && update.NewExpiration.Before(now) { + return sdkerrors.ErrInvalidRequest.Wrap("expiration must be in the future") + } } return nil @@ -485,28 +497,33 @@ func (m MsgBuy) GetSignBytes() []byte { // ValidateBasic does a sanity check on the provided data. func (m *MsgBuy) ValidateBasic() error { + now := time.Now() if _, err := sdk.AccAddressFromBech32(m.Buyer); err != nil { return sdkerrors.ErrInvalidAddress } - for i := range m.Orders { + for _, order := range m.Orders { - if _, err := math.NewPositiveDecFromString(m.Orders[i].Quantity); err != nil { - return sdkerrors.Wrapf(err, "quantity must be positive decimal: %s", m.Orders[i].Quantity) + if _, err := math.NewPositiveDecFromString(order.Quantity); err != nil { + return sdkerrors.Wrapf(err, "quantity must be positive decimal: %s", order.Quantity) } - if m.Orders[i].BidPrice == nil { + if order.BidPrice == nil { return sdkerrors.ErrInvalidRequest.Wrap("bid price cannot be empty") } - if err := m.Orders[i].BidPrice.Validate(); err != nil { + if err := order.BidPrice.Validate(); err != nil { return err } - if !m.Orders[i].BidPrice.Amount.IsPositive() { + if !order.BidPrice.Amount.IsPositive() { return sdkerrors.ErrInvalidRequest.Wrap("bid price must be positive amount") } + + if order.Expiration != nil && order.Expiration.Before(now) { + return sdkerrors.ErrInvalidRequest.Wrap("expiration must be in the future") + } } return nil diff --git a/x/ecocredit/msgs_test.go b/x/ecocredit/msgs_test.go index 79c9451336..87f7813b54 100644 --- a/x/ecocredit/msgs_test.go +++ b/x/ecocredit/msgs_test.go @@ -970,11 +970,32 @@ func TestMsgUpdateClassMetadata(t *testing.T) { func TestMsgSell(t *testing.T) { _, _, a1 := testdata.KeyTestPubAddr() + validExpiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) + invalidExpiration := time.Date(2020, 01, 01, 0, 0, 0, 0, time.UTC) + tests := map[string]struct { src MsgSell expErr bool }{ "valid": { + src: MsgSell{ + Owner: a1.String(), + Orders: []*MsgSell_Order{ + { + BatchDenom: "A00-00000000-00000000-000", + Quantity: "1.5", + AskPrice: &sdk.Coin{ + Denom: "uregen", + Amount: sdk.NewInt(20), + }, + DisableAutoRetire: true, + Expiration: &validExpiration, + }, + }, + }, + expErr: false, + }, + "valid: no expiration": { src: MsgSell{ Owner: a1.String(), Orders: []*MsgSell_Order{ @@ -1059,6 +1080,24 @@ func TestMsgSell(t *testing.T) { }, expErr: true, }, + "invalid: bad expiration": { + src: MsgSell{ + Owner: a1.String(), + Orders: []*MsgSell_Order{ + { + BatchDenom: "A00-00000000-00000000-000", + Quantity: "1.5", + AskPrice: &sdk.Coin{ + Denom: "uregen", + Amount: sdk.NewInt(-20), + }, + DisableAutoRetire: true, + Expiration: &invalidExpiration, + }, + }, + }, + expErr: true, + }, } for msg, test := range tests { @@ -1076,11 +1115,31 @@ func TestMsgSell(t *testing.T) { func TestMsgUpdateSellOrders(t *testing.T) { _, _, a1 := testdata.KeyTestPubAddr() + validExpiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) + invalidExpiration := time.Date(2020, 01, 01, 0, 0, 0, 0, time.UTC) + tests := map[string]struct { src MsgUpdateSellOrders expErr bool }{ "valid": { + src: MsgUpdateSellOrders{ + Owner: a1.String(), + Updates: []*MsgUpdateSellOrders_Update{ + { + NewQuantity: "1.5", + NewAskPrice: &sdk.Coin{ + Denom: "uregen", + Amount: sdk.NewInt(20), + }, + DisableAutoRetire: true, + NewExpiration: &validExpiration, + }, + }, + }, + expErr: false, + }, + "valid: no expiration": { src: MsgUpdateSellOrders{ Owner: a1.String(), Updates: []*MsgUpdateSellOrders_Update{ @@ -1144,6 +1203,23 @@ func TestMsgUpdateSellOrders(t *testing.T) { }, expErr: true, }, + "invalid: bad expiration": { + src: MsgUpdateSellOrders{ + Owner: a1.String(), + Updates: []*MsgUpdateSellOrders_Update{ + { + NewQuantity: "1.5", + NewAskPrice: &sdk.Coin{ + Denom: "uregen", + Amount: sdk.NewInt(-20), + }, + DisableAutoRetire: true, + NewExpiration: &invalidExpiration, + }, + }, + }, + expErr: true, + }, } for msg, test := range tests { @@ -1161,11 +1237,32 @@ func TestMsgUpdateSellOrders(t *testing.T) { func TestMsgBuy(t *testing.T) { _, _, a1 := testdata.KeyTestPubAddr() + validExpiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) + invalidExpiration := time.Date(2020, 01, 01, 0, 0, 0, 0, time.UTC) + tests := map[string]struct { src MsgBuy expErr bool }{ "valid": { + src: MsgBuy{ + Buyer: a1.String(), + Orders: []*MsgBuy_Order{ + { + Quantity: "1.5", + BidPrice: &sdk.Coin{ + Denom: "uregen", + Amount: sdk.NewInt(20), + }, + DisableAutoRetire: true, + DisablePartialFill: true, + Expiration: &validExpiration, + }, + }, + }, + expErr: false, + }, + "valid: no expiration": { src: MsgBuy{ Buyer: a1.String(), Orders: []*MsgBuy_Order{ @@ -1233,6 +1330,24 @@ func TestMsgBuy(t *testing.T) { }, expErr: true, }, + "invalid: bad expiration": { + src: MsgBuy{ + Buyer: a1.String(), + Orders: []*MsgBuy_Order{ + { + Quantity: "1.5", + BidPrice: &sdk.Coin{ + Denom: "uregen", + Amount: sdk.NewInt(-20), + }, + DisableAutoRetire: true, + DisablePartialFill: true, + Expiration: &invalidExpiration, + }, + }, + }, + expErr: true, + }, } for msg, test := range tests { @@ -1251,57 +1366,24 @@ func TestMsgAllowAskDenom(t *testing.T) { _, _, a1 := testdata.KeyTestPubAddr() tests := map[string]struct { - src MsgBuy + src MsgAllowAskDenom expErr bool }{ "valid": { - src: MsgBuy{ - Buyer: a1.String(), - Orders: []*MsgBuy_Order{ - { - Quantity: "1.5", - BidPrice: &sdk.Coin{ - Denom: "uregen", - Amount: sdk.NewInt(20), - }, - DisableAutoRetire: true, - DisablePartialFill: true, - }, - }, + src: MsgAllowAskDenom{ + RootAddress: a1.String(), + Denom: "uregen", + DisplayDenom: "regen", + Exponent: 6, }, expErr: false, }, - "invalid: bad owner address": { - src: MsgBuy{ - Buyer: "foobar", - Orders: []*MsgBuy_Order{ - { - Quantity: "1.5", - BidPrice: &sdk.Coin{ - Denom: "uregen", - Amount: sdk.NewInt(20), - }, - DisableAutoRetire: true, - DisablePartialFill: true, - }, - }, - }, - expErr: true, - }, - "invalid: bad denom": { - src: MsgBuy{ - Buyer: a1.String(), - Orders: []*MsgBuy_Order{ - { - Quantity: "1.5", - BidPrice: &sdk.Coin{ - Denom: "$$$$$", - Amount: sdk.NewInt(20), - }, - DisableAutoRetire: true, - DisablePartialFill: true, - }, - }, + "invalid address": { + src: MsgAllowAskDenom{ + RootAddress: "foobar", + Denom: "uregen", + DisplayDenom: "regen", + Exponent: 6, }, expErr: true, }, diff --git a/x/ecocredit/server/msg_server.go b/x/ecocredit/server/msg_server.go index c5229756b9..d3225a73c6 100644 --- a/x/ecocredit/server/msg_server.go +++ b/x/ecocredit/server/msg_server.go @@ -599,6 +599,7 @@ func (s serverImpl) Sell(goCtx context.Context, req *ecocredit.MsgSell) (*ecocre Quantity: order.Quantity, AskPrice: order.AskPrice, DisableAutoRetire: order.DisableAutoRetire, + Expiration: order.Expiration, }) if err != nil { return nil, err @@ -610,6 +611,7 @@ func (s serverImpl) Sell(goCtx context.Context, req *ecocredit.MsgSell) (*ecocre Quantity: order.Quantity, AskPrice: order.AskPrice, DisableAutoRetire: order.DisableAutoRetire, + Expiration: order.Expiration, }) if err != nil { return nil, err @@ -640,7 +642,7 @@ func (s serverImpl) UpdateSellOrders(goCtx context.Context, req *ecocredit.MsgUp } if req.Owner != sellOrder.Owner { - return nil, sdkerrors.ErrUnauthorized.Wrapf("signer is not the owner of sell order id %d", update.SellOrderId) + return nil, sdkerrors.ErrUnauthorized.Wrapf("signer is not the owner of sell order id %d", update.SellOrderId) } // TODO: Verify that NewAskPrice.Denom is in AllowAskDenom #624 @@ -653,6 +655,7 @@ func (s serverImpl) UpdateSellOrders(goCtx context.Context, req *ecocredit.MsgUp sellOrder.Quantity = update.NewQuantity sellOrder.AskPrice = update.NewAskPrice sellOrder.DisableAutoRetire = update.DisableAutoRetire + sellOrder.Expiration = update.NewExpiration err = s.sellOrderTable.Update(ctx, sellOrder.OrderId, sellOrder) if err != nil { @@ -666,6 +669,7 @@ func (s serverImpl) UpdateSellOrders(goCtx context.Context, req *ecocredit.MsgUp NewQuantity: sellOrder.Quantity, NewAskPrice: sellOrder.AskPrice, DisableAutoRetire: sellOrder.DisableAutoRetire, + NewExpiration: sellOrder.Expiration, }) if err != nil { return nil, err @@ -825,6 +829,7 @@ func (s serverImpl) Buy(goCtx context.Context, req *ecocredit.MsgBuy) (*ecocredi BidPrice: order.BidPrice, DisableAutoRetire: order.DisableAutoRetire, DisablePartialFill: order.DisablePartialFill, + Expiration: order.Expiration, }) if err != nil { return nil, err diff --git a/x/ecocredit/server/server.go b/x/ecocredit/server/server.go index aca0e398f9..eb3dd82613 100644 --- a/x/ecocredit/server/server.go +++ b/x/ecocredit/server/server.go @@ -30,11 +30,13 @@ const ( SellOrderTableSeqPrefix byte = 0x11 SellOrderByAddressIndexPrefix byte = 0x12 SellOrderByBatchDenomIndexPrefix byte = 0x13 + SellOrderByExpirationIndexPrefix byte = 0x14 // buy order table - BuyOrderTablePrefix byte = 0x20 - BuyOrderTableSeqPrefix byte = 0x21 - BuyOrderByAddressIndexPrefix byte = 0x22 + BuyOrderTablePrefix byte = 0x20 + BuyOrderTableSeqPrefix byte = 0x21 + BuyOrderByAddressIndexPrefix byte = 0x22 + BuyOrderByExpirationIndexPrefix byte = 0x23 AskDenomTablePrefix byte = 0x30 ) @@ -56,10 +58,12 @@ type serverImpl struct { sellOrderTable orm.AutoUInt64Table sellOrderByAddressIndex orm.Index sellOrderByBatchDenomIndex orm.Index + sellOrderByExpirationIndex orm.Index // buy order table - buyOrderTable orm.AutoUInt64Table - buyOrderByAddressIndex orm.Index + buyOrderTable orm.AutoUInt64Table + buyOrderByAddressIndex orm.Index + buyOrderByExpirationIndex orm.Index askDenomTable orm.PrimaryKeyTable @@ -137,6 +141,16 @@ func newServer(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, if err != nil { panic(err.Error()) } + s.sellOrderByExpirationIndex, err = orm.NewIndex(sellOrderTableBuilder, SellOrderByExpirationIndexPrefix, func(value interface{}) ([]interface{}, error) { + order, ok := value.(*ecocredit.SellOrder) + if !ok { + return nil, sdkerrors.ErrInvalidType.Wrapf("expected %T got %T", ecocredit.SellOrder{}, value) + } + return []interface{}{order.Expiration.String()}, nil + }, []byte{}) + if err != nil { + panic(err.Error()) + } s.sellOrderTable = sellOrderTableBuilder.Build() buyOrderTableBuilder, err := orm.NewAutoUInt64TableBuilder(BuyOrderTablePrefix, BuyOrderTableSeqPrefix, storeKey, &ecocredit.BuyOrder{}, cdc) @@ -157,6 +171,16 @@ func newServer(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, if err != nil { panic(err.Error()) } + s.buyOrderByExpirationIndex, err = orm.NewIndex(buyOrderTableBuilder, BuyOrderByExpirationIndexPrefix, func(value interface{}) ([]interface{}, error) { + order, ok := value.(*ecocredit.BuyOrder) + if !ok { + return nil, sdkerrors.ErrInvalidType.Wrapf("expected %T got %T", ecocredit.BuyOrder{}, value) + } + return []interface{}{order.Expiration.String()}, nil + }, []byte{}) + if err != nil { + panic(err.Error()) + } s.buyOrderTable = buyOrderTableBuilder.Build() askDenomTableBuilder, err := orm.NewPrimaryKeyTableBuilder(AskDenomTablePrefix, storeKey, &ecocredit.AskDenom{}, cdc) @@ -188,11 +212,12 @@ func newServer(storeKey sdk.StoreKey, paramSpace paramtypes.Subspace, } func RegisterServices(configurator server.Configurator, paramSpace paramtypes.Subspace, accountKeeper ecocredit.AccountKeeper, - bankKeeper ecocredit.BankKeeper) { + bankKeeper ecocredit.BankKeeper) ecocredit.Keeper { impl := newServer(configurator.ModuleKey(), paramSpace, accountKeeper, bankKeeper, configurator.Marshaler()) ecocredit.RegisterMsgServer(configurator.MsgServer(), impl) ecocredit.RegisterQueryServer(configurator.QueryServer(), impl) configurator.RegisterGenesisHandlers(impl.InitGenesis, impl.ExportGenesis) configurator.RegisterWeightedOperationsHandler(impl.WeightedOperations) configurator.RegisterInvariantsHandler(impl.RegisterInvariants) + return impl } diff --git a/x/ecocredit/server/testsuite/suite.go b/x/ecocredit/server/testsuite/suite.go index ae29344e06..70d0856885 100644 --- a/x/ecocredit/server/testsuite/suite.go +++ b/x/ecocredit/server/testsuite/suite.go @@ -987,22 +987,26 @@ func (s *IntegrationTestSuite) TestScenario() { // reset the space to avoid corrupting other tests s.paramSpace.Set(s.sdkCtx, ecocredit.KeyCreditTypes, ecocredit.DefaultParams().CreditTypes) - askPrice := sdk.NewInt64Coin("stake", 1) + coinPrice := sdk.NewInt64Coin("stake", 1000000) + expiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) expectedSellOrderIds := []uint64{1, 2} + createSellOrder, err := s.msgClient.Sell(s.ctx, &ecocredit.MsgSell{ Owner: addr3, Orders: []*ecocredit.MsgSell_Order{ { BatchDenom: batchDenom, Quantity: "1.0", - AskPrice: &askPrice, + AskPrice: &coinPrice, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: batchDenom, Quantity: "1.0", - AskPrice: &askPrice, + AskPrice: &coinPrice, DisableAutoRetire: true, + Expiration: &expiration, }, }, }) @@ -1019,9 +1023,10 @@ func (s *IntegrationTestSuite) TestScenario() { { Selection: selection, Quantity: "1.0", - BidPrice: &askPrice, + BidPrice: &coinPrice, DisableAutoRetire: true, DisablePartialFill: true, + Expiration: &expiration, }, }, }) diff --git a/x/ecocredit/server/testsuite/tx.go b/x/ecocredit/server/testsuite/tx.go index 19a788e871..ce626ba168 100644 --- a/x/ecocredit/server/testsuite/tx.go +++ b/x/ecocredit/server/testsuite/tx.go @@ -17,6 +17,8 @@ func (s *IntegrationTestSuite) TestScenarioCreateSellOrders() { // TODO: Verify that AskPrice.Denom is in AllowAskDenom #624 //askPrice2 := sdk.NewInt64Coin("token", 1000000) + expiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) + // create sell orders testCases := []struct { name string @@ -34,12 +36,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateSellOrders() { Quantity: "1.0", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: "A00-00000000-00000000-000", Quantity: "1.0", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "insufficient credit balance", @@ -54,12 +58,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateSellOrders() { Quantity: "99", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: createBatchRes.BatchDenom, Quantity: "99", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "insufficient credit balance", @@ -75,12 +81,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateSellOrders() { // Quantity: "1.0", // AskPrice: &askPrice2, // DisableAutoRetire: true, + // Expiration: &expiration, // }, // { // BatchDenom: createBatchRes.BatchDenom, // Quantity: "1.0", // AskPrice: &askPrice2, // DisableAutoRetire: true, + // Expiration: &expiration, // }, // }, // expErr: "denom not allowed", @@ -95,12 +103,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateSellOrders() { Quantity: "1.0", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: createBatchRes.BatchDenom, Quantity: "1.0", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "", @@ -154,6 +164,8 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { // TODO: Verify that NewAskPrice.Denom is in AllowAskDenom #624 //askPrice2 := sdk.NewInt64Coin("token", 2000000) + expiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) + // create sell order sellRes, err := s.msgClient.Sell(s.ctx, &ecocredit.MsgSell{ Owner: addr1, @@ -163,12 +175,14 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { Quantity: "1.0", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: createBatchRes.BatchDenom, Quantity: "1.0", AskPrice: &askPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, }) @@ -191,12 +205,14 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { NewQuantity: "1.0", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, { SellOrderId: 100, NewQuantity: "1.0", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, }, expErr: "invalid sell order", @@ -211,12 +227,14 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { NewQuantity: "1.0", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, { SellOrderId: sellRes.SellOrderIds[1], NewQuantity: "1.0", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, }, expErr: "unauthorized", @@ -231,12 +249,14 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { NewQuantity: "99", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, { SellOrderId: sellRes.SellOrderIds[1], NewQuantity: "99", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, }, expErr: "insufficient credit balance", @@ -252,12 +272,14 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { // NewQuantity: "1.0", // NewAskPrice: &askPrice2, // DisableAutoRetire: true, + // NewExpiration: &expiration, // }, // { // SellOrderId: sellRes.SellOrderIds[1], // NewQuantity: "1.0", // NewAskPrice: &askPrice2, // DisableAutoRetire: true, + // NewExpiration: &expiration, // }, // }, // expErr: "denom not allowed", @@ -272,12 +294,14 @@ func (s *IntegrationTestSuite) TestScenarioUpdateSellOrders() { NewQuantity: "1.0", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, { SellOrderId: sellRes.SellOrderIds[1], NewQuantity: "1.0", NewAskPrice: &askPrice1, DisableAutoRetire: true, + NewExpiration: &expiration, }, }, expErr: "", @@ -333,6 +357,8 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { // TODO: Verify that BidPrice.Denom is in AllowAskDenom #624 //bidPrice3 := sdk.NewInt64Coin("token", 1000000) + expiration := time.Date(2030, 01, 01, 0, 0, 0, 0, time.UTC) + // fund buyer account s.Require().NoError(s.fundAccount(addr2, sdk.NewCoins(sdk.NewInt64Coin("stake", 3000000)))) @@ -345,24 +371,28 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { Quantity: "1.0", AskPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: createBatchRes.BatchDenom, Quantity: "1.0", AskPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: createBatchRes.BatchDenom, Quantity: "1.0", AskPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { BatchDenom: createBatchRes.BatchDenom, Quantity: "1.0", AskPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, }) @@ -388,12 +418,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { Quantity: "1.0", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { Selection: &ecocredit.MsgBuy_Order_Selection{Sum: &ecocredit.MsgBuy_Order_Selection_SellOrderId{SellOrderId: 100}}, Quantity: "1.0", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "not found", @@ -408,12 +440,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { Quantity: "99.99", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { Selection: &ecocredit.MsgBuy_Order_Selection{Sum: &ecocredit.MsgBuy_Order_Selection_SellOrderId{SellOrderId: sellRes.SellOrderIds[1]}}, Quantity: "99.99", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "insufficient balance", @@ -428,12 +462,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { Quantity: "1.0", BidPrice: &bidPrice2, DisableAutoRetire: true, + Expiration: &expiration, }, { Selection: &ecocredit.MsgBuy_Order_Selection{Sum: &ecocredit.MsgBuy_Order_Selection_SellOrderId{SellOrderId: sellRes.SellOrderIds[1]}}, Quantity: "1.0", BidPrice: &bidPrice2, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "insufficient balance", @@ -449,12 +485,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { // Quantity: "1.0", // BidPrice: &bidPrice3, // DisableAutoRetire: true, + // Expiration: &expiration, // }, // { // Selection: &ecocredit.MsgBuy_Order_Selection{Sum: &ecocredit.MsgBuy_Order_Selection_SellOrderId{SellOrderId: sellRes.SellOrderIds[1]}}, // Quantity: "1.0", // BidPrice: &bidPrice3, // DisableAutoRetire: true, + // Expiration: &expiration, // }, // }, // expErr: "denom not allowed", @@ -469,12 +507,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { Quantity: "1.0", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { Selection: &ecocredit.MsgBuy_Order_Selection{Sum: &ecocredit.MsgBuy_Order_Selection_SellOrderId{SellOrderId: sellRes.SellOrderIds[1]}}, Quantity: "1.0", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "", @@ -495,12 +535,14 @@ func (s *IntegrationTestSuite) TestScenarioCreateBuyOrders() { Quantity: "0.5", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, { Selection: &ecocredit.MsgBuy_Order_Selection{Sum: &ecocredit.MsgBuy_Order_Selection_SellOrderId{SellOrderId: sellRes.SellOrderIds[3]}}, Quantity: "0.5", BidPrice: &bidPrice1, DisableAutoRetire: true, + Expiration: &expiration, }, }, expErr: "", diff --git a/x/ecocredit/spec/protobuf.md b/x/ecocredit/spec/protobuf.md index 9d6ac64b0e..8f53437e79 100644 --- a/x/ecocredit/spec/protobuf.md +++ b/x/ecocredit/spec/protobuf.md @@ -175,6 +175,7 @@ EventBuyOrderCreated is an event emitted when a buy order is created. | bid_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | bid price is the bid price for this buy order. A credit unit will be settled at a purchase price that is no more than the bid price. The buy order will fail if the buyer does not have enough funds available to complete the purchase. | | disable_auto_retire | [bool](#bool) | | disable_auto_retire allows auto-retirement to be disabled. If it is set to true the credits will not auto-retire and can be resold assuming that the corresponding sell order has auto-retirement disabled. If the sell order hasn't disabled auto-retirement and the buy order tries to disable it, that buy order will fail. | | disable_partial_fill | [bool](#bool) | | disable_partial_fill disables the default behavior of partially filling buy orders if the requested quantity is not available. | +| expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | expiration is the optional timestamp when the buy order expires. When the expiration time is reached, the buy order is removed from state. | @@ -329,6 +330,7 @@ EventSell is an event emitted when a sell order is created. | quantity | [string](#string) | | quantity is the quantity of credits being sold. | | ask_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | ask_price is the price the seller is asking for each unit of the batch_denom. Each credit unit of the batch will be sold for at least the ask_price or more. | | disable_auto_retire | [bool](#bool) | | disable_auto_retire disables auto-retirement of credits which allows a buyer to disable auto-retirement in their buy order enabling them to resell the credits to another buyer. | +| expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | expiration is the optional timestamp when the sell order expires. When the expiration time is reached, the sell order is removed from state. | @@ -349,6 +351,7 @@ EventUpdateSellOrder is an event emitted when a sell order is updated. | new_quantity | [string](#string) | | new_quantity is the updated quantity of credits available to sell, if it is set to zero then the order is cancelled. | | new_ask_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | new_ask_price is the new ask price for this sell order | | disable_auto_retire | [bool](#bool) | | disable_auto_retire updates the disable_auto_retire field in the sell order. | +| new_expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | new_expiration is the optional timestamp when the sell order expires. When the expiration time is reached, the sell order is removed from state. | @@ -456,6 +459,7 @@ BuyOrder represents the information for a buy order. | bid_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | bid price is the bid price for this buy order. A credit unit will be settled at a purchase price that is no more than the bid price. The buy order will fail if the buyer does not have enough funds available to complete the purchase. | | disable_auto_retire | [bool](#bool) | | disable_auto_retire allows auto-retirement to be disabled. If it is set to true the credits will not auto-retire and can be resold assuming that the corresponding sell order has auto-retirement disabled. If the sell order hasn't disabled auto-retirement and the buy order tries to disable it, that buy order will fail. | | disable_partial_fill | [bool](#bool) | | disable_partial_fill disables the default behavior of partially filling buy orders if the requested quantity is not available. | +| expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | expiration is the optional timestamp when the buy order expires. When the expiration time is reached, the buy order is removed from state. | @@ -658,6 +662,7 @@ SellOrder represents the information for a sell order. | quantity | [string](#string) | | quantity is the quantity of credits being sold. | | ask_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | ask_price is the price the seller is asking for each unit of the batch_denom. Each credit unit of the batch will be sold for at least the ask_price or more. | | disable_auto_retire | [bool](#bool) | | disable_auto_retire disables auto-retirement of credits which allows a buyer to disable auto-retirement in their buy order enabling them to resell the credits to another buyer. | +| expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | expiration is the optional timestamp when the sell order expires. When the expiration time is reached, the sell order is removed from state. | @@ -1549,6 +1554,7 @@ Order is a buy order. | bid_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | bid price is the bid price for this buy order. A credit unit will be settled at a purchase price that is no more than the bid price. The buy order will fail if the buyer does not have enough funds available to complete the purchase. | | disable_auto_retire | [bool](#bool) | | disable_auto_retire allows auto-retirement to be disabled. If it is set to true the credits will not auto-retire and can be resold assuming that the corresponding sell order has auto-retirement disabled. If the sell order hasn't disabled auto-retirement and the buy order tries to disable it, that buy order will fail. | | disable_partial_fill | [bool](#bool) | | disable_partial_fill disables the default behavior of partially filling buy orders if the requested quantity is not available. | +| expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | expiration is the optional timestamp when the buy order expires. When the expiration time is reached, the buy order is removed from state. | @@ -1883,6 +1889,7 @@ Order is the content of a new sell order. | quantity | [string](#string) | | quantity is the quantity of credits being sold from this batch. If it is less then the balance of credits the owner has available at the time this sell order is matched, the quantity will be adjusted downwards to the owner's balance. However, if the balance of credits is less than this quantity at the time the sell order is created, the operation will fail. | | ask_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | ask_price is the price the seller is asking for each unit of the batch_denom. Each credit unit of the batch will be sold for at least the ask_price or more. | | disable_auto_retire | [bool](#bool) | | disable_auto_retire disables auto-retirement of credits which allows a buyer to disable auto-retirement in their buy order enabling them to resell the credits to another buyer. | +| expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | expiration is the optional timestamp when the sell order expires. When the expiration time is reached, the sell order is removed from state. | @@ -2093,6 +2100,7 @@ Update is an update to an existing sell order. | new_quantity | [string](#string) | | new_quantity is the updated quantity of credits available to sell, if it is set to zero then the order is cancelled. | | new_ask_price | [cosmos.base.v1beta1.Coin](#cosmos.base.v1beta1.Coin) | | new_ask_price is the new ask price for this sell order | | disable_auto_retire | [bool](#bool) | | disable_auto_retire updates the disable_auto_retire field in the sell order. | +| new_expiration | [google.protobuf.Timestamp](#google.protobuf.Timestamp) | | new_expiration is the optional timestamp when the sell order expires. When the expiration time is reached, the sell order is removed from state. | diff --git a/x/ecocredit/tx.pb.go b/x/ecocredit/tx.pb.go index 2574a136e7..3bcb14fa13 100644 --- a/x/ecocredit/tx.pb.go +++ b/x/ecocredit/tx.pb.go @@ -1384,6 +1384,9 @@ type MsgSell_Order struct { // buyer to disable auto-retirement in their buy order enabling them to // resell the credits to another buyer. DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + Expiration *time.Time `protobuf:"bytes,5,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } func (m *MsgSell_Order) Reset() { *m = MsgSell_Order{} } @@ -1447,6 +1450,13 @@ func (m *MsgSell_Order) GetDisableAutoRetire() bool { return false } +func (m *MsgSell_Order) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + // MsgSellResponse is the Msg/Sell response type. type MsgSellResponse struct { // sell_order_ids are the sell order IDs of the newly created sell orders. @@ -1559,6 +1569,9 @@ type MsgUpdateSellOrders_Update struct { NewAskPrice *types1.Coin `protobuf:"bytes,3,opt,name=new_ask_price,json=newAskPrice,proto3" json:"new_ask_price,omitempty"` // disable_auto_retire updates the disable_auto_retire field in the sell order. DisableAutoRetire bool `protobuf:"varint,4,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // new_expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + NewExpiration *time.Time `protobuf:"bytes,5,opt,name=new_expiration,json=newExpiration,proto3,stdtime" json:"new_expiration,omitempty"` } func (m *MsgUpdateSellOrders_Update) Reset() { *m = MsgUpdateSellOrders_Update{} } @@ -1622,6 +1635,13 @@ func (m *MsgUpdateSellOrders_Update) GetDisableAutoRetire() bool { return false } +func (m *MsgUpdateSellOrders_Update) GetNewExpiration() *time.Time { + if m != nil { + return m.NewExpiration + } + return nil +} + // MsgUpdateSellOrdersResponse is the Msg/UpdateSellOrders response type. type MsgUpdateSellOrdersResponse struct { } @@ -1736,6 +1756,9 @@ type MsgBuy_Order struct { // disable_partial_fill disables the default behavior of partially filling // buy orders if the requested quantity is not available. DisablePartialFill bool `protobuf:"varint,5,opt,name=disable_partial_fill,json=disablePartialFill,proto3" json:"disable_partial_fill,omitempty"` + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + Expiration *time.Time `protobuf:"bytes,6,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } func (m *MsgBuy_Order) Reset() { *m = MsgBuy_Order{} } @@ -1806,6 +1829,13 @@ func (m *MsgBuy_Order) GetDisablePartialFill() bool { return false } +func (m *MsgBuy_Order) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + // Selection defines a buy order selection. type MsgBuy_Order_Selection struct { // sum defines the type of selection. @@ -2588,122 +2618,124 @@ func init() { func init() { proto.RegisterFile("regen/ecocredit/v1alpha2/tx.proto", fileDescriptor_e82815fbf9298ddc) } var fileDescriptor_e82815fbf9298ddc = []byte{ - // 1832 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x6f, 0xdb, 0xc8, - 0x15, 0x0f, 0x25, 0x5b, 0xb6, 0x9e, 0x2c, 0x39, 0x19, 0xa7, 0xa9, 0xc2, 0x34, 0x8e, 0xcd, 0xa4, - 0x1b, 0xa5, 0x45, 0xa8, 0xd8, 0xd9, 0xee, 0x07, 0xfa, 0xb1, 0xb5, 0xbd, 0xd8, 0xc6, 0xd8, 0x3a, - 0x4d, 0x18, 0xf7, 0xb2, 0x40, 0x41, 0x8c, 0xc8, 0x59, 0x85, 0x35, 0xc5, 0x51, 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f, 0x95, - 0x4c, 0x76, 0x3f, 0x49, 0x9f, 0xb0, 0x73, 0x68, 0x7d, 0x08, 0x2b, 0x23, 0x81, 0x4c, 0x79, 0x7d, - 0x7b, 0x2e, 0xaf, 0xd3, 0x56, 0x6d, 0x29, 0x70, 0x52, 0x23, 0xe6, 0xdf, 0x0c, 0xa8, 0x49, 0x19, - 0xb2, 0xa0, 0x99, 0x73, 0x57, 0x6c, 0xbc, 0xe4, 0x34, 0x32, 0xde, 0xa2, 0x6d, 0x58, 0xe3, 0x27, - 0x68, 0x8a, 0xed, 0x46, 0x44, 0x4e, 0x1f, 0xa7, 0x84, 0x7f, 0x17, 0x9a, 0xe2, 0x90, 0x95, 0x27, - 0x9d, 0xab, 0xef, 0xbd, 0x2a, 0xef, 0xd9, 0x63, 0x3b, 0x89, 0x53, 0x27, 0xea, 0xef, 0xab, 0x50, - 0x3b, 0x62, 0xfd, 0xfd, 0xd1, 0x98, 0x13, 0xda, 0x1b, 0x8d, 0x27, 0x84, 0x8a, 0x05, 0xfa, 0xde, - 0x54, 0x9e, 0xbe, 0x35, 0x97, 0xcf, 0xfd, 0xd1, 0x78, 0x2a, 0x4d, 0xff, 0x51, 0x49, 0xd3, 0xf4, - 0x21, 0xd4, 0x19, 0x09, 0x89, 0x27, 0x6a, 0xbe, 0x21, 0x82, 0xbe, 0x57, 0xce, 0x98, 0xfd, 0x24, - 0xd5, 0x73, 0x26, 0x26, 0x8a, 0xb2, 0xba, 0x17, 0xf8, 0xa5, 0xb3, 0xba, 0x17, 0xf8, 0xaf, 0xc4, - 0x2e, 0xba, 0x07, 0x97, 0x53, 0xfc, 0x10, 0xc7, 0x49, 0x80, 0x43, 0xf7, 0xd3, 0x20, 0x0c, 0x45, - 0xf7, 0xb7, 0xea, 0x20, 0xf5, 0xec, 0x91, 0x7c, 0xf4, 0x51, 0x10, 0x86, 0xe6, 0x7b, 0x50, 0xd7, - 0xd1, 0xa0, 0x5b, 0x33, 0x53, 0xea, 0xc1, 0x85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 0x4e, 0xa9, 0x0a, 0xc3, 0xa1, 0xe6, 0x4e, 0x69, 0x68, 0xb6, - 0xf0, 0x65, 0xfb, 0x8f, 0xf9, 0xbc, 0x64, 0x90, 0x05, 0x85, 0x6f, 0x56, 0x1b, 0x11, 0x43, 0x6b, - 0xaa, 0x33, 0x98, 0x5f, 0x29, 0xf2, 0x60, 0xf3, 0xfe, 0x02, 0xe0, 0xec, 0x9e, 0x53, 0xd7, 0xf2, - 0xfc, 0x3d, 0xf3, 0xe0, 0x82, 0x3d, 0x67, 0xdf, 0x97, 0xfb, 0x1f, 0xff, 0xf3, 0xc5, 0xa6, 0xf1, - 0xc5, 0x8b, 0x4d, 0xe3, 0xbf, 0x2f, 0x36, 0x8d, 0xcf, 0x5e, 0x6e, 0x5e, 0xf8, 0xe2, 0xe5, 0xe6, - 0x85, 0x7f, 0xbf, 0xdc, 0xbc, 0xf0, 0xc9, 0x4e, 0x3f, 0x48, 0x9e, 0x8e, 0x7a, 0xb6, 0x47, 0x07, - 0x5d, 0x61, 0xf8, 0x6e, 0x44, 0x92, 0x53, 0x1a, 0x9f, 0xa8, 0x55, 0x48, 0xfc, 0x3e, 0x89, 0xbb, - 0xcf, 0x27, 0xff, 0x41, 0xe9, 0xd5, 0xc4, 0x07, 0xe7, 0xfb, 0xff, 0x0f, 0x00, 0x00, 0xff, 0xff, - 0xdb, 0xe2, 0xb4, 0x18, 0xef, 0x19, 0x00, 0x00, + // 1868 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x59, 0xcd, 0x73, 0x1b, 0x49, + 0x15, 0xcf, 0x48, 0xb6, 0x6c, 0x3d, 0x59, 0x72, 0xd2, 0x0e, 0x41, 0x99, 0x10, 0xc7, 0x9e, 0x84, + 0x8d, 0x02, 0x95, 0x51, 0xec, 0x2c, 0xfb, 0x51, 0x7c, 0xec, 0xca, 0x5e, 0x76, 0xe3, 0x5a, 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6, 0x4d, 0xb8, 0x31, 0xe5, 0x10, 0xad, 0x43, + 0x17, 0xbe, 0x92, 0xdf, 0x3e, 0x50, 0x8f, 0xe6, 0xc2, 0x5a, 0x64, 0xde, 0xdf, 0x72, 0xee, 0xfd, + 0xb5, 0x6e, 0xc1, 0xcd, 0xa9, 0x67, 0x68, 0x25, 0x88, 0xa8, 0x29, 0x19, 0xc0, 0x61, 0x5a, 0x9c, + 0x17, 0xd6, 0x62, 0xc6, 0x43, 0x69, 0x6d, 0xc1, 0xe6, 0xf4, 0x63, 0xb4, 0x22, 0x7f, 0x4b, 0x2b, + 0x54, 0x18, 0xf2, 0xa3, 0xe9, 0x49, 0xa4, 0x13, 0x4c, 0x2e, 0xd0, 0x7b, 0x50, 0xa1, 0xb1, 0x9f, + 0x36, 0x19, 0xb5, 0xdd, 0xbb, 0x73, 0x0a, 0x50, 0x18, 0xda, 0x3f, 0xe4, 0x78, 0x47, 0xb1, 0x99, + 0xff, 0x35, 0x60, 0x59, 0x50, 0xe6, 0x27, 0x93, 0x09, 0xab, 0x3f, 0x1d, 0xe2, 0x28, 0x09, 0x92, + 0x91, 0x32, 0x53, 0xaf, 0xd1, 0x5b, 0x50, 0xc5, 0xec, 0xd8, 0x1d, 0xc4, 0x81, 0x78, 0x26, 0xf9, + 0xab, 0x73, 0xdd, 0x96, 0x0d, 0x97, 0xcd, 0x1b, 0x2e, 0x5b, 0x35, 0x5c, 0xf6, 0x3e, 0x0d, 0x22, + 0x67, 0x15, 0xb3, 0xe3, 0x27, 0x1c, 0x8a, 0x6c, 0xd8, 0xf0, 0x03, 0x26, 0xcb, 0xd8, 0x30, 0xa1, + 0xae, 0xac, 0x34, 0xa2, 0xee, 0xac, 0x3a, 0x57, 0xd4, 0x56, 0x67, 0x98, 0x50, 0x55, 0x55, 0xde, + 0x07, 0x20, 0xa7, 0x83, 0x20, 0x96, 0x57, 0xbe, 0xe8, 0xeb, 0x98, 0xe1, 0xb1, 0xde, 0x56, 0x85, + 0x2b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// Reference imports to suppress errors if they are not otherwise used. @@ -4383,6 +4415,16 @@ func (m *MsgSell_Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expiration != nil { + n3, err3 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err3 != nil { + return 0, err3 + } + i -= n3 + i = encodeVarintTx(dAtA, i, uint64(n3)) + i-- + dAtA[i] = 0x2a + } if m.DisableAutoRetire { i-- if m.DisableAutoRetire { @@ -4443,20 +4485,20 @@ func (m *MsgSellResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.SellOrderIds) > 0 { - dAtA5 := make([]byte, len(m.SellOrderIds)*10) - var j4 int + dAtA6 := make([]byte, len(m.SellOrderIds)*10) + var j5 int for _, num := range m.SellOrderIds { for num >= 1<<7 { - dAtA5[j4] = uint8(uint64(num)&0x7f | 0x80) + dAtA6[j5] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j4++ + j5++ } - dAtA5[j4] = uint8(num) - j4++ + dAtA6[j5] = uint8(num) + j5++ } - i -= j4 - copy(dAtA[i:], dAtA5[:j4]) - i = encodeVarintTx(dAtA, i, uint64(j4)) + i -= j5 + copy(dAtA[i:], dAtA6[:j5]) + i = encodeVarintTx(dAtA, i, uint64(j5)) i-- dAtA[i] = 0xa } @@ -4527,6 +4569,16 @@ func (m *MsgUpdateSellOrders_Update) MarshalToSizedBuffer(dAtA []byte) (int, err _ = i var l int _ = l + if m.NewExpiration != nil { + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NewExpiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration):]) + if err7 != nil { + return 0, err7 + } + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) + i-- + dAtA[i] = 0x2a + } if m.DisableAutoRetire { i-- if m.DisableAutoRetire { @@ -4651,6 +4703,16 @@ func (m *MsgBuy_Order) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expiration != nil { + n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err9 != nil { + return 0, err9 + } + i -= n9 + i = encodeVarintTx(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0x32 + } if m.DisablePartialFill { i-- if m.DisablePartialFill { @@ -4770,20 +4832,20 @@ func (m *MsgBuyResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if len(m.BuyOrderIds) > 0 { - dAtA10 := make([]byte, len(m.BuyOrderIds)*10) - var j9 int + dAtA13 := make([]byte, len(m.BuyOrderIds)*10) + var j12 int for _, num := range m.BuyOrderIds { for num >= 1<<7 { - dAtA10[j9] = uint8(uint64(num)&0x7f | 0x80) + dAtA13[j12] = uint8(uint64(num)&0x7f | 0x80) num >>= 7 - j9++ + j12++ } - dAtA10[j9] = uint8(num) - j9++ + dAtA13[j12] = uint8(num) + j12++ } - i -= j9 - copy(dAtA[i:], dAtA10[:j9]) - i = encodeVarintTx(dAtA, i, uint64(j9)) + i -= j12 + copy(dAtA[i:], dAtA13[:j12]) + i = encodeVarintTx(dAtA, i, uint64(j12)) i-- dAtA[i] = 0xa } @@ -5674,6 +5736,10 @@ func (m *MsgSell_Order) Size() (n int) { if m.DisableAutoRetire { n += 2 } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -5732,6 +5798,10 @@ func (m *MsgUpdateSellOrders_Update) Size() (n int) { if m.DisableAutoRetire { n += 2 } + if m.NewExpiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.NewExpiration) + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -5787,6 +5857,10 @@ func (m *MsgBuy_Order) Size() (n int) { if m.DisablePartialFill { n += 2 } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovTx(uint64(l)) + } return n } @@ -8989,6 +9063,42 @@ func (m *MsgSell_Order) Unmarshal(dAtA []byte) error { } } m.DisableAutoRetire = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -9397,6 +9507,42 @@ func (m *MsgUpdateSellOrders_Update) Unmarshal(dAtA []byte) error { } } m.DisableAutoRetire = bool(v != 0) + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewExpiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.NewExpiration == nil { + m.NewExpiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.NewExpiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -9766,6 +9912,42 @@ func (m *MsgBuy_Order) Unmarshal(dAtA []byte) error { } } m.DisablePartialFill = bool(v != 0) + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/x/ecocredit/types.pb.go b/x/ecocredit/types.pb.go index 78219b6d7d..a7de60c401 100644 --- a/x/ecocredit/types.pb.go +++ b/x/ecocredit/types.pb.go @@ -537,6 +537,9 @@ type SellOrder struct { // buyer to disable auto-retirement in their buy order enabling them to // resell the credits to another buyer. DisableAutoRetire bool `protobuf:"varint,6,opt,name=disable_auto_retire,json=disableAutoRetire,proto3" json:"disable_auto_retire,omitempty"` + // expiration is the optional timestamp when the sell order expires. When the + // expiration time is reached, the sell order is removed from state. + Expiration *time.Time `protobuf:"bytes,7,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } func (m *SellOrder) Reset() { *m = SellOrder{} } @@ -614,6 +617,13 @@ func (m *SellOrder) GetDisableAutoRetire() bool { return false } +func (m *SellOrder) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + // BuyOrder represents the information for a buy order. type BuyOrder struct { // buy_order_id is the unique ID of buy order. @@ -640,6 +650,9 @@ type BuyOrder struct { // disable_partial_fill disables the default behavior of partially filling // buy orders if the requested quantity is not available. DisablePartialFill bool `protobuf:"varint,7,opt,name=disable_partial_fill,json=disablePartialFill,proto3" json:"disable_partial_fill,omitempty"` + // expiration is the optional timestamp when the buy order expires. When the + // expiration time is reached, the buy order is removed from state. + Expiration *time.Time `protobuf:"bytes,8,opt,name=expiration,proto3,stdtime" json:"expiration,omitempty"` } func (m *BuyOrder) Reset() { *m = BuyOrder{} } @@ -724,6 +737,13 @@ func (m *BuyOrder) GetDisablePartialFill() bool { return false } +func (m *BuyOrder) GetExpiration() *time.Time { + if m != nil { + return m.Expiration + } + return nil +} + // Selection defines a buy order selection. type BuyOrder_Selection struct { // sum defines the type of selection. @@ -1375,89 +1395,90 @@ func init() { } var fileDescriptor_d49f179dcaefe4e9 = []byte{ - // 1303 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0x4f, 0x73, 0xdb, 0xb6, - 0x12, 0x17, 0x25, 0x59, 0x12, 0x57, 0x72, 0xfe, 0xe0, 0x79, 0x32, 0x8c, 0xde, 0x8b, 0xa4, 0x28, - 0x9e, 0x79, 0x6e, 0xd2, 0x50, 0xb1, 0xfb, 0x67, 0x32, 0xed, 0xa1, 0x95, 0x9c, 0xa4, 0x76, 0xd3, - 0x49, 0x3c, 0x4c, 0x0e, 0x9d, 0x5e, 0x38, 0x20, 0x09, 0x2b, 0x88, 0x49, 0x42, 0x06, 0x40, 0x27, - 0x3a, 0xf6, 0xd8, 0x5b, 0x3e, 0x45, 0x0f, 0xed, 0xb1, 0x5f, 0x22, 0xc7, 0x1c, 0x3b, 0x3d, 0x34, - 0x6d, 0xf2, 0x3d, 0x3a, 0x1d, 0x02, 0xa0, 0x64, 0xd9, 0x71, 0xed, 0x69, 0x0f, 0x3d, 0x09, 0xfb, - 0xdb, 0x5d, 0x2c, 0x76, 0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0x25, - 0xd8, 0x82, 0xc4, 0x24, 0x54, 0x85, 0xae, 0xa8, 0xc3, 0xbe, 0x7f, 0x32, 0x75, 0x8a, 0x70, 0xee, - 0xa3, 0xc2, 0xc7, 0x9b, 0xbb, 0x9f, 0x56, 0x94, 0x80, 0x46, 0x67, 0x2e, 0x4a, 0x40, 0xa3, 0xbf, - 0x55, 0x14, 0x74, 0x0b, 0x56, 0x0a, 0xfb, 0x09, 0xe6, 0x92, 0xe2, 0xd8, 0xdf, 0xa5, 0x71, 0xac, - 0x46, 0x4f, 0xc3, 0x43, 0x46, 0xb7, 0xa3, 0x55, 0xf7, 0x68, 0x1c, 0xb7, 0x6f, 0x2b, 0xa6, 0x98, - 0x14, 0x56, 0x61, 0x59, 0x90, 0x38, 0x3e, 0x52, 0xc7, 0xad, 0x92, 0xd7, 0x14, 0x05, 0x9b, 0xb6, - 0xa3, 0xd1, 0x12, 0x54, 0x44, 0x96, 0xf4, 0x31, 0x34, 0x86, 0x62, 0x4f, 0x13, 0x62, 0x05, 0x96, - 0x34, 0x57, 0x34, 0x59, 0xb5, 0x80, 0xae, 0xc1, 0x72, 0x44, 0xc5, 0x24, 0xc6, 0xd3, 0x85, 0x59, - 0xdc, 0x32, 0xe0, 0x8c, 0x4b, 0xe4, 0xf9, 0x84, 0xa5, 0x24, 0xd5, 0x5d, 0xb3, 0xec, 0xcd, 0xe4, - 0xfe, 0xd7, 0xd0, 0x1a, 0x61, 0xb1, 0x47, 0xa4, 0xee, 0x90, 0xa3, 0xc4, 0xb4, 0x8e, 0x11, 0xf3, - 0xff, 0x70, 0x5e, 0x72, 0x1c, 0xe9, 0x82, 0xe9, 0xe9, 0xae, 0x63, 0x9e, 0x2b, 0x60, 0x3d, 0xe0, - 0xfb, 0x4f, 0xe1, 0x5c, 0xb1, 0x33, 0x95, 0x84, 0x53, 0x8c, 0x6e, 0x43, 0x6d, 0x97, 0xc6, 0x92, - 0x70, 0xb5, 0x6d, 0x73, 0xa3, 0x77, 0x32,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xed, 0x21, 0x54, - 0x86, 0x69, 0x84, 0x3e, 0x81, 0xba, 0x26, 0x87, 0x30, 0xd7, 0xec, 0xe9, 0x6c, 0x2a, 0x1c, 0xda, - 0x9f, 0x43, 0xf9, 0x21, 0xff, 0x47, 0x3b, 0x7c, 0x67, 0x81, 0x3d, 0x3b, 0xf3, 0xbf, 0xfb, 0x08, - 0x31, 0xc3, 0x62, 0x74, 0xff, 0xe5, 0x9b, 0x8e, 0xf5, 0xea, 0x4d, 0xc7, 0xfa, 0xed, 0x4d, 0xc7, - 0x7a, 0xf1, 0xb6, 0x53, 0x7a, 0xf5, 0xb6, 0x53, 0xfa, 0xf9, 0x6d, 0xa7, 0xf4, 0xcd, 0xfa, 0xa1, - 0xd7, 0x85, 0xca, 0xf0, 0x66, 0x4a, 0xe4, 0x33, 0xc6, 0xf7, 0x8c, 0x14, 0x93, 0x68, 0x4c, 0xf8, - 0xe0, 0xf9, 0xfc, 0xaf, 0x41, 0x50, 0x53, 0x61, 0x3f, 0xf8, 0x33, 0x00, 0x00, 0xff, 0xff, 0xfe, - 0x24, 0xb6, 0xc6, 0x34, 0x0c, 0x00, 0x00, + // 1325 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x57, 0xcd, 0x72, 0x1b, 0x45, + 0x10, 0xd6, 0x4a, 0xb2, 0xac, 0x6d, 0xc9, 0xf9, 0x19, 0x5c, 0xa9, 0x8d, 0x20, 0x92, 0xa2, 0xb8, + 0x0a, 0x93, 0x90, 0x55, 0x6c, 0x7e, 0x2a, 0x05, 0x07, 0x22, 0x39, 0x09, 0x36, 0xa1, 0x12, 0xd7, + 0x26, 0x07, 0x8a, 0xcb, 0xd6, 0xec, 0xee, 0x58, 0x99, 0x78, 0x77, 0x47, 0x9e, 0x99, 0x75, 0xa2, + 0x23, 0x47, 0x6e, 0x79, 0x07, 0xaa, 0x38, 0xc0, 0x91, 0x17, 0xe0, 0x98, 0x63, 0x8e, 0x14, 0x07, + 0x42, 0x25, 0x2f, 0x42, 0xed, 0xcc, 0xac, 0x64, 0xd9, 0x31, 0x36, 0x70, 0xe0, 0xa4, 0xed, 0xaf, + 0xbb, 0xa7, 0xa7, 0x7b, 0xfa, 0x9b, 0x1e, 0xc1, 0x0a, 0x27, 0x23, 0x92, 0xf6, 0x49, 0xc8, 0x42, + 0x4e, 0x22, 0x2a, 0xfb, 0xfb, 0x6b, 0x38, 0x1e, 0x3f, 0xc6, 0xeb, 0x7d, 0x39, 0x19, 0x13, 0xe1, + 0x8e, 0x39, 0x93, 0x0c, 0x39, 0xca, 0xca, 0x9d, 0x5a, 0xb9, 0x85, 0x55, 0xab, 0x1d, 0x32, 0x91, + 0x30, 0xd1, 0x0f, 0xb0, 0x20, 0xfd, 0xfd, 0xb5, 0x80, 0x48, 0xbc, 0xd6, 0x0f, 0x19, 0x4d, 0xb5, + 0x67, 0x6b, 0x79, 0xc4, 0x46, 0x4c, 0x7d, 0xf6, 0xf3, 0x2f, 0x83, 0x76, 0x46, 0x8c, 0x8d, 0x62, + 0xd2, 0x57, 0x52, 0x90, 0xed, 0xf4, 0x25, 0x4d, 0x88, 0x90, 0x38, 0x19, 0x6b, 0x83, 0xde, 0xef, + 0x16, 0xd8, 0x1b, 0x31, 0x16, 0x62, 0x2b, 0xdd, 0x61, 0xe8, 0x22, 0xd4, 0xc3, 0x5c, 0xf0, 0x69, + 0xe4, 0x58, 0x5d, 0x6b, 0xd5, 0xf6, 0x16, 0x95, 0xbc, 0x15, 0xa1, 0x65, 0x58, 0xc0, 0x51, 0x42, + 0x53, 0xa7, 0xac, 0x70, 0x2d, 0x20, 0x07, 0x16, 0xa9, 0x10, 0x19, 0xe1, 0xc2, 0xa9, 0x74, 0x2b, + 0xb9, 0xbd, 0x11, 0x51, 0x0b, 0xea, 0x09, 0x91, 0x38, 0xc2, 0x12, 0x3b, 0xd5, 0xae, 0xb5, 0xda, + 0xf4, 0xa6, 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2e, 0x6d, 0xa3, 0x30, 0x17, 0xe6, 0xb5, 0xb7, 0x3c, 0x73, 0xc0, 0x98, 0x1c, 0x79, 0xe8, 0xdc, + 0x03, 0xc8, 0xe7, 0xb9, 0xcf, 0x71, 0x3a, 0x22, 0x4e, 0x43, 0x55, 0xf3, 0xea, 0x89, 0xd5, 0xcc, + 0x27, 0xba, 0x97, 0x7b, 0xe4, 0x19, 0x47, 0x85, 0x80, 0x10, 0x54, 0x24, 0x1e, 0x39, 0x4d, 0x13, + 0x2c, 0x17, 0x5a, 0x03, 0xa8, 0x0c, 0xd2, 0x08, 0x7d, 0x06, 0x8b, 0xba, 0x39, 0x84, 0x19, 0xf5, + 0x27, 0x77, 0x53, 0xe1, 0xd0, 0xba, 0x05, 0xe5, 0x07, 0xfc, 0x3f, 0xad, 0xf0, 0xbd, 0x05, 0xf6, + 0x74, 0xcf, 0xff, 0xef, 0x43, 0xc8, 0x5c, 0x16, 0xc3, 0x7b, 0x2f, 0x5e, 0xb7, 0xad, 0x97, 0xaf, + 0xdb, 0xd6, 0x9f, 0xaf, 0xdb, 0xd6, 0xf3, 0x37, 0xed, 0xd2, 0xcb, 0x37, 0xed, 0xd2, 0x6f, 0x6f, + 0xda, 0xa5, 0x6f, 0xd7, 0x0e, 0xbc, 0x70, 0x54, 0x86, 0xd7, 0x53, 0x22, 0x9f, 0x32, 0xbe, 0x6b, + 0xa4, 0x98, 0x44, 0x23, 0xc2, 0xfb, 0xcf, 0x66, 0x7f, 0x4f, 0x82, 0x9a, 0x0a, 0xfb, 0xd1, 0x5f, + 0x01, 0x00, 0x00, 0xff, 0xff, 0xf8, 0x4d, 0xde, 0xd7, 0xb8, 0x0c, 0x00, 0x00, } func (m *ClassInfo) Marshal() (dAtA []byte, err error) { @@ -1840,6 +1861,16 @@ func (m *SellOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expiration != nil { + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err4 != nil { + return 0, err4 + } + i -= n4 + i = encodeVarintTypes(dAtA, i, uint64(n4)) + i-- + dAtA[i] = 0x3a + } if m.DisableAutoRetire { i-- if m.DisableAutoRetire { @@ -1911,6 +1942,16 @@ func (m *BuyOrder) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.Expiration != nil { + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Expiration, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration):]) + if err6 != nil { + return 0, err6 + } + i -= n6 + i = encodeVarintTypes(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x42 + } if m.DisablePartialFill { i-- if m.DisablePartialFill { @@ -2458,22 +2499,22 @@ func (m *Filter_DateRange) MarshalToSizedBuffer(dAtA []byte) (int, error) { var l int _ = l if m.EndDate != nil { - n11, err11 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndDate):]) - if err11 != nil { - return 0, err11 + n13, err13 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.EndDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.EndDate):]) + if err13 != nil { + return 0, err13 } - i -= n11 - i = encodeVarintTypes(dAtA, i, uint64(n11)) + i -= n13 + i = encodeVarintTypes(dAtA, i, uint64(n13)) i-- dAtA[i] = 0x42 } if m.StartDate != nil { - n12, err12 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartDate):]) - if err12 != nil { - return 0, err12 + n14, err14 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.StartDate, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.StartDate):]) + if err14 != nil { + return 0, err14 } - i -= n12 - i = encodeVarintTypes(dAtA, i, uint64(n12)) + i -= n14 + i = encodeVarintTypes(dAtA, i, uint64(n14)) i-- dAtA[i] = 0x3a } @@ -2689,6 +2730,10 @@ func (m *SellOrder) Size() (n int) { if m.DisableAutoRetire { n += 2 } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -2723,6 +2768,10 @@ func (m *BuyOrder) Size() (n int) { if m.DisablePartialFill { n += 2 } + if m.Expiration != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.Expiration) + n += 1 + l + sovTypes(uint64(l)) + } return n } @@ -4377,6 +4426,42 @@ func (m *SellOrder) Unmarshal(dAtA []byte) error { } } m.DisableAutoRetire = bool(v != 0) + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:]) @@ -4625,6 +4710,42 @@ func (m *BuyOrder) Unmarshal(dAtA []byte) error { } } m.DisablePartialFill = bool(v != 0) + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Expiration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTypes + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTypes + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTypes + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Expiration == nil { + m.Expiration = new(time.Time) + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(m.Expiration, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTypes(dAtA[iNdEx:])