mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2024-12-29 07:07:16 +00:00
added util to convert to H2048 interface (#188)
* added util to convert to H2048 interface * plain bytes * lint
This commit is contained in:
parent
34e6ca3c35
commit
4258567eb7
@ -29,6 +29,19 @@ func ConvertH2048ToBloom(h2048 *types.H2048) [256]byte {
|
||||
return bloom
|
||||
}
|
||||
|
||||
func ConvertBytesToH2048(data []byte) *types.H2048 {
|
||||
return &types.H2048{
|
||||
Lo: &types.H1024{
|
||||
Lo: ConvertBytesToH512(data),
|
||||
Hi: ConvertBytesToH512(data[64:]),
|
||||
},
|
||||
Hi: &types.H1024{
|
||||
Lo: ConvertBytesToH512(data[128:]),
|
||||
Hi: ConvertBytesToH512(data[192:]),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
func ConvertH256ToHash(h256 *types.H256) [32]byte {
|
||||
var hash [32]byte
|
||||
binary.BigEndian.PutUint64(hash[0:], h256.Hi.Hi)
|
||||
|
Loading…
Reference in New Issue
Block a user