lighthouse/consensus/types/Cargo.toml
Michael Sproul 74fa87aa98 Add serde_utils module with quoted u64 support (#1588)
## Proposed Changes

This is an extraction of the quoted int code from #1569, that I've come to rely on for #1544.

It allows us to parse integers from serde strings in YAML, JSON, etc. The main differences from the code in Paul's original PR are:

* Added a submodule that makes quoting mandatory (`require_quotes`).
* Decoding is generic over the type `T` being decoded. You can use `#[serde(with = "serde_utils::quoted_u64::require_quotes")]` on `Epoch` and `Slot` fields (this is what I do in my slashing protection PR).

I've turned on quoting for `Epoch` and `Slot` in this PR, but will leave the other `types` changes to you Paul.

I opted to put everything in the `conseus/serde_utils` module so that BLS can use it without a circular dependency. In future when we want to publish `types` I think we could publish `serde_utils` as `lighthouse_serde_utils` or something. Open to other ideas on this front too.
2020-09-07 01:03:53 +00:00

62 lines
1.6 KiB
TOML

[package]
name = "types"
version = "0.2.0"
authors = ["Paul Hauner <paul@paulhauner.com>", "Age Manning <Age@AgeManning.com>"]
edition = "2018"
[[bench]]
name = "benches"
harness = false
[dependencies]
bls = { path = "../../crypto/bls" }
compare_fields = { path = "../../common/compare_fields" }
compare_fields_derive = { path = "../../common/compare_fields_derive" }
dirs = "2.0.2"
eth2_interop_keypairs = { path = "../../common/eth2_interop_keypairs" }
ethereum-types = "0.9.1"
eth2_hashing = "0.1.0"
hex = "0.4.2"
int_to_bytes = { path = "../int_to_bytes" }
log = "0.4.8"
merkle_proof = { path = "../merkle_proof" }
rayon = "1.3.0"
rand = "0.7.3"
safe_arith = { path = "../safe_arith" }
serde = "1.0.110"
serde_derive = "1.0.110"
serde_utils = { path = "../serde_utils" }
slog = "2.5.2"
eth2_ssz = "0.1.2"
eth2_ssz_derive = "0.1.0"
eth2_ssz_types = { path = "../ssz_types" }
swap_or_not_shuffle = { path = "../swap_or_not_shuffle" }
test_random_derive = { path = "../../common/test_random_derive" }
tree_hash = "0.1.0"
tree_hash_derive = "0.2.0"
rand_xorshift = "0.2.0"
cached_tree_hash = { path = "../cached_tree_hash" }
serde_yaml = "0.8.11"
tempfile = "3.1.0"
derivative = "2.1.1"
rusqlite = { version = "0.23.1", features = ["bundled"], optional = true }
arbitrary = { version = "0.4.4", features = ["derive"], optional = true }
[dev-dependencies]
serde_json = "1.0.52"
criterion = "0.3.2"
[features]
default = ["sqlite"]
sqlite = ["rusqlite"]
arbitrary-fuzz = [
"arbitrary",
"ethereum-types/arbitrary",
"bls/arbitrary",
"eth2_ssz/arbitrary",
"eth2_ssz_types/arbitrary",
"merkle_proof/arbitrary",
"swap_or_not_shuffle/arbitrary",
"tree_hash/arbitrary",
]