Skip to content

Commit

Permalink
fix index out of bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Dec 18, 2024
1 parent eddca35 commit 4454b69
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions primitives/src/serde_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,9 @@ impl From<sp_runtime::Justifications> for Justifications {

impl From<Justifications> for sp_runtime::Justifications {
fn from(justifications: Justifications) -> Self {
if justifications.0.len() == 0 {
return Decode::decode(&mut justifications.encode().as_ref()).unwrap()
}
let first_justifaction = justifications.0[0].clone();
let mut sp_runtime_justifications: sp_runtime::Justifications = first_justifaction.into();
for justification in justifications.0 {
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[toolchain]
channel = "nightly-2023-05-22"
channel = "nightly-2022-10-22"
targets = ["wasm32-unknown-unknown"]
profile = "default" # include rustfmt, clippy

0 comments on commit 4454b69

Please sign in to comment.