mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
Fix clippy in test code (#993)
* fix clippy issues * clippy + tests * more clippy Co-authored-by: adoerr <0xad@gmx.net>
This commit is contained in:
committed by
Bastian Köcher
parent
812e782904
commit
0261d1e321
@@ -991,7 +991,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Root,
|
&Sender::Root,
|
||||||
&ThisChainBalance(1),
|
&ThisChainBalance(1),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
),
|
),
|
||||||
@@ -1001,7 +1001,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Root,
|
&Sender::Root,
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
)
|
)
|
||||||
@@ -1024,7 +1024,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Signed(ThisChainAccountId(0)),
|
&Sender::Signed(ThisChainAccountId(0)),
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
),
|
),
|
||||||
@@ -1034,7 +1034,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::None,
|
&Sender::None,
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
),
|
),
|
||||||
@@ -1044,7 +1044,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Root,
|
&Sender::Root,
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
)
|
)
|
||||||
@@ -1067,7 +1067,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Signed(ThisChainAccountId(0)),
|
&Sender::Signed(ThisChainAccountId(0)),
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
),
|
),
|
||||||
@@ -1077,7 +1077,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Signed(ThisChainAccountId(1)),
|
&Sender::Signed(ThisChainAccountId(1)),
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&test_lane_outbound_data(),
|
&test_lane_outbound_data(),
|
||||||
&payload,
|
&payload,
|
||||||
)
|
)
|
||||||
@@ -1105,7 +1105,7 @@ mod tests {
|
|||||||
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
source::FromThisChainMessageVerifier::<OnThisChainBridge>::verify_message(
|
||||||
&Sender::Root,
|
&Sender::Root,
|
||||||
&ThisChainBalance(1_000_000),
|
&ThisChainBalance(1_000_000),
|
||||||
&TEST_LANE_ID,
|
TEST_LANE_ID,
|
||||||
&OutboundLaneData {
|
&OutboundLaneData {
|
||||||
latest_received_nonce: 100,
|
latest_received_nonce: 100,
|
||||||
latest_generated_nonce: 100 + MAXIMAL_PENDING_MESSAGES_AT_TEST_LANE + 1,
|
latest_generated_nonce: 100 + MAXIMAL_PENDING_MESSAGES_AT_TEST_LANE + 1,
|
||||||
|
|||||||
@@ -214,7 +214,7 @@ impl HeaderBuilder {
|
|||||||
/// Helper function for getting a genesis header which has been signed by an authority.
|
/// Helper function for getting a genesis header which has been signed by an authority.
|
||||||
pub fn build_genesis_header(author: &SecretKey) -> AuraHeader {
|
pub fn build_genesis_header(author: &SecretKey) -> AuraHeader {
|
||||||
let genesis = HeaderBuilder::genesis();
|
let genesis = HeaderBuilder::genesis();
|
||||||
genesis.header.sign_by(&author)
|
genesis.header.sign_by(author)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Helper function for building a custom child header which has been signed by an authority.
|
/// Helper function for building a custom child header which has been signed by an authority.
|
||||||
@@ -222,7 +222,7 @@ pub fn build_custom_header<F>(author: &SecretKey, previous: &AuraHeader, customi
|
|||||||
where
|
where
|
||||||
F: FnOnce(AuraHeader) -> AuraHeader,
|
F: FnOnce(AuraHeader) -> AuraHeader,
|
||||||
{
|
{
|
||||||
let new_header = HeaderBuilder::with_parent(&previous);
|
let new_header = HeaderBuilder::with_parent(previous);
|
||||||
let custom_header = customize_header(new_header.header);
|
let custom_header = customize_header(new_header.header);
|
||||||
custom_header.sign_by(author)
|
custom_header.sign_by(author)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -396,7 +396,7 @@ mod tests {
|
|||||||
fn verify_with_config(config: &AuraConfiguration, header: &AuraHeader) -> Result<ImportContext<AccountId>, Error> {
|
fn verify_with_config(config: &AuraConfiguration, header: &AuraHeader) -> Result<ImportContext<AccountId>, Error> {
|
||||||
run_test_with_genesis(genesis(), TOTAL_VALIDATORS, |_| {
|
run_test_with_genesis(genesis(), TOTAL_VALIDATORS, |_| {
|
||||||
let storage = BridgeStorage::<TestRuntime>::new();
|
let storage = BridgeStorage::<TestRuntime>::new();
|
||||||
verify_aura_header(&storage, &config, None, header, &ConstChainTime::default())
|
verify_aura_header(&storage, config, None, header, &ConstChainTime::default())
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -787,7 +787,7 @@ mod tests {
|
|||||||
fn pool_verifies_future_block_number() {
|
fn pool_verifies_future_block_number() {
|
||||||
// when header is too far from the future
|
// when header is too far from the future
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
default_accept_into_pool(|validators| (HeaderBuilder::with_number(100).sign_by_set(&validators), None),),
|
default_accept_into_pool(|validators| (HeaderBuilder::with_number(100).sign_by_set(validators), None),),
|
||||||
Err(Error::UnsignedTooFarInTheFuture),
|
Err(Error::UnsignedTooFarInTheFuture),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -800,7 +800,7 @@ mod tests {
|
|||||||
default_accept_into_pool(|validators| (
|
default_accept_into_pool(|validators| (
|
||||||
HeaderBuilder::with_parent_number(3)
|
HeaderBuilder::with_parent_number(3)
|
||||||
.step(GENESIS_STEP + 3)
|
.step(GENESIS_STEP + 3)
|
||||||
.sign_by_set(&validators),
|
.sign_by_set(validators),
|
||||||
None,
|
None,
|
||||||
),),
|
),),
|
||||||
Err(Error::DoubleVote),
|
Err(Error::DoubleVote),
|
||||||
|
|||||||
Reference in New Issue
Block a user