fix: concat hex-encoded hashes instead

This commit is contained in:
Gaze
2024-06-10 01:52:24 +07:00
parent 3603248485
commit 8110434e18

View File

@@ -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,