Time Travel to Right Before Error Occurs

Launch Debugger Directly From Failed Tests

sCrypt
2 min readDec 20, 2020

sCrypt IDE v0.4.13 lets you launch a debugger that stops right at where sCrypt test fails. This will help developers to locate contract bugs tremendously.

Previously, when a test fails using the sCrypt testing framework, error message only shows where it fails in JavaScript/TypeScript code. If a user has to find out where it fails inside the sCrypt code, he has to print out debug arguments, copy and paste them into launch.json, which is a laborious and error-prone process.

Launch Debugger Right From a Failed sCrypt Test

In the latest IDE, when a test fails, there are two additional lines in the error message.

  • Go to Source: it shows which line fails inside sCrypt code and also the last opcode executed. Right clicking on the link will take you directly to the offending line.
  • Launch Debugger: Right clicking on the link will directly launch a debugger session, based on arguments in the test. The debugger will pause right before the error about to occur, allowing inspection of what caused the failure.
Debug Info in Output

Happy debugging!

--

--

sCrypt
sCrypt

Written by sCrypt

sCrypt (https://scrypt.io) is a web3 development platform specialized in UTXO-blockchains like Bitcoin

No responses yet