Get rid of suffixed contract versioning and replace it with a poor-mans package manager. Versions are stored locally, and are generated in a copy-on-write basis as required
This commit is contained in:
committed by
Amir Bandeali
parent
47d74aa24a
commit
2721252d6a
@@ -44,6 +44,14 @@ describe('UnlimitedAllowanceToken', () => {
|
||||
await blockchainLifecycle.revertAsync();
|
||||
});
|
||||
describe('transfer', () => {
|
||||
it('should throw if owner has insufficient balance', async () => {
|
||||
const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner);
|
||||
const amountToTransfer = ownerBalance.plus(1);
|
||||
return expect(token.transfer.call(spender, amountToTransfer, { from: owner })).to.be.rejectedWith(
|
||||
constants.REVERT,
|
||||
);
|
||||
});
|
||||
|
||||
it('should transfer balance from sender to receiver', async () => {
|
||||
const receiver = spender;
|
||||
const initOwnerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner);
|
||||
@@ -67,15 +75,18 @@ describe('UnlimitedAllowanceToken', () => {
|
||||
});
|
||||
|
||||
describe('transferFrom', () => {
|
||||
it('should return false if owner has insufficient balance', async () => {
|
||||
it('should throw if owner has insufficient balance', async () => {
|
||||
const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner);
|
||||
const amountToTransfer = ownerBalance.plus(1);
|
||||
await zeroEx.token.setAllowanceAsync(tokenAddress, owner, spender, amountToTransfer);
|
||||
const didReturnTrue = await token.transferFrom.call(owner, spender, amountToTransfer, { from: spender });
|
||||
expect(didReturnTrue).to.be.false();
|
||||
return expect(
|
||||
token.transferFrom.call(owner, spender, amountToTransfer, {
|
||||
from: spender,
|
||||
}),
|
||||
).to.be.rejectedWith(constants.REVERT);
|
||||
});
|
||||
|
||||
it('should return false if spender has insufficient allowance', async () => {
|
||||
it('should throw if spender has insufficient allowance', async () => {
|
||||
const ownerBalance = await zeroEx.token.getBalanceAsync(tokenAddress, owner);
|
||||
const amountToTransfer = ownerBalance;
|
||||
|
||||
@@ -83,8 +94,11 @@ describe('UnlimitedAllowanceToken', () => {
|
||||
const spenderAllowanceIsInsufficient = spenderAllowance.cmp(amountToTransfer) < 0;
|
||||
expect(spenderAllowanceIsInsufficient).to.be.true();
|
||||
|
||||
const didReturnTrue = await token.transferFrom.call(owner, spender, amountToTransfer, { from: spender });
|
||||
expect(didReturnTrue).to.be.false();
|
||||
return expect(
|
||||
token.transferFrom.call(owner, spender, amountToTransfer, {
|
||||
from: spender,
|
||||
}),
|
||||
).to.be.rejectedWith(constants.REVERT);
|
||||
});
|
||||
|
||||
it('should return true on a 0 value transfer', async () => {
|
||||
|
Reference in New Issue
Block a user