Skip to content

Commit e59baf9

Browse files
authored
Update cargo-contract crate versions (#91)
1 parent 2f62439 commit e59baf9

File tree

10 files changed

+777
-252
lines changed

10 files changed

+777
-252
lines changed

Cargo.lock

Lines changed: 756 additions & 233 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ homepage = "https://github.com/Cardinal-Cryptography/drink"
1818
license = "Apache-2.0"
1919
readme = "README.md"
2020
repository = "https://github.com/Cardinal-Cryptography/drink"
21-
version = "0.8.4"
21+
version = "0.8.5"
2222

2323
[workspace.dependencies]
2424
anyhow = { version = "1.0.71" }
2525
cargo_metadata = { version = "0.18.1" }
2626
clap = { version = "4.3.4" }
27-
contract-build = { version = "3.0.1" }
28-
contract-metadata = { version = "3.2.0" }
29-
contract-transcode = { version = "3.2.0" }
27+
contract-build = { version = "4.0.0-rc.1" }
28+
contract-metadata = { version = "4.0.0-rc.1" }
29+
contract-transcode = { version = "4.0.0-rc.1" }
3030
convert_case = { version = "0.6.0" }
3131
crossterm = { version = "0.26.0" }
3232
parity-scale-codec = { version = "3.4" }
@@ -56,5 +56,5 @@ sp-runtime-interface = { version = "19.0.0" }
5656

5757
# Local dependencies
5858

59-
drink = { version = "0.8.4", path = "drink" }
60-
drink-test-macro = { version = "0.8.4", path = "drink/test-macro" }
59+
drink = { version = "0.8.5", path = "drink" }
60+
drink-test-macro = { version = "0.8.5", path = "drink/test-macro" }

drink/test-macro/src/contract_building.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::{
66

77
use cargo_metadata::{Metadata, MetadataCommand, Package};
88
use contract_build::{
9-
BuildArtifacts, BuildMode, ExecuteArgs, Features, ManifestPath, Network, OptimizationPasses,
10-
OutputType, Target, UnstableFlags, Verbosity,
9+
BuildArtifacts, BuildMode, ExecuteArgs, Features, ImageVariant, ManifestPath, Network,
10+
OptimizationPasses, OutputType, Target, UnstableFlags, Verbosity,
1111
};
1212

1313
use crate::bundle_provision::BundleProviderGenerator;
@@ -102,10 +102,12 @@ fn build_contract_crate(pkg: &Package) -> (String, PathBuf) {
102102
unstable_flags: UnstableFlags::default(),
103103
optimization_passes: Some(OptimizationPasses::default()),
104104
keep_debug_symbols: false,
105-
lint: false,
105+
dylint: false,
106106
output_type: OutputType::HumanReadable,
107107
skip_wasm_validation: false,
108108
target: Target::Wasm,
109+
image: ImageVariant::Default,
110+
max_memory_pages: contract_build::DEFAULT_MAX_MEMORY_PAGES,
109111
};
110112

111113
let result = contract_build::execute(args).expect("Error building contract");

examples/chain-extension/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ version = "0.1.0"
1010
path = "src/lib.rs"
1111

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

1515
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
1616
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

examples/chain-extension/src/chain_extension_ink_side.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
use ink::env::{chain_extension::FromStatusCode, DefaultEnvironment, Environment};
22

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

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

examples/cross-contract-call-tracing/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/Cardinal-Cryptography/drink"
77
version = "0.1.0"
88

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

1212
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
1313
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

examples/cross-contract-call-tracing/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ mod contract {
5353
#[ink(message)]
5454
pub fn inner_call(&self, arg: u32) -> u32 {
5555
match arg % 2 {
56-
0 => arg / 2,
57-
_ => 3 * arg + 1,
56+
0 => arg.checked_div(2).unwrap(),
57+
_ => 3_u32.saturating_mul(arg).saturating_add(1),
5858
}
5959
}
6060
}
@@ -117,7 +117,7 @@ mod tests {
117117
};
118118

119119
transcoder
120-
.decode_return(call_name, &mut result.as_slice())
120+
.decode_message_return(call_name, &mut result.as_slice())
121121
.unwrap()
122122
} else {
123123
Value::Unit

examples/flipper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/Cardinal-Cryptography/drink"
77
version = "0.1.0"
88

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

1212
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
1313
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

examples/mocking/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repository = "https://github.com/Cardinal-Cryptography/drink"
77
version = "0.1.0"
88

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

1212
scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
1313
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

examples/quick-start-with-drink/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ path = "lib.rs"
1313
# We use standard dependencies for an ink! smart-contract.
1414

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

0 commit comments

Comments
 (0)