Skip to content

Commit f932d2a

Browse files
author
Oren Sokolowsky
committed
naming
1 parent d9a963e commit f932d2a

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

contracts/misc/TimeLocking.sol renamed to contracts/misc/TimeLock.sol

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pragma solidity ^0.5.17;
22

33

4-
contract DxDAOTimeLock {
4+
contract TimeLock {
55

66
address public owner;
77
uint256 public releaseTime;
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,45 @@
11
const helpers = require('./helpers');
22

33
const Wallet = artifacts.require("./Wallet.sol");
4-
const DxDAOTimeLock = artifacts.require("./DxDAOTimeLock.sol");
5-
contract('DxDAOTimeLock', accounts => {
4+
const TimeLock = artifacts.require("./TimeLock.sol");
5+
contract('TimeLock', accounts => {
66

77
it("sendEther", async () => {
88
var wallet = await Wallet.new();
99
await wallet.initialize(accounts[0]);
1010
var owner = wallet.address;
1111
var block = await web3.eth.getBlock("latest");
1212
var releaseTime = block.timestamp + (30*60*60*24);
13-
var dxDAOTimeLock = await DxDAOTimeLock.new(owner,releaseTime);
14-
assert.equal(await dxDAOTimeLock.owner(), owner);
15-
assert.equal(await dxDAOTimeLock.releaseTime(), releaseTime);
13+
var timeLock = await TimeLock.new(owner,releaseTime);
14+
assert.equal(await timeLock.owner(), owner);
15+
assert.equal(await timeLock.releaseTime(), releaseTime);
1616

1717
//send funds to wallet
1818
await web3.eth.sendTransaction({from:accounts[0],to:owner, value: web3.utils.toWei('10', "ether")});
1919
assert.equal(await web3.eth.getBalance(owner), web3.utils.toWei('10', "ether"));
20-
await wallet.pay(dxDAOTimeLock.address);
21-
await wallet.pay(dxDAOTimeLock.address);
22-
assert.equal(await web3.eth.getBalance(dxDAOTimeLock.address), web3.utils.toWei('10', "ether"));
20+
await wallet.pay(timeLock.address);
21+
await wallet.pay(timeLock.address);
22+
assert.equal(await web3.eth.getBalance(timeLock.address), web3.utils.toWei('10', "ether"));
2323

24-
var encodedABI = await new web3.eth.Contract(dxDAOTimeLock.abi)
24+
var encodedABI = await new web3.eth.Contract(timeLock.abi)
2525
.methods
2626
.withdraw()
2727
.encodeABI();
2828

2929
try {
30-
await wallet.genericCall(dxDAOTimeLock.address, encodedABI);
30+
await wallet.genericCall(timeLock.address, encodedABI);
3131
throw 'cannot withdraw before time';
3232
} catch (error) {
3333
helpers.assertVMException(error);
3434
}
3535
await helpers.increaseTime((30*60*60*24)+1);
3636
try {
37-
await dxDAOTimeLock.withdraw();
37+
await timeLock.withdraw();
3838
throw 'only Owner can withdraw';
3939
} catch (error) {
4040
helpers.assertVMException(error);
4141
}
42-
await wallet.genericCall(dxDAOTimeLock.address, encodedABI);
42+
await wallet.genericCall(timeLock.address, encodedABI);
4343
assert.equal(await web3.eth.getBalance(owner), web3.utils.toWei('10', "ether"));
4444
});
4545
});

0 commit comments

Comments
 (0)