Skip to content

Commit

Permalink
Bump versions on polkadot-sdk crates (#2328)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cmichi authored Dec 5, 2024
1 parent 9066a03 commit 3af8674
Show file tree
Hide file tree
Showing 22 changed files with 1,128 additions and 1,211 deletions.
1,848 changes: 1,052 additions & 796 deletions Cargo.lock

Large diffs are not rendered by default.

42 changes: 21 additions & 21 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ version = "5.1.0"
arrayref = { version = "0.3" }
array-init = { version = "2.0", default-features = false }
blake2 = { version = "0.10" }
cargo_metadata = { version = "0.18.0" }
cargo_metadata = { version = "0.19.0" }
cfg-if = { version = "1.0" }
contract-build = { version = "5.0.1" }
darling = { version = "0.20.10" }
Expand All @@ -56,9 +56,9 @@ quickcheck = { version = "1" }
quickcheck_macros = { version = "1" }
quote = { version = "1" }
rlibc = { version = "1" }
scale = { package = "parity-scale-codec", version = "3.6.9", default-features = false, features = ["derive"] }
scale-decode = { version = "0.11.1", default-features = false }
scale-encode = { version = "0.6.0", default-features = false }
scale = { package = "parity-scale-codec", version = "3.6.12", default-features = false, features = ["derive"] }
scale-decode = { version = "0.14.0", default-features = false }
scale-encode = { version = "0.8.0", default-features = false }
scale-info = { version = "2.11", default-features = false }
schemars = { version = "0.8" }
secp256k1 = { version = "0.28.2" }
Expand All @@ -67,9 +67,9 @@ serde_json = { version = "1.0.133" }
sha2 = { version = "0.10" }
sha3 = { version = "0.10" }
static_assertions = { version = "1.1" }
subxt = { version = "0.35.3" }
subxt-metadata = { version = "0.35.2" }
subxt-signer = { version = "0.35.3" }
subxt = { version = "0.38.0" }
subxt-metadata = { version = "0.38.0" }
subxt-signer = { version = "0.38.0" }
syn = { version = "2" }
synstructure = { version = "0.13.1" }
thiserror = { version = "1.0.69" }
Expand All @@ -85,21 +85,21 @@ wat = { version = "1.221.2" }

# Substrate dependencies
frame-metadata = { version = "16.0.0" }
frame-system = { version = "32.0.0", default-features = false }
frame-support = { version = "32.0.0", default-features = false }
pallet-contracts = { version = "31.0.0", default-features = false }
pallet-balances = { version = "33.0.0", default-features = false }
pallet-timestamp = { version = "31.0.0", default-features = false }
pallet-contracts-uapi = { version = "9.0.0", default-features = false }
pallet-contracts-mock-network = { version = "7.0.0", default-features = false }
sp-externalities = { version = "0.28.0", default-features = false }
sp-io = { version = "34.0.0", default-features = false }
sp-runtime-interface = { version = "27.0.0" }
sp-core = { version = "32.0.0", default-features = false }
sp-keyring = { version = "35.0.0", default-features = false }
sp-runtime = { version = "35.0.0", default-features = false }
frame-system = { version = "38.0.0", default-features = false }
frame-support = { version = "38.0.0", default-features = false }
pallet-contracts = { version = "38.0.0", default-features = false }
pallet-balances = { version = "39.0.0", default-features = false }
pallet-timestamp = { version = "37.0.0", default-features = false }
pallet-contracts-uapi = { version = "12.0.0", default-features = false }
pallet-contracts-mock-network = { version = "14.0.0", default-features = false }
sp-externalities = { version = "0.29.0", default-features = false }
sp-io = { version = "38.0.0", default-features = false }
sp-runtime-interface = { version = "28.0.0" }
sp-core = { version = "34.0.0", default-features = false }
sp-keyring = { version = "39.0.0", default-features = false }
sp-runtime = { version = "39.0.2", default-features = false }
sp-weights = { version = "31.0.0", default-features = false }
xcm = { package = "staging-xcm", version = "11.0.0", default-features = false }
xcm = { package = "staging-xcm", version = "14.2.0", default-features = false }

# Local dependencies
ink = { version = "=5.1.0", path = "crates/ink", default-features = false }
Expand Down
3 changes: 1 addition & 2 deletions crates/e2e/sandbox/src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ mod construct_runtime {
type AddressGenerator = $crate::pallet_contracts::DefaultAddressGenerator;
type MaxCodeLen = ConstU32<{ 123 * 1024 }>;
type MaxStorageKeyLen = ConstU32<128>;
type MaxTransientStorageSize = ConstU32<{ 1024 * 1024 }>;
type UnsafeUnstableInterface = ConstBool<false>;
type UploadOrigin = $crate::frame_system::EnsureSigned<Self::AccountId>;
type InstantiateOrigin = $crate::frame_system::EnsureSigned<Self::AccountId>;
Expand Down Expand Up @@ -314,8 +315,6 @@ mod construct_runtime {
Default::default(),
);
}


}
}

Expand Down
6 changes: 3 additions & 3 deletions crates/e2e/src/sandbox_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ use std::{
};
use subxt::{
dynamic::Value,
tx::TxPayload,
tx::Payload,
};
use subxt_signer::sr25519::Keypair;

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

Keypair::from_seed(seed).expect("Failed to create keypair")
Keypair::from_secret_key(seed).expect("Failed to create keypair")
}

async fn free_balance(
Expand Down Expand Up @@ -547,7 +547,7 @@ pub mod preset {

fn take_snapshot(&mut self) -> Snapshot {
EXT_PARAA.with(|v| {
let v = v.borrow();
let mut v = v.borrow_mut();
let mut backend = v.as_backend().clone();
let raw_key_values = backend
.backend_storage_mut()
Expand Down
12 changes: 6 additions & 6 deletions crates/e2e/src/xts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ where
dest: C::AccountId,
value: E::Balance,
) -> Result<(), subxt::Error> {
let call = subxt::tx::Payload::new(
let call = subxt::tx::DefaultPayload::new(
"Balances",
"transfer_allow_death",
Transfer::<E, C> {
Expand Down Expand Up @@ -311,7 +311,7 @@ where
signer: &Keypair,
) -> ExtrinsicEvents<C>
where
Call: subxt::tx::TxPayload,
Call: subxt::tx::Payload,
{
let account_id = <Keypair as Signer<C>>::account_id(signer);
let account_nonce =
Expand Down Expand Up @@ -418,7 +418,7 @@ where
salt: Vec<u8>,
signer: &Keypair,
) -> ExtrinsicEvents<C> {
let call = subxt::tx::Payload::new(
let call = subxt::tx::DefaultPayload::new(
"Contracts",
"instantiate_with_code",
InstantiateWithCode::<E> {
Expand Down Expand Up @@ -471,7 +471,7 @@ where
code: Vec<u8>,
storage_deposit_limit: Option<E::Balance>,
) -> ExtrinsicEvents<C> {
let call = subxt::tx::Payload::new(
let call = subxt::tx::DefaultPayload::new(
"Contracts",
"upload_code",
UploadCode::<E> {
Expand All @@ -494,7 +494,7 @@ where
signer: &Keypair,
code_hash: E::Hash,
) -> ExtrinsicEvents<C> {
let call = subxt::tx::Payload::new(
let call = subxt::tx::DefaultPayload::new(
"Contracts",
"remove_code",
RemoveCode::<E> { code_hash },
Expand Down Expand Up @@ -547,7 +547,7 @@ where
data: Vec<u8>,
signer: &Keypair,
) -> ExtrinsicEvents<C> {
let call = subxt::tx::Payload::new(
let call = subxt::tx::DefaultPayload::new(
"Contracts",
"call",
Call::<E> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
Arc<T>
Box<T>
Rc<T>
sp_core::Bytes
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`
note: required by a bound in `DispatchInput`
--> src/codegen/dispatch/type_check.rs
Expand All @@ -30,6 +31,7 @@ error[E0277]: the trait bound `NonCodecType: ink::parity_scale_codec::Decode` is
Arc<T>
Box<T>
Rc<T>
sp_core::Bytes
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`

error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
Expand All @@ -52,7 +54,7 @@ error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
Rc<T>
String
Vec<T>
ink::parity_scale_codec::Ref<'a, T, U>
and $N others
= note: required for `NonCodecType` to implement `Encode`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ error[E0277]: the trait bound `contract::Error: WrapperTypeDecode` is not satisf
Arc<T>
Box<T>
Rc<T>
sp_core::Bytes
= note: required for `contract::Error` to implement `ink::parity_scale_codec::Decode`
= note: required for `Result<ContractRef, contract::Error>` to implement `ConstructorReturnType<ContractRef>`
note: required by a bound in `CreateBuilder::<E, ContractRef, CodeHash, Limits, Endowment, Args, Salt, Unset<ReturnType<()>>>::returns`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeDecode` is not satisfied
Arc<T>
Box<T>
Rc<T>
sp_core::Bytes
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`
note: required by a bound in `DispatchInput`
--> src/codegen/dispatch/type_check.rs
Expand All @@ -28,6 +29,7 @@ error[E0277]: the trait bound `NonCodecType: ink::parity_scale_codec::Decode` is
Arc<T>
Box<T>
Rc<T>
sp_core::Bytes
= note: required for `NonCodecType` to implement `ink::parity_scale_codec::Decode`

error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
Expand All @@ -48,7 +50,7 @@ error[E0277]: the trait bound `NonCodecType: Encode` is not satisfied
Rc<T>
String
Vec<T>
ink::parity_scale_codec::Ref<'a, T, U>
and $N others
= note: required for `NonCodecType` to implement `Encode`
note: required by a bound in `ExecutionInput::<ArgumentList<ArgumentListEnd, ArgumentListEnd>>::push_arg`
--> $WORKSPACE/crates/env/src/call/execution.rs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ error[E0277]: the trait bound `NonCodecType: WrapperTypeEncode` is not satisfied
Rc<T>
String
Vec<T>
ink::parity_scale_codec::Ref<'a, T, U>
and $N others
= note: required for `NonCodecType` to implement `Encode`
note: required by a bound in `DispatchOutput`
--> src/codegen/dispatch/type_check.rs
Expand Down Expand Up @@ -57,7 +57,7 @@ error[E0599]: the method `try_invoke` exists for struct `CallBuilder<DefaultEnvi
`NonCodecType: WrapperTypeDecode`
which is required by `NonCodecType: ink::parity_scale_codec::Decode`
note: the trait `WrapperTypeDecode` must be implemented
--> $CARGO/parity-scale-codec-3.7.0/src/codec.rs
--> $CARGO/parity-scale-codec-3.6.12/src/codec.rs
|
| pub trait WrapperTypeDecode: Sized {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Loading

0 comments on commit 3af8674

Please sign in to comment.