Skip to content

Commit

Permalink
Update to ink 5.0.0 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
smiasojed authored Mar 13, 2024
1 parent 46b1edb commit 682605f
Show file tree
Hide file tree
Showing 64 changed files with 865 additions and 132 deletions.
6 changes: 3 additions & 3 deletions basic-contract-caller/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "basic-contract-caller"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

# Note: We **need** to specify the `ink-as-dependency` feature.
#
# If we don't we will end up with linking errors!
other-contract = { path = "other-contract", default-features = false, features = ["ink-as-dependency"] }

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions basic-contract-caller/other-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "other-contract"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "call-runtime"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

# Substrate
#
Expand All @@ -18,7 +18,7 @@ sp-io = { version = "23.0.0", default-features = false, features = ["disable_pan
sp-runtime = { version = "24.0.0", default-features = false }

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
4 changes: 2 additions & 2 deletions combined-extension/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "combined_extension"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

[dependencies]
ink = { version = "5.0.0-rc.2", default-features = false }
ink = { version = "5.0.0", default-features = false }
psp22_extension = { path = "../psp22-extension", default-features = false, features = ["ink-as-dependency"] }
rand_extension = { path = "../rand-extension", default-features = false, features = ["ink-as-dependency"] }

Expand Down
6 changes: 3 additions & 3 deletions conditional-compilation/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
[package]
name = "conditional-compilation"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions contract-storage/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "contract-storage"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions contract-terminate/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "contract_terminate"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions contract-transfer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "contract_transfer"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions cross-contract-calls/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "cross-contract-calls"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

# Note: We **need** to specify the `ink-as-dependency` feature.
#
# If we don't we will end up with linking errors!
other-contract = { path = "other-contract", default-features = false, features = ["ink-as-dependency"] }

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
12 changes: 6 additions & 6 deletions cross-contract-calls/e2e_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ async fn instantiate_v2_with_insufficient_storage_deposit_limit<Client: E2EBacke
.expect("other_contract upload failed");

const REF_TIME_LIMIT: u64 = 500_000_000;
const PROOF_TIME_LIMIT: u64 = 100_000;
const PROOF_SIZE_LIMIT: u64 = 100_000;
const STORAGE_DEPOSIT_LIMIT: u128 = 100_000_000_000;

let mut constructor = CrossContractCallsRef::new_v2_with_limits(
other_contract_code.code_hash,
REF_TIME_LIMIT,
PROOF_TIME_LIMIT,
PROOF_SIZE_LIMIT,
STORAGE_DEPOSIT_LIMIT,
);
let contract = client
Expand Down Expand Up @@ -87,13 +87,13 @@ async fn instantiate_v2_with_sufficient_limits<Client: E2EBackend>(
.expect("other_contract upload failed");

const REF_TIME_LIMIT: u64 = 500_000_000;
const PROOF_TIME_LIMIT: u64 = 100_000;
const PROOF_SIZE_LIMIT: u64 = 100_000;
const STORAGE_DEPOSIT_LIMIT: u128 = 500_000_000_000;

let mut constructor = CrossContractCallsRef::new_v2_with_limits(
other_contract_code.code_hash,
REF_TIME_LIMIT,
PROOF_TIME_LIMIT,
PROOF_SIZE_LIMIT,
STORAGE_DEPOSIT_LIMIT,
);
let contract = client
Expand Down Expand Up @@ -147,13 +147,13 @@ async fn flip_and_get_v2<Client: E2EBackend>(mut client: Client) -> E2EResult<()
let mut call_builder = contract.call_builder::<CrossContractCalls>();

const REF_TIME_LIMIT: u64 = 500_000_000;
const PROOF_TIME_LIMIT: u64 = 100_000;
const PROOF_SIZE_LIMIT: u64 = 100_000;
const STORAGE_DEPOSIT_LIMIT: u128 = 1_000_000_000;

// when
let call = call_builder.flip_and_get_invoke_v2_with_limits(
REF_TIME_LIMIT,
PROOF_TIME_LIMIT,
PROOF_SIZE_LIMIT,
STORAGE_DEPOSIT_LIMIT,
);
let result = client
Expand Down
10 changes: 5 additions & 5 deletions cross-contract-calls/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ mod cross_contract_calls {
pub fn new_v2_with_limits(
other_contract_code_hash: Hash,
ref_time_limit: u64,
proof_time_limit: u64,
proof_size_limit: u64,
storage_deposit_limit: Balance,
) -> Self {
let other_contract = OtherContractRef::new(true)
.code_hash(other_contract_code_hash)
.endowment(0)
.salt_bytes([0xDE, 0xAD, 0xBE, 0xEF])
.ref_time_limit(ref_time_limit)
.proof_time_limit(proof_time_limit)
.proof_size_limit(proof_size_limit)
.storage_deposit_limit(storage_deposit_limit)
.instantiate();

Expand Down Expand Up @@ -82,22 +82,22 @@ mod cross_contract_calls {
pub fn flip_and_get_invoke_v2_with_limits(
&mut self,
ref_time_limit: u64,
proof_time_limit: u64,
proof_size_limit: u64,
storage_deposit_limit: Balance,
) -> bool {
let call_builder = self.other_contract.call_mut();

call_builder
.flip()
.ref_time_limit(ref_time_limit)
.proof_time_limit(proof_time_limit)
.proof_size_limit(proof_size_limit)
.storage_deposit_limit(storage_deposit_limit)
.invoke();

call_builder
.get()
.ref_time_limit(ref_time_limit)
.proof_time_limit(proof_time_limit)
.proof_size_limit(proof_size_limit)
.storage_deposit_limit(storage_deposit_limit)
.invoke()
}
Expand Down
6 changes: 3 additions & 3 deletions cross-contract-calls/other-contract/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "other-contract"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions custom-allocator/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
name = "custom-allocator"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

[dependencies]
# We're going to use a different allocator than the one provided by ink!. To do that we
# first need to disable the included memory allocator.
ink = { version = "5.0.0-rc.2", default-features = false, features = ["no-allocator"] }
ink = { version = "5.0.0", default-features = false, features = ["no-allocator"] }

# This is going to be our new global memory allocator.
dlmalloc = {version = "0.2", default-features = false, features = ["global"] }

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions custom-environment/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "custom-environment"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
4 changes: 2 additions & 2 deletions dns/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
[package]
name = "dns"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[lib]
path = "lib.rs"
Expand Down
6 changes: 3 additions & 3 deletions e2e-call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[package]
name = "e2e_call_runtime"
version = "5.0.0-rc.2"
version = "5.0.0"
authors = ["Parity Technologies <[email protected]>"]
edition = "2021"
publish = false

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

[dev-dependencies]
ink_e2e = { version = "5.0.0-rc.2" }
ink_e2e = { version = "5.0.0" }

[lib]
path = "lib.rs"
Expand Down
9 changes: 9 additions & 0 deletions e2e-runtime-only-backend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Ignore build artifacts from the local tests sub-crate.
/target/

# Ignore backup files creates by cargo fmt.
**/*.rs.bk

# Remove Cargo.lock when creating an executable, leave it for libraries
# More information here http://doc.crates.io/guide.html#cargotoml-vs-cargolock
Cargo.lock
Loading

0 comments on commit 682605f

Please sign in to comment.