Add commands to create and get auctions #2
@ -13,57 +13,6 @@ import (
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
var _ protoreflect.List = (*_GenesisState_2_list)(nil)
|
||||
|
||||
type _GenesisState_2_list struct {
|
||||
list *[]*Auction
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) Len() int {
|
||||
if x.list == nil {
|
||||
return 0
|
||||
}
|
||||
return len(*x.list)
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) Get(i int) protoreflect.Value {
|
||||
return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect())
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) Set(i int, value protoreflect.Value) {
|
||||
valueUnwrapped := value.Message()
|
||||
concreteValue := valueUnwrapped.Interface().(*Auction)
|
||||
(*x.list)[i] = concreteValue
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) Append(value protoreflect.Value) {
|
||||
valueUnwrapped := value.Message()
|
||||
concreteValue := valueUnwrapped.Interface().(*Auction)
|
||||
*x.list = append(*x.list, concreteValue)
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) AppendMutable() protoreflect.Value {
|
||||
v := new(Auction)
|
||||
*x.list = append(*x.list, v)
|
||||
return protoreflect.ValueOfMessage(v.ProtoReflect())
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) Truncate(n int) {
|
||||
for i := n; i < len(*x.list); i++ {
|
||||
(*x.list)[i] = nil
|
||||
}
|
||||
*x.list = (*x.list)[:n]
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) NewElement() protoreflect.Value {
|
||||
v := new(Auction)
|
||||
return protoreflect.ValueOfMessage(v.ProtoReflect())
|
||||
}
|
||||
|
||||
func (x *_GenesisState_2_list) IsValid() bool {
|
||||
return x.list != nil
|
||||
}
|
||||
|
||||
var (
|
||||
md_GenesisState protoreflect.MessageDescriptor
|
||||
fd_GenesisState_params protoreflect.FieldDescriptor
|
||||
@ -148,8 +97,8 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor,
|
||||
return
|
||||
}
|
||||
}
|
||||
if len(x.Auctions) != 0 {
|
||||
value := protoreflect.ValueOfList(&_GenesisState_2_list{list: &x.Auctions})
|
||||
if x.Auctions != nil {
|
||||
value := protoreflect.ValueOfMessage(x.Auctions.ProtoReflect())
|
||||
if !f(fd_GenesisState_auctions, value) {
|
||||
return
|
||||
}
|
||||
@ -172,7 +121,7 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool
|
||||
case "cerc.auction.v1.GenesisState.params":
|
||||
return x.Params != nil
|
||||
case "cerc.auction.v1.GenesisState.auctions":
|
||||
return len(x.Auctions) != 0
|
||||
return x.Auctions != nil
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.GenesisState"))
|
||||
@ -213,11 +162,8 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto
|
||||
value := x.Params
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
case "cerc.auction.v1.GenesisState.auctions":
|
||||
if len(x.Auctions) == 0 {
|
||||
return protoreflect.ValueOfList(&_GenesisState_2_list{})
|
||||
}
|
||||
listValue := &_GenesisState_2_list{list: &x.Auctions}
|
||||
return protoreflect.ValueOfList(listValue)
|
||||
value := x.Auctions
|
||||
return protoreflect.ValueOfMessage(value.ProtoReflect())
|
||||
default:
|
||||
if descriptor.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.GenesisState"))
|
||||
@ -241,9 +187,7 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value
|
||||
case "cerc.auction.v1.GenesisState.params":
|
||||
x.Params = value.Message().Interface().(*Params)
|
||||
case "cerc.auction.v1.GenesisState.auctions":
|
||||
lv := value.List()
|
||||
clv := lv.(*_GenesisState_2_list)
|
||||
x.Auctions = *clv.list
|
||||
x.Auctions = value.Message().Interface().(*Auctions)
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.GenesisState"))
|
||||
@ -271,10 +215,9 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p
|
||||
return protoreflect.ValueOfMessage(x.Params.ProtoReflect())
|
||||
case "cerc.auction.v1.GenesisState.auctions":
|
||||
if x.Auctions == nil {
|
||||
x.Auctions = []*Auction{}
|
||||
x.Auctions = new(Auctions)
|
||||
}
|
||||
value := &_GenesisState_2_list{list: &x.Auctions}
|
||||
return protoreflect.ValueOfList(value)
|
||||
return protoreflect.ValueOfMessage(x.Auctions.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.GenesisState"))
|
||||
@ -292,8 +235,8 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor)
|
||||
m := new(Params)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
case "cerc.auction.v1.GenesisState.auctions":
|
||||
list := []*Auction{}
|
||||
return protoreflect.ValueOfList(&_GenesisState_2_list{list: &list})
|
||||
m := new(Auctions)
|
||||
return protoreflect.ValueOfMessage(m.ProtoReflect())
|
||||
default:
|
||||
if fd.IsExtension() {
|
||||
panic(fmt.Errorf("proto3 declared messages do not support extensions: cerc.auction.v1.GenesisState"))
|
||||
@ -367,12 +310,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
l = options.Size(x.Params)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
if len(x.Auctions) > 0 {
|
||||
for _, e := range x.Auctions {
|
||||
l = options.Size(e)
|
||||
if x.Auctions != nil {
|
||||
l = options.Size(x.Auctions)
|
||||
n += 1 + l + runtime.Sov(uint64(l))
|
||||
}
|
||||
}
|
||||
if x.unknownFields != nil {
|
||||
n += len(x.unknownFields)
|
||||
}
|
||||
@ -402,9 +343,8 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
i -= len(x.unknownFields)
|
||||
copy(dAtA[i:], x.unknownFields)
|
||||
}
|
||||
if len(x.Auctions) > 0 {
|
||||
for iNdEx := len(x.Auctions) - 1; iNdEx >= 0; iNdEx-- {
|
||||
encoded, err := options.Marshal(x.Auctions[iNdEx])
|
||||
if x.Auctions != nil {
|
||||
encoded, err := options.Marshal(x.Auctions)
|
||||
if err != nil {
|
||||
return protoiface.MarshalOutput{
|
||||
NoUnkeyedLiterals: input.NoUnkeyedLiterals,
|
||||
@ -417,7 +357,6 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
if x.Params != nil {
|
||||
encoded, err := options.Marshal(x.Params)
|
||||
if err != nil {
|
||||
@ -546,8 +485,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods {
|
||||
if postIndex > l {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF
|
||||
}
|
||||
x.Auctions = append(x.Auctions, &Auction{})
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auctions[len(x.Auctions)-1]); err != nil {
|
||||
if x.Auctions == nil {
|
||||
x.Auctions = &Auctions{}
|
||||
}
|
||||
if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Auctions); err != nil {
|
||||
return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
@ -606,7 +547,7 @@ type GenesisState struct {
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Params *Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params,omitempty"`
|
||||
Auctions []*Auction `protobuf:"bytes,2,rep,name=auctions,proto3" json:"auctions,omitempty"`
|
||||
Auctions *Auctions `protobuf:"bytes,2,opt,name=auctions,proto3" json:"auctions,omitempty"`
|
||||
}
|
||||
|
||||
func (x *GenesisState) Reset() {
|
||||
@ -636,7 +577,7 @@ func (x *GenesisState) GetParams() *Params {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *GenesisState) GetAuctions() []*Auction {
|
||||
func (x *GenesisState) GetAuctions() *Auctions {
|
||||
if x != nil {
|
||||
return x.Auctions
|
||||
}
|
||||
@ -652,29 +593,30 @@ var file_cerc_auction_v1_genesis_proto_rawDesc = []byte{
|
||||
0x1a, 0x14, 0x67, 0x6f, 0x67, 0x6f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x67, 0x6f, 0x67, 0x6f,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa0, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa1, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69,
|
||||
0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x35, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73,
|
||||
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x17, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42,
|
||||
0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a,
|
||||
0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32,
|
||||
0x18, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x42, 0x23, 0xf2, 0xde, 0x1f, 0x1f, 0x6a,
|
||||
0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20, 0x79,
|
||||
0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52, 0x08,
|
||||
0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xbd, 0x01, 0x0a, 0x13, 0x63, 0x6f, 0x6d,
|
||||
0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
|
||||
0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01,
|
||||
0x5a, 0x3a, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65, 0x72,
|
||||
0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x32, 0x64, 0x2f, 0x61,
|
||||
0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
|
||||
0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43,
|
||||
0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f,
|
||||
0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63, 0x74,
|
||||
0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61,
|
||||
0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x04, 0xc8, 0xde, 0x1f, 0x00, 0x52, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x5a, 0x0a,
|
||||
0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x19, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76,
|
||||
0x31, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x23, 0xf2, 0xde, 0x1f, 0x1f,
|
||||
0x6a, 0x73, 0x6f, 0x6e, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x20,
|
||||
0x79, 0x61, 0x6d, 0x6c, 0x3a, 0x22, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0x52,
|
||||
0x08, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0xbd, 0x01, 0x0a, 0x13, 0x63, 0x6f,
|
||||
0x6d, 0x2e, 0x63, 0x65, 0x72, 0x63, 0x2e, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x76,
|
||||
0x31, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50,
|
||||
0x01, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x2e, 0x76, 0x64, 0x62, 0x2e, 0x74, 0x6f, 0x2f, 0x63, 0x65,
|
||||
0x72, 0x63, 0x2d, 0x69, 0x6f, 0x2f, 0x6c, 0x61, 0x63, 0x6f, 0x6e, 0x69, 0x63, 0x32, 0x64, 0x2f,
|
||||
0x61, 0x70, 0x69, 0x2f, 0x63, 0x65, 0x72, 0x63, 0x2f, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e,
|
||||
0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x76, 0x31, 0xa2, 0x02, 0x03,
|
||||
0x43, 0x41, 0x58, 0xaa, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x2e, 0x41, 0x75, 0x63, 0x74, 0x69,
|
||||
0x6f, 0x6e, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0f, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41, 0x75, 0x63,
|
||||
0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1b, 0x43, 0x65, 0x72, 0x63, 0x5c, 0x41,
|
||||
0x75, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74,
|
||||
0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x11, 0x43, 0x65, 0x72, 0x63, 0x3a, 0x3a, 0x41, 0x75,
|
||||
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -693,11 +635,11 @@ var file_cerc_auction_v1_genesis_proto_msgTypes = make([]protoimpl.MessageInfo,
|
||||
var file_cerc_auction_v1_genesis_proto_goTypes = []interface{}{
|
||||
(*GenesisState)(nil), // 0: cerc.auction.v1.GenesisState
|
||||
(*Params)(nil), // 1: cerc.auction.v1.Params
|
||||
(*Auction)(nil), // 2: cerc.auction.v1.Auction
|
||||
(*Auctions)(nil), // 2: cerc.auction.v1.Auctions
|
||||
}
|
||||
var file_cerc_auction_v1_genesis_proto_depIdxs = []int32{
|
||||
1, // 0: cerc.auction.v1.GenesisState.params:type_name -> cerc.auction.v1.Params
|
||||
2, // 1: cerc.auction.v1.GenesisState.auctions:type_name -> cerc.auction.v1.Auction
|
||||
2, // 1: cerc.auction.v1.GenesisState.auctions:type_name -> cerc.auction.v1.Auctions
|
||||
2, // [2:2] is the sub-list for method output_type
|
||||
2, // [2:2] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
|
@ -10,5 +10,5 @@ option go_package = "git.vdb.to/cerc-io/laconic2d/x/auction";
|
||||
// GenesisState defines the genesis state of the auction module
|
||||
message GenesisState {
|
||||
Params params = 1 [(gogoproto.nullable) = false];
|
||||
repeated Auction auctions = 2 [(gogoproto.moretags) = "json:\"auctions\" yaml:\"auctions\""];
|
||||
Auctions auctions = 2 [(gogoproto.moretags) = "json:\"auctions\" yaml:\"auctions\""];
|
||||
}
|
||||
|
@ -82,7 +82,10 @@ message QueryGetBondsByOwnerRequest {
|
||||
|
||||
// QueryGetBondsByOwnerResponse is response type for Query/GetBondsByOwner RPC Method
|
||||
message QueryGetBondsByOwnerResponse {
|
||||
repeated Bond bonds = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""];
|
||||
repeated Bond bonds = 1 [
|
||||
(gogoproto.nullable) = false,
|
||||
(gogoproto.moretags) = "json:\"bonds\" yaml:\"bonds\""
|
||||
];
|
||||
|
||||
// pagination defines the pagination in the response.
|
||||
cosmos.base.query.v1beta1.PageResponse pagination = 2;
|
||||
|
@ -3,14 +3,14 @@ package auction
|
||||
func DefaultGenesisState() *GenesisState {
|
||||
return &GenesisState{
|
||||
Params: DefaultParams(),
|
||||
Auctions: []*Auction{},
|
||||
Auctions: &Auctions{Auctions: []Auction{}},
|
||||
}
|
||||
}
|
||||
|
||||
func NewGenesisState(params Params, auctions []*Auction) *GenesisState {
|
||||
func NewGenesisState(params Params, auctions []Auction) *GenesisState {
|
||||
return &GenesisState{
|
||||
Params: params,
|
||||
Auctions: auctions,
|
||||
Auctions: &Auctions{Auctions: auctions},
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package
|
||||
// GenesisState defines the genesis state of the auction module
|
||||
type GenesisState struct {
|
||||
Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"`
|
||||
Auctions []*Auction `protobuf:"bytes,2,rep,name=auctions,proto3" json:"auctions,omitempty" json:"auctions" yaml:"auctions"`
|
||||
Auctions *Auctions `protobuf:"bytes,2,opt,name=auctions,proto3" json:"auctions,omitempty" json:"auctions" yaml:"auctions"`
|
||||
}
|
||||
|
||||
func (m *GenesisState) Reset() { *m = GenesisState{} }
|
||||
@ -69,7 +69,7 @@ func (m *GenesisState) GetParams() Params {
|
||||
return Params{}
|
||||
}
|
||||
|
||||
func (m *GenesisState) GetAuctions() []*Auction {
|
||||
func (m *GenesisState) GetAuctions() *Auctions {
|
||||
if m != nil {
|
||||
return m.Auctions
|
||||
}
|
||||
@ -83,23 +83,22 @@ func init() {
|
||||
func init() { proto.RegisterFile("cerc/auction/v1/genesis.proto", fileDescriptor_7571460e3af58ef5) }
|
||||
|
||||
var fileDescriptor_7571460e3af58ef5 = []byte{
|
||||
// 242 bytes of a gzipped FileDescriptorProto
|
||||
// 240 bytes of a gzipped FileDescriptorProto
|
||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x4d, 0x4e, 0x2d, 0x4a,
|
||||
0xd6, 0x4f, 0x2c, 0x4d, 0x2e, 0xc9, 0xcc, 0xcf, 0xd3, 0x2f, 0x33, 0xd4, 0x4f, 0x4f, 0xcd, 0x4b,
|
||||
0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x07, 0x49, 0xeb, 0x41, 0xa5,
|
||||
0xf5, 0xca, 0x0c, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x72, 0xfa, 0x20, 0x16, 0x44, 0x99,
|
||||
0x14, 0x86, 0x29, 0x30, 0x1d, 0x60, 0x69, 0xa5, 0x05, 0x8c, 0x5c, 0x3c, 0xee, 0x10, 0x73, 0x83,
|
||||
0x14, 0x86, 0x29, 0x30, 0x1d, 0x60, 0x69, 0xa5, 0x85, 0x8c, 0x5c, 0x3c, 0xee, 0x10, 0x73, 0x83,
|
||||
0x4b, 0x12, 0x4b, 0x52, 0x85, 0x4c, 0xb9, 0xd8, 0x0a, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0x25, 0x18,
|
||||
0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf5, 0xd0, 0xec, 0xd1, 0x0b, 0x00, 0x4b, 0x3b, 0xb1, 0x9c,
|
||||
0xb8, 0x27, 0xcf, 0x10, 0x04, 0x55, 0x2c, 0x14, 0xc9, 0xc5, 0x01, 0x55, 0x52, 0x2c, 0xc1, 0xa4,
|
||||
0xc0, 0xac, 0xc1, 0x6d, 0x24, 0x81, 0xa1, 0xd1, 0x11, 0xc2, 0x74, 0x52, 0xfe, 0x74, 0x4f, 0x5e,
|
||||
0x3e, 0xab, 0x38, 0x3f, 0xcf, 0x4a, 0x09, 0xa6, 0x47, 0x49, 0xa1, 0x32, 0x31, 0x37, 0x07, 0x89,
|
||||
0x1f, 0x04, 0x37, 0xce, 0xc9, 0xe1, 0xc4, 0x23, 0x39, 0xc6, 0x0b, 0x8f, 0xe4, 0x18, 0x1f, 0x3c,
|
||||
0x92, 0x63, 0x9c, 0xf0, 0x58, 0x8e, 0xe1, 0xc2, 0x63, 0x39, 0x86, 0x1b, 0x8f, 0xe5, 0x18, 0xa2,
|
||||
0xd4, 0xd2, 0x33, 0x4b, 0xf4, 0xca, 0x52, 0x92, 0xf4, 0x4a, 0xf2, 0xf5, 0x41, 0x96, 0xe9, 0x66,
|
||||
0xe6, 0xeb, 0xe7, 0x24, 0x26, 0xe7, 0xe7, 0x65, 0x26, 0x1b, 0xa5, 0xe8, 0x57, 0xc0, 0xbc, 0x9a,
|
||||
0xc4, 0x06, 0xf6, 0xab, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0x69, 0xca, 0xb3, 0x2b, 0x52, 0x01,
|
||||
0x00, 0x00,
|
||||
0xb8, 0x27, 0xcf, 0x10, 0x04, 0x55, 0x2c, 0x14, 0xc5, 0xc5, 0x01, 0x55, 0x52, 0x2c, 0xc1, 0x04,
|
||||
0xd6, 0x28, 0x89, 0xa1, 0xd1, 0x11, 0xaa, 0xc0, 0x49, 0xf9, 0xd3, 0x3d, 0x79, 0xf9, 0xac, 0xe2,
|
||||
0xfc, 0x3c, 0x2b, 0x25, 0x98, 0x26, 0x25, 0x85, 0xca, 0xc4, 0xdc, 0x1c, 0x24, 0x7e, 0x10, 0xdc,
|
||||
0x3c, 0x27, 0x87, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71,
|
||||
0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, 0x88, 0x52, 0x4b, 0xcf,
|
||||
0x2c, 0xd1, 0x2b, 0x4b, 0x49, 0xd2, 0x2b, 0xc9, 0xd7, 0x07, 0xd9, 0xa6, 0x9b, 0x99, 0xaf, 0x9f,
|
||||
0x93, 0x98, 0x9c, 0x9f, 0x97, 0x99, 0x6c, 0x94, 0xa2, 0x5f, 0x01, 0xf3, 0x6b, 0x12, 0x1b, 0xd8,
|
||||
0xb3, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x1e, 0x3c, 0x5f, 0xc5, 0x53, 0x01, 0x00, 0x00,
|
||||
}
|
||||
|
||||
func (m *GenesisState) Marshal() (dAtA []byte, err error) {
|
||||
@ -122,10 +121,9 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
_ = i
|
||||
var l int
|
||||
_ = l
|
||||
if len(m.Auctions) > 0 {
|
||||
for iNdEx := len(m.Auctions) - 1; iNdEx >= 0; iNdEx-- {
|
||||
if m.Auctions != nil {
|
||||
{
|
||||
size, err := m.Auctions[iNdEx].MarshalToSizedBuffer(dAtA[:i])
|
||||
size, err := m.Auctions.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
@ -135,7 +133,6 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) {
|
||||
i--
|
||||
dAtA[i] = 0x12
|
||||
}
|
||||
}
|
||||
{
|
||||
size, err := m.Params.MarshalToSizedBuffer(dAtA[:i])
|
||||
if err != nil {
|
||||
@ -168,12 +165,10 @@ func (m *GenesisState) Size() (n int) {
|
||||
_ = l
|
||||
l = m.Params.Size()
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
if len(m.Auctions) > 0 {
|
||||
for _, e := range m.Auctions {
|
||||
l = e.Size()
|
||||
if m.Auctions != nil {
|
||||
l = m.Auctions.Size()
|
||||
n += 1 + l + sovGenesis(uint64(l))
|
||||
}
|
||||
}
|
||||
return n
|
||||
}
|
||||
|
||||
@ -274,8 +269,10 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error {
|
||||
if postIndex > l {
|
||||
return io.ErrUnexpectedEOF
|
||||
}
|
||||
m.Auctions = append(m.Auctions, &Auction{})
|
||||
if err := m.Auctions[len(m.Auctions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
if m.Auctions == nil {
|
||||
m.Auctions = &Auctions{}
|
||||
}
|
||||
if err := m.Auctions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
|
||||
return err
|
||||
}
|
||||
iNdEx = postIndex
|
||||
|
@ -1,41 +1,40 @@
|
||||
package keeper
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"git.vdb.to/cerc-io/laconic2d/x/auction"
|
||||
sdk "github.com/cosmos/cosmos-sdk/types"
|
||||
)
|
||||
|
||||
// InitGenesis initializes the module state from a genesis state.
|
||||
func (k *Keeper) InitGenesis(ctx context.Context, data *auction.GenesisState) error {
|
||||
func (k *Keeper) InitGenesis(ctx sdk.Context, data *auction.GenesisState) error {
|
||||
if err := k.Params.Set(ctx, data.Params); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
// Save auctions in store.
|
||||
// for _, auction := range data.Auctions {
|
||||
// if err := k.Auctions.Set(ctx, auction.Id, *auction); err != nil {
|
||||
// return err
|
||||
// }
|
||||
// }
|
||||
for _, auction := range data.Auctions.Auctions {
|
||||
if err := k.Auctions.Set(ctx, auction.Id, auction); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// ExportGenesis exports the module state to a genesis state.
|
||||
func (k *Keeper) ExportGenesis(ctx context.Context) (*auction.GenesisState, error) {
|
||||
func (k *Keeper) ExportGenesis(ctx sdk.Context) (*auction.GenesisState, error) {
|
||||
params, err := k.Params.Get(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// auctions, err := k.ListAuctions(ctx)
|
||||
// if err != nil {
|
||||
// return nil, err
|
||||
// }
|
||||
auctions, err := k.ListAuctions(ctx)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &auction.GenesisState{
|
||||
Params: params,
|
||||
// Auctions: auctions,
|
||||
Auctions: &auction.Auctions{Auctions: auctions},
|
||||
}, nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user