Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Merge branch 'master' into ao-past-session-slashing-companion
Browse files Browse the repository at this point in the history
* master:
  fix typo (#2635)
  Companion for: Substrate#13869 (#2631)
  Bump clap from 4.2.7 to 4.3.0 (#2634)
  Update & revamp e2e tests (#2614)
  • Loading branch information
ordian committed May 25, 2023
2 parents 8c24f90 + aa147f0 commit 625eeb5
Show file tree
Hide file tree
Showing 45 changed files with 689 additions and 835 deletions.
539 changes: 272 additions & 267 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bridges/bin/runtime-common/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ impl pallet_balances::Config for TestRuntime {
type MaxLocks = ConstU32<50>;
type MaxReserves = ConstU32<50>;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/messages/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl pallet_balances::Config for TestRuntime {
type WeightInfo = ();
type MaxReserves = ();
type ReserveIdentifier = ();
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion bridges/modules/relayers/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ impl pallet_balances::Config for TestRuntime {
type WeightInfo = ();
type MaxReserves = ConstU32<1>;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion client/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Parity Technologies <admin@parity.io>"]
edition = "2021"

[dependencies]
clap = { version = "4.2.7", features = ["derive"] }
clap = { version = "4.3.0", features = ["derive"] }
codec = { package = "parity-scale-codec", version = "3.0.0" }
url = "2.3.1"

Expand Down
21 changes: 10 additions & 11 deletions client/network/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,13 @@ impl BlockAnnounceData {
///
/// This will not check the signature, for this you should use [`BlockAnnounceData::check_signature`].
fn validate(&self, encoded_header: Vec<u8>) -> Result<(), Validation> {
let candidate_hash = if let CompactStatement::Seconded(h) =
self.statement.unchecked_payload()
{
h
} else {
tracing::debug!(target: LOG_TARGET, "`CompactStatement` isn't the candidate variant!",);
return Err(Validation::Failure { disconnect: true })
};
let candidate_hash =
if let CompactStatement::Seconded(h) = self.statement.unchecked_payload() {
h
} else {
tracing::debug!(target: LOG_TARGET, "`CompactStatement` isn't the candidate variant!",);
return Err(Validation::Failure { disconnect: true })
};

if *candidate_hash != self.receipt.hash() {
tracing::debug!(
Expand Down Expand Up @@ -334,9 +333,9 @@ where
let relay_chain_is_syncing = relay_chain_interface
.is_major_syncing()
.await
.map_err(|e| {
tracing::error!(target: LOG_TARGET, "Unable to determine sync status. {}", e)
})
.map_err(
|e| tracing::error!(target: LOG_TARGET, "Unable to determine sync status. {}", e),
)
.unwrap_or(false);

if relay_chain_is_syncing {
Expand Down
2 changes: 1 addition & 1 deletion pallets/collator-selection/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl pallet_balances::Config for Test {
type MaxLocks = ();
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion pallets/xcmp-queue/src/mock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ impl pallet_balances::Config for Test {
type MaxLocks = ();
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ edition = "2021"
build = "build.rs"

[dependencies]
clap = { version = "4.2.7", features = ["derive"] }
clap = { version = "4.3.0", features = ["derive"] }
log = "0.4.17"
codec = { package = "parity-scale-codec", version = "3.0.0" }
serde = { version = "1.0.163", features = ["derive"] }
Expand Down
2 changes: 1 addition & 1 deletion parachain-template/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ impl pallet_balances::Config for Runtime {
type WeightInfo = pallet_balances::weights::SubstrateWeight<Runtime>;
type MaxReserves = ConstU32<50>;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<0>;
type MaxFreezes = ConstU32<0>;
Expand Down
2 changes: 1 addition & 1 deletion parachains/common/src/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ mod tests {
type WeightInfo = ();
type MaxReserves = MaxReserves;
type ReserveIdentifier = [u8; 8];
type HoldIdentifier = ();
type RuntimeHoldReason = RuntimeHoldReason;
type FreezeIdentifier = ();
type MaxHolds = ConstU32<1>;
type MaxFreezes = ConstU32<1>;
Expand Down
51 changes: 21 additions & 30 deletions parachains/integration-tests/e2e/assets/statemine/0_xcm/0_init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ settings:
paraId: &pp_id 2000
variables:
common:
xcm_version: &xcm_version '3'
xcm_version: &xcm_version 3
require_weight_at_most: &weight_at_most {refTime: 1000000000, proofSize: 200000}
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
relay_chain:
signer: &rc_signer //Alice
Expand Down Expand Up @@ -56,13 +57,9 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.SupportedVersionChanged
attributes:
- type: u32
value: *xcm_version
result: [{ parents: 0, interior: { X1: { Parachain: *ap_id }}}, *xcm_version ]
- extrinsics: # Relay Chain sets supported version for Penpal Parachain
- chain: *relay_chain
sudo: true
Expand All @@ -82,13 +79,9 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.SupportedVersionChanged
attributes:
- type: u32
value: *xcm_version
result: [{ parents: 0, interior: { X1: { Parachain: *pp_id }}}, *xcm_version ]
- extrinsics: # Asset Parachain sets supported version for Relay Chain through it
- chain: *relay_chain
signer: *rc_signer
Expand All @@ -101,11 +94,11 @@ tests:
v3: [ #message
{
UnpaidExecution: {
weightLimit: {
limited: {
refTime: 2200000000,
proofSize: 200000
}
weightLimit: {
limited: {
refTime: 2200000000,
proofSize: 200000
}
}
}
},
Expand All @@ -121,15 +114,17 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '1,019,210,000', proofSize: '200,000' }}
}
- name: polkadotXcm.SupportedVersionChanged
chain: *assets_parachain
attributes:
- type: u32
value: *xcm_version
result: [{ parents: 1, interior: Here }, *xcm_version ]
- extrinsics: # Penpal Parachain sets supported version for Relay Chain
- chain: *penpal_parachain
signer: *pp_signer
Expand All @@ -145,10 +140,6 @@ tests:
]
events:
- name: sudo.Sudid
attributes:
- type: Result<Null, SpRuntimeDispatchError>
value: Ok
result: { sudoResult: Ok }
- name: polkadotXcm.SupportedVersionChanged
attributes:
- type: u32
value: *xcm_version
result: [{ parents: 1, interior: Here }, *xcm_version ]
78 changes: 39 additions & 39 deletions parachains/integration-tests/e2e/assets/statemine/0_xcm/1_dmp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,23 @@ settings:
wsPort: 9910
paraId: &ap_id 1000
variables:
relay_chain:
signer: &rc_signer //Alice
wallet: &rc_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
assets_parachain_destination: &ap_dest { v3: { parents: 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_account: &ap_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
assets_parachain_beneficiary: &ap_benf {v3: { parents: 0, interior: { x1: { accountId32: { id: *ap_acc }}}}}
ksm: &rc_ksm { concrete: { parents: 0, interior: { here: true }}}
amount: &amount 1000000000000
ksm_fungible: &rc_ksm_fungible { id: *rc_ksm, fun: { fungible: *amount }}
require_weight_at_most: &rc_weight_at_most {refTime: 1000000000, proofSize: 200000}
assets_parachain_account:
wallet: &ap_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
asset_id: &asset_id 1
asset_min_balance: &asset_ed 1000
common:
weight_threshold: &weight_threshold { refTime: [10, 10], proofSize: [10, 10] }
chains:
relay_chain:
signer: &rc_signer //Alice
wallet: &rc_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
assets_parachain_destination: &ap_dest { v3: { parents: 0, interior: { x1: { parachain: *ap_id }}}}
assets_parachain_account: &ap_acc '0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d'
assets_parachain_beneficiary: &ap_benf { v3: { parents: 0, interior: { x1: { accountId32: { id: *ap_acc }}}}}
ksm: &rc_ksm { concrete: { parents: 0, interior: { here: true }}}
amount: &amount 1000000000000
ksm_fungible: &rc_ksm_fungible { id: *rc_ksm, fun: { fungible: *amount }}
require_weight_at_most: &rc_weight_at_most { refTime: 1000000000, proofSize: 200000 }
assets_parachain_account:
wallet: &ap_wallet HNZata7iMYWmk5RvZRTiAsSDhV8366zq2YGb3tLH5Upf74F
asset_id: &asset_id 1
asset_min_balance: &asset_ed 1000
decodedCalls:
force_create_asset:
chain: *assets_parachain
Expand Down Expand Up @@ -69,16 +72,14 @@ tests:
]
events:
- name: xcmPallet.Attempted
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: *weight_threshold
result: [{ Complete: { refTime: '764,772,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: [10, 10]
value: {"refTime":"162,379,000","proofSize":"0"}
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '166,944,000', proofSize: 0 }}
}
- queries:
balance_rc_sender_after:
chain: *relay_chain
Expand Down Expand Up @@ -151,11 +152,10 @@ tests:
- name: xcmPallet.Sent
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: [10, 10]
value: {"refTime":"1,014,103,000","proofSize":"200,000"}
threshold: *weight_threshold
result: {
outcome: { Complete: { refTime: '1,014,103,000', proofSize: '200,000' }}
}
- queries:
forced_created_asset:
chain: *assets_parachain
Expand Down Expand Up @@ -196,9 +196,7 @@ tests:
]
events:
- name: system.ExtrinsicFailed
attributes:
- type: SpRuntimeDispatchError
value: BadOrigin
result: { dispatchError: BadOrigin }

- name: xcmPallet.limitedReserveTransferAssets
before: *before_get_balances
Expand All @@ -219,17 +217,19 @@ tests:
]
events:
- name: xcmPallet.Attempted
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Complete
threshold: [10, 10]
value: {"refTime":"750,645,000","proofSize":"0"}
threshold: *weight_threshold
result: [{ Complete: { refTime: '750,645,000', proofSize: 0 }}]
- name: dmpQueue.ExecutedDownward
chain: *assets_parachain
attributes:
- type: XcmV3TraitsOutcome
xcmOutcome: Incomplete
value: [{"refTime":"1,000,000,000","proofSize":"0"},"UntrustedReserveLocation"]
threshold: *weight_threshold
result: {
outcome: {
Incomplete: [
{ refTime: '1,000,000,000', proofSize: 0 },
UntrustedReserveLocation
]
}
}
- queries:
balance_rc_sender_after:
chain: *relay_chain
Expand Down
Loading

0 comments on commit 625eeb5

Please sign in to comment.