Skip to content

Commit

Permalink
rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
colindickson committed Dec 13, 2023
1 parent d1db3e9 commit ecd06f3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 7 deletions.
15 changes: 10 additions & 5 deletions abigen-tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ mod tests {

#[macro_export]
macro_rules! assert_bytes {
($left:expr, $right:expr$(,)?) => ({
($left:expr, $right:expr$(,)?) => {{
let (left, right) = (&$left, &$right);
if !(*left == *right) {
// Delegate to `assert_eq!` for diff
assert_eq!(Hex(left).to_string(), Hex(right).to_string())
}
});
}};
}

#[test]
Expand Down Expand Up @@ -820,7 +820,8 @@ mod tests {
use tests::functions::FunInt128 as Function;

let call = pb::eth::v2::Call {
input: hex!("5b3357ff0000000000000000000000000000000000000000000000000000000000000000").to_vec(),
input: hex!("5b3357ff0000000000000000000000000000000000000000000000000000000000000000")
.to_vec(),
..Default::default()
};

Expand All @@ -837,13 +838,17 @@ mod tests {

#[test]
fn it_encode_fun_fun_int128() {
use tests::functions::FunInt128 as Function;
use substreams::scalar::BigInt;
use tests::functions::FunInt128 as Function;

let fun = Function {
arg0: BigInt::zero(),
};

assert_bytes!(fun.encode(), hex!("5b3357ff0000000000000000000000000000000000000000000000000000000000000000").to_vec());
assert_bytes!(
fun.encode(),
hex!("5b3357ff0000000000000000000000000000000000000000000000000000000000000000")
.to_vec()
);
}
}
2 changes: 1 addition & 1 deletion core/src/block_view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{pb::eth::v2 as pb, Event};
impl pb::Block {
/// Iterates over successful transactions
pub fn transactions(&self) -> impl Iterator<Item = &pb::TransactionTrace> {
self.transaction_traces.iter().filter(|tx| { tx.status == 1 })
self.transaction_traces.iter().filter(|tx| tx.status == 1)
}

/// Iterates over transaction receipts of successful transactions.
Expand Down
1 change: 0 additions & 1 deletion substreams-ethereum/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

pub use substreams_ethereum_core::scalar;
pub use substreams_ethereum_core::{block_view, pb, rpc, Event, Function, NULL_ADDRESS};
pub use substreams_ethereum_derive::EthabiContract;
Expand Down

0 comments on commit ecd06f3

Please sign in to comment.