Ran prettier

This commit is contained in:
Greg Hysen 2019-03-07 08:57:30 -08:00
parent 9f2221a885
commit fea5a39740
4 changed files with 46 additions and 17 deletions

View File

@ -46,7 +46,7 @@ Visit our [developer portal](https://0xproject.com/docs/order-utils) for a compr
| [`@0x/contracts-multisig`](/contracts/multisig) | [![npm](https://img.shields.io/npm/v/@0x/contracts-multisig.svg)](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol | | [`@0x/contracts-multisig`](/contracts/multisig) | [![npm](https://img.shields.io/npm/v/@0x/contracts-multisig.svg)](https://www.npmjs.com/package/@0x/contracts-multisig) | Various implementations of multisignature wallets, including the [`AssetProxyOwner`](https://github.com/0xProject/0x-protocol-specification/blob/master/v2/v2-specification.md#assetproxyowner) contract that has permissions to upgrade the protocol |
| [`@0x/contracts-test-utils`](/contracts/test-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-test-utils.svg)](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts | | [`@0x/contracts-test-utils`](/contracts/test-utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-test-utils.svg)](https://www.npmjs.com/package/@0x/contracts-test-utils) | Typescript/Javascript shared utilities used for testing contracts |
| [`@0x/contracts-utils`](/contracts/utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-utils.svg)](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts | | [`@0x/contracts-utils`](/contracts/utils) | [![npm](https://img.shields.io/npm/v/@0x/contracts-utils.svg)](https://www.npmjs.com/package/@0x/contracts-utils) | Generic libraries and utilities used throughout all of the contracts |
| [`@0x/contracts-coordinator`](/contracts/coordinator) | [![npm](https://img.shields.io/npm/v/@0x/contracts-coordinator.svg)](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator | | [`@0x/contracts-coordinator`](/contracts/coordinator) | [![npm](https://img.shields.io/npm/v/@0x/contracts-coordinator.svg)](https://www.npmjs.com/package/@0x/contracts-coordinator) | A contract that allows users to execute 0x transactions with permission from a Coordinator |
### Typescript/Javascript Packages ### Typescript/Javascript Packages

View File

@ -190,10 +190,16 @@ describe('Coordinator tests', () => {
const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders); const data = exchangeDataEncoder.encodeOrdersToExchangeData(fnName, orders);
const transaction = takerTransactionFactory.newSignedTransaction(data); const transaction = takerTransactionFactory.newSignedTransaction(data);
await expectTransactionFailedAsync( await expectTransactionFailedAsync(
coordinatorContract.executeTransaction.sendTransactionAsync(transaction, transaction.signature, [], [], { coordinatorContract.executeTransaction.sendTransactionAsync(
from: takerAddress, transaction,
gas: devConstants.MAX_EXECUTE_TRANSACTION_GAS, transaction.signature,
}), [],
[],
{
from: takerAddress,
gas: devConstants.MAX_EXECUTE_TRANSACTION_GAS,
},
),
RevertReason.InvalidApprovalSignature, RevertReason.InvalidApprovalSignature,
); );
}); });
@ -388,9 +394,15 @@ describe('Coordinator tests', () => {
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDERS, orders); const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDERS, orders);
const transaction = makerTransactionFactory.newSignedTransaction(data); const transaction = makerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync( const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(transaction, transaction.signature, [], [], { await coordinatorContract.executeTransaction.sendTransactionAsync(
from: makerAddress, transaction,
}), transaction.signature,
[],
[],
{
from: makerAddress,
},
),
); );
const cancelLogs = transactionReceipt.logs.filter( const cancelLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeCancelEventArgs>).event === 'Cancel', log => (log as LogWithDecodedArgs<ExchangeCancelEventArgs>).event === 'Cancel',
@ -409,9 +421,15 @@ describe('Coordinator tests', () => {
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.BATCH_CANCEL_ORDERS, orders); const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.BATCH_CANCEL_ORDERS, orders);
const transaction = makerTransactionFactory.newSignedTransaction(data); const transaction = makerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync( const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(transaction, transaction.signature, [], [], { await coordinatorContract.executeTransaction.sendTransactionAsync(
from: makerAddress, transaction,
}), transaction.signature,
[],
[],
{
from: makerAddress,
},
),
); );
const cancelLogs = transactionReceipt.logs.filter( const cancelLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeCancelEventArgs>).event === 'Cancel', log => (log as LogWithDecodedArgs<ExchangeCancelEventArgs>).event === 'Cancel',
@ -432,9 +450,15 @@ describe('Coordinator tests', () => {
const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDERS_UP_TO, orders); const data = exchangeDataEncoder.encodeOrdersToExchangeData(constants.CANCEL_ORDERS_UP_TO, orders);
const transaction = makerTransactionFactory.newSignedTransaction(data); const transaction = makerTransactionFactory.newSignedTransaction(data);
const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync( const transactionReceipt = await web3Wrapper.awaitTransactionSuccessAsync(
await coordinatorContract.executeTransaction.sendTransactionAsync(transaction, transaction.signature, [], [], { await coordinatorContract.executeTransaction.sendTransactionAsync(
from: makerAddress, transaction,
}), transaction.signature,
[],
[],
{
from: makerAddress,
},
),
); );
const cancelLogs = transactionReceipt.logs.filter( const cancelLogs = transactionReceipt.logs.filter(
log => (log as LogWithDecodedArgs<ExchangeCancelUpToEventArgs>).event === 'CancelUpTo', log => (log as LogWithDecodedArgs<ExchangeCancelUpToEventArgs>).event === 'CancelUpTo',

View File

@ -81,14 +81,20 @@ describe('Mixins tests', () => {
describe('getSignerAddress', () => { describe('getSignerAddress', () => {
it('should return the correct address using the EthSign signature type', async () => { it('should return the correct address using the EthSign signature type', async () => {
const data = devConstants.NULL_BYTES; const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedCoordinatorTransaction(data, CoordinatorSignatureType.EthSign); const transaction = transactionFactory.newSignedCoordinatorTransaction(
data,
CoordinatorSignatureType.EthSign,
);
const transactionHash = hashUtils.getTransactionHashHex(transaction); const transactionHash = hashUtils.getTransactionHashHex(transaction);
const signerAddress = await mixins.getSignerAddress.callAsync(transactionHash, transaction.signature); const signerAddress = await mixins.getSignerAddress.callAsync(transactionHash, transaction.signature);
expect(transaction.signerAddress).to.eq(signerAddress); expect(transaction.signerAddress).to.eq(signerAddress);
}); });
it('should return the correct address using the EIP712 signature type', async () => { it('should return the correct address using the EIP712 signature type', async () => {
const data = devConstants.NULL_BYTES; const data = devConstants.NULL_BYTES;
const transaction = transactionFactory.newSignedCoordinatorTransaction(data, CoordinatorSignatureType.EIP712); const transaction = transactionFactory.newSignedCoordinatorTransaction(
data,
CoordinatorSignatureType.EIP712,
);
const transactionHash = hashUtils.getTransactionHashHex(transaction); const transactionHash = hashUtils.getTransactionHashHex(transaction);
const signerAddress = await mixins.getSignerAddress.callAsync(transactionHash, transaction.signature); const signerAddress = await mixins.getSignerAddress.callAsync(transactionHash, transaction.signature);
expect(transaction.signerAddress).to.eq(signerAddress); expect(transaction.signerAddress).to.eq(signerAddress);

View File

@ -1,6 +1,5 @@
[ [
{ {
"version": "2.0.9", "version": "2.0.9",
"changes": [ "changes": [
{ {