2024-09-29 08:52:19 +00:00
|
|
|
# eth
|
|
|
|
# Copyright (c) 2024 Status Research & Development GmbH
|
2022-09-02 14:57:52 +00:00
|
|
|
# Licensed and distributed under either of
|
|
|
|
# * MIT license (license terms in the root directory or at https://opensource.org/licenses/MIT).
|
|
|
|
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
|
|
|
|
# at your option. This file may not be copied, modified, or distributed except according to those terms.
|
|
|
|
|
2024-09-29 08:52:19 +00:00
|
|
|
{.push raises: [].}
|
2022-09-02 14:57:52 +00:00
|
|
|
|
2024-09-29 08:52:19 +00:00
|
|
|
import "."/hashes, ../rlp
|
2022-09-02 14:57:52 +00:00
|
|
|
|
2024-09-29 08:52:19 +00:00
|
|
|
export hashes, rlp
|
2022-09-02 14:57:52 +00:00
|
|
|
|
2024-09-29 08:52:19 +00:00
|
|
|
proc read*(rlp: var Rlp, T: type Hash32): Hash32 {.raises: [RlpError].} =
|
|
|
|
Hash32(rlp.read(type(result.data)))
|
|
|
|
|
|
|
|
proc append*(rlpWriter: var RlpWriter, a: Hash32) =
|
2022-09-02 14:57:52 +00:00
|
|
|
rlpWriter.append(a.data)
|