From 6a1ea9a75ff2926900402cd05e90740971a9c56b Mon Sep 17 00:00:00 2001 From: Thomas van Dam Date: Mon, 2 Dec 2024 14:33:16 +0100 Subject: [PATCH] feat(plugin): add data request height to batch assignment --- plugins/indexing/batching/module.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/indexing/batching/module.go b/plugins/indexing/batching/module.go index e3fc8c85..e78a20c8 100644 --- a/plugins/indexing/batching/module.go +++ b/plugins/indexing/batching/module.go @@ -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 } @@ -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), }