Skip to content

Commit 3af8674

Browse files
authored
Bump versions on polkadot-sdk crates (#2328)
* Bump versions on all `polkadot-sdk` crates * Adapt `contract-xcm` example * Rename to new `subxt` names * Rename to new `subxt` names * Migrate to new `Keypair` API * Make `v` mutable * Add necessary `EncodeAsType` + `IntoVisitor` trait bounds * Remove `IntoVisitor` trait bound * Update test fixtures * Deal with `scale_value::Value` vs `ink_e2e::subxt::dynamic::Value` * Enable `try-runtime` feature for `frame-support` * Downgrade to `scale` 3.6.12, as 3.7 was yanked * Use `parity-scale-codec` 3.7.0 * Use `parity-scale-codec` 3.6.12 everywhere * Add PR link to todo-comment * Use `subxt::ext::scale_value::serde` * Use `parity-scale-codec` 3.7.0 * Switch to `parity-scale-codec` 3.6.12 * Remove unnecessary dependency * Update test fixtures * Use same `scale-{encode, decode}` as subxt + `frame-decode` * Remove superfluous trait bounds * Propagate `std` properly * Revert unneeded trait bound changes * Update test fixtures
1 parent 9066a03 commit 3af8674

File tree

22 files changed

+1128
-1211
lines changed

22 files changed

+1128
-1211
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ version = "5.1.0"
3636
arrayref = { version = "0.3" }
3737
array-init = { version = "2.0", default-features = false }
3838
blake2 = { version = "0.10" }
39-
cargo_metadata = { version = "0.18.0" }
39+
cargo_metadata = { version = "0.19.0" }
4040
cfg-if = { version = "1.0" }
4141
contract-build = { version = "5.0.1" }
4242
darling = { version = "0.20.10" }
@@ -56,9 +56,9 @@ quickcheck = { version = "1" }
5656
quickcheck_macros = { version = "1" }
5757
quote = { version = "1" }
5858
rlibc = { version = "1" }
59-
scale = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] }
60-
scale-decode = { version = "0.11.1", default-features = false }
61-
scale-encode = { version = "0.6.0", default-features = false }
59+
scale = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = ["derive"] }
60+
scale-decode = { version = "0.14.0", default-features = false }
61+
scale-encode = { version = "0.8.0", default-features = false }
6262
scale-info = { version = "2.11", default-features = false }
6363
schemars = { version = "0.8" }
6464
secp256k1 = { version = "0.28.2" }
@@ -67,9 +67,9 @@ serde_json = { version = "1.0.133" }
6767
sha2 = { version = "0.10" }
6868
sha3 = { version = "0.10" }
6969
static_assertions = { version = "1.1" }
70-
subxt = { version = "0.35.3" }
71-
subxt-metadata = { version = "0.35.2" }
72-
subxt-signer = { version = "0.35.3" }
70+
subxt = { version = "0.38.0" }
71+
subxt-metadata = { version = "0.38.0" }
72+
subxt-signer = { version = "0.38.0" }
7373
syn = { version = "2" }
7474
synstructure = { version = "0.13.1" }
7575
thiserror = { version = "1.0.69" }
@@ -85,21 +85,21 @@ wat = { version = "1.221.2" }
8585

8686
# Substrate dependencies
8787
frame-metadata = { version = "16.0.0" }
88-
frame-system = { version = "32.0.0", default-features = false }
89-
frame-support = { version = "32.0.0", default-features = false }
90-
pallet-contracts = { version = "31.0.0", default-features = false }
91-
pallet-balances = { version = "33.0.0", default-features = false }
92-
pallet-timestamp = { version = "31.0.0", default-features = false }
93-
pallet-contracts-uapi = { version = "9.0.0", default-features = false }
94-
pallet-contracts-mock-network = { version = "7.0.0", default-features = false }
95-
sp-externalities = { version = "0.28.0", default-features = false }
96-
sp-io = { version = "34.0.0", default-features = false }
97-
sp-runtime-interface = { version = "27.0.0" }
98-
sp-core = { version = "32.0.0", default-features = false }
99-
sp-keyring = { version = "35.0.0", default-features = false }
100-
sp-runtime = { version = "35.0.0", default-features = false }
88+
frame-system = { version = "38.0.0", default-features = false }
89+
frame-support = { version = "38.0.0", default-features = false }
90+
pallet-contracts = { version = "38.0.0", default-features = false }
91+
pallet-balances = { version = "39.0.0", default-features = false }
92+
pallet-timestamp = { version = "37.0.0", default-features = false }
93+
pallet-contracts-uapi = { version = "12.0.0", default-features = false }
94+
pallet-contracts-mock-network = { version = "14.0.0", default-features = false }
95+
sp-externalities = { version = "0.29.0", default-features = false }
96+
sp-io = { version = "38.0.0", default-features = false }
97+
sp-runtime-interface = { version = "28.0.0" }
98+
sp-core = { version = "34.0.0", default-features = false }
99+
sp-keyring = { version = "39.0.0", default-features = false }
100+
sp-runtime = { version = "39.0.2", default-features = false }
101101
sp-weights = { version = "31.0.0", default-features = false }
102-
xcm = { package = "staging-xcm", version = "11.0.0", default-features = false }
102+
xcm = { package = "staging-xcm", version = "14.2.0", default-features = false }
103103

104104
# Local dependencies
105105
ink = { version = "=5.1.0", path = "crates/ink", default-features = false }

crates/e2e/sandbox/src/macros.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ mod construct_runtime {
206206
type AddressGenerator = $crate::pallet_contracts::DefaultAddressGenerator;
207207
type MaxCodeLen = ConstU32<{ 123 * 1024 }>;
208208
type MaxStorageKeyLen = ConstU32<128>;
209+
type MaxTransientStorageSize = ConstU32<{ 1024 * 1024 }>;
209210
type UnsafeUnstableInterface = ConstBool<false>;
210211
type UploadOrigin = $crate::frame_system::EnsureSigned<Self::AccountId>;
211212
type InstantiateOrigin = $crate::frame_system::EnsureSigned<Self::AccountId>;
@@ -314,8 +315,6 @@ mod construct_runtime {
314315
Default::default(),
315316
);
316317
}
317-
318-
319318
}
320319
}
321320

crates/e2e/src/sandbox_client.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ use std::{
6767
};
6868
use subxt::{
6969
dynamic::Value,
70-
tx::TxPayload,
70+
tx::Payload,
7171
};
7272
use subxt_signer::sr25519::Keypair;
7373

@@ -149,7 +149,7 @@ where
149149
.mint_into(&pair.public().0.into(), amount)
150150
.expect("Failed to mint tokens");
151151

152-
Keypair::from_seed(seed).expect("Failed to create keypair")
152+
Keypair::from_secret_key(seed).expect("Failed to create keypair")
153153
}
154154

155155
async fn free_balance(
@@ -547,7 +547,7 @@ pub mod preset {
547547

548548
fn take_snapshot(&mut self) -> Snapshot {
549549
EXT_PARAA.with(|v| {
550-
let v = v.borrow();
550+
let mut v = v.borrow_mut();
551551
let mut backend = v.as_backend().clone();
552552
let raw_key_values = backend
553553
.backend_storage_mut()

crates/e2e/src/xts.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ where
255255
dest: C::AccountId,
256256
value: E::Balance,
257257
) -> Result<(), subxt::Error> {
258-
let call = subxt::tx::Payload::new(
258+
let call = subxt::tx::DefaultPayload::new(
259259
"Balances",
260260
"transfer_allow_death",
261261
Transfer::<E, C> {
@@ -311,7 +311,7 @@ where
311311
signer: &Keypair,
312312
) -> ExtrinsicEvents<C>
313313
where
314-
Call: subxt::tx::TxPayload,
314+
Call: subxt::tx::Payload,
315315
{
316316
let account_id = <Keypair as Signer<C>>::account_id(signer);
317317
let account_nonce =
@@ -418,7 +418,7 @@ where
418418
salt: Vec<u8>,
419419
signer: &Keypair,
420420
) -> ExtrinsicEvents<C> {
421-
let call = subxt::tx::Payload::new(
421+
let call = subxt::tx::DefaultPayload::new(
422422
"Contracts",
423423
"instantiate_with_code",
424424
InstantiateWithCode::<E> {
@@ -471,7 +471,7 @@ where
471471
code: Vec<u8>,
472472
storage_deposit_limit: Option<E::Balance>,
473473
) -> ExtrinsicEvents<C> {
474-
let call = subxt::tx::Payload::new(
474+
let call = subxt::tx::DefaultPayload::new(
475475
"Contracts",
476476
"upload_code",
477477
UploadCode::<E> {
@@ -494,7 +494,7 @@ where
494494
signer: &Keypair,
495495
code_hash: E::Hash,
496496
) -> ExtrinsicEvents<C> {
497-
let call = subxt::tx::Payload::new(
497+
let call = subxt::tx::DefaultPayload::new(
498498
"Contracts",
499499
"remove_code",
500500
RemoveCode::<E> { code_hash },
@@ -547,7 +547,7 @@ where
547547
data: Vec<u8>,
548548
signer: &Keypair,
549549
) -> ExtrinsicEvents<C> {
550-
let call = subxt::tx::Payload::new(
550+
let call = subxt::tx::DefaultPayload::new(
551551
"Contracts",
552552
"call",
553553
Call::<E> {

crates/ink/tests/ui/contract/fail/constructor-input-non-codec.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
88
Arc<T>
99
Box<T>
1010
Rc<T>
11+
sp_core::Bytes
1112
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`
1213
note: required by a bound in `DispatchInput`
1314
--> src/codegen/dispatch/type_check.rs
@@ -30,6 +31,7 @@ error[E0277]: the trait bound `NonCodecType: ink::parity_scale_codec::Decode` is
3031
Arc<T>
3132
Box<T>
3233
Rc<T>
34+
sp_core::Bytes
3335
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`
3436

3537
error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
@@ -52,7 +54,7 @@ error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
5254
Rc<T>
5355
String
5456
Vec<T>
55-
ink::parity_scale_codec::Ref<'a, T, U>
57+
and $N others
5658
= note: required for `NonCodecType` to implement `Encode`
5759
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
5860
--> $WORKSPACE/crates/env/src/call/execution.rs

crates/ink/tests/ui/contract/fail/constructor-return-result-non-codec-error.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ error[E0277]: the trait bound `contract::Error: WrapperTypeDecode` is not satisf
3131
Arc<T>
3232
Box<T>
3333
Rc<T>
34+
sp_core::Bytes
3435
= note: required for `contract::Error` to implement `ink::parity_scale_codec::Decode`
3536
= note: required for `Result<ContractRef, contract::Error>` to implement `ConstructorReturnType<ContractRef>`
3637
note: required by a bound in `CreateBuilder::<E, ContractRef, CodeHash, Limits, Endowment, Args, Salt, Unset<ReturnType<()>>>::returns`

crates/ink/tests/ui/contract/fail/message-input-non-codec.stderr

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
88
Arc<T>
99
Box<T>
1010
Rc<T>
11+
sp_core::Bytes
1112
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`
1213
note: required by a bound in `DispatchInput`
1314
--> src/codegen/dispatch/type_check.rs
@@ -28,6 +29,7 @@ error[E0277]: the trait bound `NonCodecType: ink::parity_scale_codec::Decode` is
2829
Arc<T>
2930
Box<T>
3031
Rc<T>
32+
sp_core::Bytes
3133
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`
3234

3335
error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
@@ -48,7 +50,7 @@ error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
4850
Rc<T>
4951
String
5052
Vec<T>
51-
ink::parity_scale_codec::Ref<'a, T, U>
53+
and $N others
5254
= note: required for `NonCodecType` to implement `Encode`
5355
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
5456
--> $WORKSPACE/crates/env/src/call/execution.rs

crates/ink/tests/ui/contract/fail/message-returns-non-codec.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
1313
Rc<T>
1414
String
1515
Vec<T>
16-
ink::parity_scale_codec::Ref<'a, T, U>
16+
and $N others
1717
= note: required for `NonCodecType` to implement `Encode`
1818
note: required by a bound in `DispatchOutput`
1919
--> src/codegen/dispatch/type_check.rs
@@ -57,7 +57,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvi
5757
`NonCodecType: WrapperTypeDecode`
5858
which is required by `NonCodecType: ink::parity_scale_codec::Decode`
5959
note: the trait `WrapperTypeDecode` must be implemented
60-
--> $CARGO/parity-scale-codec-3.7.0/src/codec.rs
60+
--> $CARGO/parity-scale-codec-3.6.12/src/codec.rs
6161
|
6262
| pub trait WrapperTypeDecode: Sized {
6363
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)