Skip to content

Commit

Permalink
Address cargo fmt check
Browse files Browse the repository at this point in the history
  • Loading branch information
darthsiroftardis committed May 13, 2024
1 parent 630d86c commit 467c36b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions types/src/legacy_sse_data/fixtures.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
use casper_types::{Block, TestBlockBuilder};
use casper_types::testing::TestRng;
use super::LegacySseData;
use crate::sse_data::SseData;
use casper_types::testing::TestRng;
use casper_types::{Block, TestBlockBuilder};

pub fn legacy_block_added() -> LegacySseData {
serde_json::from_str(RAW_LEGACY_BLOCK_ADDED).unwrap()
}

pub fn legacy_block_added_from_v2(block_added: &SseData) -> LegacySseData {
if let SseData::BlockAdded {..} = block_added {
if let SseData::BlockAdded { .. } = block_added {
LegacySseData::from(block_added).expect("did not convert to legacy see data")
}else {
} else {
panic!("did not get legacy block added sse data")
}
}
Expand All @@ -23,7 +23,10 @@ pub fn block_added_v2() -> SseData {
let mut rng = TestRng::new();
let block = Box::new(Block::V2(TestBlockBuilder::new().build(&mut rng)));
let block_hash = block.hash();
let block_added = SseData::BlockAdded {block_hash: block_hash.clone(), block};
let block_added = SseData::BlockAdded {
block_hash: block_hash.clone(),
block,
};
let str = serde_json::to_string(&block_added).expect("must get string");
serde_json::from_str(&str).unwrap()
}
Expand Down

0 comments on commit 467c36b

Please sign in to comment.