How to use the @0x/sol-tracing-utils.getRevertTrace function in @0x/sol-tracing-utils

To help you get started, we’ve selected a few @0x/sol-tracing-utils 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 0xProject / 0x-monorepo / packages / sol-trace / src / revert_trace_subprovider.ts View on Github external
protected async _recordTxTraceAsync(address: string, data: string | undefined, txHash: string): Promise {
        await this._web3Wrapper.awaitTransactionMinedAsync(txHash, 0);
        const trace = await this._web3Wrapper.getTransactionTraceAsync(txHash, {
            disableMemory: true,
            disableStack: false,
            disableStorage: true,
        });
        const evmCallStack = getRevertTrace(trace.structLogs, address);
        if (evmCallStack.length > 0) {
            // if getRevertTrace returns a call stack it means there was a
            // revert.
            await this._printStackTraceAsync(evmCallStack);
        }
    }
    private async _printStackTraceAsync(evmCallStack: EvmCallStack): Promise {