From df0586cc2041ca6021473fddf109c912355cfae7 Mon Sep 17 00:00:00 2001 From: Hussein Ait Lahcen Date: Mon, 21 Oct 2024 12:14:06 +0200 Subject: [PATCH] fix: do no share buffer --- types/block.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/types/block.go b/types/block.go index 9f259a78540..6de35e9ef4d 100644 --- a/types/block.go +++ b/types/block.go @@ -492,20 +492,23 @@ func (h *Header) Hash() cmtbytes.HexBytes { return nil } - var padded [32]byte padI64 := func(x int64) []byte { + var padded [32]byte return big.NewInt(x).FillBytes(padded[:]) } padU64 := func(x uint64) []byte { + var padded [32]byte return big.NewInt(0).SetUint64(x).FillBytes(padded[:]) } padU32 := func(x uint32) []byte { + var padded [32]byte return big.NewInt(0).SetUint64(uint64(x)).FillBytes(padded[:]) } padBytes := func(b []byte) []byte { if len(b) > 31 { panic("impossible: bytes must fit in F_r") } + var padded [32]byte return big.NewInt(0).SetBytes(b).FillBytes(padded[:]) } uncons := func(b []byte) []byte {