fix & add unit test

pull/563/head
yann300 4 years ago committed by Aniket
parent 62393c301e
commit 1b583ce0ba
  1. 9
      libs/remix-debug/test/sourceLocationTracker.js

@ -63,12 +63,17 @@ tape('SourceLocationTracker', function (t) {
st.equal(map.start, 35)
map = await sourceLocationTracker.getSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts)
st.equal(map.file, 1)
st.equal(map.file, 1) // 1 refers to the generated source (pragma experimental ABIEncoderV2)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 45, output.contracts)
st.equal(map.file, 1)
st.equal(map.file, 1) // 1 refers to the generated source (pragma experimental ABIEncoderV2)
st.equal(map.start, 1293)
st.equal(map.length, 32)
map = await sourceLocationTracker.getValidSourceLocationFromVMTraceIndex('0x0d3a18d64dfe4f927832ab58d6451cecc4e517c5', 36, output.contracts)
st.equal(map.file, 0) // 0 refers to the initial solidity code. see source below (ABIEncoderV2)
st.equal(map.start, 303)
st.equal(map.length, 448)
} catch (e) {
console.log(e)
}

Loading…
Cancel
Save