Commit d095ba84 by Pavel Rubin Committed by Francisco Giordano

Add tests to check transfers to 0x0 fail

parent 209e2de9
...@@ -32,4 +32,14 @@ contract('BasicToken', function(accounts) { ...@@ -32,4 +32,14 @@ contract('BasicToken', function(accounts) {
} }
}); });
it("should throw an error when trying to transfer to 0x0", async function() {
let token = await StandardTokenMock.new(accounts[0], 100);
try {
let transfer = await token.transfer(0x0, 100);
assert.fail('should have thrown before');
} catch(error) {
assertJump(error);
}
});
}); });
...@@ -88,4 +88,14 @@ contract('StandardToken', function(accounts) { ...@@ -88,4 +88,14 @@ contract('StandardToken', function(accounts) {
}) })
}); });
it("should throw an error when trying to transfer to 0x0", async function() {
let token = await StandardTokenMock.new(accounts[0], 100);
try {
let transfer = await token.transfer(0x0, 100);
assert.fail('should have thrown before');
} catch(error) {
assertJump(error);
}
});
}); });
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment