How to use the @0x/sol-tracing-utils.utils.isRangeInside 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-coverage / src / coverage_subprovider.ts View on Github external
const isFunctionCovered = _.some(sourceRanges, range =>
            utils.isRangeInside(range.location, functionDescription.loc),
        );
github 0xProject / 0x-monorepo / packages / sol-coverage / src / coverage_subprovider.ts View on Github external
(statementDescription: StatementDescription, statementId: number) => {
                const isInsideTheModifierEnclosingFunction = utils.isRangeInside(
                    statementDescription,
                    enclosingFunction.loc,
                );
                const isCovered = statementCoverage[statementId];
                return isInsideTheModifierEnclosingFunction && isCovered;
            },
        );
github 0xProject / 0x-monorepo / packages / sol-profiler / src / profiler_subprovider.ts View on Github external
_.map(subtrace, structLog => {
                const sourceRange = pcToSourceRange[structLog.pc];
                if (_.isUndefined(sourceRange)) {
                    return 0;
                }
                if (sourceRange.fileName !== absoluteFileName) {
                    return 0;
                }
                if (utils.isRangeInside(sourceRange.location, statementDescription)) {
                    return structLog.gasCost;
                } else {
                    return 0;
                }
            }),
        );
github 0xProject / 0x-monorepo / packages / sol-coverage / src / coverage_subprovider.ts View on Github external
const isStatementCovered = _.some(sourceRanges, range =>
            utils.isRangeInside(range.location, statementDescription),
        );
github 0xProject / 0x-monorepo / packages / sol-coverage / src / coverage_subprovider.ts View on Github external
const enclosingFunction = _.find(coverageEntriesDescription.fnMap, functionDescription =>
            utils.isRangeInside(modifierDescription, functionDescription.loc),
        ) as FunctionDescription;
github 0xProject / 0x-monorepo / packages / sol-coverage / src / coverage_subprovider.ts View on Github external
            const isBranchCovered = _.some(sourceRanges, range => utils.isRangeInside(range.location, location));
            const timesBranchCovered = Number(isBranchCovered);