diff --git a/.cargo/config.toml b/.cargo/config.toml new file mode 100644 index 000000000..3503b8a6d --- /dev/null +++ b/.cargo/config.toml @@ -0,0 +1,2 @@ +[target.wasm32-unknown-unknown] +rustflags = ["--cfg", "substrate_runtime"] diff --git a/Cargo.lock b/Cargo.lock index 55dc1eb48..9980ddd35 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -14,7 +14,7 @@ dependencies = [ [[package]] name = "ac-compose-macros" -version = "1.21.0" +version = "1.22.0" dependencies = [ "ac-node-api", "ac-primitives", @@ -26,7 +26,7 @@ dependencies = [ [[package]] name = "ac-examples-async" -version = "1.21.0" +version = "1.22.0" dependencies = [ "env_logger", "frame-system", @@ -48,7 +48,7 @@ dependencies = [ [[package]] name = "ac-examples-sync" -version = "1.21.0" +version = "1.22.0" dependencies = [ "env_logger", "log", @@ -61,7 +61,7 @@ dependencies = [ [[package]] name = "ac-examples-wasm" -version = "1.21.0" +version = "1.22.0" dependencies = [ "pallet-balances", "sp-core", @@ -71,7 +71,7 @@ dependencies = [ [[package]] name = "ac-keystore" -version = "1.21.0" +version = "1.22.0" dependencies = [ "array-bytes 9.3.0", "parking_lot", @@ -85,7 +85,7 @@ dependencies = [ [[package]] name = "ac-node-api" -version = "1.21.0" +version = "1.22.0" dependencies = [ "bitvec", "derive_more 2.1.0", @@ -111,7 +111,7 @@ dependencies = [ [[package]] name = "ac-primitives" -version = "1.21.0" +version = "1.22.0" dependencies = [ "frame-system", "impl-serde", @@ -137,7 +137,7 @@ dependencies = [ [[package]] name = "ac-testing-async" -version = "1.21.0" +version = "1.22.0" dependencies = [ "frame-support", "jsonrpsee", @@ -155,7 +155,7 @@ dependencies = [ [[package]] name = "ac-testing-sync" -version = "1.21.0" +version = "1.22.0" dependencies = [ "ac-keystore", "sp-application-crypto", @@ -6526,7 +6526,7 @@ dependencies = [ [[package]] name = "substrate-api-client" -version = "1.21.0" +version = "1.22.0" dependencies = [ "ac-compose-macros", "ac-node-api", @@ -6712,7 +6712,7 @@ dependencies = [ [[package]] name = "test-no-std" -version = "1.21.0" +version = "1.22.0" dependencies = [ "ac-compose-macros", "ac-node-api", diff --git a/README.md b/README.md index 26cda83d6..5b15581b9 100644 --- a/README.md +++ b/README.md @@ -214,3 +214,7 @@ _In alphabetical order_ A: When specifying your own state query, you must provide the return type of the state you're trying to retrieve. This is because the api-client only gets bytes from the node and must be able to deserialize these properly. That is not possible without knowing the type to decode to. This type may be for example a simple `u64` for retrieving the `Balance` of an account. But careful: If you're looking at the pallet code and its return type, don't forget to take the Query type into consideration. The `OptionQuery` for example automatically wraps the return type into an `Option` (see the [substrate docs "Handling query return values"](https://docs.substrate.io/build/runtime-storage/) for more information). Alternatively, you can always double check via [polkadot.js](https://polkadot.js.org/). If you're importing a value directly from the runtime, as it's done in this [example](https://github.com/scs/substrate-api-client/blob/fb108a7d1994705bbca50233e3bc66cec3726523/examples/examples/subscribe_events.rs#L25-L27), remember to adapt it to the node you are querying from. + +4. Q: I get a compilation error when compiling for `no-std` or `wasm`. For example "unresolved import `sp_core::storage::Storage`" in `sp-state-machine`. What is wrong? + + A: You might have to specify `RUSTFLAGS` for compilation. See the [substrate documentation](https://github.com/paritytech/polkadot-sdk?tab=readme-ov-file#wasm). If you still get an error like `error[E0308]: mismatched types` in `sp-io` you might have to switch to the `master` branch (instead of using a release branch). This is a temporary issue do to incompatible versions being published on crates.io and should be fixed in the future. diff --git a/api-client/Cargo.toml b/api-client/Cargo.toml index 56e4a5f63..cbd44f97a 100644 --- a/api-client/Cargo.toml +++ b/api-client/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "substrate-api-client" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/compose-macros/Cargo.toml b/compose-macros/Cargo.toml index 6e6f37f6b..1812e39f4 100644 --- a/compose-macros/Cargo.toml +++ b/compose-macros/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-compose-macros" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/examples/async/Cargo.toml b/examples/async/Cargo.toml index 0135336e7..32cabf3c0 100644 --- a/examples/async/Cargo.toml +++ b/examples/async/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-examples-async" -version = "1.21.0" +version = "1.22.0" license = "Apache-2.0" edition = "2021" diff --git a/examples/sync/Cargo.toml b/examples/sync/Cargo.toml index 740da99bb..6275e9c7d 100644 --- a/examples/sync/Cargo.toml +++ b/examples/sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-examples-sync" -version = "1.21.0" +version = "1.22.0" license = "Apache-2.0" edition = "2021" diff --git a/examples/wasm/Cargo.toml b/examples/wasm/Cargo.toml index d6df3c533..f689fc404 100644 --- a/examples/wasm/Cargo.toml +++ b/examples/wasm/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-examples-wasm" -version = "1.21.0" +version = "1.22.0" license = "Apache-2.0" edition = "2021" diff --git a/keystore/Cargo.toml b/keystore/Cargo.toml index 03cbddb72..d8d5917e1 100644 --- a/keystore/Cargo.toml +++ b/keystore/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-keystore" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/node-api/Cargo.toml b/node-api/Cargo.toml index 257868a6d..41792f328 100644 --- a/node-api/Cargo.toml +++ b/node-api/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-node-api" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 279dce10e..bc4dc2361 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-primitives" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/test-no-std/Cargo.toml b/test-no-std/Cargo.toml index f21861b2c..f967ba7f9 100644 --- a/test-no-std/Cargo.toml +++ b/test-no-std/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "test-no-std" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/testing/async/Cargo.toml b/testing/async/Cargo.toml index ffa4599c0..0a51a7556 100644 --- a/testing/async/Cargo.toml +++ b/testing/async/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-testing-async" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021" diff --git a/testing/sync/Cargo.toml b/testing/sync/Cargo.toml index c4fa2b5d0..f94dbfd33 100644 --- a/testing/sync/Cargo.toml +++ b/testing/sync/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "ac-testing-sync" -version = "1.21.0" +version = "1.22.0" authors = ["Supercomputing Systems AG "] license = "Apache-2.0" edition = "2021"