Skip to content

Commit

Permalink
fix: do no share buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
hussein-aitlahcen committed Oct 21, 2024
1 parent 9f8a98f commit df0586c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion types/block.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit df0586c

Please sign in to comment.