diff --git a/proto/stride/staketia/query.proto b/proto/stride/staketia/query.proto index ab0a28885..1e6332f39 100644 --- a/proto/stride/staketia/query.proto +++ b/proto/stride/staketia/query.proto @@ -86,7 +86,7 @@ message QueryRedemptionRecordRequest { string address = 2; }; message QueryRedemptionRecordResponse { - RedemptionRecord redemption_record = 1; + RedemptionRecordResponse redemption_record_response = 1; } // All Redemption Records @@ -96,7 +96,7 @@ message QueryRedemptionRecordsRequest { cosmos.base.query.v1beta1.PageRequest pagination = 3; }; message QueryRedemptionRecordsResponse { - repeated RedemptionRecord redemption_records = 1 + repeated RedemptionRecordResponse redemption_record_responses = 1 [ (gogoproto.nullable) = false ]; cosmos.base.query.v1beta1.PageResponse pagination = 2; } @@ -106,3 +106,13 @@ message QuerySlashRecordsRequest {}; message QuerySlashRecordsResponse { repeated SlashRecord slash_records = 1 [ (gogoproto.nullable) = false ]; } + +// Data structure for frontend to consume +message RedemptionRecordResponse { + // Redemption record + RedemptionRecord redemption_record = 1; + + // The Unix timestamp (in seconds) at which the unbonding for the UR + // associated with this RR completes + uint64 unbonding_completion_time_seconds = 2; +} \ No newline at end of file diff --git a/x/staketia/keeper/grpc_query.go b/x/staketia/keeper/grpc_query.go index 2099389d4..f2fa6ede2 100644 --- a/x/staketia/keeper/grpc_query.go +++ b/x/staketia/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + "time" "github.com/cosmos/cosmos-sdk/store/prefix" sdk "github.com/cosmos/cosmos-sdk/types" @@ -72,7 +73,14 @@ func (k Keeper) RedemptionRecord(c context.Context, req *types.QueryRedemptionRe "no redemption record found for unbonding ID %d and address %s", req.UnbondingRecordId, req.Address) } - return &types.QueryRedemptionRecordResponse{RedemptionRecord: &redemptionRecord}, nil + // Get the unbonding time from the unbonding record + unbondingRecord, found := k.GetUnbondingRecord(ctx, req.UnbondingRecordId) + if !found { + return &types.QueryRedemptionRecordResponse{}, types.ErrUnbondingRecordNotFound + } + + redemptionRecordResponse := types.NewRedemptionRecordResponse(redemptionRecord, unbondingRecord.UnbondingCompletionTimeSeconds) + return &types.QueryRedemptionRecordResponse{RedemptionRecordResponse: &redemptionRecordResponse}, nil } // Queries all redemption records with an optional filter by address @@ -82,23 +90,55 @@ func (k Keeper) RedemptionRecords(c context.Context, req *types.QueryRedemptionR } ctx := sdk.UnwrapSDKContext(c) - redemptionRecords := []types.RedemptionRecord{} + redemptionRecordResponses := []types.RedemptionRecordResponse{} + + // Create a map of estimated unbonding time by UnbondingRecord + unbondingTimeMap := map[uint64]uint64{} + unbondingRecords := k.GetAllActiveUnbondingRecords(ctx) + zone, err := k.GetHostZone(ctx) + if err != nil { + return &types.QueryRedemptionRecordsResponse{}, types.ErrHostZoneNotFound + } + fourDays := time.Duration(4) * time.Hour * 24 + unbondingLength := time.Duration(zone.UnbondingPeriodSeconds) * time.Second // 21 days + estimatedUnbondingTime := uint64(ctx.BlockTime().Add(unbondingLength).Add(fourDays).Unix()) // 21 days from now + 4 day buffer + for _, unbondingRecord := range unbondingRecords { + // Edge case: a user has submitted a redemption, but the corresponding unbonding record has not been confirmed, meaning + // the unbonding completion time is 0. Give a rough estimate. + if unbondingRecord.UnbondingCompletionTimeSeconds == 0 { + unbondingTimeMap[unbondingRecord.Id] = estimatedUnbondingTime + continue + } + unbondingTimeMap[unbondingRecord.Id] = unbondingRecord.UnbondingCompletionTimeSeconds + } // If they specify an address, search for that address and only return the matches if req.Address != "" { redemptionRecords := k.GetRedemptionRecordsFromAddress(ctx, req.Address) + // Iterate records and create response objects + redemptionRecordResponses := []types.RedemptionRecordResponse{} + for _, redemptionRecord := range redemptionRecords { + unbondingTime := unbondingTimeMap[redemptionRecord.UnbondingRecordId] + redemptionRecordResponses = append(redemptionRecordResponses, types.NewRedemptionRecordResponse(redemptionRecord, unbondingTime)) + } return &types.QueryRedemptionRecordsResponse{ - RedemptionRecords: redemptionRecords, - Pagination: nil, + RedemptionRecordResponses: redemptionRecordResponses, + Pagination: nil, }, nil } // If they specify an unbonding record ID, grab just the records for that ID if req.UnbondingRecordId != 0 { + unbondingTime := unbondingTimeMap[req.UnbondingRecordId] redemptionRecords := k.GetRedemptionRecordsFromUnbondingId(ctx, req.UnbondingRecordId) + redemptionRecordResponses := []types.RedemptionRecordResponse{} + // Iterate records and create response objects + for _, redemptionRecord := range redemptionRecords { + redemptionRecordResponses = append(redemptionRecordResponses, types.NewRedemptionRecordResponse(redemptionRecord, unbondingTime)) + } return &types.QueryRedemptionRecordsResponse{ - RedemptionRecords: redemptionRecords, - Pagination: nil, + RedemptionRecordResponses: redemptionRecordResponses, + Pagination: nil, }, nil } @@ -112,7 +152,10 @@ func (k Keeper) RedemptionRecords(c context.Context, req *types.QueryRedemptionR return err } - redemptionRecords = append(redemptionRecords, redemptionRecord) + unbondingTime := unbondingTimeMap[redemptionRecord.UnbondingRecordId] + redemptionRecordResponse := types.NewRedemptionRecordResponse(redemptionRecord, unbondingTime) + + redemptionRecordResponses = append(redemptionRecordResponses, redemptionRecordResponse) return nil }) if err != nil { @@ -120,8 +163,8 @@ func (k Keeper) RedemptionRecords(c context.Context, req *types.QueryRedemptionR } return &types.QueryRedemptionRecordsResponse{ - RedemptionRecords: redemptionRecords, - Pagination: pageRes, + RedemptionRecordResponses: redemptionRecordResponses, + Pagination: pageRes, }, nil } diff --git a/x/staketia/keeper/grpc_query_test.go b/x/staketia/keeper/grpc_query_test.go index 48b6e6c94..5e1a32f51 100644 --- a/x/staketia/keeper/grpc_query_test.go +++ b/x/staketia/keeper/grpc_query_test.go @@ -106,6 +106,21 @@ func (s *KeeperTestSuite) TestQueryRedemptionRecord() { queriedUnbondingRecordId := uint64(2) queriedAddress := "address-B" + unbondingRecords := []types.UnbondingRecord{ + {Id: 1, UnbondingCompletionTimeSeconds: 12345}, + {Id: 2, UnbondingCompletionTimeSeconds: 12346}, + {Id: 3, UnbondingCompletionTimeSeconds: 12347}, + {Id: 4, UnbondingCompletionTimeSeconds: 12348}, + } + for _, unbondingRecord := range unbondingRecords { + s.App.StaketiaKeeper.SetUnbondingRecord(s.Ctx, unbondingRecord) + } + // map unbonding record id to unbonding time + unbondingTimeMap := map[uint64]uint64{} + for _, unbondingRecord := range unbondingRecords { + unbondingTimeMap[unbondingRecord.Id] = unbondingRecord.UnbondingCompletionTimeSeconds + } + redemptionRecords := []types.RedemptionRecord{ {UnbondingRecordId: 1, Redeemer: "address-A"}, {UnbondingRecordId: 2, Redeemer: "address-B"}, @@ -122,13 +137,17 @@ func (s *KeeperTestSuite) TestQueryRedemptionRecord() { resp, err := s.App.StaketiaKeeper.RedemptionRecord(sdk.WrapSDKContext(s.Ctx), req) s.Require().NoError(err, "no error expected when querying redemption record") - s.Require().Equal(queriedUnbondingRecordId, resp.RedemptionRecord.UnbondingRecordId, "redemption record unbonding ID") - s.Require().Equal(queriedAddress, resp.RedemptionRecord.Redeemer, "redemption record address") + s.Require().Equal(queriedUnbondingRecordId, resp.RedemptionRecordResponse.RedemptionRecord.UnbondingRecordId, "redemption record unbonding ID") + s.Require().Equal(queriedAddress, resp.RedemptionRecordResponse.RedemptionRecord.Redeemer, "redemption record address") + s.Require().Equal(unbondingTimeMap[queriedUnbondingRecordId], resp.RedemptionRecordResponse.UnbondingCompletionTimeSeconds, "redemption record unbonding time") } func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_Address() { queriedAddress := "address-B" expectedUnbondingRecordIds := []uint64{2, 4} + s.App.StaketiaKeeper.SetHostZone(s.Ctx, types.HostZone{ + UnbondingPeriodSeconds: 10000, + }) allRedemptionRecords := []types.RedemptionRecord{ {UnbondingRecordId: 1, Redeemer: "address-A"}, {UnbondingRecordId: 2, Redeemer: "address-B"}, @@ -147,13 +166,16 @@ func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_Address() { s.Require().Nil(resp.Pagination, "pagination should be nil since it all fits on one page") actualUnbondingRecordIds := []uint64{} - for _, record := range resp.RedemptionRecords { - actualUnbondingRecordIds = append(actualUnbondingRecordIds, record.UnbondingRecordId) + for _, resp := range resp.RedemptionRecordResponses { + actualUnbondingRecordIds = append(actualUnbondingRecordIds, resp.RedemptionRecord.UnbondingRecordId) } s.Require().ElementsMatch(expectedUnbondingRecordIds, actualUnbondingRecordIds) } func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_UnbondingRecordId() { + s.App.StaketiaKeeper.SetHostZone(s.Ctx, types.HostZone{ + UnbondingPeriodSeconds: 10000, + }) queriedUnbondingRecordId := uint64(2) expectedAddresss := []string{"address-B", "address-D"} allRedemptionRecords := []types.RedemptionRecord{ @@ -174,13 +196,17 @@ func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_UnbondingRecordId() { s.Require().Nil(resp.Pagination, "pagination should be nil since it all fits on one page") actualAddresss := []string{} - for _, record := range resp.RedemptionRecords { - actualAddresss = append(actualAddresss, record.Redeemer) + for _, response := range resp.RedemptionRecordResponses { + actualAddresss = append(actualAddresss, response.RedemptionRecord.Redeemer) } s.Require().ElementsMatch(expectedAddresss, actualAddresss) } func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_Pagination() { + s.App.StaketiaKeeper.SetHostZone(s.Ctx, types.HostZone{ + UnbondingPeriodSeconds: 10000, + }) + // Set more records than what will fit on one page pageLimit := 50 numExcessRecords := 10 @@ -201,7 +227,7 @@ func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_Pagination() { s.Require().NoError(err, "no error expected when querying all redemption records") // Confirm only the first page was returned - s.Require().Equal(pageLimit, len(resp.RedemptionRecords), "only the first page should be returned") + s.Require().Equal(pageLimit, len(resp.RedemptionRecordResponses), "only the first page should be returned") // Attempt one more page, and it should get the remainder req = &types.QueryRedemptionRecordsRequest{ @@ -211,7 +237,7 @@ func (s *KeeperTestSuite) TestQueryAllRedemptionRecords_Pagination() { } resp, err = s.App.StaketiaKeeper.RedemptionRecords(sdk.WrapSDKContext(s.Ctx), req) s.Require().NoError(err, "no error expected when querying all redemption records on second page") - s.Require().Equal(numExcessRecords, len(resp.RedemptionRecords), "only the remainder should be returned") + s.Require().Equal(numExcessRecords, len(resp.RedemptionRecordResponses), "only the remainder should be returned") } func (s *KeeperTestSuite) TestQuerySlashRecords() { diff --git a/x/staketia/types/query.pb.go b/x/staketia/types/query.pb.go index 41accacbd..c1d69b433 100644 --- a/x/staketia/types/query.pb.go +++ b/x/staketia/types/query.pb.go @@ -343,7 +343,7 @@ func (m *QueryRedemptionRecordRequest) GetAddress() string { } type QueryRedemptionRecordResponse struct { - RedemptionRecord *RedemptionRecord `protobuf:"bytes,1,opt,name=redemption_record,json=redemptionRecord,proto3" json:"redemption_record,omitempty"` + RedemptionRecordResponse *RedemptionRecordResponse `protobuf:"bytes,1,opt,name=redemption_record_response,json=redemptionRecordResponse,proto3" json:"redemption_record_response,omitempty"` } func (m *QueryRedemptionRecordResponse) Reset() { *m = QueryRedemptionRecordResponse{} } @@ -379,9 +379,9 @@ func (m *QueryRedemptionRecordResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryRedemptionRecordResponse proto.InternalMessageInfo -func (m *QueryRedemptionRecordResponse) GetRedemptionRecord() *RedemptionRecord { +func (m *QueryRedemptionRecordResponse) GetRedemptionRecordResponse() *RedemptionRecordResponse { if m != nil { - return m.RedemptionRecord + return m.RedemptionRecordResponse } return nil } @@ -448,8 +448,8 @@ func (m *QueryRedemptionRecordsRequest) GetPagination() *query.PageRequest { } type QueryRedemptionRecordsResponse struct { - RedemptionRecords []RedemptionRecord `protobuf:"bytes,1,rep,name=redemption_records,json=redemptionRecords,proto3" json:"redemption_records"` - Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` + RedemptionRecordResponses []RedemptionRecordResponse `protobuf:"bytes,1,rep,name=redemption_record_responses,json=redemptionRecordResponses,proto3" json:"redemption_record_responses"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` } func (m *QueryRedemptionRecordsResponse) Reset() { *m = QueryRedemptionRecordsResponse{} } @@ -485,9 +485,9 @@ func (m *QueryRedemptionRecordsResponse) XXX_DiscardUnknown() { var xxx_messageInfo_QueryRedemptionRecordsResponse proto.InternalMessageInfo -func (m *QueryRedemptionRecordsResponse) GetRedemptionRecords() []RedemptionRecord { +func (m *QueryRedemptionRecordsResponse) GetRedemptionRecordResponses() []RedemptionRecordResponse { if m != nil { - return m.RedemptionRecords + return m.RedemptionRecordResponses } return nil } @@ -580,6 +580,62 @@ func (m *QuerySlashRecordsResponse) GetSlashRecords() []SlashRecord { return nil } +// Data structure for frontend to consume +type RedemptionRecordResponse struct { + // Redemption record + RedemptionRecord *RedemptionRecord `protobuf:"bytes,1,opt,name=redemption_record,json=redemptionRecord,proto3" json:"redemption_record,omitempty"` + // The Unix timestamp (in seconds) at which the unbonding for the UR + // associated with this RR completes + UnbondingCompletionTimeSeconds uint64 `protobuf:"varint,2,opt,name=unbonding_completion_time_seconds,json=unbondingCompletionTimeSeconds,proto3" json:"unbonding_completion_time_seconds,omitempty"` +} + +func (m *RedemptionRecordResponse) Reset() { *m = RedemptionRecordResponse{} } +func (m *RedemptionRecordResponse) String() string { return proto.CompactTextString(m) } +func (*RedemptionRecordResponse) ProtoMessage() {} +func (*RedemptionRecordResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_38d30838f2bbb0b1, []int{12} +} +func (m *RedemptionRecordResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RedemptionRecordResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RedemptionRecordResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *RedemptionRecordResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_RedemptionRecordResponse.Merge(m, src) +} +func (m *RedemptionRecordResponse) XXX_Size() int { + return m.Size() +} +func (m *RedemptionRecordResponse) XXX_DiscardUnknown() { + xxx_messageInfo_RedemptionRecordResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_RedemptionRecordResponse proto.InternalMessageInfo + +func (m *RedemptionRecordResponse) GetRedemptionRecord() *RedemptionRecord { + if m != nil { + return m.RedemptionRecord + } + return nil +} + +func (m *RedemptionRecordResponse) GetUnbondingCompletionTimeSeconds() uint64 { + if m != nil { + return m.UnbondingCompletionTimeSeconds + } + return 0 +} + func init() { proto.RegisterType((*QueryHostZoneRequest)(nil), "stride.staketia.QueryHostZoneRequest") proto.RegisterType((*QueryHostZoneResponse)(nil), "stride.staketia.QueryHostZoneResponse") @@ -593,61 +649,67 @@ func init() { proto.RegisterType((*QueryRedemptionRecordsResponse)(nil), "stride.staketia.QueryRedemptionRecordsResponse") proto.RegisterType((*QuerySlashRecordsRequest)(nil), "stride.staketia.QuerySlashRecordsRequest") proto.RegisterType((*QuerySlashRecordsResponse)(nil), "stride.staketia.QuerySlashRecordsResponse") + proto.RegisterType((*RedemptionRecordResponse)(nil), "stride.staketia.RedemptionRecordResponse") } func init() { proto.RegisterFile("stride/staketia/query.proto", fileDescriptor_38d30838f2bbb0b1) } var fileDescriptor_38d30838f2bbb0b1 = []byte{ - // 783 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x4f, 0x13, 0x41, - 0x14, 0xee, 0x14, 0xd4, 0x32, 0x60, 0x68, 0x47, 0x34, 0xa5, 0xe2, 0x5a, 0x37, 0x11, 0x0b, 0x91, - 0x1d, 0x5b, 0x13, 0x38, 0x4b, 0x8c, 0x88, 0x21, 0x88, 0x4b, 0xe4, 0xc0, 0xa5, 0xd9, 0x76, 0x27, - 0xdb, 0x8d, 0x65, 0xa7, 0xec, 0x6c, 0x09, 0x48, 0xb8, 0x78, 0x31, 0xde, 0x4c, 0x3c, 0xf9, 0x27, - 0x78, 0xf0, 0xe0, 0x9f, 0xe0, 0x0d, 0x6f, 0x24, 0x5e, 0x3c, 0x19, 0x03, 0xfe, 0x21, 0xa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0x6f, 0x84, 0x7b, 0x67, - 0x74, 0xf6, 0xce, 0x08, 0xb7, 0x5e, 0xec, 0x9d, 0xb1, 0x65, 0x39, 0xd1, 0x6a, 0x99, 0x7d, 0x37, - 0xf5, 0xef, 0x40, 0x8c, 0x72, 0x0c, 0xe7, 0xde, 0x28, 0x2b, 0xcf, 0x94, 0x3c, 0xca, 0x32, 0x4e, - 0x34, 0xca, 0xf2, 0x6b, 0x31, 0xb4, 0x36, 0x20, 0x21, 0xcd, 0x25, 0x3c, 0xb8, 0x54, 0x42, 0x48, - 0x6a, 0x40, 0x43, 0x01, 0xe6, 0xb9, 0x84, 0xed, 0xa6, 0xc5, 0x1a, 0x83, 0x2f, 0xae, 0xdb, 0x70, - 0x36, 0x26, 0x27, 0x94, 0xad, 0xc1, 0xeb, 0xac, 0x13, 0x97, 0x44, 0xcd, 0x29, 0xa2, 0xfa, 0x6e, - 0x0b, 0x3d, 0x53, 0xac, 0x0f, 0xb0, 0xf2, 0x3e, 0x03, 0xaf, 0xf0, 0x36, 0xe8, 0x03, 0x80, 0x99, - 0xc8, 0x7c, 0xd0, 0x7d, 0x05, 0x28, 0xce, 0xea, 0x0a, 0xf3, 0x97, 0x95, 0x85, 0x74, 0x75, 0xe3, - 0xdd, 0xcf, 0xbf, 0x9f, 0xd2, 0x25, 0x34, 0x8f, 0xb7, 0x79, 0xfd, 0xd2, 0x86, 0x55, 0x63, 0x58, - 0xf6, 0xef, 0xae, 0x39, 0xa2, 0xaf, 0x00, 0xe6, 0x14, 0x87, 0x42, 0x46, 0x7c, 0xb7, 0x24, 0x5b, - 0x2c, 0xe0, 0x91, 0xeb, 0x05, 0xcd, 0x15, 0x4e, 0xb3, 0x8c, 0xf0, 0x50, 0x9a, 0xaa, 0x3b, 0xa2, - 0x2f, 0x00, 0x66, 0x65, 0x33, 0x42, 0x4b, 0xf1, 0xed, 0x13, 0xfc, 0xaf, 0x60, 0x8c, 0x5a, 0x2e, - 0xc8, 0x2e, 0x73, 0xb2, 0x8f, 0x90, 0x31, 0x94, 0xac, 0x62, 0x83, 0xe8, 0x07, 0x80, 0x59, 0x79, - 0xd4, 0x93, 0xb8, 0x26, 0x58, 0x5d, 0x12, 0xd7, 0x24, 0xbf, 0xd2, 0x77, 0x38, 0xd7, 0x2d, 0xb4, - 0x39, 0x94, 0xab, 0xb2, 0xab, 0xf8, 0x38, 0xc6, 0x59, 0x4e, 0xf0, 0xb1, 0xb0, 0x9e, 0x13, 0x3e, - 0x27, 0xca, 0xfa, 0xa3, 0x11, 0xd9, 0x5d, 0x36, 0x27, 0x89, 0xbe, 0x32, 0xe2, 0x9c, 0xa8, 0xd6, - 0x83, 0x3e, 0x03, 0x38, 0xd5, 0xbf, 0xcf, 0x68, 0x21, 0xbe, 0x75, 0x8c, 0x1f, 0x14, 0x16, 0x47, - 0x29, 0x15, 0x04, 0x2b, 0x9c, 0xe0, 0x43, 0xb4, 0x38, 0x94, 0xe0, 0x80, 0x83, 0xac, 0x6e, 0x9c, - 0x9e, 0x6b, 0xe0, 0xec, 0x5c, 0x03, 0x7f, 0xce, 0x35, 0xf0, 0xf1, 0x42, 0x4b, 0x9d, 0x5d, 0x68, - 0xa9, 0x5f, 0x17, 0x5a, 0x6a, 0xb7, 0xe2, 0xb8, 0x41, 0xa3, 0x5d, 0x33, 0xea, 0x74, 0x2f, 0x0e, - 0xef, 0xa0, 0xbc, 0x82, 0x0f, 0x7b, 0xa8, 0xc1, 0x51, 0x8b, 0xb0, 0xda, 0x55, 0xfe, 0x1f, 0xe9, - 0xf1, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x5f, 0xca, 0xe5, 0xd3, 0x09, 0x00, 0x00, + // 855 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x56, 0xcf, 0x6f, 0xd3, 0x48, + 0x14, 0xce, 0xa4, 0xdd, 0xdd, 0x74, 0xda, 0x55, 0x93,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6, 0x65, 0x79, 0x98, 0x52, 0x29, 0x9d, 0x07, 0x85, 0x29, + 0x23, 0xfc, 0xa9, 0xbe, 0x02, 0x5c, 0x60, 0xbc, 0x14, 0x17, 0x68, 0x43, 0xd9, 0xeb, 0xc6, 0xc2, + 0x62, 0x1e, 0x8f, 0xf2, 0xd9, 0x5a, 0x89, 0x29, 0x15, 0xc1, 0x19, 0x92, 0x27, 0x88, 0xa8, 0x1f, + 0x45, 0x54, 0xba, 0xdf, 0xad, 0x4f, 0x06, 0x18, 0x90, 0x21, 0x6a, 0x48, 0x5a, 0xd4, 0x90, 0xfb, + 0x10, 0xf6, 0x96, 0x4c, 0x9a, 0x60, 0x22, 0x96, 0xb5, 0x60, 0x23, 0xb5, 0xce, 0x46, 0x6a, 0x81, + 0x1f, 0xf0, 0x8d, 0xd4, 0xf6, 0x4c, 0x3b, 0x5c, 0x3a, 0xa3, 0xef, 0x4d, 0xf5, 0x1b, 0xe0, 0x43, + 0x9e, 0xc0, 0x99, 0xf7, 0x8f, 0xc0, 0x05, 0x71, 0xff, 0xc2, 0x51, 0x19, 0xbf, 0x81, 0x7c, 0x66, + 0xe6, 0x45, 0x6d, 0xa4, 0x68, 0x6b, 0x40, 0x5b, 0x9a, 0x69, 0xbb, 0x31, 0x52, 0x1b, 0xff, 0x3c, + 0xfd, 0xe2, 0x64, 0x28, 0x31, 0x6d, 0xe5, 0x86, 0x49, 0xeb, 0x83, 0x9f, 0x42, 0xb5, 0xe0, 0x7c, + 0x42, 0x8c, 0x4b, 0xde, 0x82, 0x7f, 0xd3, 0xce, 0x79, 0x64, 0x1f, 0x16, 0x63, 0x22, 0xfb, 0xde, + 0xe6, 0xba, 0x66, 0x68, 0x1f, 0xa0, 0xfa, 0x09, 0x40, 0x49, 0x38, 0x98, 0xbb, 0x30, 0x17, 0x6b, + 0x2c, 0x9f, 0xc7, 0xa5, 0xd1, 0xed, 0xcc, 0x46, 0x1b, 0x88, 0xb6, 0xe1, 0x52, 0x6f, 0x86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c, 0x93, 0x98, 0x1c, 0x8a, 0xde, 0x01, 0x38, 0xd3, 0xef, 0x43, 0x68, + 0x25, 0xb9, 0x74, 0x82, 0x8f, 0xc9, 0xab, 0xe3, 0xa4, 0x72, 0x82, 0x25, 0x46, 0xf0, 0x26, 0x5a, + 0x1d, 0x4a, 0x70, 0xc0, 0xf9, 0x36, 0x77, 0xce, 0x2f, 0x15, 0x70, 0x71, 0xa9, 0x80, 0x1f, 0x97, + 0x0a, 0x78, 0x73, 0xa5, 0xa4, 0x2e, 0xae, 0x94, 0xd4, 0xd7, 0x2b, 0x25, 0x75, 0x50, 0xb2, 0x1d, + 0xbf, 0xde, 0xae, 0x6a, 0x35, 0xd2, 0x4c, 0xc2, 0x3b, 0x2a, 0x6e, 0xe8, 0xc7, 0x3d, 0x54, 0xff, + 0xa4, 0x85, 0x69, 0xf5, 0x4f, 0xf6, 0x77, 0xf0, 0xf6, 0xaf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x24, + 0xd7, 0x12, 0x39, 0xbe, 0x0a, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1195,9 +1257,9 @@ func (m *QueryRedemptionRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, _ = i var l int _ = l - if m.RedemptionRecord != nil { + if m.RedemptionRecordResponse != nil { { - size, err := m.RedemptionRecord.MarshalToSizedBuffer(dAtA[:i]) + size, err := m.RedemptionRecordResponse.MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1289,10 +1351,10 @@ func (m *QueryRedemptionRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, i-- dAtA[i] = 0x12 } - if len(m.RedemptionRecords) > 0 { - for iNdEx := len(m.RedemptionRecords) - 1; iNdEx >= 0; iNdEx-- { + if len(m.RedemptionRecordResponses) > 0 { + for iNdEx := len(m.RedemptionRecordResponses) - 1; iNdEx >= 0; iNdEx-- { { - size, err := m.RedemptionRecords[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + size, err := m.RedemptionRecordResponses[iNdEx].MarshalToSizedBuffer(dAtA[:i]) if err != nil { return 0, err } @@ -1366,6 +1428,46 @@ func (m *QuerySlashRecordsResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *RedemptionRecordResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *RedemptionRecordResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RedemptionRecordResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.UnbondingCompletionTimeSeconds != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.UnbondingCompletionTimeSeconds)) + i-- + dAtA[i] = 0x10 + } + if m.RedemptionRecord != nil { + { + size, err := m.RedemptionRecord.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1475,8 +1577,8 @@ func (m *QueryRedemptionRecordResponse) Size() (n int) { } var l int _ = l - if m.RedemptionRecord != nil { - l = m.RedemptionRecord.Size() + if m.RedemptionRecordResponse != nil { + l = m.RedemptionRecordResponse.Size() n += 1 + l + sovQuery(uint64(l)) } return n @@ -1508,8 +1610,8 @@ func (m *QueryRedemptionRecordsResponse) Size() (n int) { } var l int _ = l - if len(m.RedemptionRecords) > 0 { - for _, e := range m.RedemptionRecords { + if len(m.RedemptionRecordResponses) > 0 { + for _, e := range m.RedemptionRecordResponses { l = e.Size() n += 1 + l + sovQuery(uint64(l)) } @@ -1545,6 +1647,22 @@ func (m *QuerySlashRecordsResponse) Size() (n int) { return n } +func (m *RedemptionRecordResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.RedemptionRecord != nil { + l = m.RedemptionRecord.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.UnbondingCompletionTimeSeconds != 0 { + n += 1 + sovQuery(uint64(m.UnbondingCompletionTimeSeconds)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2127,7 +2245,7 @@ func (m *QueryRedemptionRecordResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RedemptionRecord", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RedemptionRecordResponse", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2154,10 +2272,10 @@ func (m *QueryRedemptionRecordResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.RedemptionRecord == nil { - m.RedemptionRecord = &RedemptionRecord{} + if m.RedemptionRecordResponse == nil { + m.RedemptionRecordResponse = &RedemptionRecordResponse{} } - if err := m.RedemptionRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + if err := m.RedemptionRecordResponse.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2350,7 +2468,7 @@ func (m *QueryRedemptionRecordsResponse) Unmarshal(dAtA []byte) error { switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RedemptionRecords", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RedemptionRecordResponses", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -2377,8 +2495,8 @@ func (m *QueryRedemptionRecordsResponse) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RedemptionRecords = append(m.RedemptionRecords, RedemptionRecord{}) - if err := m.RedemptionRecords[len(m.RedemptionRecords)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.RedemptionRecordResponses = append(m.RedemptionRecordResponses, RedemptionRecordResponse{}) + if err := m.RedemptionRecordResponses[len(m.RedemptionRecordResponses)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -2573,6 +2691,111 @@ func (m *QuerySlashRecordsResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *RedemptionRecordResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: RedemptionRecordResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RedemptionRecordResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RedemptionRecord", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.RedemptionRecord == nil { + m.RedemptionRecord = &RedemptionRecord{} + } + if err := m.RedemptionRecord.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingCompletionTimeSeconds", wireType) + } + m.UnbondingCompletionTimeSeconds = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondingCompletionTimeSeconds |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/staketia/types/records.go b/x/staketia/types/records.go index 8cee2e6cd..da04cbbb9 100644 --- a/x/staketia/types/records.go +++ b/x/staketia/types/records.go @@ -1,6 +1,8 @@ package types -import fmt "fmt" +import ( + fmt "fmt" +) // Confirm there are no duplicate delegation record Ids and that the amounts are not nil func ValidateDelegationRecordGenesis(delegationRecords []DelegationRecord) error { @@ -71,3 +73,11 @@ func ValidateSlashRecordGenesis(slashRecords []SlashRecord) error { } return nil } + +// Returns a RedemptionRecordResponse, which is a RedemptionRecord with the unbonding time +func NewRedemptionRecordResponse(redemptionRecord RedemptionRecord, unbondingTime uint64) RedemptionRecordResponse { + return RedemptionRecordResponse{ + RedemptionRecord: &redemptionRecord, + UnbondingCompletionTimeSeconds: unbondingTime, + } +}