more tests fixed

pull/5370/head
aniket-engg 4 years ago committed by Aniket
parent ad2131feaf
commit ec63f13170
  1. 3
      libs/remix-debug/test/decoder/mockStorageResolver.ts
  2. 10
      libs/remix-debug/test/decoder/storageDecoder.ts
  3. 4
      libs/remix-debug/test/sourceMappingDecoder.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 {

@ -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) => {

@ -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)

Loading…
Cancel
Save