Skip to content

Commit

Permalink
feat(plugin): add data request height to batch assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
Thomasvdam committed Dec 2, 2024
1 parent 9e90765 commit 6a1ea9a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions plugins/indexing/batching/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func ExtractUpdate(ctx *types.BlockContext, cdc codec.Codec, logger *log.Logger,

return types.NewMessage("batch", data, ctx), nil
} else if keyBytes, found := bytes.CutPrefix(change.Key, batchingtypes.BatchAssignmentsPrefix); found {
_, key, err := collections.StringKey.Decode(keyBytes)
_, key, err := collections.PairKeyCodec(collections.StringKey, collections.Uint64Key).Decode(keyBytes)
if err != nil {
return nil, err
}
Expand All @@ -96,9 +96,11 @@ func ExtractUpdate(ctx *types.BlockContext, cdc codec.Codec, logger *log.Logger,

data := struct {
DrID string `json:"dr_id"`
DrHeight string `json:"dr_height"`
BatchNumber string `json:"batch_number"`
}{
DrID: key,
DrID: key.K1(),
DrHeight: strconv.FormatUint(key.K2(), 10),
BatchNumber: strconv.FormatUint(val, 10),
}

Expand Down

0 comments on commit 6a1ea9a

Please sign in to comment.