From ec63f13170fe3434f7f4d43c803603abe2b1deec Mon Sep 17 00:00:00 2001 From: aniket-engg Date: Wed, 16 Dec 2020 18:48:42 +0530 Subject: [PATCH] more tests fixed --- libs/remix-debug/test/decoder/mockStorageResolver.ts | 3 +-- libs/remix-debug/test/decoder/storageDecoder.ts | 10 +++++----- libs/remix-debug/test/sourceMappingDecoder.ts | 4 ++-- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/libs/remix-debug/test/decoder/mockStorageResolver.ts b/libs/remix-debug/test/decoder/mockStorageResolver.ts index cf79a8b0d5..242789c0d0 100644 --- a/libs/remix-debug/test/decoder/mockStorageResolver.ts +++ b/libs/remix-debug/test/decoder/mockStorageResolver.ts @@ -1,6 +1,5 @@ 'use strict' -var remixLib = require('@remix-project/remix-lib') -var util = remixLib.util +import { util } from '@remix-project/remix-lib' export class MockStorageResolver { diff --git a/libs/remix-debug/test/decoder/storageDecoder.ts b/libs/remix-debug/test/decoder/storageDecoder.ts index 82cb0bcf4f..0ec3993e9b 100644 --- a/libs/remix-debug/test/decoder/storageDecoder.ts +++ b/libs/remix-debug/test/decoder/storageDecoder.ts @@ -1,7 +1,7 @@ 'use strict' import tape from 'tape' -var compiler = require('solc') -var stateDecoder = require('../../src/solidity-decoder/stateDecoder') +import { compile } from 'solc' +import * as stateDecoder from '../../src/solidity-decoder/stateDecoder' import { MockStorageResolver } from './mockStorageResolver' import { compilerInput } from '../helpers/compilerHelper' var testMappingStorage = require('./stateTests/mapping') @@ -22,7 +22,7 @@ tape('solidity', function (t) { function testIntStorage (st, cb) { var intStorage = require('./contracts/intStorage') - var output = compiler.compile(compilerInput(intStorage.contract)) + var output = compile(compilerInput(intStorage.contract)) output = JSON.parse(output) var mockStorageResolver for (var storage of [intStorage.fullStorage, shrinkStorage(intStorage.fullStorage)]) { @@ -69,7 +69,7 @@ function testIntStorage (st, cb) { function testByteStorage (st, cb) { var byteStorage = require('./contracts/byteStorage') - var output = compiler.compile(compilerInput(byteStorage.contract)) + var output = compile(compilerInput(byteStorage.contract)) output = JSON.parse(output) var mockStorageResolver for (var storage of [byteStorage.storage, shrinkStorage(byteStorage.storage)]) { @@ -182,7 +182,7 @@ function shrinkStorage (storage) { function testStructArrayStorage (st, cb) { var structArrayStorage = require('./contracts/structArrayStorage') - var output = compiler.compile(compilerInput(structArrayStorage.contract)) + var output = compile(compilerInput(structArrayStorage.contract)) output = JSON.parse(output) var mockStorageResolver = new MockStorageResolver(structArrayStorage.storage) stateDecoder.solidityState(mockStorageResolver, output.sources, 'structArrayStorage').then((decoded) => { diff --git a/libs/remix-debug/test/sourceMappingDecoder.ts b/libs/remix-debug/test/sourceMappingDecoder.ts index 106d1b2074..6ae1853406 100644 --- a/libs/remix-debug/test/sourceMappingDecoder.ts +++ b/libs/remix-debug/test/sourceMappingDecoder.ts @@ -62,8 +62,8 @@ tape('SourceMappingDecoder', function (t) { // console.log(result) st.equal(result3['start'], 103) st.equal(result3['length'], 2) - st.equal(result['file'], 4) - st.equal(result['jump'], '-') + st.equal(result3['file'], 4) + st.equal(result3['jump'], '-') testSourceMapping[82] = result3 const result4 = sourceMappingDecoder.atIndex(85, sourceMapping.mapping)