From 0a5f9cb5cdaf4d3616c8dc6a1f84af4ffd856b53 Mon Sep 17 00:00:00 2001 From: xhliu Date: Mon, 2 Sep 2024 15:09:25 -0700 Subject: [PATCH] Link ScriptContext debug in how-to-debug-a-contract.md --- docs/how-to-debug-a-contract.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/how-to-debug-a-contract.md b/docs/how-to-debug-a-contract.md index 517ec06ab..200610130 100644 --- a/docs/how-to-debug-a-contract.md +++ b/docs/how-to-debug-a-contract.md @@ -72,4 +72,11 @@ If you want to debug a unit test written with the [Mocha](https://mochajs.org) t :::note You need to change the contract test file name in [launch.json](https://github.com/sCrypt-Inc/boilerplate/blob/master/.vscode/launch.json#L25) if needed. -::: \ No newline at end of file +::: + +### Debug a ScriptContext Failure +One common failure is caused by ScriptContext assertions, like +```typescript +assert(this.ctx.hashOutputs == hash256(outputs), 'hashOutputs mismatch') +``` +Refer to [this guide](advanced/how-to-debug-scriptcontext.md) to debug such failures.