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 subxt, scale-* and sp-* dependencies #1795

Merged
merged 14 commits into from
Jun 23, 2023
14 changes: 7 additions & 7 deletions crates/e2e/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ ink_env = { version = "4.2.0", path = "../env" }
ink_primitives = { version = "4.2.0", path = "../primitives" }

funty = "2.0.0"
impl-serde = { version = "0.3.1", default-features = false }
impl-serde = { version = "0.4.0", default-features = false }
jsonrpsee = { version = "0.18.0", features = ["ws-client"] }
serde = { version = "1.0.137", default-features = false, features = ["derive"] }
serde_json = { version = "1.0.81" }
tokio = { version = "1.18.2", features = ["rt-multi-thread"] }
tracing = "0.1.37"
tracing-subscriber = { version = "0.3.17", features = ["env-filter"] }
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
subxt = "0.28.0"
subxt = "0.29.0"

# Substrate
pallet-contracts-primitives = "23.0.0"
sp-core = "20.0.0"
sp-keyring = "23.0.0"
sp-runtime = "23.0.0"
sp-weights = "19.0.0"
pallet-contracts-primitives = "24.0.0"
sp-core = { version = "21.0.0", default-features = false }
sp-keyring = "24.0.0"
sp-runtime = "24.0.0"
sp-weights = "20.0.0"

[dev-dependencies]
# Required for the doctest of `MessageBuilder::call`
Expand Down
13 changes: 7 additions & 6 deletions crates/e2e/src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ use subxt::{
},
},
tx::PairSigner,
Config,
};

/// Represents an initialized contract message builder.
Expand All @@ -80,7 +81,7 @@ pub struct InstantiationResult<C: subxt::Config, E: Environment> {
pub account_id: E::AccountId,
/// The result of the dry run, contains debug messages
/// if there were any.
pub dry_run: ContractInstantiateResult<C::AccountId, E::Balance>,
pub dry_run: ContractInstantiateResult<C::AccountId, E::Balance, ()>,
/// Events that happened with the contract instantiation.
pub events: ExtrinsicEvents<C>,
}
Expand Down Expand Up @@ -226,7 +227,7 @@ where
pub struct CallDryRunResult<E: Environment, V> {
/// The result of the dry run, contains debug messages
/// if there were any.
pub exec_result: ContractExecResult<E::Balance>,
pub exec_result: ContractExecResult<E::Balance, ()>,
_marker: PhantomData<V>,
}

Expand Down Expand Up @@ -306,15 +307,15 @@ where
/// No contract with the given name found in scope.
ContractNotFound(String),
/// The `instantiate_with_code` dry run failed.
InstantiateDryRun(ContractInstantiateResult<C::AccountId, E::Balance>),
InstantiateDryRun(ContractInstantiateResult<C::AccountId, E::Balance, ()>),
/// The `instantiate_with_code` extrinsic failed.
InstantiateExtrinsic(subxt::error::DispatchError),
/// The `upload` dry run failed.
UploadDryRun(CodeUploadResult<E::Hash, E::Balance>),
/// The `upload` extrinsic failed.
UploadExtrinsic(subxt::error::DispatchError),
/// The `call` dry run failed.
CallDryRun(ContractExecResult<E::Balance>),
CallDryRun(ContractExecResult<E::Balance, ()>),
/// The `call` extrinsic failed.
CallExtrinsic(subxt::error::DispatchError),
/// Error fetching account balance.
Expand Down Expand Up @@ -533,7 +534,7 @@ where
constructor: CreateBuilderPartial<E, Contract, Args, R>,
value: E::Balance,
storage_deposit_limit: Option<E::Balance>,
) -> ContractInstantiateResult<C::AccountId, E::Balance>
) -> ContractInstantiateResult<C::AccountId, E::Balance, ()>
where
Args: scale::Encode,
{
Expand Down Expand Up @@ -992,6 +993,6 @@ where
}

/// Returns true if the give event is System::Extrinsic failed.
fn is_extrinsic_failed_event(event: &EventDetails) -> bool {
fn is_extrinsic_failed_event<C: Config>(event: &EventDetails<C>) -> bool {
event.pallet_name() == "System" && event.variant_name() == "ExtrinsicFailed"
}
7 changes: 2 additions & 5 deletions crates/e2e/src/node_proc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,7 @@ where
.stdout(process::Stdio::piped())
.stderr(process::Stdio::piped())
.arg("--port=0")
.arg("--rpc-port=0")
.arg("--ws-port=0");
.arg("--rpc-port=0");

if let Some(authority) = self.authority {
let authority = format!("{authority:?}");
Expand Down Expand Up @@ -173,9 +172,7 @@ fn find_substrate_port_from_output(r: impl Read + Send + 'static) -> u16 {
// substrate).
let line_end = line
.rsplit_once("Listening for new connections on 127.0.0.1:")
.or_else(|| {
line.rsplit_once("Running JSON-RPC WS server: addr=127.0.0.1:")
})
.or_else(|| line.rsplit_once("Running JSON-RPC server: addr=127.0.0.1:"))
.map(|(_, port_str)| port_str)?;

// trim non-numeric chars from the end of the port part of the line.
Expand Down
4 changes: 2 additions & 2 deletions crates/e2e/src/xts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ where
data: Vec<u8>,
salt: Vec<u8>,
signer: &Signer<C>,
) -> ContractInstantiateResult<C::AccountId, E::Balance> {
) -> ContractInstantiateResult<C::AccountId, E::Balance, ()> {
let code = Code::Upload(code);
let call_request = RpcInstantiateRequest::<C, E> {
origin: subxt::tx::Signer::account_id(signer).clone(),
Expand Down Expand Up @@ -419,7 +419,7 @@ where
input_data: Vec<u8>,
value: E::Balance,
storage_deposit_limit: Option<E::Balance>,
) -> ContractExecResult<E::Balance> {
) -> ContractExecResult<E::Balance, ()> {
let call_request = RpcCallRequest::<C, E> {
origin,
dest,
Expand Down
4 changes: 2 additions & 2 deletions crates/env/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ secp256k1 = { version = "0.27.0", features = ["recovery", "global-context"], opt
#
# Sadly couldn't be marked as dev-dependency.
# Never use this crate outside the off-chain environment!
scale-decode = { version = "0.5.0", default-features = false, optional = true }
scale-encode = { version = "0.1.0", default-features = false, optional = true }
scale-decode = { version = "0.7.0", default-features = false, optional = true }
scale-encode = { version = "0.3.0", default-features = false, optional = true }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions crates/primitives/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ include = ["/Cargo.toml", "src/**/*.rs", "/README.md", "/LICENSE"]
derive_more = { version = "0.99", default-features = false, features = ["from", "display"] }
ink_prelude = { version = "4.2.0", path = "../prelude/", default-features = false }
scale = { package = "parity-scale-codec", version = "3.4", default-features = false, features = ["derive"] }
scale-decode = { version = "0.5.0", default-features = false, features = ["derive"], optional = true }
scale-encode = { version = "0.1.0", default-features = false, features = ["derive"], optional = true }
scale-decode = { version = "0.7.0", default-features = false, features = ["derive"], optional = true }
scale-encode = { version = "0.3.0", default-features = false, features = ["derive"], optional = true }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }
xxhash-rust = { version = "0.8", features = ["const_xxh32"] }

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ scale-info = { version = "2.6", default-features = false, features = ["derive"],
# (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 = "22.0.0", default-features = false, features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime = { version = "23.0.0", default-features = false }
sp-io = { version = "23.0.0", default-features = false, features = ["disable_panic_handler", "disable_oom", "disable_allocator"] }
sp-runtime = { version = "24.0.0", default-features = false }

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/e2e-call-runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ scale-info = { version = "2.6", default-features = false, features = ["derive"],

[dev-dependencies]
ink_e2e = { path = "../../crates/e2e" }
subxt = { version = "0.28.0", default-features = false }
subxt = { version = "0.29.0", default-features = false }

[lib]
path = "lib.rs"
Expand Down
5 changes: 3 additions & 2 deletions integration-tests/payment-channel/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ scale = { package = "parity-scale-codec", version = "3", default-features = fals
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

[dev-dependencies]
hex-literal = { version = "0.3" }
sp-core = "6.0.0"
hex-literal = { version = "0.4.1" }
sp-core = { version = "21.0.0", default-features = false }

[lib]
path = "lib.rs"
Expand All @@ -24,6 +24,7 @@ std = [
"ink/std",
"scale/std",
"scale-info/std",
"sp-core/std",
]

ink-as-dependency = []