Skip to content

Commit

Permalink
Merge pull request #2 from TheWaWaR/support-ckb2021
Browse files Browse the repository at this point in the history
chore: support ckb2021
  • Loading branch information
TheWaWaR authored Sep 1, 2021
2 parents 3971ba1 + bdd9ce2 commit 44ae650
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "ckb-x64-simulator"
description = "A simulator that allows running CKB smart contracts on x64 environment for tooling benefits"
version = "0.4.0"
version = "0.5.0"
license = "MIT"
authors = ["Nervos Core Dev <dev@nervos.org>"]
edition = "2018"
Expand All @@ -13,9 +13,9 @@ crate-type = ["lib", "staticlib", "cdylib"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
ckb-standalone-debugger = "0.3.0"
ckb-types = "0.37.0"
faster-hex = "0.4.1"
ckb-standalone-debugger = "0.20.0-rc3"
ckb-types = "0.100.0-rc2"
faster-hex = "0.6"
lazy_static = "1.4"
serde = "1.0"
serde_derive = "1.0"
Expand Down
5 changes: 3 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ pub extern "C" fn ckb_dlopen2(
let mut buffer = vec![];
buffer.extend_from_slice(dep_cell_hash);
buffer.push(hash_type);
let key = format!("0x{}", faster_hex::hex_string(&buffer).expect("faster hex"));
let key = format!("0x{}", faster_hex::hex_string(&buffer));
let filename = SETUP
.native_binaries
.get(&key)
Expand Down Expand Up @@ -596,5 +596,6 @@ fn store_data(ptr: *mut c_void, len: *mut u64, offset: u64, data: &[u8]) {
let full_size = data_len - offset;
let real_size = std::cmp::min(size, full_size);
*size_ptr = full_size;
buffer[..real_size as usize].copy_from_slice(&data[offset as usize..(offset + real_size) as usize]);
buffer[..real_size as usize]
.copy_from_slice(&data[offset as usize..(offset + real_size) as usize]);
}

0 comments on commit 44ae650

Please sign in to comment.