Skip to content

Commit

Permalink
wip: need alloy-zksync for provider?
Browse files Browse the repository at this point in the history
  • Loading branch information
dutterbutter committed Nov 20, 2024
1 parent 2a2b4b2 commit 69c7e8f
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions crates/zksync/core/src/vm/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,6 @@ where
}
/// Helper function to perform async code fetching
fn fetch_code_async(ecx: &InnerEvmContext<DB>, hash: H256) -> Option<Vec<u8>> {
// Define the async logic
// TODO: figure out provider stuff when alloy-zksync is introduced
let async_code_fetch = async {
let provider = get_http_provider("https://mainnet.era.zksync.io");
Expand All @@ -212,7 +211,6 @@ where
Some(bytecode.bytecode().to_vec())
};

// Use a Tokio runtime to block on the async task
tokio::runtime::Handle::current().block_on(async_code_fetch)
}
}
Expand Down Expand Up @@ -248,10 +246,9 @@ where
}
None
})
.unwrap_or_else(|| {
// Correctly call the static method
Self::fetch_code_async(&self.ecx, hash)
})
// TODO: figure out provider stuff when alloy-zksync is introduced
// test ??
.unwrap_or_else(|| Self::fetch_code_async(&self.ecx, hash))
})
}

Expand Down

0 comments on commit 69c7e8f

Please sign in to comment.