Remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner (#1254)
* remove HasNoEther, HasNoTokens, HasNoContracts, and NoOwner * remove unused ERC223TokenMock * remove Contactable * remove TokenDestructible * remove DeprecatedERC721 * inline Destructible#destroy in Bounty * remove Destructible
This commit is contained in:
committed by
GitHub
parent
2441fd7d17
commit
bd994a88de
@ -1,33 +0,0 @@
|
||||
const DestructibleMock = artifacts.require('DestructibleMock');
|
||||
const { ethGetBalance } = require('../helpers/web3');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
contract('Destructible', function ([_, owner, recipient]) {
|
||||
beforeEach(async function () {
|
||||
this.destructible = await DestructibleMock.new({ from: owner });
|
||||
await web3.eth.sendTransaction({
|
||||
from: owner,
|
||||
to: this.destructible.address,
|
||||
value: web3.toWei('10', 'ether'),
|
||||
});
|
||||
});
|
||||
|
||||
it('should send balance to owner after destruction', async function () {
|
||||
const initBalance = await ethGetBalance(owner);
|
||||
await this.destructible.destroy({ from: owner });
|
||||
const newBalance = await ethGetBalance(owner);
|
||||
newBalance.should.be.bignumber.gt(initBalance);
|
||||
});
|
||||
|
||||
it('should send balance to recepient after destruction', async function () {
|
||||
const initBalance = await ethGetBalance(recipient);
|
||||
await this.destructible.destroyAndSend(recipient, { from: owner });
|
||||
const newBalance = await ethGetBalance(recipient);
|
||||
newBalance.should.be.bignumber.gt(initBalance);
|
||||
});
|
||||
});
|
||||
@ -1,39 +0,0 @@
|
||||
const { ethGetBalance } = require('../helpers/web3');
|
||||
|
||||
const TokenDestructible = artifacts.require('TokenDestructible');
|
||||
const ERC20Mock = artifacts.require('ERC20Mock');
|
||||
|
||||
const BigNumber = web3.BigNumber;
|
||||
|
||||
require('chai')
|
||||
.use(require('chai-bignumber')(BigNumber))
|
||||
.should();
|
||||
|
||||
contract('TokenDestructible', function ([_, owner]) {
|
||||
let tokenDestructible;
|
||||
|
||||
beforeEach(async function () {
|
||||
tokenDestructible = await TokenDestructible.new({
|
||||
from: owner,
|
||||
value: web3.toWei('10', 'ether'),
|
||||
});
|
||||
});
|
||||
|
||||
it('should send balance to owner after destruction', async function () {
|
||||
const initBalance = await ethGetBalance(owner);
|
||||
await tokenDestructible.destroy([], { from: owner });
|
||||
|
||||
const newBalance = await ethGetBalance(owner);
|
||||
newBalance.should.be.bignumber.gt(initBalance);
|
||||
});
|
||||
|
||||
it('should send tokens to owner after destruction', async function () {
|
||||
const token = await ERC20Mock.new(tokenDestructible.address, 100);
|
||||
(await token.balanceOf(tokenDestructible.address)).should.be.bignumber.equal(100);
|
||||
(await token.balanceOf(owner)).should.be.bignumber.equal(0);
|
||||
|
||||
await tokenDestructible.destroy([token.address], { from: owner });
|
||||
(await token.balanceOf(tokenDestructible.address)).should.be.bignumber.equal(0);
|
||||
(await token.balanceOf(owner)).should.be.bignumber.equal(100);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user