Add missing rlp imports to properple decode/encode blocks/bodies (#761)

Without these added transanction/header import/exports decoding
blocks or block bodies would fail if one only had imported
blocks_rlp.

Also removes unused import + add copyright comments in rlp code.
This commit is contained in:
Kim De Mey 2024-11-20 18:15:34 +07:00 committed by GitHub
parent 88e4be4dc4
commit dc092ca393
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
8 changed files with 54 additions and 4 deletions

View File

@ -7,8 +7,9 @@
{.push raises: [].}
import ./[addresses_rlp, blocks, base_rlp, hashes_rlp], ../rlp
import
./[addresses_rlp, blocks, base_rlp, hashes_rlp, headers_rlp, transactions_rlp], ../rlp
from stew/objects import checkedEnumAssign
export addresses_rlp, blocks, base_rlp, hashes_rlp, rlp
export addresses_rlp, blocks, base_rlp, hashes_rlp, headers_rlp, transactions_rlp, rlp

View File

@ -1,9 +1,16 @@
# nim-eth
# Copyright (c) 2018-2024 Status Research & Development GmbH
# 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.
## This module implements RLP encoding and decoding as
## defined in Appendix B of the Ethereum Yellow Paper:
## https://ethereum.github.io/yellowpaper/paper.pdf
import
std/[strutils, options],
std/strutils,
stew/[byteutils, shims/macros],
results,
./rlp/[writer, object_serialization],

View File

@ -1,3 +1,10 @@
# eth
# Copyright (c) 2019-2024 Status Research & Development GmbH
# 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.
import
std/os,
../../rlp

View File

@ -1,3 +1,10 @@
# eth
# Copyright (c) 2019-2024 Status Research & Development GmbH
# 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.
import
stew/bitseqs,
../rlp

View File

@ -1,3 +1,10 @@
# eth
# Copyright (c) 2019-2024 Status Research & Development GmbH
# 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.
import
stew/shims/macros

View File

@ -1,3 +1,10 @@
# eth
# Copyright (c) 2019-2024 Status Research & Development GmbH
# 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.
const
BLOB_START_MARKER* = byte(0x80)
LIST_START_MARKER* = byte(0xc0)

View File

@ -1,8 +1,15 @@
# eth
# Copyright (c) 2024 Status Research & Development GmbH
# 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.
import ../rlp
import writer
import pkg/results
export
export
rlp, results
proc append*[T](w: var RlpWriter, val: Opt[T]) =

View File

@ -1,3 +1,10 @@
# eth
# Copyright (c) 2019-2024 Status Research & Development GmbH
# 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.
import
std/options,
pkg/results,