Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use workspace.{package,dependencies} #17

Merged
merged 5 commits into from
Apr 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 43 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,51 @@
[workspace]
resolver = "2"
members = [
"uint",
"uint/ruint-macro",
"primitives",
"rlp",
"rlp/rlp-derive",
"abi",
"abi/sol-type-parser",
"dyn-abi",
"primitives",
"rlp",
"rlp/rlp-derive",
"uint",
"uint/ruint-macro",
]

# Copied from ruint cargo.toml:
#
# Compilation profile for any non-workspace member.
# Dependencies are optimized, even in a dev build. This improves dev performance
# while having neglible impact on incremental build times.
[profile.dev.package."*"]
opt-level = 3
[workspace.package]
edition = "2021"
rust-version = "1.65"
authors = []
license = "MIT OR Apache-2.0"
homepage = "https://github.com/ethers-rs/core"
repository = "https://github.com/ethers-rs/core"

[workspace.dependencies]
# workspace crates
ethers-abi-enc = { version = "0.1.0", path = "abi", default-features = false }
sol-type-parser = { version = "0.1.0", path = "abi/sol-type-parser", default-features = false }
ethers-dyn-abi = { version = "0.1.0", path = "dyn-abi", default-features = false }
ethers-primitives = { version = "0.1.0", path = "primitives", default-features = false }
ethers-rlp = { version = "0.1.0", path = "rlp", default-features = false }
ethers-rlp-derive = { version = "0.1.0", path = "rlp/rlp-derive", default-features = false }
ruint = { version = "1.0.2", path = "uint", default-features = false }
ruint-macro = { version = "1.7.0", path = "uint/ruint-macro", default-features = false }

# serde
serde = { version = "1.0", default-features = false }
serde_json = { version = "1.0", default-features = false }

# macros
proc-macro2 = "1.0"
quote = "1.0"
syn = "2.0"

# misc
arbitrary = { version = "1.2", default-features = false }
arrayvec = { version = "0.7.2", default-features = false }
bytes = { version = "1.0", default-features = false }
hex = { version = "0.4", default-features = false }
hex-literal = "0.4"
proptest = { version = "1.1", default-features = false }
proptest-derive = "0.3"
thiserror = "1.0"
tiny-keccak = "2.0"
25 changes: 0 additions & 25 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
Expand Up @@ -174,28 +174,3 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
of your accepting any such warranty or additional liability.

END OF TERMS AND CONDITIONS

APPENDIX: How to apply the Apache License to your work.

To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright [yyyy] [name of copyright owner]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
33 changes: 19 additions & 14 deletions abi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,28 +1,33 @@
[package]
name = "ethers-abi-enc"
version = "0.1.0"
edition = "2021"
description = "Ethereum ABI encoding and decoding, with static typing"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/ethers-rs/core"
readme = "README.md"
keywords = ["ethereum", "abi", "encoding", "EVM", "solidity"]
categories = ["encoding", "serialization", "cryptocurrency", "ethereum"]
authors = []
categories = ["encoding", "cryptography::cryptocurrencies"]

edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
ethers-primitives = { version = "0.1.0", path = "../primitives" }
hex = "0.4.3"
tiny-keccak = { version = "2.0.2", features = ["keccak"] }
sol-type-parser = { version = "0.1.0", path = "sol-type-parser" }
ethers-primitives.workspace = true
sol-type-parser.workspace = true

hex.workspace = true
tiny-keccak = { workspace = true, features = ["keccak"] }

thiserror = { version = "1.0.39", optional = true }
serde = { version = "1.0.159", optional = true }
thiserror = { workspace = true, optional = true }
serde = { workspace = true, optional = true }

[dev-dependencies]
hex-literal = "0.3.4"
hex-literal.workspace = true

[features]
default = ["std"]
std = ["hex/std", "thiserror"]
eip712-serde = ["dep:serde"]
std = ["ethers-primitives/std", "hex/std", "serde?/std", "thiserror"]
# TODO: Can we remove std from here?
eip712-serde = ["std", "dep:serde"]
Comment on lines +32 to +33
Copy link
Member Author

@DaniPopes DaniPopes Apr 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

util::StringifiedNumeric uses String and ToString

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we could remove std by importing String and ToString from alloc 🤔

19 changes: 11 additions & 8 deletions abi/sol-type-parser/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
[package]
name = "sol-type-parser"
version = "0.1.0"
edition = "2021"
description = "Solidity type parsing & generation for the ethers-abi-enc"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/ethers-rs/core"
readme = "README.md"
keywords = ["ethereum", "abi", "encoding", "EVM", "solidity"]
categories = ["encoding", "serialization", "cryptocurrency", "ethereum"]
authors = []
categories = ["encoding", "cryptography::cryptocurrencies"]

edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[lib]
proc_macro = true

[dependencies]
proc-macro2 = "1.0.52"
quote = "1.0.26"
syn = "2.0.3"
proc-macro2.workspace = true
quote.workspace = true
syn.workspace = true
10 changes: 6 additions & 4 deletions abi/src/eip712.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
use crate::{
no_std_prelude::{Cow, String, Vec},
sol_type,
util::keccak256,
SolType,
};
use ethers_primitives::{B160, B256, U256};

use crate::{sol_type, util::keccak256, SolType};

use crate::no_std_prelude::{Cow, String, Vec};

/// Eip712 Domain attributes used in determining the domain separator;
/// Unused fields are left out of the struct type.
///
Expand Down
2 changes: 1 addition & 1 deletion abi/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ mod serde_helper {
use serde::{Deserialize, Deserializer};

/// Helper type to parse numeric strings, `u64` and `U256`
#[derive(serde::Deserialize, Debug, Clone)]
#[derive(Deserialize, Debug, Clone)]
#[serde(untagged)]
pub(crate) enum StringifiedNumeric {
String(String),
Expand Down
26 changes: 15 additions & 11 deletions dyn-abi/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
[package]
name = "ethers-dyn-abi"
version = "0.1.0"
edition = "2021"
description = "Ethereum ABI encoding and decoding, with runtime typing"
license = "Apache-2.0 OR MIT"
repository = "https://github.com/ethers-rs/core"
readme = "README.md"
keywords = ["ethereum", "abi", "encoding", "EVM", "solidity"]
categories = ["encoding", "serialization", "cryptocurrency", "ethereum"]
authors = []
categories = ["encoding", "cryptography::cryptocurrencies"]

edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
ethers-abi-enc = { version = "0.1.0", path = "../abi", features = ["eip712-serde"] }
ethers-primitives = { version = "0.1.0", path = "../primitives" }
hex = "0.4.3"
serde = "1.0.160"
serde_json = "1.0.96"
ethers-abi-enc = { workspace = true, features = ["eip712-serde"] }
ethers-primitives.workspace = true

hex.workspace = true
serde.workspace = true
serde_json.workspace = true

[features]
default = ["std"]
std = ["ethers-abi-enc/std", "ethers-primitives/std"]
std = ["ethers-abi-enc/std", "ethers-primitives/std", "hex/std", "serde/std", "serde_json/std"]
53 changes: 25 additions & 28 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,53 +1,50 @@
[package]
name = "ethers-primitives"
version = "0.1.0"
edition = "2021"
description = "Fundamental ethereum types shared by revm, reth and ethers"
license = "MIT OR Apache-2.0"
repository = "https://github.com/ethers-rs/core"
readme = "README.md"
keywords = ["ethereum", "ethers", "revm", "reth"]
categories = ["ethereum", "cryptocurrency", "blockchain", "types"]
authors = []
categories = ["cryptography::cryptocurrencies"]

edition.workspace = true
rust-version.workspace = true
authors.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true

[dependencies]
# eth
ruint = { path = "../uint", version = "1.7", features = ["rlp", "serde"] }
ruint = { workspace = true, features = ["rlp", "serde"] }

# bits B256 B160 crate
fixed-hash = { version = "0.8", default-features = false, features = [
"rustc-hex",
] }
fixed-hash = { version = "0.8", default-features = false, features = ["rustc-hex"] }

# utility
derive_more = "0.99"

# optional
serde = { version = "1.0", features = ["derive"], optional = true }
thiserror = { version = "1.0.40", optional = true }
serde = { workspace = true, features = ["derive"], optional = true }
thiserror = { workspace = true, optional = true }

# rlp support
ethers-rlp = { version = "0.1.0", path = "../rlp", optional = true }
bytes = { version = "1", default-features = false, optional = true }
ethers-rlp = { workspace = true, optional = true }
bytes = { workspace = true, optional = true }

# prop tests
arbitrary = { version = "1.2", features = ["derive"], optional = true }
proptest = { version = "1.1", optional = true }
proptest-derive = { version = "0.3", optional = true }

[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies]
arbitrary = { version = "1.2", features = ["derive"] }
proptest = { version = "1.1" }
proptest-derive = "0.3"
ruint = { path = "../uint", version = "1.7.0", features = [
"primitive-types",
"proptest",
"arbitrary",
] }
arbitrary = { workspace = true, features = ["derive"], optional = true }
proptest = { workspace = true, optional = true }
proptest-derive = { workspace = true, optional = true }

[features]
default = ["std", "rlp", "serde"]
std = ["dep:thiserror"]
std = ["serde/std", "ethers-rlp?/std", "bytes?/std", "proptest?/std", "dep:thiserror"]
rlp = ["dep:ethers-rlp", "dep:bytes"]
serde = ["dep:serde", "ruint/serde"]
arbitrary = ["ruint/arbitrary", "ruint/proptest", "dep:arbitrary", "dep:proptest", "dep:proptest-derive"]
arbitrary = [
"ruint/arbitrary",
"ruint/proptest",
"dep:arbitrary",
"dep:proptest",
"dep:proptest-derive",
]
Loading