Create and test PausableToken Contract

This commit is contained in:
David Knott
2017-04-24 11:04:42 -06:00
parent 071040f3eb
commit b4b6029f66
7 changed files with 153 additions and 40 deletions

View File

@ -5,7 +5,7 @@ const PausableMock = artifacts.require('helpers/PausableMock.sol');
contract('Pausable', function(accounts) {
it('can perform normal process in non-emergency', async function() {
it('can perform normal process in non-pause', async function() {
let Pausable = await PausableMock.new();
let count0 = await Pausable.count();
assert.equal(count0, 0);
@ -15,9 +15,9 @@ contract('Pausable', function(accounts) {
assert.equal(count1, 1);
});
it('can not perform normal process in emergency', async function() {
it('can not perform normal process in pause', async function() {
let Pausable = await PausableMock.new();
await Pausable.emergencyStop();
await Pausable.pause();
let count0 = await Pausable.count();
assert.equal(count0, 0);
@ -31,7 +31,7 @@ contract('Pausable', function(accounts) {
});
it('can not take drastic measure in non-emergency', async function() {
it('can not take drastic measure in non-pause', async function() {
let Pausable = await PausableMock.new();
try {
await Pausable.drasticMeasure();
@ -43,19 +43,19 @@ contract('Pausable', function(accounts) {
assert.isFalse(drasticMeasureTaken);
});
it('can take a drastic measure in an emergency', async function() {
it('can take a drastic measure in a pause', async function() {
let Pausable = await PausableMock.new();
await Pausable.emergencyStop();
await Pausable.pause();
await Pausable.drasticMeasure();
let drasticMeasureTaken = await Pausable.drasticMeasureTaken();
assert.isTrue(drasticMeasureTaken);
});
it('should resume allowing normal process after emergency is over', async function() {
it('should resume allowing normal process after pause is over', async function() {
let Pausable = await PausableMock.new();
await Pausable.emergencyStop();
await Pausable.release();
await Pausable.pause();
await Pausable.unpause();
await Pausable.normalProcess();
let count0 = await Pausable.count();