mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 17:31:05 +00:00
Bump substrate & deps (#637)
This commit is contained in:
committed by
Bastian Köcher
parent
820407ee98
commit
58fbd8cb49
@@ -26,8 +26,6 @@ use frame_benchmarking::benchmarks_instance;
|
||||
use frame_system::RawOrigin;
|
||||
|
||||
benchmarks_instance! {
|
||||
_ { }
|
||||
|
||||
// Benchmark `import_unsigned_header` extrinsic with the best possible conditions:
|
||||
// * Parent header is finalized.
|
||||
// * New header doesn't require receipts.
|
||||
|
||||
@@ -66,6 +66,7 @@ impl frame_system::Config for TestRuntime {
|
||||
type BlockWeights = ();
|
||||
type BlockLength = ();
|
||||
type DbWeight = ();
|
||||
type SS58Prefix = ();
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
|
||||
@@ -53,7 +53,7 @@ impl HeaderBuilder {
|
||||
Self {
|
||||
header: AuraHeader {
|
||||
gas_limit: GAS_LIMIT.into(),
|
||||
seal: vec![bp_eth_poa::rlp_encode(¤t_step), vec![]],
|
||||
seal: vec![bp_eth_poa::rlp_encode(¤t_step).to_vec(), vec![]],
|
||||
..Default::default()
|
||||
},
|
||||
parent_header: Default::default(),
|
||||
@@ -95,7 +95,7 @@ impl HeaderBuilder {
|
||||
pub fn with_number(number: u64) -> Self {
|
||||
Self::with_parent(&AuraHeader {
|
||||
number: number - 1,
|
||||
seal: vec![bp_eth_poa::rlp_encode(&(number - 1)), vec![]],
|
||||
seal: vec![bp_eth_poa::rlp_encode(&(number - 1)).to_vec(), vec![]],
|
||||
..Default::default()
|
||||
})
|
||||
}
|
||||
@@ -109,7 +109,7 @@ impl HeaderBuilder {
|
||||
parent_hash: parent_header.compute_hash(),
|
||||
number: parent_header.number + 1,
|
||||
gas_limit: GAS_LIMIT.into(),
|
||||
seal: vec![bp_eth_poa::rlp_encode(¤t_step), vec![]],
|
||||
seal: vec![bp_eth_poa::rlp_encode(¤t_step).to_vec(), vec![]],
|
||||
difficulty: calculate_score(parent_step, current_step, 0),
|
||||
..Default::default()
|
||||
},
|
||||
@@ -120,7 +120,7 @@ impl HeaderBuilder {
|
||||
/// Update step of this header.
|
||||
pub fn step(mut self, step: u64) -> Self {
|
||||
let parent_step = self.parent_header.step();
|
||||
self.header.seal[0] = rlp_encode(&step);
|
||||
self.header.seal[0] = rlp_encode(&step).to_vec();
|
||||
self.header.difficulty = parent_step
|
||||
.map(|parent_step| calculate_score(parent_step, step, 0))
|
||||
.unwrap_or_default();
|
||||
|
||||
@@ -637,11 +637,11 @@ mod tests {
|
||||
assert_eq!(default_verify(&header), Err(Error::MissingStep));
|
||||
|
||||
// when step is the same as for the parent block
|
||||
header.seal[0] = rlp_encode(&42u64);
|
||||
header.seal[0] = rlp_encode(&42u64).to_vec();
|
||||
assert_eq!(default_verify(&header), Err(Error::DoubleVote));
|
||||
|
||||
// when step is OK
|
||||
header.seal[0] = rlp_encode(&43u64);
|
||||
header.seal[0] = rlp_encode(&43u64).to_vec();
|
||||
assert_ne!(default_verify(&header), Err(Error::DoubleVote));
|
||||
|
||||
// now check with validate_step check enabled
|
||||
@@ -649,12 +649,12 @@ mod tests {
|
||||
config.validate_step_transition = 0;
|
||||
|
||||
// when step is lesser that for the parent block
|
||||
header.seal[0] = rlp_encode(&40u64);
|
||||
header.seal[0] = rlp_encode(&40u64).to_vec();
|
||||
header.seal = vec![vec![40], vec![]];
|
||||
assert_eq!(verify_with_config(&config, &header), Err(Error::DoubleVote));
|
||||
|
||||
// when step is OK
|
||||
header.seal[0] = rlp_encode(&44u64);
|
||||
header.seal[0] = rlp_encode(&44u64).to_vec();
|
||||
assert_ne!(verify_with_config(&config, &header), Err(Error::DoubleVote));
|
||||
}
|
||||
|
||||
@@ -720,7 +720,7 @@ mod tests {
|
||||
|
||||
// when header signature is invalid
|
||||
let mut header = good_header.clone();
|
||||
header.seal[1] = rlp_encode(&H520::default());
|
||||
header.seal[1] = rlp_encode(&H520::default()).to_vec();
|
||||
assert_eq!(default_verify(&header), Err(Error::NotValidator));
|
||||
|
||||
// when everything is OK
|
||||
|
||||
Reference in New Issue
Block a user