Skip to content
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
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,11 @@ frame-support = { version = "49.0.1", default-features = false }
pallet-contracts = { version = "51.0.0", default-features = false }
pallet-balances = { version = "51.0.2", default-features = false }
pallet-timestamp = { version = "49.0.0", default-features = false }
# Keep the ink! v5 contract imports compatible with existing chains.
# Newer bindings change CallFlags::all() and remove RISC-V support.
pallet-contracts-uapi = { version = "9.0.0", default-features = false }
pallet-contracts-mock-network = { version = "31.0.0", default-features = false }
sp-externalities = { version = "0.34.0", default-features = false }
sp-io = { version = "49.0.0", default-features = false }
sp-runtime-interface = { version = "27.0.0" }
sp-core = { version = "43.0.0", default-features = false }
sp-keyring = { version = "49.0.0", default-features = false }
sp-runtime = { version = "49.0.0", default-features = false }
Expand Down
1 change: 0 additions & 1 deletion crates/ink/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ ink_primitives = { workspace = true }
ink_metadata = { workspace = true, optional = true }
ink_prelude = { workspace = true }
ink_macro = { workspace = true }
pallet-contracts-uapi = { workspace = true }
scale = { workspace = true }
scale-info = { workspace = true, default-features = false, features = ["derive"], optional = true }
derive_more = { workspace = true, features = ["from"] }
Expand Down
3 changes: 1 addition & 2 deletions crates/ink/src/env_access.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ use ink_env::{
FromAccountId, LimitParamsV1, LimitParamsV2,
},
hash::{CryptoHash, HashOutput},
Environment, Result,
Environment, Result, ReturnErrorCode,
};
use pallet_contracts_uapi::ReturnErrorCode;

/// The API behind the `self.env()` and `Self::env()` syntax in ink!.
///
Expand Down
1 change: 0 additions & 1 deletion crates/storage/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ ink_metadata = { workspace = true, optional = true }
ink_primitives = { workspace = true }
ink_storage_traits = { workspace = true }
ink_prelude = { workspace = true }
pallet-contracts-uapi = { workspace = true}

scale = { workspace = true }
derive_more = { workspace = true, features = ["from", "display"] }
Expand Down
2 changes: 1 addition & 1 deletion crates/storage/src/lazy/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
//! Instead it is just a simple wrapper around the contract storage facilities.

use core::cell::Cell;
use ink_env::ReturnErrorCode;
use ink_primitives::Key;
use ink_storage_traits::{AutoKey, Packed, Storable, StorableHint, StorageKey};
use pallet_contracts_uapi::ReturnErrorCode;
use scale::EncodeLike;

use crate::{Lazy, Mapping};
Expand Down
15 changes: 1 addition & 14 deletions integration-tests/public/call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,6 @@ publish = false
[dependencies]
ink = { path = "../../../crates/ink", default-features = false }

# Substrate
#
# We need to explicitly turn off some of the `sp-io` features, to avoid conflicts
# (especially for global allocator).
#
# See also: https://substrate.stackexchange.com/questions/4733/error-when-compiling-a-contract-using-the-xcm-chain-extension.
sp-io = { version = "34.0.0", default-features = false, features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime = { version = "35.0.0", default-features = false }

[dev-dependencies]
ink_e2e = { path = "../../../crates/e2e" }

Expand All @@ -25,10 +16,6 @@ path = "lib.rs"

[features]
default = ["std"]
std = [
"ink/std",
"sp-runtime/std",
"sp-io/std",
]
std = ["ink/std"]
ink-as-dependency = []
e2e-tests = []
16 changes: 12 additions & 4 deletions integration-tests/public/call-runtime/lib.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#![cfg_attr(not(feature = "std"), no_std, no_main)]

use ink::primitives::AccountId;
use sp_runtime::MultiAddress;

/// A part of the runtime dispatchable API.
///
Expand All @@ -27,6 +26,15 @@ enum RuntimeCall {
Balances(BalancesCall),
}

// Only the chain's MultiAddress::Id encoding is needed by this example.
#[ink::scale_derive(Encode)]
// SCALE validates variant indices before generating the narrowing cast.
#[allow(clippy::cast_possible_truncation)]
enum RuntimeAddress {
#[codec(index = 0)]
Id(AccountId),
}

#[ink::scale_derive(Encode)]
// SCALE validates variant indices before generating the narrowing cast.
#[allow(clippy::cast_possible_truncation)]
Expand All @@ -37,15 +45,15 @@ enum BalancesCall {
/// missing, use source-code order (0-based).
#[codec(index = 0)]
Transfer {
dest: MultiAddress<AccountId, ()>,
dest: RuntimeAddress,
#[codec(compact)]
value: u128,
},
}

#[ink::contract]
mod runtime_call {
use crate::{BalancesCall, RuntimeCall};
use crate::{BalancesCall, RuntimeAddress, RuntimeCall};

use ink::env::Error as EnvError;

Expand Down Expand Up @@ -98,7 +106,7 @@ mod runtime_call {
) -> Result<(), RuntimeError> {
self.env()
.call_runtime(&RuntimeCall::Balances(BalancesCall::Transfer {
dest: receiver.into(),
dest: RuntimeAddress::Id(receiver),
value,
}))
.map_err(Into::into)
Expand Down
2 changes: 0 additions & 2 deletions linting/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading