difftreelog
build do not build stubgen by default
in: master
11 files changed
.maintain/scripts/generate_sol.shdiffbeforeafterboth--- a/.maintain/scripts/generate_sol.sh
+++ b/.maintain/scripts/generate_sol.sh
@@ -4,7 +4,7 @@
PRETTIER_CONFIG="$(pwd)""/.prettierrc"
tmp=$(mktemp)
-cargo test --package $PACKAGE -- $NAME --exact --nocapture --ignored | tee $tmp
+cargo test --package=$PACKAGE --features=stubgen -- $NAME --exact --nocapture --ignored | tee $tmp
raw=$(mktemp --suffix .sol)
sed -n '/=== SNIP START ===/, /=== SNIP END ===/{ /=== SNIP START ===/! { /=== SNIP END ===/! p } }' $tmp > $raw
crates/evm-coder/Cargo.tomldiffbeforeafterboth--- a/crates/evm-coder/Cargo.toml
+++ b/crates/evm-coder/Cargo.toml
@@ -37,3 +37,5 @@
"evm-core/std",
"frame-support/std",
]
+# Stub/interface generation
+stubgen = []
crates/evm-coder/procedural/src/solidity_interface.rsdiffbeforeafterboth--- a/crates/evm-coder/procedural/src/solidity_interface.rs
+++ b/crates/evm-coder/procedural/src/solidity_interface.rs
@@ -951,6 +951,7 @@
u32::to_be_bytes(interface_id)
}
/// Generate solidity definitions for methods described in this interface
+ #[cfg(feature = "stubgen")]
pub fn generate_solidity_interface(tc: &evm_coder::solidity::TypeCollector, is_impl: bool) {
use evm_coder::solidity::*;
use core::fmt::Write;
crates/evm-coder/procedural/src/to_log.rsdiffbeforeafterboth--- a/crates/evm-coder/procedural/src/to_log.rs
+++ b/crates/evm-coder/procedural/src/to_log.rs
@@ -195,6 +195,7 @@
#consts
)*
+ #[cfg(feature = "stubgen")]
pub fn generate_solidity_interface(tc: &evm_coder::solidity::TypeCollector, is_impl: bool) {
use evm_coder::solidity::*;
use core::fmt::Write;
crates/evm-coder/src/lib.rsdiffbeforeafterboth--- a/crates/evm-coder/src/lib.rs
+++ b/crates/evm-coder/src/lib.rs
@@ -108,6 +108,7 @@
#[doc(hidden)]
pub mod events;
#[doc(hidden)]
+#[cfg(feature = "stubgen")]
pub mod solidity;
/// Solidity type definitions (aliases from solidity name to rust type)
@@ -354,6 +355,7 @@
#[macro_export]
macro_rules! generate_stubgen {
($name:ident, $decl:ty, $is_impl:literal) => {
+ #[cfg(feature = "stubgen")]
#[test]
#[ignore]
fn $name() {
pallets/common/Cargo.tomldiffbeforeafterboth--- a/pallets/common/Cargo.toml
+++ b/pallets/common/Cargo.toml
@@ -45,3 +45,4 @@
"up-data-structs/runtime-benchmarks",
]
try-runtime = ["frame-support/try-runtime"]
+stubgen = ["evm-coder/stubgen"]
pallets/evm-contract-helpers/Cargo.tomldiffbeforeafterboth--- a/pallets/evm-contract-helpers/Cargo.toml
+++ b/pallets/evm-contract-helpers/Cargo.toml
@@ -52,3 +52,4 @@
"up-sponsorship/std",
]
try-runtime = ["frame-support/try-runtime"]
+stubgen = ["evm-coder/stubgen"]
pallets/fungible/Cargo.tomldiffbeforeafterboth1[package]2name = "pallet-fungible"3version = "0.1.6"4license = "GPLv3"5edition = "2021"67[dependencies.codec]8default-features = false9features = ['derive']10package = 'parity-scale-codec'11version = '3.1.2'1213[dependencies]14frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }15frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }19pallet-common = { default-features = false, path = '../common' }20pallet-structure = { default-features = false, path = '../structure' }21up-data-structs = { default-features = false, path = '../../primitives/data-structs' }22evm-coder = { default-features = false, path = '../../crates/evm-coder' }23pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }24ethereum = { version = "0.12.0", default-features = false }25frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }26pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }27scale-info = { version = "2.0.1", default-features = false, features = [28 "derive",29] }3031[features]32default = ["std"]33std = [34 "frame-support/std",35 "frame-system/std",36 "sp-runtime/std",37 "sp-std/std",38 "up-data-structs/std",39 "pallet-common/std",40 "pallet-structure/std",41 "evm-coder/std",42 "ethereum/std",43 "pallet-evm-coder-substrate/std",44 'frame-benchmarking/std',45 "pallet-evm/std",46]47runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']48try-runtime = ["frame-support/try-runtime"]1[package]2name = "pallet-fungible"3version = "0.1.6"4license = "GPLv3"5edition = "2021"67[dependencies.codec]8default-features = false9features = ['derive']10package = 'parity-scale-codec'11version = '3.1.2'1213[dependencies]14frame-support = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }15frame-system = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }16sp-runtime = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }17sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }18sp-core = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }19pallet-common = { default-features = false, path = '../common' }20pallet-structure = { default-features = false, path = '../structure' }21up-data-structs = { default-features = false, path = '../../primitives/data-structs' }22evm-coder = { default-features = false, path = '../../crates/evm-coder' }23pallet-evm-coder-substrate = { default-features = false, path = '../evm-coder-substrate' }24ethereum = { version = "0.12.0", default-features = false }25frame-benchmarking = { default-features = false, optional = true, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.30" }26pallet-evm = { default-features = false, git = "https://github.com/uniquenetwork/frontier", branch = "unique-polkadot-v0.9.30" }27scale-info = { version = "2.0.1", default-features = false, features = [28 "derive",29] }3031[features]32default = ["std"]33std = [34 "frame-support/std",35 "frame-system/std",36 "sp-runtime/std",37 "sp-std/std",38 "up-data-structs/std",39 "pallet-common/std",40 "pallet-structure/std",41 "evm-coder/std",42 "ethereum/std",43 "pallet-evm-coder-substrate/std",44 'frame-benchmarking/std',45 "pallet-evm/std",46]47runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']48try-runtime = ["frame-support/try-runtime"]49stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]pallets/nonfungible/Cargo.tomldiffbeforeafterboth--- a/pallets/nonfungible/Cargo.toml
+++ b/pallets/nonfungible/Cargo.toml
@@ -52,3 +52,4 @@
'up-data-structs/runtime-benchmarks',
]
try-runtime = ["frame-support/try-runtime"]
+stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
pallets/refungible/Cargo.tomldiffbeforeafterboth--- a/pallets/refungible/Cargo.toml
+++ b/pallets/refungible/Cargo.toml
@@ -54,3 +54,4 @@
'up-data-structs/runtime-benchmarks',
]
try-runtime = ["frame-support/try-runtime"]
+stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
runtime/unique/Cargo.tomldiffbeforeafterboth--- a/runtime/unique/Cargo.toml
+++ b/runtime/unique/Cargo.toml
@@ -169,6 +169,7 @@
]
limit-testing = ['pallet-unique/limit-testing', 'up-data-structs/limit-testing']
unique-runtime = []
+stubgen = ["evm-coder/stubgen"]
refungible = []
scheduler = []