git.delta.rocks / unique-network / refs/commits / 773312d15af5

difftreelog

build do not build stubgen by default

Yaroslav Bolyukin2022-11-02parent: #912e503.patch.diff
in: master

11 files changed

modified.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
 
modifiedcrates/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 = []
modifiedcrates/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;
modifiedcrates/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;
modifiedcrates/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() {
modifiedpallets/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"]
modifiedpallets/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"]
modifiedpallets/fungible/Cargo.tomldiffbeforeafterboth
--- a/pallets/fungible/Cargo.toml
+++ b/pallets/fungible/Cargo.toml
@@ -46,3 +46,4 @@
 ]
 runtime-benchmarks = ['frame-benchmarking', 'pallet-common/runtime-benchmarks']
 try-runtime = ["frame-support/try-runtime"]
+stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
modifiedpallets/nonfungible/Cargo.tomldiffbeforeafterboth
52 'up-data-structs/runtime-benchmarks',52 'up-data-structs/runtime-benchmarks',
53]53]
54try-runtime = ["frame-support/try-runtime"]54try-runtime = ["frame-support/try-runtime"]
55stubgen = ["evm-coder/stubgen", "pallet-common/stubgen"]
5556
modifiedpallets/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"]
modifiedruntime/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 = []