diff --git a/kinode/packages/app_store/app_store/src/lib.rs b/kinode/packages/app_store/app_store/src/lib.rs index 808f60c8..63d39a75 100644 --- a/kinode/packages/app_store/app_store/src/lib.rs +++ b/kinode/packages/app_store/app_store/src/lib.rs @@ -40,8 +40,16 @@ use ft_worker_lib::{ const ICON: &str = include_str!("icon"); const CHAIN_ID: u64 = 10; // optimism +#[cfg(feature = "simulation-mode")] +const CHAIN_ID: u64 = 31337; // local + const CONTRACT_ADDRESS: &str = "0x52185B6a6017E6f079B994452F234f7C2533787B"; // optimism +#[cfg(feature = "simulation-mode")] +const CONTRACT_ADDRESS: &str = "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6"; // local + const CONTRACT_FIRST_BLOCK: u64 = 118_590_088; +#[cfg(feature = "simulation-mode")] +const CONTRACT_FIRST_BLOCK: u64 = 1; const EVENTS: [&str; 3] = [ "AppRegistered(uint256,string,bytes,string,bytes32)", @@ -71,7 +79,6 @@ pub enum Resp { } fn fetch_logs(eth_provider: ð::Provider, filter: ð::Filter) -> Vec { - #[cfg(not(feature = "simulation-mode"))] loop { match eth_provider.get_logs(filter) { Ok(res) => return res, @@ -82,13 +89,10 @@ fn fetch_logs(eth_provider: ð::Provider, filter: ð::Filter) -> Vec break, @@ -99,7 +103,6 @@ fn subscribe_to_logs(eth_provider: ð::Provider, filter: eth::Filter) { } } } - #[cfg(not(feature = "simulation-mode"))] println!("subscribed to logs successfully"); } @@ -156,10 +159,7 @@ fn init(our: Address) { state = State::new(CONTRACT_ADDRESS.to_string()).unwrap(); } - #[cfg(not(feature = "simulation-mode"))] println!("indexing on contract address {}", state.contract_address); - #[cfg(feature = "simulation-mode")] - println!("simulation mode: not indexing packages"); // create new provider for sepolia with request-timeout of 60s // can change, log requests can take quite a long time.