mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 07:01:05 +00:00
Move CI from GitHub Actions to GitLab (#814)
* CI: do not trust this CI 1 * CI: don't want to trigger unneded statuses * CI: debug 1 * CI: new CI * CI: temp allow failure * CI: exclude paths * doc: check if docs won't trigger pipelines * doc: check hybrid changes pipeline * doc: do not push excluded files together with others * CI: undebug fmt * CI: better deny * CI: fix deny and spellcheck * CI: global backtrace * CI: deny config * CI: publishing * Dockerfile: metadata fix [skip ci] * CI: revert me * CI: debug bash * CI: mv ci.Dockerfile; fix buildah bug * CI: fix artifact name * Dockerfile: fix context * CI: separate deny check licenses * CI: when to run * CI: unneded stuff in these Dockerfiles * CI: merged test-refs and build-refs * CI: test-build optimizations * CI: changes, web, scheduled pipelines now work as intended * CI: use tested production CI image * CI: substitute GHA * Fix clippy. * Moar clippy fixes. * Fix more. * Finally fix all? Co-authored-by: Tomasz Drwięga <tomasz@parity.io>
This commit is contained in:
committed by
Bastian Köcher
parent
700d63672b
commit
0b7f40a371
@@ -23,6 +23,8 @@
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
#![warn(missing_docs)]
|
||||
// Generated by `decl_event!`
|
||||
#![allow(clippy::unused_unit)]
|
||||
|
||||
use bp_message_dispatch::{CallOrigin, MessageDispatch, MessagePayload, SpecVersion, Weight};
|
||||
use bp_runtime::{derive_account_id, ChainId, SourceAccount};
|
||||
|
||||
@@ -1381,15 +1381,12 @@ pub(crate) mod tests {
|
||||
fn verify_transaction_finalized_works_for_best_finalized_header() {
|
||||
run_test_with_genesis(example_header(), TOTAL_VALIDATORS, |_| {
|
||||
let storage = BridgeStorage::<TestRuntime>::new();
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
),
|
||||
true,
|
||||
);
|
||||
assert!(verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1400,15 +1397,12 @@ pub(crate) mod tests {
|
||||
insert_header(&mut storage, example_header_parent());
|
||||
insert_header(&mut storage, example_header());
|
||||
storage.finalize_and_prune_headers(Some(example_header().compute_id()), 0);
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header_parent().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
),
|
||||
true,
|
||||
);
|
||||
assert!(verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header_parent().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1416,10 +1410,12 @@ pub(crate) mod tests {
|
||||
fn verify_transaction_finalized_rejects_proof_with_missing_tx() {
|
||||
run_test_with_genesis(example_header(), TOTAL_VALIDATORS, |_| {
|
||||
let storage = BridgeStorage::<TestRuntime>::new();
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(&storage, example_header().compute_hash(), 1, &[],),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
1,
|
||||
&[],
|
||||
),);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1427,10 +1423,12 @@ pub(crate) mod tests {
|
||||
fn verify_transaction_finalized_rejects_unknown_header() {
|
||||
run_test(TOTAL_VALIDATORS, |_| {
|
||||
let storage = BridgeStorage::<TestRuntime>::new();
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(&storage, example_header().compute_hash(), 1, &[],),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
1,
|
||||
&[],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1440,15 +1438,12 @@ pub(crate) mod tests {
|
||||
let mut storage = BridgeStorage::<TestRuntime>::new();
|
||||
insert_header(&mut storage, example_header_parent());
|
||||
insert_header(&mut storage, example_header());
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1464,15 +1459,12 @@ pub(crate) mod tests {
|
||||
insert_header(&mut storage, example_header());
|
||||
insert_header(&mut storage, finalized_header_sibling);
|
||||
storage.finalize_and_prune_headers(Some(example_header().compute_id()), 0);
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
finalized_header_sibling_hash,
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
finalized_header_sibling_hash,
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1488,15 +1480,12 @@ pub(crate) mod tests {
|
||||
insert_header(&mut storage, finalized_header_uncle);
|
||||
insert_header(&mut storage, example_header());
|
||||
storage.finalize_and_prune_headers(Some(example_header().compute_id()), 0);
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
finalized_header_uncle_hash,
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
finalized_header_uncle_hash,
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(true))],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1504,18 +1493,15 @@ pub(crate) mod tests {
|
||||
fn verify_transaction_finalized_rejects_invalid_transactions_in_proof() {
|
||||
run_test_with_genesis(example_header(), TOTAL_VALIDATORS, |_| {
|
||||
let storage = BridgeStorage::<TestRuntime>::new();
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[
|
||||
(example_tx(), example_tx_receipt(true)),
|
||||
(example_tx(), example_tx_receipt(true))
|
||||
],
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[
|
||||
(example_tx(), example_tx_receipt(true)),
|
||||
(example_tx(), example_tx_receipt(true))
|
||||
],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1523,15 +1509,12 @@ pub(crate) mod tests {
|
||||
fn verify_transaction_finalized_rejects_invalid_receipts_in_proof() {
|
||||
run_test_with_genesis(example_header(), TOTAL_VALIDATORS, |_| {
|
||||
let storage = BridgeStorage::<TestRuntime>::new();
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), vec![42])],
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), vec![42])],
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1539,15 +1522,12 @@ pub(crate) mod tests {
|
||||
fn verify_transaction_finalized_rejects_failed_transaction() {
|
||||
run_test_with_genesis(example_header_with_failed_receipt(), TOTAL_VALIDATORS, |_| {
|
||||
let storage = BridgeStorage::<TestRuntime>::new();
|
||||
assert_eq!(
|
||||
verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header_with_failed_receipt().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(false))],
|
||||
),
|
||||
false,
|
||||
);
|
||||
assert!(!verify_transaction_finalized(
|
||||
&storage,
|
||||
example_header_with_failed_receipt().compute_hash(),
|
||||
0,
|
||||
&[(example_tx(), example_tx_receipt(false))],
|
||||
));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -693,7 +693,7 @@ mod tests {
|
||||
CurrentAuthoritySet::<TestRuntime>::get().authorities,
|
||||
init_data.authority_list
|
||||
);
|
||||
assert_eq!(IsHalted::<TestRuntime>::get(), false);
|
||||
assert!(!IsHalted::<TestRuntime>::get());
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -291,23 +291,17 @@ mod tests {
|
||||
));
|
||||
}
|
||||
// Fails to dispatch new message from different than latest relayer.
|
||||
assert_eq!(
|
||||
false,
|
||||
lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_A + max_nonce + 1,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
)
|
||||
);
|
||||
assert!(!lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_A + max_nonce + 1,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
));
|
||||
// Fails to dispatch new messages from latest relayer. Prevents griefing attacks.
|
||||
assert_eq!(
|
||||
false,
|
||||
lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_A + max_nonce,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
)
|
||||
);
|
||||
assert!(!lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_A + max_nonce,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -324,23 +318,17 @@ mod tests {
|
||||
));
|
||||
}
|
||||
// Fails to dispatch new message from different than latest relayer.
|
||||
assert_eq!(
|
||||
false,
|
||||
lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_B,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
)
|
||||
);
|
||||
assert!(!lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_B,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
));
|
||||
// Fails to dispatch new messages from latest relayer.
|
||||
assert_eq!(
|
||||
false,
|
||||
lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_A,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
)
|
||||
);
|
||||
assert!(!lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_A,
|
||||
max_nonce + 1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -379,10 +367,11 @@ mod tests {
|
||||
1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
));
|
||||
assert_eq!(
|
||||
false,
|
||||
lane.receive_message::<TestMessageDispatch>(TEST_RELAYER_B, 1, message_data(REGULAR_PAYLOAD).into())
|
||||
);
|
||||
assert!(!lane.receive_message::<TestMessageDispatch>(
|
||||
TEST_RELAYER_B,
|
||||
1,
|
||||
message_data(REGULAR_PAYLOAD).into()
|
||||
));
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,8 @@
|
||||
//! or some benchmarks assumptions are broken for your runtime.
|
||||
|
||||
#![cfg_attr(not(feature = "std"), no_std)]
|
||||
// Generated by `decl_event!`
|
||||
#![allow(clippy::unused_unit)]
|
||||
|
||||
pub use crate::weights_ext::{
|
||||
ensure_able_to_receive_confirmation, ensure_able_to_receive_message, ensure_weights_are_correct, WeightInfoExt,
|
||||
|
||||
Reference in New Issue
Block a user