Ran prettier & linter

This commit is contained in:
Greg Hysen
2019-03-07 17:30:16 -08:00
parent 6957e6e8f7
commit 6992bff0e0
3 changed files with 32 additions and 25 deletions

View File

@@ -137,21 +137,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(
@@ -259,7 +259,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 () => {
@@ -1240,7 +1240,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,
@@ -1263,7 +1263,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({
@@ -1290,7 +1294,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);

View File

@@ -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.1.3",
"@0x/contracts-utils": "^2.0.8",
"@0x/order-utils": "^7.0.2",

View File

@@ -1,12 +1,13 @@
import {
artifacts as proxyArtifacts,
ERC1155ProxyWrapper,
ERC20ProxyContract,
ERC20Wrapper,
ERC721ProxyContract,
ERC721Wrapper,
MultiAssetProxyContract,
ERC1155ProxyWrapper,
} from '@0x/contracts-asset-proxy';
import { ERC1155MintableContract } from '@0x/contracts-erc1155';
import {
artifacts as erc20Artifacts,
DummyERC20TokenContract,
@@ -27,7 +28,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';
@@ -38,6 +38,7 @@ import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
import * as _ from 'lodash';
import { Erc1155Wrapper } from '../../erc1155/lib/src';
import {
artifacts,
ExchangeCancelEventArgs,
@@ -46,8 +47,6 @@ import {
ReentrantERC20TokenContract,
TestStaticCallReceiverContract,
} from '../src';
import { Erc1155Wrapper, ERC1155Contract } from '../../erc1155/lib/src';
import { Exception } from 'handlebars';
chaiSetup.configure();
const expect = chai.expect;
@@ -1087,8 +1086,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];