From bdc183ac145c2f257d2dc89cc8d9d826ea43bbb3 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 17:01:04 +0800 Subject: [PATCH 01/11] chore(ci): add ci --- .editorconfig | 6 +++++ .github/workflows/build.yml | 44 +++++++++++++++++++++++++++++++++++++ Makefile | 6 +++++ 3 files changed, 56 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.editorconfig b/.editorconfig index f0b0ff4..09db437 100644 --- a/.editorconfig +++ b/.editorconfig @@ -11,3 +11,9 @@ insert_final_newline=true [Makefile] indent_style=tab + +[*.{yml, yaml}] +indent_style = space +indent_size = 2 +tab_width = 8 +end_of_line = lf diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..17edadf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,44 @@ +name: Check + +on: + push: + branches: ["master"] + pull_request: + branches: ["master"] + +env: + CARGO_TERM_COLOR: always + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install toolchain + uses: dtolnay/rust-toolchain@stable + with: + components: rustfmt, clippy + + - uses: Swatinem/rust-cache@v2 + + - name: Install toolchain targeting RV32E + run: | + curl -sL https://github.com/paritytech/rustc-rv32e-toolchain/releases/download/v1.1.0/rust-rve-nightly-2024-01-05-x86_64-unknown-linux-gnu.tar.zst -o rv32e.tar.zst + tar --zstd -xf rv32e.tar.zst + mv rve-nightly ~/.rustup/toolchains/ + + - name: Check format + run: cargo fmt --all -- --check + + - name: Custom cargo check + run: make check + + - name: Custom cargo clippy + run: make clippy diff --git a/Makefile b/Makefile index 11702ac..46590da 100644 --- a/Makefile +++ b/Makefile @@ -18,6 +18,12 @@ check: SKIP_WASM_BUILD= cargo check cd poc/guest; cargo check +clippy: + cargo clippy --no-default-features + --target=wasm32-unknown-unknown -p poc-executor + SKIP_WASM_BUILD= cargo clippy + cd poc/guest; cargo clippy + chainspec: cargo build -p poc-runtime --release cp target/release/wbuild/poc-runtime/poc_runtime.compact.compressed.wasm output From 509ab3d0c3b37c5c04d667bc8a60445861ac6247 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 17:15:04 +0800 Subject: [PATCH 02/11] chore(ci): fix --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17edadf..db670a9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,16 +24,17 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@stable with: + targets: wasm32-uknown-unknown components: rustfmt, clippy - - uses: Swatinem/rust-cache@v2 - - name: Install toolchain targeting RV32E run: | curl -sL https://github.com/paritytech/rustc-rv32e-toolchain/releases/download/v1.1.0/rust-rve-nightly-2024-01-05-x86_64-unknown-linux-gnu.tar.zst -o rv32e.tar.zst tar --zstd -xf rv32e.tar.zst mv rve-nightly ~/.rustup/toolchains/ + - uses: Swatinem/rust-cache@v2 + - name: Check format run: cargo fmt --all -- --check From c0df6a6509b60e164375c51fd4314592df114927 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 17:44:34 +0800 Subject: [PATCH 03/11] fix actions --- .github/workflows/build.yml | 2 +- Makefile | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index db670a9..a79ef80 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: submodules: recursive - name: Install toolchain - uses: dtolnay/rust-toolchain@stable + uses: dtolnay/rust-toolchain@nightly with: targets: wasm32-uknown-unknown components: rustfmt, clippy diff --git a/Makefile b/Makefile index 46590da..c670975 100644 --- a/Makefile +++ b/Makefile @@ -19,8 +19,7 @@ check: cd poc/guest; cargo check clippy: - cargo clippy --no-default-features - --target=wasm32-unknown-unknown -p poc-executor + cargo clippy --no-default-features --target=wasm32-unknown-unknown -p poc-executor SKIP_WASM_BUILD= cargo clippy cd poc/guest; cargo clippy From ea05bc0f12224d788cd70124a4c4237c569a3390 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 18:02:57 +0800 Subject: [PATCH 04/11] fix typos --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a79ef80..3230971 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,7 +24,7 @@ jobs: - name: Install toolchain uses: dtolnay/rust-toolchain@nightly with: - targets: wasm32-uknown-unknown + targets: wasm32-unknown-unknown components: rustfmt, clippy - name: Install toolchain targeting RV32E From db34771e35e7663d94e081dc44018da6a708ed8d Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 18:05:50 +0800 Subject: [PATCH 05/11] chore(fmt): fmt --- poc/runtime/src/lib.rs | 335 +++++++++++++++++++++-------------------- 1 file changed, 168 insertions(+), 167 deletions(-) diff --git a/poc/runtime/src/lib.rs b/poc/runtime/src/lib.rs index 506745e..7f44a8f 100644 --- a/poc/runtime/src/lib.rs +++ b/poc/runtime/src/lib.rs @@ -7,75 +7,77 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); mod xcq; use frame::{ - deps::frame_support::{ - genesis_builder_helper::{build_config, create_default_config}, - weights::{FixedFee, NoFee}, - }, - prelude::*, - runtime::{ - apis::{ - self, impl_runtime_apis, ApplyExtrinsicResult, CheckInherentsResult, - ExtrinsicInclusionMode, OpaqueMetadata, - }, - prelude::*, - }, + deps::frame_support::{ + genesis_builder_helper::{build_config, create_default_config}, + weights::{FixedFee, NoFee}, + }, + prelude::*, + runtime::{ + apis::{ + self, impl_runtime_apis, ApplyExtrinsicResult, CheckInherentsResult, ExtrinsicInclusionMode, OpaqueMetadata, + }, + prelude::*, + }, }; #[runtime_version] pub const VERSION: RuntimeVersion = RuntimeVersion { - spec_name: create_runtime_str!("xcq-poc"), - impl_name: create_runtime_str!("xcq-poc"), - authoring_version: 1, - spec_version: 0, - impl_version: 1, - apis: RUNTIME_API_VERSIONS, - transaction_version: 1, - state_version: 1, + spec_name: create_runtime_str!("xcq-poc"), + impl_name: create_runtime_str!("xcq-poc"), + authoring_version: 1, + spec_version: 0, + impl_version: 1, + apis: RUNTIME_API_VERSIONS, + transaction_version: 1, + state_version: 1, }; /// The version information used to identify this runtime when compiled natively. #[cfg(feature = "std")] pub fn native_version() -> NativeVersion { - NativeVersion { runtime_version: VERSION, can_author_with: Default::default() } + NativeVersion { + runtime_version: VERSION, + can_author_with: Default::default(), + } } type SignedExtra = ( - frame_system::CheckNonZeroSender, - frame_system::CheckSpecVersion, - frame_system::CheckTxVersion, - frame_system::CheckGenesis, - frame_system::CheckEra, - frame_system::CheckNonce, - frame_system::CheckWeight, - pallet_transaction_payment::ChargeTransactionPayment, + frame_system::CheckNonZeroSender, + frame_system::CheckSpecVersion, + frame_system::CheckTxVersion, + frame_system::CheckGenesis, + frame_system::CheckEra, + frame_system::CheckNonce, + frame_system::CheckWeight, + pallet_transaction_payment::ChargeTransactionPayment, ); construct_runtime!( - pub enum Runtime { - System: frame_system, - Timestamp: pallet_timestamp, - - Balances: pallet_balances, - Sudo: pallet_sudo, - TransactionPayment: pallet_transaction_payment, - } + pub enum Runtime { + System: frame_system, + Timestamp: pallet_timestamp, + + Balances: pallet_balances, + Sudo: pallet_sudo, + TransactionPayment: pallet_transaction_payment, + } ); parameter_types! { - pub const Version: RuntimeVersion = VERSION; + pub const Version: RuntimeVersion = VERSION; } #[derive_impl(frame_system::config_preludes::SolochainDefaultConfig as frame_system::DefaultConfig)] impl frame_system::Config for Runtime { - type Block = Block; - type Version = Version; - type BlockHashCount = ConstU32<1024>; - type AccountData = pallet_balances::AccountData<::Balance>; + type Block = Block; + type Version = Version; + type BlockHashCount = ConstU32<1024>; + type AccountData = pallet_balances::AccountData<::Balance>; } #[derive_impl(pallet_balances::config_preludes::TestDefaultConfig as pallet_balances::DefaultConfig)] impl pallet_balances::Config for Runtime { - type AccountStore = System; + type AccountStore = System; } #[derive_impl(pallet_sudo::config_preludes::TestDefaultConfig as pallet_sudo::DefaultConfig)] @@ -86,129 +88,128 @@ impl pallet_timestamp::Config for Runtime {} #[derive_impl(pallet_transaction_payment::config_preludes::TestDefaultConfig as pallet_transaction_payment::DefaultConfig)] impl pallet_transaction_payment::Config for Runtime { - type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; - type WeightToFee = NoFee<::Balance>; - type LengthToFee = FixedFee<1, ::Balance>; + type OnChargeTransaction = pallet_transaction_payment::CurrencyAdapter; + type WeightToFee = NoFee<::Balance>; + type LengthToFee = FixedFee<1, ::Balance>; } type Block = frame::runtime::types_common::BlockOf; type Header = HeaderFor; -type RuntimeExecutive = - Executive, Runtime, AllPalletsWithSystem>; +type RuntimeExecutive = Executive, Runtime, AllPalletsWithSystem>; use pallet_transaction_payment::{FeeDetails, RuntimeDispatchInfo}; impl_runtime_apis! { - impl apis::Core for Runtime { - fn version() -> RuntimeVersion { - VERSION - } - - fn execute_block(block: Block) { - RuntimeExecutive::execute_block(block) - } - - fn initialize_block(header: &Header) -> ExtrinsicInclusionMode { - RuntimeExecutive::initialize_block(header) - } - } - impl apis::Metadata for Runtime { - fn metadata() -> OpaqueMetadata { - OpaqueMetadata::new(Runtime::metadata().into()) - } - - fn metadata_at_version(version: u32) -> Option { - Runtime::metadata_at_version(version) - } - - fn metadata_versions() -> Vec { - Runtime::metadata_versions() - } - } - - impl apis::BlockBuilder for Runtime { - fn apply_extrinsic(extrinsic: ExtrinsicFor) -> ApplyExtrinsicResult { - RuntimeExecutive::apply_extrinsic(extrinsic) - } - - fn finalize_block() -> HeaderFor { - RuntimeExecutive::finalize_block() - } - - fn inherent_extrinsics(data: InherentData) -> Vec> { - data.create_extrinsics() - } - - fn check_inherents( - block: Block, - data: InherentData, - ) -> CheckInherentsResult { - data.check_extrinsics(&block) - } - } - - impl apis::TaggedTransactionQueue for Runtime { - fn validate_transaction( - source: TransactionSource, - tx: ExtrinsicFor, - block_hash: ::Hash, - ) -> TransactionValidity { - RuntimeExecutive::validate_transaction(source, tx, block_hash) - } - } - - impl apis::OffchainWorkerApi for Runtime { - fn offchain_worker(header: &HeaderFor) { - RuntimeExecutive::offchain_worker(header) - } - } - - impl apis::SessionKeys for Runtime { - fn generate_session_keys(_seed: Option>) -> Vec { - Default::default() - } - - fn decode_session_keys( - _encoded: Vec, - ) -> Option, apis::KeyTypeId)>> { - Default::default() - } - } - - impl apis::AccountNonceApi for Runtime { - fn account_nonce(account: interface::AccountId) -> interface::Nonce { - System::account_nonce(account) - } - } - - impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< - Block, - interface::Balance, - > for Runtime { - fn query_info(uxt: ExtrinsicFor, len: u32) -> RuntimeDispatchInfo { - TransactionPayment::query_info(uxt, len) - } - fn query_fee_details(uxt: ExtrinsicFor, len: u32) -> FeeDetails { - TransactionPayment::query_fee_details(uxt, len) - } - fn query_weight_to_fee(weight: Weight) -> interface::Balance { - TransactionPayment::weight_to_fee(weight) - } - fn query_length_to_fee(length: u32) -> interface::Balance { - TransactionPayment::length_to_fee(length) - } - } - - impl sp_genesis_builder::GenesisBuilder for Runtime { - fn create_default_config() -> Vec { - create_default_config::() - } - - fn build_config(config: Vec) -> sp_genesis_builder::Result { - build_config::(config) - } - } + impl apis::Core for Runtime { + fn version() -> RuntimeVersion { + VERSION + } + + fn execute_block(block: Block) { + RuntimeExecutive::execute_block(block) + } + + fn initialize_block(header: &Header) -> ExtrinsicInclusionMode { + RuntimeExecutive::initialize_block(header) + } + } + impl apis::Metadata for Runtime { + fn metadata() -> OpaqueMetadata { + OpaqueMetadata::new(Runtime::metadata().into()) + } + + fn metadata_at_version(version: u32) -> Option { + Runtime::metadata_at_version(version) + } + + fn metadata_versions() -> Vec { + Runtime::metadata_versions() + } + } + + impl apis::BlockBuilder for Runtime { + fn apply_extrinsic(extrinsic: ExtrinsicFor) -> ApplyExtrinsicResult { + RuntimeExecutive::apply_extrinsic(extrinsic) + } + + fn finalize_block() -> HeaderFor { + RuntimeExecutive::finalize_block() + } + + fn inherent_extrinsics(data: InherentData) -> Vec> { + data.create_extrinsics() + } + + fn check_inherents( + block: Block, + data: InherentData, + ) -> CheckInherentsResult { + data.check_extrinsics(&block) + } + } + + impl apis::TaggedTransactionQueue for Runtime { + fn validate_transaction( + source: TransactionSource, + tx: ExtrinsicFor, + block_hash: ::Hash, + ) -> TransactionValidity { + RuntimeExecutive::validate_transaction(source, tx, block_hash) + } + } + + impl apis::OffchainWorkerApi for Runtime { + fn offchain_worker(header: &HeaderFor) { + RuntimeExecutive::offchain_worker(header) + } + } + + impl apis::SessionKeys for Runtime { + fn generate_session_keys(_seed: Option>) -> Vec { + Default::default() + } + + fn decode_session_keys( + _encoded: Vec, + ) -> Option, apis::KeyTypeId)>> { + Default::default() + } + } + + impl apis::AccountNonceApi for Runtime { + fn account_nonce(account: interface::AccountId) -> interface::Nonce { + System::account_nonce(account) + } + } + + impl pallet_transaction_payment_rpc_runtime_api::TransactionPaymentApi< + Block, + interface::Balance, + > for Runtime { + fn query_info(uxt: ExtrinsicFor, len: u32) -> RuntimeDispatchInfo { + TransactionPayment::query_info(uxt, len) + } + fn query_fee_details(uxt: ExtrinsicFor, len: u32) -> FeeDetails { + TransactionPayment::query_fee_details(uxt, len) + } + fn query_weight_to_fee(weight: Weight) -> interface::Balance { + TransactionPayment::weight_to_fee(weight) + } + fn query_length_to_fee(length: u32) -> interface::Balance { + TransactionPayment::length_to_fee(length) + } + } + + impl sp_genesis_builder::GenesisBuilder for Runtime { + fn create_default_config() -> Vec { + create_default_config::() + } + + fn build_config(config: Vec) -> sp_genesis_builder::Result { + build_config::(config) + } + } impl xcq::XcqApi for Runtime { fn execute_query(query: Vec, input: Vec) -> xcq::XcqResult { @@ -223,14 +224,14 @@ impl_runtime_apis! { // TODO: this should be standardized in some way, see: // https://github.com/paritytech/substrate/issues/10579#issuecomment-1600537558 pub mod interface { - use super::Runtime; - use frame::deps::frame_system; - - pub type Block = super::Block; - pub use frame::runtime::types_common::OpaqueBlock; - pub type AccountId = ::AccountId; - pub type Nonce = ::Nonce; - pub type Hash = ::Hash; - pub type Balance = ::Balance; - pub type MinimumBalance = ::ExistentialDeposit; + use super::Runtime; + use frame::deps::frame_system; + + pub type Block = super::Block; + pub use frame::runtime::types_common::OpaqueBlock; + pub type AccountId = ::AccountId; + pub type Nonce = ::Nonce; + pub type Hash = ::Hash; + pub type Balance = ::Balance; + pub type MinimumBalance = ::ExistentialDeposit; } From 63a88e55f4c7ea57962c4ae9f8290f76b899d2d7 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 18:11:44 +0800 Subject: [PATCH 06/11] chore(ci): add make poc-guest step --- .github/workflows/build.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3230971..b136e37 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,9 @@ jobs: - name: Check format run: cargo fmt --all -- --check + - name: Generate poc-guest.polkavm + run: make poc-guest + - name: Custom cargo check run: make check From d6fc7c8353b19110040e02d444ea14f69404d1a9 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Tue, 14 May 2024 18:19:56 +0800 Subject: [PATCH 07/11] add step for installing polkatool --- .github/workflows/build.yml | 3 +++ Makefile | 1 + 2 files changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b136e37..3c167a2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -38,6 +38,9 @@ jobs: - name: Check format run: cargo fmt --all -- --check + - name: Install polkatool + run: make tools + - name: Generate poc-guest.polkavm run: make poc-guest diff --git a/Makefile b/Makefile index c670975..027b3cc 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,7 @@ clippy: chainspec: cargo build -p poc-runtime --release + mkdir -p output cp target/release/wbuild/poc-runtime/poc_runtime.compact.compressed.wasm output chain-spec-builder -c output/chainspec.json create -n poc-runtime -i poc-runtime -r ./output/poc_runtime.compact.compressed.wasm -s default cat output/chainspec.json | jq '.properties = {}' > output/chainspec.json.tmp From 6b7c95414173f55d41ed54ca08307b80a957a324 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Wed, 15 May 2024 09:40:57 +0800 Subject: [PATCH 08/11] add fmt target --- Makefile | 3 +++ poc/guest/src/main.rs | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 027b3cc..c37e1c1 100644 --- a/Makefile +++ b/Makefile @@ -13,6 +13,9 @@ tools: cargo install --git https://github.com/koute/polkavm --force polkatool cargo install --git https://github.com/paritytech/polkadot-sdk --tag polkadot-v1.9.0 --force staging-chain-spec-builder +fmt: + cargo fmt --all -- --check + check: cargo check --no-default-features --target=wasm32-unknown-unknown -p poc-executor SKIP_WASM_BUILD= cargo check diff --git a/poc/guest/src/main.rs b/poc/guest/src/main.rs index 01eec91..5827d8f 100644 --- a/poc/guest/src/main.rs +++ b/poc/guest/src/main.rs @@ -51,7 +51,7 @@ extern "C" fn main(ptr: u32) -> u64 { let size = core::mem::size_of_val(val); let val_ptr = val.as_ptr(); - (val_ptr as u64) << 32 | size as u64 / core::mem::size_of::() as u64 + (val_ptr as u64) << 32 | (size as u64 / core::mem::size_of::() as u64) } 1 => { let val = unsafe { core::ptr::read_volatile((ptr + 1) as *const u8) }; @@ -63,7 +63,7 @@ extern "C" fn main(ptr: u32) -> u64 { host_call(guest_args, &mut ret); let res = ret.data0 as u32 + 1; let size = core::mem::size_of_val(&res); - (&res as *const u32 as u64) << 32 | size as u64 / core::mem::size_of::() as u64 + (&res as *const u32 as u64) << 32 | (size as u64 / core::mem::size_of::() as u64) } _ => 0, } From 0cffa012e2cc4b07bd2e8093d4e7c11fb077f61c Mon Sep 17 00:00:00 2001 From: indirection42 Date: Wed, 15 May 2024 13:39:32 +0800 Subject: [PATCH 09/11] Bump polkavm version --- .gitmodules | 2 +- poc/executor/src/lib.rs | 4 ++-- vendor/polkavm | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.gitmodules b/.gitmodules index 48e842b..499c8d5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "vendor/polkavm"] path = vendor/polkavm - url = https://github.com/koute/polkavm + url = https://github.com/acalanetwork/polkavm diff --git a/poc/executor/src/lib.rs b/poc/executor/src/lib.rs index d0af2a9..93cb5f6 100644 --- a/poc/executor/src/lib.rs +++ b/poc/executor/src/lib.rs @@ -53,8 +53,8 @@ impl XcqExecutor { } pub fn execute(&mut self, raw_blob: &[u8], input: &[u8]) -> Result, XcqExecutorError> { - let blob = ProgramBlob::parse(raw_blob)?; - let module = Module::from_blob(&self.engine, &Default::default(), &blob)?; + let blob = ProgramBlob::parse(raw_blob.into())?; + let module = Module::from_blob(&self.engine, &Default::default(), blob)?; let instance_pre = self.linker.instantiate_pre(&module)?; let instance = instance_pre.instantiate()?; diff --git a/vendor/polkavm b/vendor/polkavm index a871cf7..847eac7 160000 --- a/vendor/polkavm +++ b/vendor/polkavm @@ -1 +1 @@ -Subproject commit a871cf7c5b7bcc70fcc05ccf7431af27da78144b +Subproject commit 847eac7dd58606d48c4e24274eb336e848fe7fe1 From 8e39d14ff5c4538e9e035fddb128c7cf63b8064e Mon Sep 17 00:00:00 2001 From: indirection42 Date: Wed, 15 May 2024 13:39:44 +0800 Subject: [PATCH 10/11] Clippy fix --- Makefile | 4 ++-- poc/runtime/src/xcq.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c37e1c1..8dfd360 100644 --- a/Makefile +++ b/Makefile @@ -18,12 +18,12 @@ fmt: check: cargo check --no-default-features --target=wasm32-unknown-unknown -p poc-executor - SKIP_WASM_BUILD= cargo check + SKIP_WASM_BUILD= cargo check -- -D warnings cd poc/guest; cargo check clippy: cargo clippy --no-default-features --target=wasm32-unknown-unknown -p poc-executor - SKIP_WASM_BUILD= cargo clippy + SKIP_WASM_BUILD= cargo clippy -- -D warnings cd poc/guest; cargo clippy chainspec: diff --git a/poc/runtime/src/xcq.rs b/poc/runtime/src/xcq.rs index 7602ac6..7e0126d 100644 --- a/poc/runtime/src/xcq.rs +++ b/poc/runtime/src/xcq.rs @@ -1,5 +1,6 @@ use frame::deps::sp_api::decl_runtime_apis; use frame::prelude::*; +#[allow(unused_imports)] use scale_info::prelude::{format, string::String}; pub type XcqResponse = Vec; From 37f4101e31ecd9a766755e2a483def543364d7e3 Mon Sep 17 00:00:00 2001 From: indirection42 Date: Wed, 15 May 2024 13:48:43 +0800 Subject: [PATCH 11/11] fix check args --- .github/workflows/build.yml | 3 --- Makefile | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c167a2..3125185 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,8 +44,5 @@ jobs: - name: Generate poc-guest.polkavm run: make poc-guest - - name: Custom cargo check - run: make check - - name: Custom cargo clippy run: make clippy diff --git a/Makefile b/Makefile index 8dfd360..718aac0 100644 --- a/Makefile +++ b/Makefile @@ -18,7 +18,7 @@ fmt: check: cargo check --no-default-features --target=wasm32-unknown-unknown -p poc-executor - SKIP_WASM_BUILD= cargo check -- -D warnings + SKIP_WASM_BUILD= cargo check cd poc/guest; cargo check clippy: