From 8110434e18f24ae364aebce33e5fbc518422b509 Mon Sep 17 00:00:00 2001 From: Gaze Date: Mon, 10 Jun 2024 01:52:24 +0700 Subject: [PATCH] fix: concat hex-encoded hashes instead --- modules/brc20/processor_process.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/brc20/processor_process.go b/modules/brc20/processor_process.go index 1a306a1..7af28aa 100644 --- a/modules/brc20/processor_process.go +++ b/modules/brc20/processor_process.go @@ -103,7 +103,7 @@ func (p *Processor) flushBlock(ctx context.Context, blockHeader types.BlockHeade if len(prevIndexedBlock.CumulativeEventHash) == 0 { cumulativeEventHash = eventHash } else { - cumulativeEventHash = sha256.Sum256(append(prevIndexedBlock.CumulativeEventHash[:], eventHash[:]...)) + cumulativeEventHash = sha256.Sum256([]byte(hex.EncodeToString(prevIndexedBlock.CumulativeEventHash[:]) + hex.EncodeToString(eventHash[:]))) } if err := brc20DgTx.CreateIndexedBlock(ctx, &entity.IndexedBlock{ Height: blockHeight,