mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-07 11:57:23 +00:00
Update parity-scale-codec to 2.0 (#7994)
* update cargo.toml * use 2.0 in mmmr
This commit is contained in:
committed by
GitHub
parent
bea4a6524d
commit
f48296e9ad
@@ -107,13 +107,13 @@ impl Era {
|
||||
}
|
||||
|
||||
impl Encode for Era {
|
||||
fn encode_to<T: Output>(&self, output: &mut T) {
|
||||
fn encode_to<T: Output + ?Sized>(&self, output: &mut T) {
|
||||
match self {
|
||||
Era::Immortal => output.push_byte(0),
|
||||
Era::Mortal(period, phase) => {
|
||||
let quantize_factor = (*period as u64 >> 12).max(1);
|
||||
let encoded = (period.trailing_zeros() - 1).max(1).min(15) as u16 | ((phase / quantize_factor) << 4) as u16;
|
||||
output.push(&encoded);
|
||||
encoded.encode_to(output);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user