From f7ea831d7c27c58224d4f44acdf116c5f3fd6642 Mon Sep 17 00:00:00 2001 From: franfran Date: Thu, 29 Dec 2022 14:44:57 +0100 Subject: [PATCH] nitz rebase --- Cargo.lock | 170 +++++++++++++++++++++++++++---- ethers-solc/src/artifacts/mod.rs | 8 +- 2 files changed, 153 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index bce5942b..f6f73319 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1420,6 +1420,7 @@ dependencies = [ "hex", "hex-literal", "k256", + "num_enum", "once_cell", "open-fastrlp", "proc-macro2", @@ -1626,6 +1627,111 @@ dependencies = [ "wee_alloc", ] +[[package]] +name = "examples-anvil" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "tokio", +] + +[[package]] +name = "examples-big-numbers" +version = "1.0.2" +dependencies = [ + "ethers", +] + +[[package]] +name = "examples-contracts" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "examples-events" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "examples-middleware" +version = "1.0.2" +dependencies = [ + "async-trait", + "ethers", + "eyre", + "serde_json", + "thiserror", + "tokio", +] + +[[package]] +name = "examples-providers" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "examples-queries" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "examples-subscriptions" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "examples-transactions" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + +[[package]] +name = "examples-wallets" +version = "1.0.2" +dependencies = [ + "ethers", + "eyre", + "serde", + "serde_json", + "tokio", +] + [[package]] name = "eyre" version = "0.6.8" @@ -2569,14 +2675,35 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.14.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6058e64324c71e02bc2b150e4f3bc8286db6c83092132ffa3f6b1eab0f9def5" +checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" dependencies = [ - "hermit-abi 0.1.19", + "hermit-abi 0.2.6", "libc", ] +[[package]] +name = "num_enum" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" +dependencies = [ + "num_enum_derive", +] + +[[package]] +name = "num_enum_derive" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" +dependencies = [ + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "num_threads" version = "0.1.3" @@ -2594,9 +2721,9 @@ checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" [[package]] name = "once_cell" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860" +checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" [[package]] name = "oorandom" @@ -3087,9 +3214,9 @@ checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" [[package]] name = "proc-macro2" -version = "1.0.47" +version = "1.0.49" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ea3d908b0e36316caf9e9e2c4625cdde190a7e6f440d794667ed17a1855e725" +checksum = "57a8eca9f9c4ffde41714334dee777596264c7825420f521abc92b5b5deb63a5" dependencies = [ "unicode-ident", ] @@ -3652,9 +3779,9 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.14" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e25dfac463d778e353db5be2449d1cce89bd6fd23c9f1ea21310ce6e5a1b29c4" +checksum = "58bc9567378fc7690d6b2addae4e60ac2eeea07becb2c64b9f218b53865cba2a" dependencies = [ "serde", ] @@ -3729,9 +3856,9 @@ dependencies = [ [[package]] name = "serde_path_to_error" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "184c643044780f7ceb59104cef98a5a6f12cb2288a7bc701ab93a362b49fd47d" +checksum = "26b04f22b563c91331a10074bda3dd5492e3cc39d56bd557e91c0af42b6c7341" dependencies = [ "serde", ] @@ -3750,9 +3877,9 @@ dependencies = [ [[package]] name = "serial_test" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92761393ee4dc3ff8f4af487bd58f4307c9329bbedea02cac0089ad9c411e153" +checksum = "1c789ec87f4687d022a2405cf46e0cd6284889f1839de292cadeb6c6019506f2" dependencies = [ "dashmap", "futures", @@ -3764,11 +3891,10 @@ dependencies = [ [[package]] name = "serial_test_derive" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b6f5d1c3087fb119617cff2966fe3808a80e5eb59a8c1601d5994d66f4346a5" +checksum = "b64f9e531ce97c88b4778aad0ceee079216071cffec6ac9b904277f8f92e7fe3" dependencies = [ - "proc-macro-error", "proc-macro2", "quote", "syn", @@ -4044,9 +4170,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.105" +version = "1.0.107" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b9b43d45702de4c839cb9b51d9f529c5dd26a4aff255b42b1ebc03e88ee908" +checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" dependencies = [ "proc-macro2", "quote", @@ -4132,18 +4258,18 @@ checksum = "0066c8d12af8b5acd21e00547c3797fde4e8677254a7ee429176ccebbe93dd80" [[package]] name = "thiserror" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10deb33631e3c9018b9baf9dcbbc4f737320d2b576bac10f6aefa048fa407e3e" +checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "982d17546b47146b28f7c22e3d08465f6b8903d0ea13c1660d9d84a6e7adcdbb" +checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" dependencies = [ "proc-macro2", "quote", diff --git a/ethers-solc/src/artifacts/mod.rs b/ethers-solc/src/artifacts/mod.rs index 7de6b01b..5a103a9a 100644 --- a/ethers-solc/src/artifacts/mod.rs +++ b/ethers-solc/src/artifacts/mod.rs @@ -22,7 +22,9 @@ pub mod contract; pub mod output_selection; pub mod serde_helpers; use crate::{ - artifacts::output_selection::{ContractOutputSelection, OutputSelection}, + artifacts::{ + output_selection::{ContractOutputSelection, OutputSelection}, + }, filter::FilteredSources, }; pub use bytecode::*; @@ -1835,7 +1837,7 @@ pub struct SecondarySourceLocation { pub struct SourceFile { pub id: u32, #[serde(default, with = "serde_helpers::empty_json_object_opt")] - pub ast: Option, + pub ast: Option, } // === impl SourceFile === @@ -1849,7 +1851,7 @@ impl SourceFile { return ast .nodes .iter() - .any(|node| matches!(node, SourceUnitPart::ContractDefinition(_))) + .any(|node| matches!(node.node_type, NodeType::ContractDefinition)) // abstract contract, interfaces: ContractDefinition }