Commit e0d70f5
committed
fix: propagate script errors from native-simulator instead of ignoring them
The run_simulator function was ignoring the return value from
__ckb_std_main, always returning 0 (success) regardless of whether
the contract actually failed. This made it impossible to test error
conditions when using the native-simulator feature.
Changed run_simulator to return Result<u64, ScriptError> and properly
propagate validation failures using ScriptError::validation_failure(),
which is consistent with how errors are handled in non-simulator mode.1 parent 29c24a7 commit e0d70f5
1 file changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
| |||
526 | 528 | | |
527 | 529 | | |
528 | 530 | | |
529 | | - | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
530 | 534 | | |
531 | 535 | | |
532 | 536 | | |
| |||
548 | 552 | | |
549 | 553 | | |
550 | 554 | | |
551 | | - | |
| 555 | + | |
552 | 556 | | |
553 | 557 | | |
554 | 558 | | |
| |||
632 | 636 | | |
633 | 637 | | |
634 | 638 | | |
635 | | - | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
636 | 643 | | |
637 | | - | |
| 644 | + | |
638 | 645 | | |
639 | 646 | | |
640 | 647 | | |
| |||
0 commit comments