diff --git a/code/Cargo.lock b/code/Cargo.lock index e3f609c944a..573540b1f47 100644 --- a/code/Cargo.lock +++ b/code/Cargo.lock @@ -1829,8 +1829,6 @@ dependencies = [ name = "cosmwasm-rpc" version = "0.0.1" dependencies = [ - "composable-support", - "composable-traits", "cosmwasm-runtime-api", "jsonrpsee 0.14.0", "parity-scale-codec", @@ -1845,8 +1843,6 @@ dependencies = [ name = "cosmwasm-runtime-api" version = "0.0.1" dependencies = [ - "composable-support", - "composable-traits", "parity-scale-codec", "sp-api", "sp-std", @@ -1893,16 +1889,6 @@ dependencies = [ "uint", ] -[[package]] -name = "cosmwasm-storage" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d18403b07304d15d304dad11040d45bbcaf78d603b4be3fb5e2685c16f9229b5" -dependencies = [ - "cosmwasm-std", - "serde", -] - [[package]] name = "cosmwasm-vm" version = "0.1.0" @@ -2778,25 +2764,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" -[[package]] -name = "cw-multi-test" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f9a8ab7c3c29ec93cb7a39ce4b14a05e053153b4a17ef7cf2246af1b7c087e" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cosmwasm-storage", - "cw-storage-plus", - "cw-utils", - "derivative", - "itertools", - "prost 0.9.0", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "cw-storage-plus" version = "0.13.4" @@ -4695,7 +4662,7 @@ dependencies = [ "parity-scale-codec", "primitive-types", "primitives 0.1.0 (git+https://github.com/ComposableFi/beefy-rs?rev=ea3c74c7c1f959ba1b90e2508b1b6c1fd9afc7ee)", - "prost 0.10.4", + "prost", "prost-types", "ripemd", "safe-regex", @@ -4747,7 +4714,7 @@ source = "git+https://github.com/ComposableFi/ibc-rs?rev=13de07663749a59a424d67b dependencies = [ "base64 0.13.0", "bytes 1.2.1", - "prost 0.10.4", + "prost", "prost-types", "serde", "tendermint-proto", @@ -4835,7 +4802,7 @@ dependencies = [ "anyhow", "bytes 1.2.1", "hex", - "prost 0.10.4", + "prost", "ripemd160", "sha2 0.9.9", "sha3 0.9.1", @@ -5834,7 +5801,7 @@ dependencies = [ "libp2p-request-response", "libp2p-swarm", "log 0.4.17", - "prost 0.10.4", + "prost", "prost-build", "rand 0.8.5", ] @@ -5861,7 +5828,7 @@ dependencies = [ "multistream-select", "parking_lot 0.12.1", "pin-project", - "prost 0.10.4", + "prost", "prost-build", "rand 0.8.5", "ring", @@ -5912,7 +5879,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost 0.10.4", + "prost", "prost-build", "rand 0.7.3", "smallvec 1.9.0", @@ -5936,7 +5903,7 @@ dependencies = [ "libp2p-swarm", "log 0.4.17", "prometheus-client", - "prost 0.10.4", + "prost", "prost-build", "rand 0.7.3", "regex", @@ -5959,7 +5926,7 @@ dependencies = [ "libp2p-swarm", "log 0.4.17", "lru 0.7.8", - "prost 0.10.4", + "prost", "prost-build", "prost-codec", "smallvec 1.9.0", @@ -5984,7 +5951,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost 0.10.4", + "prost", "prost-build", "rand 0.7.3", "sha2 0.10.6", @@ -6062,7 +6029,7 @@ dependencies = [ "lazy_static", "libp2p-core", "log 0.4.17", - "prost 0.10.4", + "prost", "prost-build", "rand 0.8.5", "sha2 0.10.6", @@ -6099,7 +6066,7 @@ dependencies = [ "futures 0.3.24", "libp2p-core", "log 0.4.17", - "prost 0.10.4", + "prost", "prost-build", "unsigned-varint", "void", @@ -6135,7 +6102,7 @@ dependencies = [ "libp2p-swarm", "log 0.4.17", "pin-project", - "prost 0.10.4", + "prost", "prost-build", "prost-codec", "rand 0.8.5", @@ -6159,7 +6126,7 @@ dependencies = [ "libp2p-core", "libp2p-swarm", "log 0.4.17", - "prost 0.10.4", + "prost", "prost-build", "rand 0.8.5", "sha2 0.10.6", @@ -8244,7 +8211,7 @@ dependencies = [ "parachain-info", "parity-scale-codec", "primitives 0.1.0", - "prost 0.10.4", + "prost", "scale-info", "serde", "serde_json", @@ -11092,16 +11059,6 @@ dependencies = [ "syn 0.15.44", ] -[[package]] -name = "prost" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" -dependencies = [ - "bytes 1.2.1", - "prost-derive 0.9.0", -] - [[package]] name = "prost" version = "0.10.4" @@ -11109,7 +11066,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" dependencies = [ "bytes 1.2.1", - "prost-derive 0.10.1", + "prost-derive", ] [[package]] @@ -11127,7 +11084,7 @@ dependencies = [ "log 0.4.17", "multimap", "petgraph", - "prost 0.10.4", + "prost", "prost-types", "regex", "tempfile", @@ -11142,24 +11099,11 @@ checksum = "00af1e92c33b4813cc79fda3f2dbf56af5169709be0202df730e9ebc3e4cd007" dependencies = [ "asynchronous-codec", "bytes 1.2.1", - "prost 0.10.4", + "prost", "thiserror", "unsigned-varint", ] -[[package]] -name = "prost-derive" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2 1.0.43", - "quote 1.0.21", - "syn 1.0.100", -] - [[package]] name = "prost-derive" version = "0.10.1" @@ -11180,7 +11124,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" dependencies = [ "bytes 1.2.1", - "prost 0.10.4", + "prost", ] [[package]] @@ -12117,7 +12061,7 @@ dependencies = [ "libp2p", "log 0.4.17", "parity-scale-codec", - "prost 0.10.4", + "prost", "prost-build", "rand 0.7.3", "sc-client-api", @@ -12690,7 +12634,7 @@ dependencies = [ "parity-scale-codec", "parking_lot 0.12.1", "pin-project", - "prost 0.10.4", + "prost", "prost-build", "rand 0.7.3", "sc-block-builder", @@ -12758,7 +12702,7 @@ dependencies = [ "libp2p", "log 0.4.17", "parity-scale-codec", - "prost 0.10.4", + "prost", "prost-build", "sc-client-api", "sc-network-common", @@ -12780,7 +12724,7 @@ dependencies = [ "log 0.4.17", "lru 0.7.8", "parity-scale-codec", - "prost 0.10.4", + "prost", "prost-build", "sc-client-api", "sc-consensus", @@ -15261,7 +15205,7 @@ dependencies = [ "futures 0.3.24", "num-traits", "once_cell", - "prost 0.10.4", + "prost", "prost-types", "serde", "serde_bytes", @@ -15310,7 +15254,7 @@ dependencies = [ "flex-error", "num-derive", "num-traits", - "prost 0.10.4", + "prost", "prost-types", "serde", "serde_bytes", @@ -17245,8 +17189,6 @@ version = "0.1.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", - "cw-multi-test", "cw-storage-plus", "schemars", "serde", @@ -17271,8 +17213,6 @@ version = "0.1.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", - "cw-multi-test", "cw-storage-plus", "cw20", "num", @@ -17291,8 +17231,6 @@ version = "0.1.0" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cosmwasm-storage", - "cw-multi-test", "cw-storage-plus", "cw20", "hex", diff --git a/code/parachain/frame/cosmwasm/rpc/Cargo.toml b/code/parachain/frame/cosmwasm/rpc/Cargo.toml index 9e995c2271f..0529a2084be 100644 --- a/code/parachain/frame/cosmwasm/rpc/Cargo.toml +++ b/code/parachain/frame/cosmwasm/rpc/Cargo.toml @@ -17,8 +17,6 @@ sp-runtime = { git = "https://github.com/paritytech/substrate", branch = "polkad sp-std = { git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } # local -composable-support = { path = "../../composable-support" } -composable-traits = { path = "../../composable-traits" } cosmwasm-runtime-api = { path = "../runtime-api" } # SCALE diff --git a/code/parachain/frame/cosmwasm/rpc/src/lib.rs b/code/parachain/frame/cosmwasm/rpc/src/lib.rs index 086fe906df8..3216a329117 100644 --- a/code/parachain/frame/cosmwasm/rpc/src/lib.rs +++ b/code/parachain/frame/cosmwasm/rpc/src/lib.rs @@ -11,37 +11,43 @@ use sp_blockchain::HeaderBackend; use sp_runtime::{generic::BlockId, traits::Block as BlockT}; use sp_std::{cmp::Ord, collections::btree_map::BTreeMap, sync::Arc}; -#[rpc(client, server)] -pub trait CosmwasmApi -where - AccountId: FromStr + Display, - AssetId: FromStr + Display + Ord, - Balance: FromStr + Display, -{ - #[method(name = "cosmwasm_query")] - fn query( - &self, - contract: AccountId, - gas: u64, - query_request: Vec, - at: Option, - ) -> RpcResult>; +#[allow(clippy::too_many_arguments)] +mod cosmwasm_api { + use super::*; + #[rpc(client, server)] + pub trait CosmwasmApi + where + AccountId: FromStr + Display, + AssetId: FromStr + Display + Ord, + Balance: FromStr + Display, + { + #[method(name = "cosmwasm_query")] + fn query( + &self, + contract: AccountId, + gas: u64, + query_request: Vec, + at: Option, + ) -> RpcResult>; - #[method(name = "cosmwasm_instantiate")] - fn instantiate( - &self, - instantiator: AccountId, - code_id: u64, - salt: Vec, - admin: Option, - label: Vec, - funds: BTreeMap, - gas: u64, - message: Vec, - at: Option, - ) -> RpcResult; + #[method(name = "cosmwasm_instantiate")] + fn instantiate( + &self, + instantiator: AccountId, + code_id: u64, + salt: Vec, + admin: Option, + label: Vec, + funds: BTreeMap, + gas: u64, + message: Vec, + at: Option, + ) -> RpcResult; + } } +pub use cosmwasm_api::*; + pub struct Cosmwasm { client: Arc, _marker: sp_std::marker::PhantomData, diff --git a/code/parachain/frame/cosmwasm/runtime-api/Cargo.toml b/code/parachain/frame/cosmwasm/runtime-api/Cargo.toml index aac9d8900dc..467468e0b2e 100644 --- a/code/parachain/frame/cosmwasm/runtime-api/Cargo.toml +++ b/code/parachain/frame/cosmwasm/runtime-api/Cargo.toml @@ -13,12 +13,10 @@ targets = ["x86_64-unknown-linux-gnu"] codec = { default-features = false, features = [ "derive", ], package = "parity-scale-codec", version = "3.0.0" } -composable-support = { path = "../../composable-support", default-features = false } -composable-traits = { path = "../../composable-traits", default-features = false } sp-api = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } sp-std = { default-features = false, git = "https://github.com/paritytech/substrate", branch = "polkadot-v0.9.27" } # REVIEW: Does the runtime API need features? [features] default = ["std"] -std = ["sp-api/std", "composable-support/std"] +std = ["sp-api/std"] diff --git a/code/parachain/frame/cosmwasm/src/lib.rs b/code/parachain/frame/cosmwasm/src/lib.rs index e97be6cfd66..2e44e95010b 100644 --- a/code/parachain/frame/cosmwasm/src/lib.rs +++ b/code/parachain/frame/cosmwasm/src/lib.rs @@ -546,7 +546,7 @@ pub mod pallet { label, &message, )?; - let _ = Self::do_extrinsic_dispatch( + Self::do_extrinsic_dispatch( shared, EntryPoint::Instantiate, instantiator, diff --git a/code/parachain/runtime/dali/src/lib.rs b/code/parachain/runtime/dali/src/lib.rs index 22e4404cc05..fa97848656c 100644 --- a/code/parachain/runtime/dali/src/lib.rs +++ b/code/parachain/runtime/dali/src/lib.rs @@ -1576,7 +1576,7 @@ impl_runtime_apis! { label, funds, gas, - message.into() + message ).map_err(|err| alloc::format!("{:?}", err).into_bytes()) } } diff --git a/code/xcvm/cosmwasm/contracts/asset-registry/Cargo.toml b/code/xcvm/cosmwasm/contracts/asset-registry/Cargo.toml index ed01dfe6f5d..d4299f8a319 100644 --- a/code/xcvm/cosmwasm/contracts/asset-registry/Cargo.toml +++ b/code/xcvm/cosmwasm/contracts/asset-registry/Cargo.toml @@ -15,12 +15,10 @@ crate-type = ["cdylib", "rlib"] [features] # use library feature to disable all instantiate/execute/query exports -backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cosmwasm-std = { version = "1.0.0" } -cosmwasm-storage = "1.0.0" +cosmwasm-std = "1.0.0" cw-storage-plus = "0.13.2" schemars = "0.8.8" serde = { version = "1.0.137", default-features = false, features = ["derive"] } @@ -28,4 +26,3 @@ thiserror = { version = "1.0.31" } [dev-dependencies] cosmwasm-schema = "1.0.0" -cw-multi-test = "0.13.2" diff --git a/code/xcvm/cosmwasm/contracts/asset-registry/Developing.md b/code/xcvm/cosmwasm/contracts/asset-registry/Developing.md deleted file mode 100644 index 0df3a1ed262..00000000000 --- a/code/xcvm/cosmwasm/contracts/asset-registry/Developing.md +++ /dev/null @@ -1,104 +0,0 @@ -# Developing - -If you have recently created a contract with this template, you probably could use some -help on how to build and test the contract, as well as prepare it for production. This -file attempts to provide a brief overview, assuming you have installed a recent -version of Rust already (eg. 1.58.1+). - -## Prerequisites - -Before starting, make sure you have [rustup](https://rustup.rs/) along with a -recent `rustc` and `cargo` version installed. Currently, we are testing on 1.58.1+. - -And you need to have the `wasm32-unknown-unknown` target installed as well. - -You can check that via: - -```sh -rustc --version -cargo --version -rustup target list --installed -# if wasm32 is not listed above, run this -rustup target add wasm32-unknown-unknown -``` - -## Compiling and running tests - -Now that you created your custom contract, make sure you can compile and run it before -making any changes. Go into the repository and do: - -```sh -# this will produce a wasm build in ./target/wasm32-unknown-unknown/release/YOUR_NAME_HERE.wasm -cargo wasm - -# this runs unit tests with helpful backtraces -RUST_BACKTRACE=1 cargo unit-test - -# auto-generate json schema -cargo run --example=schema -``` - -### Understanding the tests - -The main code is in `src/contract.rs` and the unit tests there run in pure rust, -which makes them very quick to execute and give nice output on failures, especially -if you do `RUST_BACKTRACE=1 cargo unit-test`. - -We consider testing critical for anything on a blockchain, and recommend to always keep -the tests up to date. - -## Generating JSON Schema - -While the Wasm calls (`instantiate`, `execute`, `query`) accept JSON, this is not enough -information to use it. We need to expose the schema for the expected messages to the -clients. You can generate this schema by calling `cargo schema`, which will output -4 files in `./schema`, corresponding to the 3 message types the contract accepts, -as well as the internal `State`. - -These files are in standard json-schema format, which should be usable by various -client side tools, either to auto-generate codecs, or just to validate incoming -json wrt. the defined schema. - -## Preparing the Wasm bytecode for production - -Before we upload it to a chain, we need to ensure the smallest output size possible, -as this will be included in the body of a transaction. We also want to have a -reproducible build process, so third parties can verify that the uploaded Wasm -code did indeed come from the claimed rust code. - -To solve both these issues, we have produced `rust-optimizer`, a docker image to -produce an extremely small build output in a consistent manner. The suggest way -to run it is this: - -```sh -docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.6 -``` - -Or, If you're on an arm64 machine, you should use a docker image built with arm64. -```sh -docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer-arm64:0.12.6 -``` - -We must mount the contract code to `/code`. You can use a absolute path instead -of `$(pwd)` if you don't want to `cd` to the directory first. The other two -volumes are nice for speedup. Mounting `/code/target` in particular is useful -to avoid docker overwriting your local dev files with root permissions. -Note the `/code/target` cache is unique for each contract being compiled to limit -interference, while the registry cache is global. - -This is rather slow compared to local compilations, especially the first compile -of a given contract. The use of the two volume caches is very useful to speed up -following compiles of the same contract. - -This produces an `artifacts` directory with a `PROJECT_NAME.wasm`, as well as -`checksums.txt`, containing the Sha256 hash of the wasm file. -The wasm file is compiled deterministically (anyone else running the same -docker on the same git commit should get the identical file with the same Sha256 hash). -It is also stripped and minimized for upload to a blockchain (we will also -gzip it in the uploading process to make it even smaller). diff --git a/code/xcvm/cosmwasm/contracts/interpreter/Cargo.toml b/code/xcvm/cosmwasm/contracts/interpreter/Cargo.toml index f3ed6ce1e87..7d683c719e4 100644 --- a/code/xcvm/cosmwasm/contracts/interpreter/Cargo.toml +++ b/code/xcvm/cosmwasm/contracts/interpreter/Cargo.toml @@ -18,12 +18,10 @@ crate-type = ["cdylib", "rlib"] [features] # use library feature to disable all instantiate/execute/query exports -backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] cosmwasm-std = { version = "1.0.0" } -cosmwasm-storage = "1.0.0" cw-storage-plus = "0.13.2" cw20 = "0.13.2" num = "0.4" @@ -37,4 +35,3 @@ xcvm-core = { path = "../../../lib/core", features = ["std"] } [dev-dependencies] cosmwasm-schema = "1.0.0" -cw-multi-test = "0.13.2" diff --git a/code/xcvm/cosmwasm/contracts/router/Cargo.toml b/code/xcvm/cosmwasm/contracts/router/Cargo.toml index 9b146b0200c..7412ff415ab 100644 --- a/code/xcvm/cosmwasm/contracts/router/Cargo.toml +++ b/code/xcvm/cosmwasm/contracts/router/Cargo.toml @@ -15,12 +15,10 @@ crate-type = ["cdylib", "rlib"] [features] # use library feature to disable all instantiate/execute/query exports -backtraces = ["cosmwasm-std/backtraces"] library = [] [dependencies] -cosmwasm-std = { version = "1.0.0", features = ["abort"] } -cosmwasm-storage = "1.0.0" +cosmwasm-std = "1.0.0" cw-storage-plus = "0.13.2" cw20 = "0.13.2" hex = "0.4" @@ -33,5 +31,4 @@ xcvm-interpreter = { path = "../interpreter", features = ["library"] } [dev-dependencies] cosmwasm-schema = "1.0.0" -cw-multi-test = "0.13.2" serde-json-wasm = { git = "https://github.com/hussein-aitlahcen/serde-json-wasm", rev = "1608a13d2a2ba90605d9626a51ff6667aca5a2d6" } diff --git a/code/xcvm/cosmwasm/contracts/router/Developing.md b/code/xcvm/cosmwasm/contracts/router/Developing.md deleted file mode 100644 index 0df3a1ed262..00000000000 --- a/code/xcvm/cosmwasm/contracts/router/Developing.md +++ /dev/null @@ -1,104 +0,0 @@ -# Developing - -If you have recently created a contract with this template, you probably could use some -help on how to build and test the contract, as well as prepare it for production. This -file attempts to provide a brief overview, assuming you have installed a recent -version of Rust already (eg. 1.58.1+). - -## Prerequisites - -Before starting, make sure you have [rustup](https://rustup.rs/) along with a -recent `rustc` and `cargo` version installed. Currently, we are testing on 1.58.1+. - -And you need to have the `wasm32-unknown-unknown` target installed as well. - -You can check that via: - -```sh -rustc --version -cargo --version -rustup target list --installed -# if wasm32 is not listed above, run this -rustup target add wasm32-unknown-unknown -``` - -## Compiling and running tests - -Now that you created your custom contract, make sure you can compile and run it before -making any changes. Go into the repository and do: - -```sh -# this will produce a wasm build in ./target/wasm32-unknown-unknown/release/YOUR_NAME_HERE.wasm -cargo wasm - -# this runs unit tests with helpful backtraces -RUST_BACKTRACE=1 cargo unit-test - -# auto-generate json schema -cargo run --example=schema -``` - -### Understanding the tests - -The main code is in `src/contract.rs` and the unit tests there run in pure rust, -which makes them very quick to execute and give nice output on failures, especially -if you do `RUST_BACKTRACE=1 cargo unit-test`. - -We consider testing critical for anything on a blockchain, and recommend to always keep -the tests up to date. - -## Generating JSON Schema - -While the Wasm calls (`instantiate`, `execute`, `query`) accept JSON, this is not enough -information to use it. We need to expose the schema for the expected messages to the -clients. You can generate this schema by calling `cargo schema`, which will output -4 files in `./schema`, corresponding to the 3 message types the contract accepts, -as well as the internal `State`. - -These files are in standard json-schema format, which should be usable by various -client side tools, either to auto-generate codecs, or just to validate incoming -json wrt. the defined schema. - -## Preparing the Wasm bytecode for production - -Before we upload it to a chain, we need to ensure the smallest output size possible, -as this will be included in the body of a transaction. We also want to have a -reproducible build process, so third parties can verify that the uploaded Wasm -code did indeed come from the claimed rust code. - -To solve both these issues, we have produced `rust-optimizer`, a docker image to -produce an extremely small build output in a consistent manner. The suggest way -to run it is this: - -```sh -docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer:0.12.6 -``` - -Or, If you're on an arm64 machine, you should use a docker image built with arm64. -```sh -docker run --rm -v "$(pwd)":/code \ - --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ - --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ - cosmwasm/rust-optimizer-arm64:0.12.6 -``` - -We must mount the contract code to `/code`. You can use a absolute path instead -of `$(pwd)` if you don't want to `cd` to the directory first. The other two -volumes are nice for speedup. Mounting `/code/target` in particular is useful -to avoid docker overwriting your local dev files with root permissions. -Note the `/code/target` cache is unique for each contract being compiled to limit -interference, while the registry cache is global. - -This is rather slow compared to local compilations, especially the first compile -of a given contract. The use of the two volume caches is very useful to speed up -following compiles of the same contract. - -This produces an `artifacts` directory with a `PROJECT_NAME.wasm`, as well as -`checksums.txt`, containing the Sha256 hash of the wasm file. -The wasm file is compiled deterministically (anyone else running the same -docker on the same git commit should get the identical file with the same Sha256 hash). -It is also stripped and minimized for upload to a blockchain (we will also -gzip it in the uploading process to make it even smaller). diff --git a/scripts/style.sh b/scripts/style.sh deleted file mode 100755 index f02657f6090..00000000000 --- a/scripts/style.sh +++ /dev/null @@ -1,122 +0,0 @@ -#!/usr/bin/env bash - -NIGHTLY_VERSION="2022-04-18" - -usage() { - cat </dev/null -fi - -for arg in "$@"; do - case $arg in - "--help" | "-h") - usage - exit 0 - ;; - "--check" | "-c") - check="check" - ;; - "--verbose" | "-v") - verbose="verbose" - ;; - *) - echo "Unknown option '$arg'" - usage - exit 1 - ;; - esac -done - -cargo_fmt -taplo_fmt -prettier_fmt