Update transferAnyERC20 function test

This commit is contained in:
David E. Perez Negron Rocha 2020-02-27 18:53:03 -06:00
parent f60901512c
commit ec7e25a456
1 changed files with 32 additions and 38 deletions

View File

@ -201,44 +201,39 @@ contract('DECA', function (accs) {
}) })
}) })
// SOMEHOW THIS FUNCTIONS TEST WORKED IN ROPSTEN describe('transferAnyERC20Token', async function () {
// describe('transferAnyERC20Token', async function () { it('check transfer from external', async function () {
// it('check transfer from external', async function () {
// this.deca2 = await DECA.new({ var sender = await getHighBalance();
// from: this.creator.address, await web3.eth.sendTransaction({
// gas: 6712390 from: sender.address,
// }) to: this.deca.address,
// value: 1,
// var sender = await getHighBalance(); gas: 6712390
// await web3.eth.sendTransaction({ });
// from: sender.address, let decaBalance = await this.deca.balanceOf.call(this.deca.address)
// to: this.deca2.address, await this.deca.transfer(this.deca.address, 10, {from: sender.address, gas: 6712390})
// value: 1, decaBalance = await this.deca.balanceOf.call(this.deca.address)
// gas: 6712390 assert.equal(decaBalance.toString(10), '10', " contract should have balance")
// });
// let deca2Balance = await this.deca2.balanceOf.call(sender.address) let wasErr = false;
// console.log('DECA2 BALANCE : ', deca2Balance.toString(10)) try {
// let ok = await this.deca.transferAnyERC20Token(this.deca.address, 10, {
// assert.equal(deca2Balance.toString(10), '300', " sender should have balance") from: this.creator.address,
// gas: 6712390
// let wasErr = false; })
// try { assert.equal(true, ok, "transferAnyERC20Token should return positive result")
// let ok = await this.deca.transferAnyERC20Token(this.deca2.address, 1, { } catch (err) {
// from: this.creator.address, console.dir(err)
// gas: 6712390 wasErr = true;
// }) }
// assert.equal(true, ok, "transferAnyERC20Token should return positive result")
// } catch (err) { assert.equal(true, wasErr, "transferAnyERC20Token should proces without error")
// console.dir(err) })
// wasErr = true; })
// } // SOMEHOW THIS FUNCTIONS TEST WORKED IN ROPSTEN
// deca2Balance = await this.deca2.balanceOf.call(sender.address)
//
// assert.equal(deca2Balance.toString(10), '0', " sender should have 0 on balance")
// })
// })
// describe('check payout', async function () { // describe('check payout', async function () {
// it('check getETH', async function () { // it.only('check getETH', async function () {
// let decaBalance = await web3.eth.getBalance(this.deca.address); // let decaBalance = await web3.eth.getBalance(this.deca.address);
// assert.equal(decaBalance.toString(10), '0', " wrong contract balance") // assert.equal(decaBalance.toString(10), '0', " wrong contract balance")
// var sender = await getHighBalance(); // var sender = await getHighBalance();
@ -267,5 +262,4 @@ contract('DECA', function (accs) {
// //
// }) // })
// }) // })
}) })