Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
carneiro-cw committed May 23, 2024
1 parent aee5c87 commit 44f335f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/bin/relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use stratus::config::ExternalRelayerConfig;
use stratus::GlobalServices;

fn main() -> anyhow::Result<()> {
let global_services = GlobalServices::<ExternalRelayerConfig>::init();
let global_services = GlobalServices::<ExternalRelayerConfig>::init()?;
global_services.runtime.block_on(run(global_services.config))
}

Expand Down
2 changes: 1 addition & 1 deletion src/eth/primitives/transaction_mined.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct TransactionMined {

impl HashTrait for TransactionMined {
fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
self.input.hash.hash(state)
self.input.hash.hash(state);
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/eth/transaction_relayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ impl ExternalRelayer {
for (i, (tx1, set1)) in slot_conflicts.iter().sorted_by_key(|(idx, _)| **idx).enumerate() {
for (tx2, set2) in slot_conflicts.iter().sorted_by_key(|(idx, _)| **idx).skip(i + 1) {
if !set1.is_disjoint(set2) {
dag.add_edge(*node_indexes.get(&tx1).unwrap(), *node_indexes.get(&tx2).unwrap(), 1).unwrap();
dag.add_edge(*node_indexes.get(tx1).unwrap(), *node_indexes.get(tx2).unwrap(), 1).unwrap();
// todo: unwrap -> expect
}
}
Expand All @@ -206,7 +206,7 @@ impl ExternalRelayer {
for (i, (tx1, set1)) in balance_conflicts.iter().sorted_by_key(|(idx, _)| **idx).enumerate() {
for (tx2, set2) in balance_conflicts.iter().sorted_by_key(|(idx, _)| **idx).skip(i + 1) {
if !set1.is_disjoint(set2) {
dag.add_edge(*node_indexes.get(&tx1).unwrap(), *node_indexes.get(&tx2).unwrap(), 1).unwrap();
dag.add_edge(*node_indexes.get(tx1).unwrap(), *node_indexes.get(tx2).unwrap(), 1).unwrap();
// todo: unwrap -> expect
}
}
Expand Down Expand Up @@ -266,7 +266,7 @@ impl ExternalRelayer {
fn take_roots(dag: &mut StableDag<TransactionMined, i32>) -> Option<Vec<TransactionMined>> {
let mut root_indexes = vec![];
for index in dag.node_identifiers() {
if dag.parents(index).walk_next(&dag).is_none() {
if dag.parents(index).walk_next(dag).is_none() {
root_indexes.push(index);
}
}
Expand Down Expand Up @@ -435,7 +435,7 @@ mod tests {
for (test, expected) in tests.into_iter().zip(expected_results) {
let transactions = test
.into_iter()
.map(|indexes| indexes.into_iter().map(|idx| SlotIndex::from(idx)))
.map(|indexes| indexes.into_iter().map(SlotIndex::from))
.enumerate()
.map(|(i, indexes)| create_tx(indexes.collect(), i as u64))
.collect();
Expand Down

0 comments on commit 44f335f

Please sign in to comment.