diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f9dc0c053..4c531c4ab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -71,7 +71,9 @@ jobs: save-if: ${{ github.ref == 'refs/heads/main' }} cache-all-crates: "true" # Yes, it's a string - name: Install Cargo Plugins - run: cargo install cargo-make cargo-near --locked + run: | + cargo install cargo-make --locked + cargo install cargo-near --git https://github.com/near/cargo-near --rev daa04940cbf834ef3ccf55b595e140475e41a314 - name: Build run: cargo make build - name: Upload Artifacts @@ -104,7 +106,9 @@ jobs: save-if: ${{ github.ref == 'refs/heads/main' }} cache-all-crates: "true" # Yes, it's a string - name: Install Cargo Plugins - run: cargo install cargo-make cargo-near --locked + run: | + cargo install cargo-make --locked + cargo install cargo-near --git https://github.com/near/cargo-near --rev daa04940cbf834ef3ccf55b595e140475e41a314 - name: Build Reproducible WASM and calculate checksum run: cargo make build-reproducible - name: Upload Reproducible Artifacts diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6fdb93289..3bad7dcab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: run: cargo install --debug cargo-make@0.37.24 --locked - name: Install cargo-near - run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.17.0/cargo-near-installer.sh | sh + run: cargo install cargo-near --git https://github.com/near/cargo-near --rev daa04940cbf834ef3ccf55b595e140475e41a314 - name: Build Reproducible WASM run: cargo make build-defuse-reproducible diff --git a/Makefile.toml b/Makefile.toml index a2dc45bab..06f2822a3 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -39,8 +39,8 @@ args = [ "--locked", "--manifest-path", "./defuse/Cargo.toml", - "--features", - "abi,contract", + "--features=contract", + "--abi-features=abi,contract", "--out-dir", "${TARGET_DIR}", "--no-embed-abi", @@ -56,8 +56,8 @@ args = [ "--locked", "--manifest-path", "./escrow-swap/Cargo.toml", - "--features", - "abi,contract", + "--features=contract", + "--abi-features=abi,contract", "--out-dir", "${TARGET_DIR}", "--no-embed-abi", @@ -73,8 +73,7 @@ args = [ "--locked", "--manifest-path", "./poa-factory/Cargo.toml", - "--features", - "contract", + "--features=contract", "--out-dir", "${TARGET_DIR}", "--no-embed-abi", @@ -90,8 +89,7 @@ args = [ "--locked", "--manifest-path", "./poa-token/Cargo.toml", - "--features", - "contract", + "--features=contract", "--out-dir", "${TARGET_DIR}", "--no-embed-abi", @@ -107,8 +105,7 @@ args = [ "--locked", "--manifest-path", "./poa-token/Cargo.toml", - "--features", - "contract,no-registration", + "--features=contract,no-registration", "--out-dir", "${POA_TOKEN_WITH_NO_REGISTRATION_DIR}", "--no-embed-abi", @@ -251,8 +248,7 @@ args = [ "--locked", "--manifest-path", "./tests/contracts/multi-token-receiver-stub/Cargo.toml", - "--features", - "abi", + "--abi-features=abi", "--out-dir", "${MT_RECEIVER_STUB_DIR}", "--no-embed-abi", diff --git a/core/src/amounts.rs b/core/src/amounts.rs index 0061a6595..1fdddf3da 100644 --- a/core/src/amounts.rs +++ b/core/src/amounts.rs @@ -227,7 +227,7 @@ where } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{r#gen::SchemaGenerator, schema::Schema}; use serde_with::schemars_0_8::JsonSchemaAs; diff --git a/core/src/nonce/salted.rs b/core/src/nonce/salted.rs index 4c7abd1ed..65205378e 100644 --- a/core/src/nonce/salted.rs +++ b/core/src/nonce/salted.rs @@ -57,7 +57,7 @@ impl FromStr for Salt { } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{ JsonSchema, diff --git a/core/src/payload/mod.rs b/core/src/payload/mod.rs index 880e3cbb3..a70d819a3 100644 --- a/core/src/payload/mod.rs +++ b/core/src/payload/mod.rs @@ -51,7 +51,7 @@ impl ExtractDefusePayload for DefusePayload { } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] mod examples { use super::*; diff --git a/crypto/src/public_key.rs b/crypto/src/public_key.rs index f8da94311..92bb19ee6 100644 --- a/crypto/src/public_key.rs +++ b/crypto/src/public_key.rs @@ -127,7 +127,7 @@ impl FromStr for PublicKey { } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::{ schemars::{ diff --git a/crypto/src/serde/curve.rs b/crypto/src/serde/curve.rs index 51ec54302..9cf364860 100644 --- a/crypto/src/serde/curve.rs +++ b/crypto/src/serde/curve.rs @@ -26,7 +26,7 @@ impl<'de, C: TypedCurve, const N: usize> DeserializeAs<'de, [u8; N]> for AsCurve } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{ JsonSchema, diff --git a/crypto/src/signature.rs b/crypto/src/signature.rs index 365cf3e41..5a6276775 100644 --- a/crypto/src/signature.rs +++ b/crypto/src/signature.rs @@ -83,7 +83,7 @@ impl FromStr for Signature { } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::{ schemars::{ diff --git a/defuse/Cargo.toml b/defuse/Cargo.toml index baad2c447..600e0eff3 100644 --- a/defuse/Cargo.toml +++ b/defuse/Cargo.toml @@ -51,7 +51,8 @@ container_build_command = [ "build", "non-reproducible-wasm", "--locked", - "--features=abi,contract", + "--features=contract", + "--abi-features=abi,contract", "--no-embed-abi", ] diff --git a/defuse/src/contract/mod.rs b/defuse/src/contract/mod.rs index e92b3cde8..21d1c78d4 100644 --- a/defuse/src/contract/mod.rs +++ b/defuse/src/contract/mod.rs @@ -1,4 +1,4 @@ -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] mod abi; mod accounts; mod admin; diff --git a/escrow-swap/src/event.rs b/escrow-swap/src/event.rs index 3c84b7e56..226d0ceae 100644 --- a/escrow-swap/src/event.rs +++ b/escrow-swap/src/event.rs @@ -133,5 +133,5 @@ pub trait EscrowIntentEmit<'a>: Into> { impl<'a, T> EscrowIntentEmit<'a> for T where T: Into> {} // fix JsonSchema macro bug -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] use near_sdk::serde; diff --git a/escrow-swap/src/state.rs b/escrow-swap/src/state.rs index 2f1a8eb4b..4701b2b34 100644 --- a/escrow-swap/src/state.rs +++ b/escrow-swap/src/state.rs @@ -279,5 +279,5 @@ pub struct State { } // fix JsonSchema macro bug -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] use near_sdk::serde; diff --git a/serde-utils/src/base58.rs b/serde-utils/src/base58.rs index b8db21449..4b6f27048 100644 --- a/serde-utils/src/base58.rs +++ b/serde-utils/src/base58.rs @@ -39,7 +39,7 @@ where } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{ JsonSchema, diff --git a/serde-utils/src/base64.rs b/serde-utils/src/base64.rs index ee121ffa7..eb63ce415 100644 --- a/serde-utils/src/base64.rs +++ b/serde-utils/src/base64.rs @@ -79,7 +79,7 @@ impl AsBase64 { } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{ JsonSchema, diff --git a/serde-utils/src/tlb.rs b/serde-utils/src/tlb.rs index ccbb4f53d..bc8e25880 100644 --- a/serde-utils/src/tlb.rs +++ b/serde-utils/src/tlb.rs @@ -60,7 +60,7 @@ where } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{SchemaGenerator, schema::Schema}; use serde_with::schemars_0_8::JsonSchemaAs; diff --git a/token-id/src/lib.rs b/token-id/src/lib.rs index 7995a3ad6..2475e2a39 100644 --- a/token-id/src/lib.rs +++ b/token-id/src/lib.rs @@ -114,7 +114,7 @@ impl FromStr for TokenId { } } -#[cfg(all(feature = "abi", not(target_arch = "wasm32")))] +#[cfg(feature = "abi")] const _: () = { use near_sdk::schemars::{ JsonSchema,