From 427a29145d90070e8c67753e7f76c7b88322eefb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Tue, 15 May 2018 11:13:01 +0200 Subject: Support all opcodes in a trace parser --- packages/sol-cov/test/trace_test.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/sol-cov/test') diff --git a/packages/sol-cov/test/trace_test.ts b/packages/sol-cov/test/trace_test.ts index b9d846732..58b9203b0 100644 --- a/packages/sol-cov/test/trace_test.ts +++ b/packages/sol-cov/test/trace_test.ts @@ -1,4 +1,4 @@ -import { StructLog } from '@0xproject/types'; +import { OpCode, StructLog } from '@0xproject/types'; import * as chai from 'chai'; import * as fs from 'fs'; import * as _ from 'lodash'; @@ -15,13 +15,13 @@ const DEFAULT_STRUCT_LOG: StructLog = { gas: 0, gasCost: 0, memory: [], - op: 'DEFAULT', + op: OpCode.Invalid, pc: 0, stack: [], storage: {}, }; -function addDefaultStructLogFields(compactStructLog: Partial & { op: string; depth: number }): StructLog { +function addDefaultStructLogFields(compactStructLog: Partial & { op: OpCode; depth: number }): StructLog { return { ...DEFAULT_STRUCT_LOG, ...compactStructLog }; } @@ -31,16 +31,16 @@ describe('Trace', () => { const delegateCallAddress = '0x0000000000000000000000000000000000000002'; const trace = [ { - op: 'DELEGATECALL', + op: OpCode.DelegateCall, stack: ['0x', '0x', delegateCallAddress], depth: 0, }, { - op: 'RETURN', + op: OpCode.Return, depth: 1, }, { - op: 'RETURN', + op: OpCode.Return, depth: 0, }, ]; -- cgit v1.2.3