(Fix) Small fixes

This commit is contained in:
Vadim Arasev 2018-07-27 12:46:13 +03:00
parent 2456ee1b91
commit c2ef6fc4c8
4 changed files with 6 additions and 4 deletions

View File

@ -242,6 +242,7 @@ contract KeysManager is EternalStorage, IKeysManager {
)
public
onlyValidInitialKey
withinTotalLimit
{
require(_miningKey != address(0));
require(_votingKey != address(0));

View File

@ -107,8 +107,8 @@ contract EternalStorageProxy is EternalStorage {
* @param implementation representing the address of the new implementation to be set.
*/
function upgradeTo(address implementation) public onlyProxyStorage {
require(_implementation != implementation);
require(implementation != address(0));
if (_implementation == implementation) return;
uint256 _newVersion = _version + 1;
assert(_newVersion > _version);

View File

@ -115,10 +115,11 @@ contract('EternalStorageProxy [all features]', function (accounts) {
await instance.upgradeTo(accounts[3], {from: accounts[1]}).should.be.fulfilled;
});
it('should not change implementation address if it is the same', async () => {
await instance.upgradeTo(
const result = await instance.upgradeTo(
accounts[2],
{from: accounts[1]}
).should.be.rejectedWith(ERROR_MSG);
).should.be.fulfilled;
result.logs.length.should.be.equal(0);
});
it('should not change implementation address if it is 0x0', async () => {
await instance.upgradeTo(

View File

@ -24,7 +24,7 @@ module.exports = {
sokol: {
host: "localhost",
port: 8545,
gas: 6200000,
gas: 6400000,
network_id: "*" // Match any network id
},
},