feat(db): codec encoding/decoding (#51)

* wip

* add table macro

* add simple put get test with Address

* add Env.view and Env.update

* docs

* slightly change the test

* add initial table initialization and placeholders

* lint & some

* replace String with str

* add error.rs

* add docs to encode

* add docs

* clamp

* add source on libmdbx_max_page_size

* add BlockNumer_BlockHash

* add scale

* set header filed to bytes Bytes

* remove unwrap

* restrict scale to chosen types

* into bytes

* add postcard

* changed to BlockNumHash

* add proc_macro_attribute codecs

* fix feature flagging

* set a version for postcard

* cleanup

* seal ScaleOnly

* remove unnecessary dependencies

* properly encode/decode blocknumhash

* change Account codec to scale

* add missing feature to scale

* add codec to a couple more types

* silence clippy

* add docs about table encoding

* move and add reth-codecs

* clippy

* make proc-macro visible

* add README.md
This commit is contained in:
joshieDo
2022-10-17 16:04:57 +08:00
committed by GitHub
parent 8009d997c0
commit 063b444792
25 changed files with 606 additions and 148 deletions

View File

@ -10,9 +10,13 @@ description = "Commonly used types in reth."
[dependencies]
ethers-core = { git = "https://github.com/gakonst/ethers-rs", default-features = false }
bytes = "1.2"
serde = "1.0"
thiserror = "1"
reth-rlp = { path = "../common/rlp", features = ["derive"]}
parity-scale-codec = { version = "3.2.1", features = ["derive", "bytes"] }
reth-codecs = { version = "0.1.0", path = "../codecs" }
#used for forkid
crc = "1"