Fix sol-cov tests

This commit is contained in:
Leonid Logvinov
2018-05-22 13:44:48 -07:00
parent 06be580d2c
commit 9740199870
2 changed files with 4 additions and 2 deletions

View File

@@ -27,7 +27,9 @@ export function getTracesByContractAddress(structLogs: StructLog[], startAddress
const currentAddress = _.last(callStack) as string;
const jumpAddressOffset = structLog.op === OpCode.DelegateCall ? 4 : 2;
const newAddress = addressUtils.padZeros(
new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset])).toString(16),
new BigNumber(addHexPrefix(structLog.stack[structLog.stack.length - jumpAddressOffset - 1])).toString(
16,
),
);
if (structLog === _.last(structLogs)) {
throw new Error('CALL-like opcode can not be the last one');

View File

@@ -32,7 +32,7 @@ describe('Trace', () => {
const trace = [
{
op: OpCode.DelegateCall,
stack: ['0x', '0x', '0x', '0x', delegateCallAddress],
stack: [delegateCallAddress, '0x', '0x', '0x', '0x'],
depth: 0,
},
{