Works for almost all tests

This commit is contained in:
Greg Hysen
2018-12-18 22:01:48 -08:00
parent 2f1454e90e
commit e4551c8f60
19 changed files with 323 additions and 1079 deletions

View File

@@ -78,7 +78,6 @@ describe('Asset Transfer Proxies', () => {
await blockchainLifecycle.revertAsync();
});
before(async () => {
console.log('1');
const accounts = await web3Wrapper.getAvailableAddressesAsync();
const usedAddresses = ([owner, notAuthorized, authorized, fromAddress, toAddress] = _.slice(accounts, 0, 5));
@@ -94,7 +93,6 @@ describe('Asset Transfer Proxies', () => {
txDefaults,
);
console.log('2');
// Configure ERC20Proxy
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
@@ -102,7 +100,6 @@ describe('Asset Transfer Proxies', () => {
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('3');
await web3Wrapper.awaitTransactionSuccessAsync(
await erc20Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
@@ -110,7 +107,6 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('4');
// Configure ERC721Proxy
await web3Wrapper.awaitTransactionSuccessAsync(
@@ -120,7 +116,6 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('5');
await web3Wrapper.awaitTransactionSuccessAsync(
await erc721Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
@@ -128,7 +123,6 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('6');
// Configure MultiAssetProxy
await web3Wrapper.awaitTransactionSuccessAsync(
@@ -138,7 +132,6 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('7');
await web3Wrapper.awaitTransactionSuccessAsync(
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc20Proxy.address, {
from: owner,
@@ -146,7 +139,6 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('8');
await web3Wrapper.awaitTransactionSuccessAsync(
await multiAssetProxy.registerAssetProxy.sendTransactionAsync(erc721Proxy.address, {
from: owner,
@@ -154,7 +146,6 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('9');
// Deploy and configure ERC20 tokens
const numDummyErc20ToDeploy = 2;
@@ -181,14 +172,12 @@ describe('Asset Transfer Proxies', () => {
constants.DUMMY_TOKEN_TOTAL_SUPPLY,
);
console.log('10');
await erc20Wrapper.setBalancesAndAllowancesAsync();
await web3Wrapper.awaitTransactionSuccessAsync(
await noReturnErc20Token.setBalance.sendTransactionAsync(fromAddress, constants.INITIAL_ERC20_BALANCE),
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('11');
await web3Wrapper.awaitTransactionSuccessAsync(
await noReturnErc20Token.approve.sendTransactionAsync(
erc20Proxy.address,
@@ -197,7 +186,6 @@ describe('Asset Transfer Proxies', () => {
),
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('12');
await web3Wrapper.awaitTransactionSuccessAsync(
await multipleReturnErc20Token.setBalance.sendTransactionAsync(
fromAddress,
@@ -205,7 +193,6 @@ describe('Asset Transfer Proxies', () => {
),
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('13');
await web3Wrapper.awaitTransactionSuccessAsync(
await multipleReturnErc20Token.approve.sendTransactionAsync(
erc20Proxy.address,
@@ -214,7 +201,6 @@ describe('Asset Transfer Proxies', () => {
),
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('14');
// Deploy and configure ERC721 tokens and receiver
[erc721TokenA, erc721TokenB] = await erc721Wrapper.deployDummyTokensAsync();
@@ -223,12 +209,9 @@ describe('Asset Transfer Proxies', () => {
provider,
txDefaults,
);
console.log('15');
await erc721Wrapper.setBalancesAndAllowancesAsync();
console.log('16');
const erc721Balances = await erc721Wrapper.getBalancesAsync();
console.log('17');
erc721AFromTokenId = erc721Balances[fromAddress][erc721TokenA.address][0];
erc721BFromTokenId = erc721Balances[fromAddress][erc721TokenB.address][0];
});

View File

@@ -451,7 +451,6 @@ describe.skip('Exchange core internal functions', () => {
makerFeePaid: new BigNumber(0),
takerFeePaid: new BigNumber(0),
};
//console.log(`EMPTY ORDER:\n ${JSON.stringify(emptySignedOrder, null ,4)}`);
await web3Wrapper.awaitTransactionSuccessAsync(
await testExchange.publicUpdateFilledState.sendTransactionAsync(
orderUtils.getOrderWithoutExchangeAddress(emptySignedOrder),

View File

@@ -102,15 +102,12 @@ export class ERC721Wrapper {
public async approveAsync(to: string, tokenAddress: string, tokenId: BigNumber): Promise<void> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
const tokenOwner = await this.ownerOfAsync(tokenAddress, tokenId);
console.log('a');
console.log(to, ':', tokenId, ':', tokenOwner);
await this._web3Wrapper.awaitTransactionSuccessAsync(
await tokenContract.approve.sendTransactionAsync(to, tokenId, {
from: tokenOwner,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
console.log('b');
}
public async transferFromAsync(
tokenAddress: string,
@@ -147,7 +144,6 @@ export class ERC721Wrapper {
public async ownerOfAsync(tokenAddress: string, tokenId: BigNumber): Promise<string> {
const tokenContract = this._getTokenContractFromAssetData(tokenAddress);
const owner = await tokenContract.ownerOf.callAsync(tokenId);
console.log(`OWNER OF = ${owner}`);
return owner;
}
public async isOwnerAsync(userAddress: string, tokenAddress: string, tokenId: BigNumber): Promise<boolean> {