How to use @truffle/debugger - 3 common examples

To help you get started, we’ve selected a few @truffle/debugger examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufflesuite / truffle / packages / core / lib / debug / printer.js View on Github external
this.select = expr => {
      let selector, result;

      try {
        selector = expr
          .split(".")
          .filter(next => next.length > 0)
          .reduce((sel, next) => sel[next], selectors);
      } catch (_) {
        throw new Error("Unknown selector: %s", expr);
      }

      // throws its own exception
      result = this.session.view(selector);

      return result;
    };
github trufflesuite / truffle / packages / core / lib / debug / interpreter.js View on Github external
txSpinner.succeed();
          //if successful, change prompt
          this.setPrompt(DebugUtils.formatPrompt(this.network, cmdArgs));
        } else {
          txSpinner.fail();
          loadFailed = true;
        }
      } else {
        loadFailed = true;
        this.printer.print(
          "Please unload the current transaction before loading a new one."
        );
      }
    }
    if (cmd === "T") {
      if (this.session.view(selectors.session.status.loaded)) {
        await this.session.unload();
        this.printer.print("Transaction unloaded.");
        this.setPrompt(DebugUtils.formatPrompt(this.network));
      } else {
        this.printer.print("No transaction to unload.");
        this.printer.print("");
      }
    }

    // Check if execution has (just now) stopped.
    if (this.session.view(trace.finished) && !alreadyFinished) {
      this.printer.print("");
      //check if transaction failed
      if (!this.session.view(evm.transaction.status)) {
        this.printer.print("Transaction halted with a RUNTIME ERROR.");
        this.printer.print("");
github microsoft / vscode-azure-blockchain-ethereum / src / debugAdapter / runtimeInterface.ts View on Github external
private async generateSession(txHash: string, debuggerOptions: any) {
    const bugger = await truffleDebugger.forTx(txHash, debuggerOptions);
    return bugger.connect();
  }

@truffle/debugger

Core functionality for debugging Solidity files built with Truffle

MIT
Latest version published 1 year ago

Package Health Score

55 / 100
Full package analysis