-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Upgrade test contracts to 0.5.0 and fix all resulting problems #1465
Conversation
Note: The intermittent failure should now be addressed due to PR #1466. |
{ | ||
unsafeCleanup: true, | ||
setGracefulCleanup: true, | ||
name: "default#web3-one" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is necessary for Migrations.sol
packages/truffle-config/index.js
Outdated
@@ -1,3 +1,4 @@ | |||
/* eslint-disable no-unused-vars */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably get rid of this
|
||
const __VARIABLES = ` | ||
pragma solidity ^0.4.18; | ||
pragma solidity ~0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These of course are necessary
@@ -11,7 +11,7 @@ import Debugger from "lib/debugger"; | |||
import sessionSelector from "lib/session/selectors"; | |||
|
|||
const __OUTER = ` | |||
pragma solidity ^0.4.18; | |||
pragma solidity ~0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -33,7 +33,7 @@ contract OuterContract { | |||
`; | |||
|
|||
const __INNER = ` | |||
pragma solidity ^0.4.18; | |||
pragma solidity ~0.5; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -1,10 +1,9 @@ | |||
import debugModule from "debug"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep these too
version: "0.4.25" | ||
} | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotta put this back in and turn the version up, apparently!
@@ -1,10 +1,9 @@ | |||
import debugModule from "debug"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All this
@@ -12,14 +12,14 @@ import data from "lib/data/selectors"; | |||
import solidity from "lib/solidity/selectors"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
@@ -12,7 +12,7 @@ import solidity from "lib/solidity/selectors"; | |||
import trace from "lib/trace/selectors"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
c12afff
to
fcd4195
Compare
OK, the optimizer has now been turned off for the tests (thanks @gnidan), solving most of the problems. In addition, I've passed the A word of warning, the compiler version is currently set to |
30f0155
to
2e1e2d7
Compare
2e1e2d7
to
10f4cb8
Compare
10f4cb8
to
2b5a836
Compare
[Note: This branch is kind of a mess; it might not end up getting merged in as such.]
This branch upgrades all the test contracts to 0.5.0, and attempts to fix all the resulting problems. I've already fixed one such problem, namely the lack of support for
STATICCALL
, in PR #1446. But there's more.One issue that's come up is that a number of my tests are quite shaky. This isn't an 0.5.0 problem, but I in my investigations I think I've figured out what's causing it anyway -- namely, I was relying on
sourceId
to be consistent between runs, when it's not. That's an easy fix.But the real problems are the 0.5.0-specific problems, which are very consistent. The failing tests (now that I've fixed the storage decoding tests, where the problem was
STATICCALL
) are:Note that these errors exist also, in near-identical form, on the
truffle-decoder
branch; I made a separate branch for testing that, namelydecoder-0.5.0-tests
, which see.The memory decoding tests, as best I can tell, do seem to be due to a decoding problem. However, I'm not certain of this.
The variable ID tests seem to be due to some difference in how variable declarations are handled, except for one of them which also seems to be due to a decoding problem like above. Again, all this is uncertain.
The two mapping tests... I'd say also a decoding problem, probably, but a different one. However I've made no real exploration of this at all.
Basically, I don't know what's going on, but that's my current progress. Will update.