Skip to content

Commit

Permalink
Use u64 since U256 was not deserialized correctly from config
Browse files Browse the repository at this point in the history
  • Loading branch information
m30m committed May 22, 2024
1 parent 45a22d3 commit d1c1c40
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion apps/fortuna/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub struct EthereumConfig {
pub confirmed_block_status: BlockStatus,

/// The gas limit to use for entropy callback transactions.
pub gas_limit: U256,
pub gas_limit: u64,
}

#[derive(Args, Clone, Debug)]
Expand Down
5 changes: 3 additions & 2 deletions apps/fortuna/src/keeper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,14 +228,15 @@ pub async fn run_keeper_threads(
let fulfilled_requests_cache = Arc::new(RwLock::new(HashMap::<u64, RequestState>::new()));

// Spawn a thread to handle the events from last BACKLOG_RANGE blocks.
let gas_limit: U256 = chain_eth_config.gas_limit.into();
spawn(
process_backlog(
BlockRange {
from: latest_safe_block.saturating_sub(BACKLOG_RANGE),
to: latest_safe_block,
},
contract.clone(),
chain_eth_config.gas_limit,
gas_limit,
chain_state.clone(),
keeper_metrics.clone(),
fulfilled_requests_cache.clone(),
Expand All @@ -260,7 +261,7 @@ pub async fn run_keeper_threads(
chain_state.clone(),
rx,
Arc::clone(&contract),
chain_eth_config.gas_limit,
gas_limit,
keeper_metrics.clone(),
fulfilled_requests_cache.clone(),
)
Expand Down
1 change: 1 addition & 0 deletions apps/fortuna/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
use {
anyhow::Result,
clap::Parser,
ethers::types::U256,
std::io::IsTerminal,
};

Expand Down

0 comments on commit d1c1c40

Please sign in to comment.