Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update cargo-contract crate versions #91

Merged
merged 5 commits into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
989 changes: 756 additions & 233 deletions Cargo.lock

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ homepage = "https://github.com/Cardinal-Cryptography/drink"
license = "Apache-2.0"
readme = "README.md"
repository = "https://github.com/Cardinal-Cryptography/drink"
version = "0.8.4"
version = "0.8.5"

[workspace.dependencies]
anyhow = { version = "1.0.71" }
cargo_metadata = { version = "0.18.1" }
clap = { version = "4.3.4" }
contract-build = { version = "3.0.1" }
contract-metadata = { version = "3.2.0" }
contract-transcode = { version = "3.2.0" }
contract-build = { version = "4.0.0-rc.1" }
contract-metadata = { version = "4.0.0-rc.1" }
contract-transcode = { version = "4.0.0-rc.1" }
Comment on lines +27 to +29
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that - I don't think the main release of drink! to crates should be done against release candidates. There are other projects that depend on drink! from crates.io and they might get silently broken now.

Judging from the diff though - there aren't that many changes. Does it mean ink5 is backwards comptible with ink4 ?

convert_case = { version = "0.6.0" }
crossterm = { version = "0.26.0" }
parity-scale-codec = { version = "3.4" }
Expand Down Expand Up @@ -56,5 +56,5 @@ sp-runtime-interface = { version = "19.0.0" }

# Local dependencies

drink = { version = "0.8.4", path = "drink" }
drink-test-macro = { version = "0.8.4", path = "drink/test-macro" }
drink = { version = "0.8.5", path = "drink" }
drink-test-macro = { version = "0.8.5", path = "drink/test-macro" }
8 changes: 5 additions & 3 deletions drink/test-macro/src/contract_building.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ use std::{

use cargo_metadata::{Metadata, MetadataCommand, Package};
use contract_build::{
BuildArtifacts, BuildMode, ExecuteArgs, Features, ManifestPath, Network, OptimizationPasses,
OutputType, Target, UnstableFlags, Verbosity,
BuildArtifacts, BuildMode, ExecuteArgs, Features, ImageVariant, ManifestPath, Network,
OptimizationPasses, OutputType, Target, UnstableFlags, Verbosity,
};

use crate::bundle_provision::BundleProviderGenerator;
Expand Down Expand Up @@ -102,10 +102,12 @@ fn build_contract_crate(pkg: &Package) -> (String, PathBuf) {
unstable_flags: UnstableFlags::default(),
optimization_passes: Some(OptimizationPasses::default()),
keep_debug_symbols: false,
lint: false,
dylint: false,
output_type: OutputType::HumanReadable,
skip_wasm_validation: false,
target: Target::Wasm,
image: ImageVariant::Default,
max_memory_pages: contract_build::DEFAULT_MAX_MEMORY_PAGES,
};

let result = contract_build::execute(args).expect("Error building contract");
Expand Down
2 changes: 1 addition & 1 deletion examples/chain-extension/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = "0.1.0"
path = "src/lib.rs"

[dependencies]
ink = { version = "=4.2.1", default-features = false }
ink = { version = "=5.0.0-rc", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
Expand Down
4 changes: 2 additions & 2 deletions examples/chain-extension/src/chain_extension_ink_side.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
use ink::env::{chain_extension::FromStatusCode, DefaultEnvironment, Environment};

/// Simple chain extension that provides some staking information.
#[ink::chain_extension]
#[ink::chain_extension(extension = 0)]
pub trait StakingExtension {
type ErrorCode = StakingExtensionErrorCode;

/// Returns the number of the validators.
#[ink(extension = 41, handle_status = false)]
#[ink(function = 41, handle_status = false)]
fn get_num_of_validators() -> u32;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/cross-contract-call-tracing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/Cardinal-Cryptography/drink"
version = "0.1.0"

[dependencies]
ink = { version = "=4.2.1", default-features = false }
ink = { version = "=5.0.0-rc", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
Expand Down
6 changes: 3 additions & 3 deletions examples/cross-contract-call-tracing/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ mod contract {
#[ink(message)]
pub fn inner_call(&self, arg: u32) -> u32 {
match arg % 2 {
0 => arg / 2,
_ => 3 * arg + 1,
0 => arg.checked_div(2).unwrap(),
_ => 3_u32.saturating_mul(arg).saturating_add(1),
}
}
}
Expand Down Expand Up @@ -117,7 +117,7 @@ mod tests {
};

transcoder
.decode_return(call_name, &mut result.as_slice())
.decode_message_return(call_name, &mut result.as_slice())
.unwrap()
} else {
Value::Unit
Expand Down
2 changes: 1 addition & 1 deletion examples/flipper/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/Cardinal-Cryptography/drink"
version = "0.1.0"

[dependencies]
ink = { version = "=4.2.1", default-features = false, features = ["ink-debug"] }
ink = { version = "=5.0.0-rc", default-features = false, features = ["ink-debug"] }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion examples/mocking/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ repository = "https://github.com/Cardinal-Cryptography/drink"
version = "0.1.0"

[dependencies]
ink = { version = "=4.2.1", default-features = false }
ink = { version = "=5.0.0-rc", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
Expand Down
2 changes: 1 addition & 1 deletion examples/quick-start-with-drink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ path = "lib.rs"
# We use standard dependencies for an ink! smart-contract.

# For debugging from contract, we enable the `ink-debug` feature of `ink` crate.
ink = { version = "=4.2.1", default-features = false, features = ["ink-debug"] }
ink = { version = "=5.0.0-rc", default-features = false, features = ["ink-debug"] }
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

Expand Down
Loading