Skip to content

Commit

Permalink
fix(sl): grpc sl add missing batch info (dymensionxyz#1309)
Browse files Browse the repository at this point in the history
  • Loading branch information
srene authored Jan 8, 2025
1 parent 13816c4 commit ebe8a96
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions settlement/grpc/grpc.go
Original file line number Diff line number Diff line change
Expand Up @@ -344,11 +344,13 @@ func (c *Client) saveBatch(batch *settlement.Batch) error {

func (c *Client) convertBatchtoSettlementBatch(batch *types.Batch, daResult *da.ResultSubmitBatch) *settlement.Batch {
bds := []rollapp.BlockDescriptor{}
for _, block := range batch.Blocks {

for index, block := range batch.Blocks {
bd := rollapp.BlockDescriptor{
Height: block.Header.Height,
StateRoot: block.Header.AppHash[:],
Timestamp: block.Header.GetTimestamp(),
Height: block.Header.Height,
StateRoot: block.Header.AppHash[:],
Timestamp: block.Header.GetTimestamp(),
DrsVersion: batch.DRSVersion[index],
}
bds = append(bds, bd)
}
Expand All @@ -359,16 +361,18 @@ func (c *Client) convertBatchtoSettlementBatch(batch *types.Batch, daResult *da.
}

settlementBatch := &settlement.Batch{
Sequencer: proposer.SettlementAddress,
StartHeight: batch.StartHeight(),
EndHeight: batch.EndHeight(),
Sequencer: proposer.SettlementAddress,
StartHeight: batch.StartHeight(),
EndHeight: batch.EndHeight(),
NextSequencer: proposer.SettlementAddress,
MetaData: &settlement.BatchMetaData{
DA: &da.DASubmitMetaData{
Height: daResult.SubmitMetaData.Height,
Client: daResult.SubmitMetaData.Client,
},
},
BlockDescriptors: bds,
NumBlocks: batch.EndHeight() - batch.StartHeight() + 1,
}

return settlementBatch
Expand Down

0 comments on commit ebe8a96

Please sign in to comment.