|
|
|
@ -29,7 +29,7 @@ describe('blocks', function () { |
|
|
|
|
parentHash: '0x0000000000000000000000000000000000000000000000000000000000000000', |
|
|
|
|
sha3Uncles: '0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347', |
|
|
|
|
size: 163591, |
|
|
|
|
stateRoot: '0xa633ca0e8f0ae4e86d4d572b048ea93d84eb4b11e2c988b48cb3a5f6f10b3c68', |
|
|
|
|
stateRoot: '0x63e1738ea12d4e7d12b71f0f4604706417921eb6a62c407ca5f1d66b9e67f579', |
|
|
|
|
timestamp: block.timestamp, |
|
|
|
|
totalDifficulty: '0', |
|
|
|
|
transactions: [], |
|
|
|
@ -202,22 +202,25 @@ describe('blocks', function () { |
|
|
|
|
|
|
|
|
|
const contract = new web3.eth.Contract(abi) |
|
|
|
|
const accounts = await web3.eth.getAccounts() |
|
|
|
|
console.dir('--------') |
|
|
|
|
console.dir(accounts) |
|
|
|
|
console.dir('--------') |
|
|
|
|
|
|
|
|
|
const contractInstance = await contract.deploy({ data: code, arguments: [100] }).send({ from: accounts[0], gas: 400000 }) |
|
|
|
|
contractInstance.currentProvider = web3.eth.currentProvider |
|
|
|
|
contractInstance.givenProvider = web3.eth.currentProvider |
|
|
|
|
|
|
|
|
|
await contractInstance.methods.set(100).send({ from: accounts[0], gas: 400000 }) |
|
|
|
|
let storage = await web3.eth.getStorageAt(contractInstance.options.address, 0) |
|
|
|
|
assert.deepEqual(storage, '0x64') |
|
|
|
|
// await contractInstance.methods.set(100).send({ from: accounts[0].toLowerCase(), gas: 400000 })
|
|
|
|
|
// let storage = await web3.eth.getStorageAt(contractInstance.options.address, 0)
|
|
|
|
|
// assert.deepEqual(storage, '0x64')
|
|
|
|
|
|
|
|
|
|
await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 }) |
|
|
|
|
storage = await web3.eth.getStorageAt(contractInstance.options.address, 0) |
|
|
|
|
assert.deepEqual(storage, '0x64') |
|
|
|
|
// await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 })
|
|
|
|
|
// storage = await web3.eth.getStorageAt(contractInstance.options.address, 0)
|
|
|
|
|
// assert.deepEqual(storage, '0x64')
|
|
|
|
|
|
|
|
|
|
await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 }) |
|
|
|
|
storage = await web3.eth.getStorageAt(contractInstance.options.address, 0) |
|
|
|
|
assert.deepEqual(storage, '0xc8') |
|
|
|
|
// await contractInstance.methods.set(200).send({ from: accounts[0], gas: 400000 })
|
|
|
|
|
// storage = await web3.eth.getStorageAt(contractInstance.options.address, 0)
|
|
|
|
|
// assert.deepEqual(storage, '0xc8')
|
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|
}) |
|
|
|
|