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 b53fbe7
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion apps/fortuna/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apps/fortuna/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "fortuna"
version = "5.3.1"
version = "5.3.2"
edition = "2021"

[dependencies]
Expand Down
7 changes: 2 additions & 5 deletions apps/fortuna/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,7 @@ use {
Args,
Parser,
},
ethers::types::{
Address,
U256,
},
ethers::types::Address,
std::{
collections::HashMap,
fs,
Expand Down Expand Up @@ -161,7 +158,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

0 comments on commit b53fbe7

Please sign in to comment.