Skip to content

Commit

Permalink
more lint
Browse files Browse the repository at this point in the history
  • Loading branch information
renancloudwalk committed Jun 2, 2024
1 parent c030674 commit 275e36e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/bin/run_with_importer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ async fn run(config: RunWithImporterConfig) -> anyhow::Result<()> {
// init services
let storage = config.storage.init().await?;
let consensus = Consensus::new(Arc::clone(&storage), Some(config.clone())).await; // in development, with no leader configured, the current node ends up being the leader
let Some((http_url, ws_url)) = consensus.get_chain_url() else { return Err(anyhow!("No chain url found")) };
let Some((http_url, ws_url)) = consensus.get_chain_url() else {
return Err(anyhow!("No chain url found"));
};
let chain = Arc::new(BlockchainClient::new_http_ws(&http_url, ws_url.as_deref(), config.online.external_rpc_timeout).await?);

let relayer = config.relayer.init().await?;
Expand Down
4 changes: 3 additions & 1 deletion src/eth/consensus/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,9 @@ impl Consensus {

pub async fn forward(&self, transaction: TransactionInput) -> anyhow::Result<Hash> {
//TODO rename to TransactionForward
let Some((http_url, _)) = self.get_chain_url() else { return Err(anyhow!("No chain url found")) };
let Some((http_url, _)) = self.get_chain_url() else {
return Err(anyhow!("No chain url found"));
};
let chain = BlockchainClient::new_http(&http_url, Duration::from_secs(2)).await?;
let forward_to = forward_to::TransactionRelayer::new(chain);
let result = forward_to.forward(transaction).await?;
Expand Down

0 comments on commit 275e36e

Please sign in to comment.