don't actually change get_logs

this has its own edge case, but i need more tests before i trust the change
This commit is contained in:
Bryan Stitt 2023-10-29 20:35:25 -07:00
parent e682798364
commit 2724cfa95e

View File

@ -402,11 +402,12 @@ impl CacheMode {
let (block_num, change) = let (block_num, change) =
BlockNumber_to_U64(block_num, head_block.number()); BlockNumber_to_U64(block_num, head_block.number());
if change { // TODO: double check this. it scares me
// TODO: include the hash instead of the number? // if change {
trace!("changing fromBlock in eth_getLogs. {} -> {}", x, block_num); // // TODO: include the hash instead of the number?
*x = json!(block_num); // trace!("changing fromBlock in eth_getLogs. {} -> {}", x, block_num);
} // *x = json!(block_num);
// }
BlockNumOrHash::Num(block_num) BlockNumOrHash::Num(block_num)
} else { } else {
@ -425,10 +426,11 @@ impl CacheMode {
let (block_num, change) = BlockNumber_to_U64(block_num, latest_block); let (block_num, change) = BlockNumber_to_U64(block_num, latest_block);
if change { // TODO: double check this. it scares me
trace!("changing toBlock in eth_getLogs. {} -> {}", x, block_num); // if change {
*x = json!(block_num); // trace!("changing toBlock in eth_getLogs. {} -> {}", x, block_num);
} // *x = json!(block_num);
// }
if let Some(app) = app { if let Some(app) = app {
// TODO: make a jsonrpc query here? cache rates will be better but it adds a network request // TODO: make a jsonrpc query here? cache rates will be better but it adds a network request