Skip to content
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

Support exec native simulator debug #4

Merged
merged 2 commits into from
Jul 31, 2024
Merged

Conversation

joii2020
Copy link
Contributor

No description provided.

src/context.rs Outdated
Comment on lines 475 to 496
let native_binaries = {
let mut s = String::new();

for (code_hash, path) in &self.simulator_binaries {
let buf = vec![
code_hash.as_bytes().to_vec(),
vec![0xff],
0u32.to_le_bytes().to_vec(),
0u32.to_le_bytes().to_vec(),
]
.concat();

s += &format!(
"\"0x{}\" : \"{}\",",
faster_hex::hex_string(&buf),
path.to_str().unwrap()
);
}
s.pop();

format!("{{ {} }}", s)
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggest to use iter:

let native_binaries = self.simulator_binaries
        .iter()
        .map(|(code_hash, path)| {
            let buf = vec![
                code_hash.as_bytes().to_vec(),
                vec![0xff],
                0u32.to_le_bytes().to_vec(),
                0u32.to_le_bytes().to_vec(),
            ].concat();

            format!(
                "\"0x{}\" : \"{}\"",
                faster_hex::hex_string(&buf),
                path.to_str()
            )
        })
        .collect::<Vec<String>>()
        .join(",");

* Optimize the path processing of deploy_cell_by_name
* Optimize splicing CKB_RUNNING_SETUP
@quake quake merged commit 9f0bf46 into nervosnetwork:main Jul 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants