-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Debugger Refactor #2: DebuggerArgs
#5753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 12 commits
07468d2
f470de9
e016eaa
78dca6a
15e4709
4b40bc3
e9f8942
29aa8ab
f41cf33
7818767
0058201
466d24a
7b71916
d336bfe
c6a66fb
17ddabc
0aec987
b513de3
9663c2b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,7 +17,7 @@ use futures::{ | |
| }; | ||
| use std::{ | ||
| borrow::Cow, | ||
| collections::BTreeMap, | ||
| collections::{BTreeMap, HashMap}, | ||
| pin::Pin, | ||
| sync::{ | ||
| atomic::{AtomicBool, Ordering}, | ||
|
|
@@ -60,10 +60,14 @@ impl EtherscanIdentifier { | |
| /// Etherscan and compiles them locally, for usage in the debugger. | ||
| pub async fn get_compiled_contracts( | ||
| &self, | ||
| ) -> eyre::Result<(BTreeMap<ArtifactId, String>, BTreeMap<ArtifactId, ContractBytecodeSome>)> | ||
| { | ||
| ) -> eyre::Result<( | ||
| // TODO should use `ContractSources` but has circular import. | ||
|
franfrandev marked this conversation as resolved.
Outdated
|
||
| // Maybe move it lower | ||
| HashMap<String, HashMap<u32, (String, ContractBytecodeSome)>>, | ||
| BTreeMap<ArtifactId, ContractBytecodeSome>, | ||
| )> { | ||
| let mut compiled_contracts = BTreeMap::new(); | ||
| let mut sources = BTreeMap::new(); | ||
| let mut sources = HashMap::new(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This shuffles ordering—is ordering an issue here?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need ordering, so there should be better performances with a |
||
|
|
||
| // TODO: Add caching so we dont double-fetch contracts. | ||
| let contracts_iter = self | ||
|
|
@@ -90,9 +94,10 @@ impl EtherscanIdentifier { | |
| // construct the map | ||
| for (results, (_, metadata)) in artifacts.into_iter().zip(contracts_iter) { | ||
| // get the inner type | ||
| let (artifact_id, bytecode) = results?; | ||
| compiled_contracts.insert(artifact_id.clone(), bytecode); | ||
| sources.insert(artifact_id, metadata.source_code()); | ||
| let (artifact_id, file_id, bytecode) = results?; | ||
| compiled_contracts.insert(artifact_id.clone(), bytecode.clone()); | ||
| let inner_map = sources.entry(artifact_id.clone().name).or_insert_with(HashMap::new); | ||
| inner_map.insert(file_id, (metadata.source_code(), bytecode)); | ||
| } | ||
|
|
||
| Ok((sources, compiled_contracts)) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.