Skip to content

Commit 09c5d69

Browse files
committed
Add load_binary_dbg and support native simulator debug
1 parent c261f84 commit 09c5d69

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

contract/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ build:
4545
fi
4646

4747
build-simulator:
48-
cd {{project-name}}-dbg && cargo build $(MODE_ARGS) && cp target/$(MODE)/*_dbg.* $(TOP)/$(BUILD_DIR)
48+
cd {{project-name}}-dbg && cargo build && cp target/debug/*_dbg.* $(TOP)/$(BUILD_DIR)
4949

5050
# test, check, clippy and fmt here are provided for completeness,
5151
# there is nothing wrong invoking cargo directly instead of make.

workspace/tests/src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,17 @@ impl Loader {
8888
}
8989
result.unwrap().into()
9090
}
91+
92+
pub fn load_binary_dbg(
93+
&self,
94+
context: &mut ckb_testtool::context::Context,
95+
name: &str,
96+
) -> Bytes {
97+
let mut path = self.0.clone();
98+
path.push(name);
99+
100+
context.load_binary(path)
101+
}
91102
}
92103

93104
// This helper method runs Context::verify_tx, but in case error happens,

0 commit comments

Comments
 (0)