Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Ran prettier & linter
Browse files Browse the repository at this point in the history
  • Loading branch information
hysz committed Mar 8, 2019
1 parent b2f9b07 commit 4e72b93
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 25 deletions.
46 changes: 27 additions & 19 deletions contracts/asset-proxy/test/proxies.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,21 +133,21 @@ describe('Asset Transfer Proxies', () => {
constants.AWAIT_TRANSACTION_MINED_MS,
);

// Configure ERC115Proxy
erc1155ProxyWrapper = new ERC1155ProxyWrapper(provider, usedAddresses, owner);
erc1155Proxy = await erc1155ProxyWrapper.deployProxyAsync();
await web3Wrapper.awaitTransactionSuccessAsync(
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
from: owner,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
// Configure ERC115Proxy
erc1155ProxyWrapper = new ERC1155ProxyWrapper(provider, usedAddresses, owner);
erc1155Proxy = await erc1155ProxyWrapper.deployProxyAsync();
await web3Wrapper.awaitTransactionSuccessAsync(
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(authorized, {
from: owner,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);
await web3Wrapper.awaitTransactionSuccessAsync(
await erc1155Proxy.addAuthorizedAddress.sendTransactionAsync(multiAssetProxy.address, {
from: owner,
}),
constants.AWAIT_TRANSACTION_MINED_MS,
);

// Configure MultiAssetProxy
await web3Wrapper.awaitTransactionSuccessAsync(
Expand Down Expand Up @@ -255,7 +255,7 @@ describe('Asset Transfer Proxies', () => {
const nonFungibleTokenAsString = nonFungibleToken.toString();
const nonFungibleTokenHeldBySpender =
tokenBalances.nonFungible[fromAddress][erc1155Contract.address][nonFungibleTokenAsString][0];
erc1155NonFungibleTokensOwnedBySpender.push(nonFungibleTokenHeldBySpender);
erc1155NonFungibleTokensOwnedBySpender.push(nonFungibleTokenHeldBySpender);
});
});
beforeEach(async () => {
Expand Down Expand Up @@ -1236,7 +1236,7 @@ describe('Asset Transfer Proxies', () => {
const erc1155ValuesToTransfer = [new BigNumber(25)];
const erc1155Amount = new BigNumber(23);
const erc1155ReceiverCallbackData = '0x0102030405';
const erc1155AssetData = assetDataUtils.encodeERC1155AssetData(
const erc1155AssetData = assetDataUtils.encodeERC1155AssetData(
erc1155Contract.address,
erc1155TokensToTransfer,
erc1155ValuesToTransfer,
Expand All @@ -1259,7 +1259,11 @@ describe('Asset Transfer Proxies', () => {
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
constants.INITIAL_ERC1155_FUNGIBLE_BALANCE,
];
await erc1155Wrapper.assertBalancesAsync(erc1155TokenHolders, erc1155TokensToTransfer, erc1155ExpectedInitialBalances);
await erc1155Wrapper.assertBalancesAsync(
erc1155TokenHolders,
erc1155TokensToTransfer,
erc1155ExpectedInitialBalances,
);
// execute transfer
await web3Wrapper.awaitTransactionSuccessAsync(
await web3Wrapper.sendTransactionAsync({
Expand All @@ -1286,7 +1290,11 @@ describe('Asset Transfer Proxies', () => {
erc1155ExpectedInitialBalances[0].minus(erc1155TotalValueTransferred),
erc1155ExpectedInitialBalances[1].plus(erc1155TotalValueTransferred),
];
await erc1155Wrapper.assertBalancesAsync(erc1155TokenHolders, erc1155TokensToTransfer, expectedFinalBalances);
await erc1155Wrapper.assertBalancesAsync(
erc1155TokenHolders,
erc1155TokensToTransfer,
expectedFinalBalances,
);
});
it('should successfully transfer a combination of ERC20 and ERC721 tokens', async () => {
const inputAmount = new BigNumber(1);
Expand Down
1 change: 1 addition & 0 deletions contracts/exchange/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
"@0x/contracts-asset-proxy": "^1.0.9",
"@0x/contracts-erc20": "^1.0.9",
"@0x/contracts-erc721": "^1.0.9",
"@0x/contracts-erc1155": "^0.0.1",
"@0x/contracts-exchange-libs": "1.0.2",
"@0x/contracts-utils": "2.0.1",
"@0x/order-utils": "^7.0.2",
Expand Down
10 changes: 4 additions & 6 deletions contracts/exchange/test/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import {
DummyERC20TokenTransferEventArgs,
DummyERC721TokenContract,
DummyNoReturnERC20TokenContract,
ERC1155ProxyWrapper,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
ERC721Wrapper,
MultiAssetProxyContract,
ERC1155ProxyWrapper,
} from '@0x/contracts-asset-proxy';
import { ERC1155MintableContract } from '@0x/contracts-erc1155';
import {
chaiSetup,
constants,
Expand All @@ -23,7 +24,6 @@ import {
txDefaults,
web3Wrapper,
} from '@0x/contracts-test-utils';
import { ERC1155MintableContract, DummyERC1155ReceiverBatchTokenReceivedEventArgs } from '@0x/contracts-erc1155';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { assetDataUtils, orderHashUtils } from '@0x/order-utils';
import { RevertReason, SignatureType, SignedOrder } from '@0x/types';
Expand All @@ -34,6 +34,7 @@ import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';

import { Erc1155Wrapper } from '../../erc1155/lib/src';
import {
artifacts,
ExchangeCancelEventArgs,
Expand All @@ -42,8 +43,6 @@ import {
ReentrantERC20TokenContract,
TestStaticCallReceiverContract,
} from '../src';
import { Erc1155Wrapper, ERC1155Contract } from '../../erc1155/lib/src';
import { Exception } from 'handlebars';

chaiSetup.configure();
const expect = chai.expect;
Expand Down Expand Up @@ -1083,8 +1082,7 @@ describe('Exchange core', () => {
);
});
});

describe.only('Testing exchange of erc1155 assets', () => {
describe('Testing exchange of erc1155 assets', () => {
it('should allow a single fungible erc1155 asset to be exchanged for another', async () => {
// setup test parameters
const tokenHolders = [makerAddress, takerAddress];
Expand Down

0 comments on commit 4e72b93

Please sign in to comment.