aboutsummaryrefslogtreecommitdiffstats
path: root/packages/sol-cov/test
diff options
context:
space:
mode:
authorLeonid Logvinov <logvinov.leon@gmail.com>2018-05-15 17:13:01 +0800
committerLeonid Logvinov <logvinov.leon@gmail.com>2018-05-23 06:20:34 +0800
commit427a29145d90070e8c67753e7f76c7b88322eefb (patch)
tree2b7ca7a922183e8f7cbefd2f62c83e2416897e95 /packages/sol-cov/test
parent974575b695108dd70f4b165f6789f71c3647c2b1 (diff)
downloaddexon-sol-tools-427a29145d90070e8c67753e7f76c7b88322eefb.tar.gz
dexon-sol-tools-427a29145d90070e8c67753e7f76c7b88322eefb.tar.zst
dexon-sol-tools-427a29145d90070e8c67753e7f76c7b88322eefb.zip
Support all opcodes in a trace parser
Diffstat (limited to 'packages/sol-cov/test')
-rw-r--r--packages/sol-cov/test/trace_test.ts12
1 files changed, 6 insertions, 6 deletions
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<StructLog> & { op: string; depth: number }): StructLog {
+function addDefaultStructLogFields(compactStructLog: Partial<StructLog> & { 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,
},
];