Skip to content
New issue

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

[CENT-240] location of initialized #182

Merged
merged 1 commit into from
Aug 3, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions test/MiscTests.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
var FiatTokenProxy = artifacts.require('FiatTokenProxy');

var tokenUtils = require('./TokenTestUtils');;
var BigNumber = require('bignumber.js');
var assertDiff = require('assert-diff');
Expand Down Expand Up @@ -435,6 +437,21 @@ async function run_tests(newToken) {
assert(await token.removeMinter.call(minterAccount, { from: masterMinterAccount }));
});

it('ms045 initialized should be in slot 8, byte 21', async function() {
var slot8Data = await web3.eth.getStorageAt(proxy.address, 8);
var initialized = "0x" + slot8Data.substring(2,4); // first 2 hex-chars after 0x
var masterMinterAddress = "0x" + slot8Data.substring(4,44); // first 42 hex chars after 0xii

assert.equal(masterMinterAccount, masterMinterAddress);
assert.equal("0x01", initialized);
});

it('ms046 initialized should be 0 before initialization', async function() {
var newProxy = await FiatTokenProxy.new(token.address, { from: arbitraryAccount });
var slot8Data = await web3.eth.getStorageAt(newProxy.address, 8);
assert.equal("0x00", slot8Data);
});

}

module.exports = {
Expand Down