We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, I am having trouble replicating your work, which overall is great.
I am using Truffle5 and Solc 0.4.23;
I am following along using a basic uint256 operations contract:
` pragma solidity ^0.4.23;
import "../upgradeable/upgradeable.sol";
contract CalculatorV5 is Upgradeable { uint256 internal _count;
constructor(uint256 count)public { _count = count; } function increment(uint256 amount) public returns (bool) { require(amount > 0, "amount must be positive"); _count = _count + amount; return true; } function getCount() external view returns(uint256) { return _count; }
}
For test using a .js type of tests (vs .sol):
const UpgradeableProxy = artifacts.require('./upgradeable.sol') const CalculatorV5 = artifacts.require('./CalculatorV5.sol'); const CalculatorV6 = artifacts.require('./CalculatorV6.sol') contract('Calculator', (accounts) => { beforeEach(async () => { calcV5 = await CalculatorV5.new(100); uproxy = await UpgradeableProxy.new(calcV5.address); calcV5Proxy = await CalculatorV5.at(uproxy.address); await calcV5Proxy.initialize(); }); it('calc v5 should equal 100',async () => { let value = await calcV5Proxy.getCount({from:accounts[1]}); // also tried let value = await calcV5Proxy.getCount(); // as well as let value = await calcV5Proxy.getCount.call(); assert.equal(value, 100); });
When I run it the before each works perfectly, emits the event Initalized, but fails on the test with this vague response:
Contract: Calculator calc v5 should equal 100: Error: Returned error: VM Exception while processing transaction: revert
Please let me know if you need more information. Thanks!
The text was updated successfully, but these errors were encountered:
Edit: Minor grammar and styling errors.
Sorry, something went wrong.
No branches or pull requests
Hello, I am having trouble replicating your work, which overall is great.
I am using Truffle5 and Solc 0.4.23;
I am following along using a basic uint256 operations contract:
`
pragma solidity ^0.4.23;
import "../upgradeable/upgradeable.sol";
contract CalculatorV5 is Upgradeable {
uint256 internal _count;
}
For test using a .js type of tests (vs .sol):
When I run it the before each works perfectly, emits the event Initalized, but fails on the test with this vague response:
Contract: Calculator
calc v5 should equal 100:
Error: Returned error: VM Exception while processing transaction: revert
Please let me know if you need more information. Thanks!
The text was updated successfully, but these errors were encountered: