diff --git a/api/side/btcbridge/genesis.pulsar.go b/api/side/btcbridge/genesis.pulsar.go index 531fa667..d9448e94 100644 --- a/api/side/btcbridge/genesis.pulsar.go +++ b/api/side/btcbridge/genesis.pulsar.go @@ -121,6 +121,7 @@ var ( fd_GenesisState_best_block_header protoreflect.FieldDescriptor fd_GenesisState_block_headers protoreflect.FieldDescriptor fd_GenesisState_utxos protoreflect.FieldDescriptor + fd_GenesisState_dkg_request protoreflect.FieldDescriptor ) func init() { @@ -130,6 +131,7 @@ func init() { fd_GenesisState_best_block_header = md_GenesisState.Fields().ByName("best_block_header") fd_GenesisState_block_headers = md_GenesisState.Fields().ByName("block_headers") fd_GenesisState_utxos = md_GenesisState.Fields().ByName("utxos") + fd_GenesisState_dkg_request = md_GenesisState.Fields().ByName("dkg_request") } var _ protoreflect.Message = (*fastReflection_GenesisState)(nil) @@ -221,6 +223,12 @@ func (x *fastReflection_GenesisState) Range(f func(protoreflect.FieldDescriptor, return } } + if x.DkgRequest != nil { + value := protoreflect.ValueOfMessage(x.DkgRequest.ProtoReflect()) + if !f(fd_GenesisState_dkg_request, value) { + return + } + } } // Has reports whether a field is populated. @@ -244,6 +252,8 @@ func (x *fastReflection_GenesisState) Has(fd protoreflect.FieldDescriptor) bool return len(x.BlockHeaders) != 0 case "side.btcbridge.GenesisState.utxos": return len(x.Utxos) != 0 + case "side.btcbridge.GenesisState.dkg_request": + return x.DkgRequest != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: side.btcbridge.GenesisState")) @@ -268,6 +278,8 @@ func (x *fastReflection_GenesisState) Clear(fd protoreflect.FieldDescriptor) { x.BlockHeaders = nil case "side.btcbridge.GenesisState.utxos": x.Utxos = nil + case "side.btcbridge.GenesisState.dkg_request": + x.DkgRequest = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: side.btcbridge.GenesisState")) @@ -302,6 +314,9 @@ func (x *fastReflection_GenesisState) Get(descriptor protoreflect.FieldDescripto } listValue := &_GenesisState_4_list{list: &x.Utxos} return protoreflect.ValueOfList(listValue) + case "side.btcbridge.GenesisState.dkg_request": + value := x.DkgRequest + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: side.btcbridge.GenesisState")) @@ -334,6 +349,8 @@ func (x *fastReflection_GenesisState) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_GenesisState_4_list) x.Utxos = *clv.list + case "side.btcbridge.GenesisState.dkg_request": + x.DkgRequest = value.Message().Interface().(*DKGRequest) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: side.btcbridge.GenesisState")) @@ -376,6 +393,11 @@ func (x *fastReflection_GenesisState) Mutable(fd protoreflect.FieldDescriptor) p } value := &_GenesisState_4_list{list: &x.Utxos} return protoreflect.ValueOfList(value) + case "side.btcbridge.GenesisState.dkg_request": + if x.DkgRequest == nil { + x.DkgRequest = new(DKGRequest) + } + return protoreflect.ValueOfMessage(x.DkgRequest.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: side.btcbridge.GenesisState")) @@ -401,6 +423,9 @@ func (x *fastReflection_GenesisState) NewField(fd protoreflect.FieldDescriptor) case "side.btcbridge.GenesisState.utxos": list := []*UTXO{} return protoreflect.ValueOfList(&_GenesisState_4_list{list: &list}) + case "side.btcbridge.GenesisState.dkg_request": + m := new(DKGRequest) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: side.btcbridge.GenesisState")) @@ -490,6 +515,10 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } + if x.DkgRequest != nil { + l = options.Size(x.DkgRequest) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -519,6 +548,20 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.DkgRequest != nil { + encoded, err := options.Marshal(x.DkgRequest) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x2a + } if len(x.Utxos) > 0 { for iNdEx := len(x.Utxos) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Utxos[iNdEx]) @@ -768,6 +811,42 @@ func (x *fastReflection_GenesisState) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field DkgRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.DkgRequest == nil { + x.DkgRequest = &DKGRequest{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.DkgRequest); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -827,6 +906,7 @@ type GenesisState struct { BestBlockHeader *BlockHeader `protobuf:"bytes,2,opt,name=best_block_header,json=bestBlockHeader,proto3" json:"best_block_header,omitempty"` BlockHeaders []*BlockHeader `protobuf:"bytes,3,rep,name=block_headers,json=blockHeaders,proto3" json:"block_headers,omitempty"` Utxos []*UTXO `protobuf:"bytes,4,rep,name=utxos,proto3" json:"utxos,omitempty"` + DkgRequest *DKGRequest `protobuf:"bytes,5,opt,name=dkg_request,json=dkgRequest,proto3" json:"dkg_request,omitempty"` } func (x *GenesisState) Reset() { @@ -877,6 +957,13 @@ func (x *GenesisState) GetUtxos() []*UTXO { return nil } +func (x *GenesisState) GetDkgRequest() *DKGRequest { + if x != nil { + return x.DkgRequest + } + return nil +} + var File_side_btcbridge_genesis_proto protoreflect.FileDescriptor var file_side_btcbridge_genesis_proto_rawDesc = []byte{ @@ -888,7 +975,7 @@ var file_side_btcbridge_genesis_proto_rawDesc = []byte{ 0x69, 0x64, 0x67, 0x65, 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2f, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, - 0x6f, 0x22, 0xfb, 0x01, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, + 0x6f, 0x22, 0xb8, 0x02, 0x0a, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x34, 0x0a, 0x06, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x42, 0x04, 0xc8, 0xde, 0x1f, 0x00, @@ -903,18 +990,22 @@ var file_side_btcbridge_genesis_proto_rawDesc = []byte{ 0x65, 0x61, 0x64, 0x65, 0x72, 0x52, 0x0c, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x48, 0x65, 0x61, 0x64, 0x65, 0x72, 0x73, 0x12, 0x2a, 0x0a, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, - 0x64, 0x67, 0x65, 0x2e, 0x55, 0x54, 0x58, 0x4f, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x42, - 0x9c, 0x01, 0x0a, 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, - 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, - 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, - 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x74, - 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x0e, - 0x53, 0x69, 0x64, 0x65, 0x2e, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xca, 0x02, - 0x0e, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xe2, - 0x02, 0x1a, 0x53, 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, - 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, - 0x69, 0x64, 0x65, 0x3a, 0x3a, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x62, 0x06, - 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x64, 0x67, 0x65, 0x2e, 0x55, 0x54, 0x58, 0x4f, 0x52, 0x05, 0x75, 0x74, 0x78, 0x6f, 0x73, 0x12, + 0x3b, 0x0a, 0x0b, 0x64, 0x6b, 0x67, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x05, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, + 0x72, 0x69, 0x64, 0x67, 0x65, 0x2e, 0x44, 0x4b, 0x47, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x52, 0x0a, 0x64, 0x6b, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x42, 0x9c, 0x01, 0x0a, + 0x12, 0x63, 0x6f, 0x6d, 0x2e, 0x73, 0x69, 0x64, 0x65, 0x2e, 0x62, 0x74, 0x63, 0x62, 0x72, 0x69, + 0x64, 0x67, 0x65, 0x42, 0x0c, 0x47, 0x65, 0x6e, 0x65, 0x73, 0x69, 0x73, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x1f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x73, 0x69, 0x64, 0x65, 0x2f, 0x62, 0x74, 0x63, 0x62, 0x72, + 0x69, 0x64, 0x67, 0x65, 0xa2, 0x02, 0x03, 0x53, 0x42, 0x58, 0xaa, 0x02, 0x0e, 0x53, 0x69, 0x64, + 0x65, 0x2e, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xca, 0x02, 0x0e, 0x53, 0x69, + 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0xe2, 0x02, 0x1a, 0x53, + 0x69, 0x64, 0x65, 0x5c, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x53, 0x69, 0x64, 0x65, + 0x3a, 0x3a, 0x42, 0x74, 0x63, 0x62, 0x72, 0x69, 0x64, 0x67, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( @@ -935,17 +1026,19 @@ var file_side_btcbridge_genesis_proto_goTypes = []interface{}{ (*Params)(nil), // 1: side.btcbridge.Params (*BlockHeader)(nil), // 2: side.btcbridge.BlockHeader (*UTXO)(nil), // 3: side.btcbridge.UTXO + (*DKGRequest)(nil), // 4: side.btcbridge.DKGRequest } var file_side_btcbridge_genesis_proto_depIdxs = []int32{ 1, // 0: side.btcbridge.GenesisState.params:type_name -> side.btcbridge.Params 2, // 1: side.btcbridge.GenesisState.best_block_header:type_name -> side.btcbridge.BlockHeader 2, // 2: side.btcbridge.GenesisState.block_headers:type_name -> side.btcbridge.BlockHeader 3, // 3: side.btcbridge.GenesisState.utxos:type_name -> side.btcbridge.UTXO - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 4, // 4: side.btcbridge.GenesisState.dkg_request:type_name -> side.btcbridge.DKGRequest + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_side_btcbridge_genesis_proto_init() } diff --git a/proto/side/btcbridge/genesis.proto b/proto/side/btcbridge/genesis.proto index ea6740ee..3c4e4eec 100644 --- a/proto/side/btcbridge/genesis.proto +++ b/proto/side/btcbridge/genesis.proto @@ -14,4 +14,5 @@ message GenesisState { BlockHeader best_block_header = 2; repeated BlockHeader block_headers = 3; repeated UTXO utxos = 4; + DKGRequest dkg_request= 5; } diff --git a/x/btcbridge/module/genesis.go b/x/btcbridge/module/genesis.go index c17b5e4c..ee464125 100644 --- a/x/btcbridge/module/genesis.go +++ b/x/btcbridge/module/genesis.go @@ -23,11 +23,17 @@ func InitGenesis(ctx sdk.Context, k keeper.Keeper, genState types.GenesisState) k.SetBlockHeader(ctx, header) } - // import utxos + // set utxos for _, utxo := range genState.Utxos { k.SaveUTXO(ctx, utxo) } + // set dkg request + if genState.DkgRequest != nil { + k.SetDKGRequest(ctx, genState.DkgRequest) + k.SetDKGRequestID(ctx, genState.DkgRequest.Id) + } + // sort vaults and set the latest vault version if len(genState.Params.Vaults) > 0 { vaults := genState.Params.Vaults diff --git a/x/btcbridge/module/genesis_test.go b/x/btcbridge/module/genesis_test.go index 803625a3..4c223d3b 100644 --- a/x/btcbridge/module/genesis_test.go +++ b/x/btcbridge/module/genesis_test.go @@ -11,7 +11,7 @@ import ( "github.com/btcsuite/btcd/wire" keepertest "github.com/sideprotocol/side/testutil/keeper" "github.com/sideprotocol/side/testutil/nullify" - "github.com/sideprotocol/side/x/btcbridge/module" + btcbridge "github.com/sideprotocol/side/x/btcbridge/module" "github.com/sideprotocol/side/x/btcbridge/types" "github.com/stretchr/testify/require" ) @@ -20,14 +20,10 @@ func TestGenesis(t *testing.T) { mnemonic := "sunny bamboo garlic fold reopen exile letter addict forest vessel square lunar shell number deliver cruise calm artist fire just kangaroo suit wheel extend" println(mnemonic) - genesisState := types.GenesisState{ - Params: types.DefaultParams(), - - // this line is used by starport scaffolding # genesis/test/state - } + genesisState := types.DefaultGenesis() k, ctx := keepertest.BtcBridgeKeeper(t) - btcbridge.InitGenesis(ctx, *k, genesisState) + btcbridge.InitGenesis(ctx, *k, *genesisState) got := btcbridge.ExportGenesis(ctx, *k) require.NotNil(t, got) diff --git a/x/btcbridge/types/genesis.go b/x/btcbridge/types/genesis.go index 839b87c7..eaae45df 100644 --- a/x/btcbridge/types/genesis.go +++ b/x/btcbridge/types/genesis.go @@ -3,6 +3,7 @@ package types import ( "github.com/btcsuite/btcd/chaincfg" + errorsmod "cosmossdk.io/errors" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -72,6 +73,7 @@ func DefaultGenesis() *GenesisState { BestBlockHeader: DefaultBestBlockHeader(), BlockHeaders: []*BlockHeader{}, Utxos: []*UTXO{}, + DkgRequest: nil, } } @@ -81,10 +83,20 @@ func (gs GenesisState) Validate() error { // this line is used by starport scaffolding # genesis/types/validate // validate the best block header + if gs.BestBlockHeader == nil { + return errorsmod.Wrap(ErrInvalidBlockHeader, "best block header can not be empty") + } if err := gs.BestBlockHeader.Validate(); err != nil { return err } + // validate block headers + if len(gs.BlockHeaders) != 0 { + if err := BlockHeaders(gs.BlockHeaders).Validate(); err != nil { + return err + } + } + // validate params return gs.Params.Validate() } diff --git a/x/btcbridge/types/genesis.pb.go b/x/btcbridge/types/genesis.pb.go index d53e7bff..4b186bf3 100644 --- a/x/btcbridge/types/genesis.pb.go +++ b/x/btcbridge/types/genesis.pb.go @@ -30,6 +30,7 @@ type GenesisState struct { BestBlockHeader *BlockHeader `protobuf:"bytes,2,opt,name=best_block_header,json=bestBlockHeader,proto3" json:"best_block_header,omitempty"` BlockHeaders []*BlockHeader `protobuf:"bytes,3,rep,name=block_headers,json=blockHeaders,proto3" json:"block_headers,omitempty"` Utxos []*UTXO `protobuf:"bytes,4,rep,name=utxos,proto3" json:"utxos,omitempty"` + DkgRequest *DKGRequest `protobuf:"bytes,5,opt,name=dkg_request,json=dkgRequest,proto3" json:"dkg_request,omitempty"` } func (m *GenesisState) Reset() { *m = GenesisState{} } @@ -93,6 +94,13 @@ func (m *GenesisState) GetUtxos() []*UTXO { return nil } +func (m *GenesisState) GetDkgRequest() *DKGRequest { + if m != nil { + return m.DkgRequest + } + return nil +} + func init() { proto.RegisterType((*GenesisState)(nil), "side.btcbridge.GenesisState") } @@ -100,25 +108,27 @@ func init() { func init() { proto.RegisterFile("side/btcbridge/genesis.proto", fileDescriptor_37c22954cf4a954b) } var fileDescriptor_37c22954cf4a954b = []byte{ - // 282 bytes of a gzipped FileDescriptorProto + // 318 bytes of a gzipped FileDescriptorProto 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x92, 0x29, 0xce, 0x4c, 0x49, 0xd5, 0x4f, 0x2a, 0x49, 0x4e, 0x2a, 0xca, 0x4c, 0x49, 0x4f, 0xd5, 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x03, 0xc9, 0xea, 0xc1, 0x65, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x52, 0xfa, 0x20, 0x16, 0x44, 0x95, 0x94, 0x34, 0x9a, 0x19, 0x05, 0x89, 0x45, 0x89, 0xb9, 0x50, 0x23, 0xa4, 0xe4, 0xd0, 0x24, 0xe1, 0x2c, 0x88, 0xbc, 0xd2, - 0x6f, 0x46, 0x2e, 0x1e, 0x77, 0x88, 0xa5, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0x26, 0x5c, 0x6c, + 0x0e, 0x26, 0x2e, 0x1e, 0x77, 0x88, 0xa5, 0xc1, 0x25, 0x89, 0x25, 0xa9, 0x42, 0x26, 0x5c, 0x6c, 0x10, 0x03, 0x24, 0x18, 0x15, 0x18, 0x35, 0xb8, 0x8d, 0xc4, 0xf4, 0x50, 0x1d, 0xa1, 0x17, 0x00, 0x96, 0x75, 0x62, 0x39, 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x56, 0xc8, 0x9d, 0x4b, 0x30, 0x29, 0xb5, 0xb8, 0x24, 0x3e, 0x29, 0x27, 0x3f, 0x39, 0x3b, 0x3e, 0x23, 0x35, 0x31, 0x25, 0xb5, 0x48, 0x82, 0x09, 0x6c, 0x80, 0x34, 0xba, 0x01, 0x4e, 0x20, 0x35, 0x1e, 0x60, 0x25, 0x41, 0xfc, 0x20, 0x5d, 0x48, 0x02, 0x42, 0x0e, 0x5c, 0xbc, 0xc8, 0x66, 0x14, 0x4b, 0x30, 0x2b, 0x30, 0x13, 0x32, 0x84, 0x27, 0x09, 0xc1, 0x29, 0x16, 0xd2, 0xe2, 0x62, 0x2d, 0x2d, 0xa9, 0xc8, 0x2f, 0x96, 0x60, - 0x01, 0xeb, 0x14, 0x41, 0xd7, 0x19, 0x1a, 0x12, 0xe1, 0x1f, 0x04, 0x51, 0xe2, 0xe4, 0x71, 0xe2, - 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0x4e, 0x78, 0x2c, 0xc7, 0x70, - 0xe1, 0xb1, 0x1c, 0xc3, 0x8d, 0xc7, 0x72, 0x0c, 0x51, 0x7a, 0xe9, 0x99, 0x25, 0x19, 0xa5, 0x49, - 0x7a, 0xc9, 0xf9, 0xb9, 0xfa, 0x20, 0x03, 0xc0, 0xa1, 0x95, 0x9c, 0x9f, 0x03, 0xe6, 0xe8, 0x57, - 0x20, 0x85, 0x68, 0x49, 0x65, 0x41, 0x6a, 0x71, 0x12, 0x1b, 0x58, 0x81, 0x31, 0x20, 0x00, 0x00, - 0xff, 0xff, 0x6e, 0x80, 0xfe, 0xd5, 0xd1, 0x01, 0x00, 0x00, + 0x01, 0xeb, 0x14, 0x41, 0xd7, 0x19, 0x1a, 0x12, 0xe1, 0x1f, 0x04, 0x51, 0x22, 0x64, 0xcd, 0xc5, + 0x9d, 0x92, 0x9d, 0x1e, 0x5f, 0x94, 0x5a, 0x58, 0x9a, 0x5a, 0x5c, 0x22, 0xc1, 0x0a, 0x76, 0xb0, + 0x14, 0xba, 0x0e, 0x17, 0x6f, 0xf7, 0x20, 0x88, 0x8a, 0x20, 0xae, 0x94, 0xec, 0x74, 0x28, 0xdb, + 0xc9, 0xe3, 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, 0xf4, 0xd2, 0x33, 0x4b, + 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x41, 0x66, 0x81, 0x83, 0x3a, 0x39, 0x3f, 0x07, + 0xcc, 0xd1, 0xaf, 0x40, 0x8a, 0x8e, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, 0xb0, 0x02, 0x63, + 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x80, 0xfe, 0x23, 0x0e, 0x02, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { @@ -141,6 +151,18 @@ func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DkgRequest != nil { + { + size, err := m.DkgRequest.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } if len(m.Utxos) > 0 { for iNdEx := len(m.Utxos) - 1; iNdEx >= 0; iNdEx-- { { @@ -229,6 +251,10 @@ func (m *GenesisState) Size() (n int) { n += 1 + l + sovGenesis(uint64(l)) } } + if m.DkgRequest != nil { + l = m.DkgRequest.Size() + n += 1 + l + sovGenesis(uint64(l)) + } return n } @@ -404,6 +430,42 @@ func (m *GenesisState) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DkgRequest", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DkgRequest == nil { + m.DkgRequest = &DKGRequest{} + } + if err := m.DkgRequest.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipGenesis(dAtA[iNdEx:])