add missing test for error when doing transferFrom to 0x0
This commit is contained in:
@ -22,7 +22,7 @@ contract('BasicToken', function(accounts) {
|
|||||||
assert.equal(secondAccountBalance, 100);
|
assert.equal(secondAccountBalance, 100);
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should throw an error when trying to transfer more than balance", async function() {
|
it('should throw an error when trying to transfer more than balance', async function() {
|
||||||
let token = await BasicTokenMock.new(accounts[0], 100);
|
let token = await BasicTokenMock.new(accounts[0], 100);
|
||||||
try {
|
try {
|
||||||
let transfer = await token.transfer(accounts[1], 101);
|
let transfer = await token.transfer(accounts[1], 101);
|
||||||
@ -32,7 +32,7 @@ contract('BasicToken', function(accounts) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should throw an error when trying to transfer to 0x0", async function() {
|
it('should throw an error when trying to transfer to 0x0', async function() {
|
||||||
let token = await StandardTokenMock.new(accounts[0], 100);
|
let token = await StandardTokenMock.new(accounts[0], 100);
|
||||||
try {
|
try {
|
||||||
let transfer = await token.transfer(0x0, 100);
|
let transfer = await token.transfer(0x0, 100);
|
||||||
|
|||||||
@ -88,7 +88,7 @@ contract('StandardToken', function(accounts) {
|
|||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
it("should throw an error when trying to transfer to 0x0", async function() {
|
it('should throw an error when trying to transfer to 0x0', async function() {
|
||||||
let token = await StandardTokenMock.new(accounts[0], 100);
|
let token = await StandardTokenMock.new(accounts[0], 100);
|
||||||
try {
|
try {
|
||||||
let transfer = await token.transfer(0x0, 100);
|
let transfer = await token.transfer(0x0, 100);
|
||||||
@ -98,4 +98,15 @@ contract('StandardToken', function(accounts) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should throw an error when trying to transferFrom to 0x0', async function() {
|
||||||
|
let token = await StandardTokenMock.new(accounts[0], 100);
|
||||||
|
await token.approve(accounts[1], 100);
|
||||||
|
try {
|
||||||
|
let transfer = await token.transferFrom(accounts[0], 0x0, 100, {from: accounts[1]});
|
||||||
|
assert.fail('should have thrown before');
|
||||||
|
} catch(error) {
|
||||||
|
assertJump(error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user