Skip to content

Commit

Permalink
clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
0o-de-lally committed Dec 5, 2024
1 parent 4d60921 commit 704f6ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
12 changes: 4 additions & 8 deletions src/json_rescue_v5_extract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ pub fn extract_v5_json_rescue(
let mut unique_functions = vec![];

let mut timestamp = 0;
let mut epoch_counter = 0;
for t in txs {
let mut wtxs = WarehouseTxMaster::default();
match &t.transaction {
Expand Down Expand Up @@ -78,14 +79,9 @@ pub fn extract_v5_json_rescue(

// TODO get epoch events
t.events.iter().for_each(|e| {
// if let Some(epoch) = bcs::from_bytes::<NewEpochEventV5>(&e.data).ok() {
// warn!("new epoch event: {:?}", epoch);
// };
match &e.data {
EventDataView::NewEpoch { epoch } => {
warn!("new epoch event: {:?}", epoch);
}
_ => {}
if let EventDataView::NewEpoch { epoch } = &e.data {
warn!("new epoch event: {:?}", epoch);
epoch_counter = *epoch;
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_json_rescue_v5_parse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ fn test_json_format_example() -> anyhow::Result<()> {
let (tx, _, _) = extract_v5_json_rescue(&p)?;
let first = tx.first().unwrap();

assert!(first.sender.to_hex_literal() == "0xecaf65add1b785b0495e3099f4045ec0".to_string());
assert!(first.sender.to_hex_literal() == *"0xecaf65add1b785b0495e3099f4045ec0");
Ok(())
}

Expand Down

0 comments on commit 704f6ea

Please sign in to comment.