aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2018-05-25 07:30:30 +0800
committerFabio Berger <me@fabioberger.com>2018-05-25 07:30:30 +0800
commit35121f0b780102f0235ab3d5f26441cbb3f090e9 (patch)
tree9f1e56a98683fbee69a6b5fc051dc81064643734 /packages/contracts
parent3cc8af819c9f62f42e7cb3d03f896b35cfc10d05 (diff)
parentc4a7574f7bd3939eac9417241144197bbb22edb1 (diff)
downloaddexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar
dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.gz
dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.bz2
dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.lz
dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.xz
dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.tar.zst
dexon-sol-tools-35121f0b780102f0235ab3d5f26441cbb3f090e9.zip
Merge branch 'v2-prototype' into feature/contracts/eip712-order-hash
* v2-prototype: Temporarily disable installation tests Pin connect in sra-report Fix a typo Pin types in sra-report Fix linter issues Unpin types version in @0xproject/connect Pin types version in website Do a fake version bump on types so that yarn doesn't try to install updated version for not yet migrated packages Migrate migrations to v2 # Conflicts: # packages/contracts/src/utils/order_utils.ts
Diffstat (limited to 'packages/contracts')
-rw-r--r--packages/contracts/src/utils/exchange_wrapper.ts4
-rw-r--r--packages/contracts/src/utils/formatters.ts3
-rw-r--r--packages/contracts/src/utils/match_order_tester.ts3
-rw-r--r--packages/contracts/src/utils/order_factory.ts3
-rw-r--r--packages/contracts/src/utils/order_utils.ts3
-rw-r--r--packages/contracts/src/utils/types.ts39
-rw-r--r--packages/contracts/test/exchange/core.ts4
-rw-r--r--packages/contracts/test/exchange/libs.ts2
-rw-r--r--packages/contracts/test/exchange/match_orders.ts3
-rw-r--r--packages/contracts/test/exchange/signature_validator.ts2
-rw-r--r--packages/contracts/test/exchange/transactions.ts5
-rw-r--r--packages/contracts/test/exchange/wrapper.ts3
12 files changed, 26 insertions, 48 deletions
diff --git a/packages/contracts/src/utils/exchange_wrapper.ts b/packages/contracts/src/utils/exchange_wrapper.ts
index c353442f3..f2533a598 100644
--- a/packages/contracts/src/utils/exchange_wrapper.ts
+++ b/packages/contracts/src/utils/exchange_wrapper.ts
@@ -1,4 +1,4 @@
-import { Provider, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
+import { Provider, SignedOrder, TransactionReceiptWithDecodedLogs } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as _ from 'lodash';
@@ -10,7 +10,7 @@ import { constants } from './constants';
import { formatters } from './formatters';
import { LogDecoder } from './log_decoder';
import { orderUtils } from './order_utils';
-import { AssetProxyId, OrderInfo, SignedOrder, SignedTransaction } from './types';
+import { AssetProxyId, OrderInfo, SignedTransaction } from './types';
export class ExchangeWrapper {
private _exchange: ExchangeContract;
diff --git a/packages/contracts/src/utils/formatters.ts b/packages/contracts/src/utils/formatters.ts
index bfa48d6f1..c46d668bc 100644
--- a/packages/contracts/src/utils/formatters.ts
+++ b/packages/contracts/src/utils/formatters.ts
@@ -1,8 +1,9 @@
+import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { orderUtils } from './order_utils';
-import { BatchCancelOrders, BatchFillOrders, MarketBuyOrders, MarketSellOrders, SignedOrder } from './types';
+import { BatchCancelOrders, BatchFillOrders, MarketBuyOrders, MarketSellOrders } from './types';
export const formatters = {
createBatchFill(signedOrders: SignedOrder[], takerAssetFillAmounts: BigNumber[] = []): BatchFillOrders {
diff --git a/packages/contracts/src/utils/match_order_tester.ts b/packages/contracts/src/utils/match_order_tester.ts
index 30039937f..87399b9f6 100644
--- a/packages/contracts/src/utils/match_order_tester.ts
+++ b/packages/contracts/src/utils/match_order_tester.ts
@@ -1,5 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { LogWithDecodedArgs } from '@0xproject/types';
+import { LogWithDecodedArgs, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
@@ -29,7 +29,6 @@ import {
ERC20BalancesByOwner,
ERC721TokenIdsByOwner,
ExchangeStatus,
- SignedOrder,
TransferAmountsByMatchOrders as TransferAmounts,
} from '../utils/types';
import { provider, web3Wrapper } from '../utils/web3_wrapper';
diff --git a/packages/contracts/src/utils/order_factory.ts b/packages/contracts/src/utils/order_factory.ts
index 86b3d5ac7..f704c26ec 100644
--- a/packages/contracts/src/utils/order_factory.ts
+++ b/packages/contracts/src/utils/order_factory.ts
@@ -1,11 +1,12 @@
import { generatePseudoRandomSalt } from '@0xproject/order-utils';
+import { SignedOrder, UnsignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as _ from 'lodash';
import { constants } from './constants';
import { orderUtils } from './order_utils';
import { signingUtils } from './signing_utils';
-import { SignatureType, SignedOrder, UnsignedOrder } from './types';
+import { SignatureType } from './types';
export class OrderFactory {
private _defaultOrderParams: Partial<UnsignedOrder>;
diff --git a/packages/contracts/src/utils/order_utils.ts b/packages/contracts/src/utils/order_utils.ts
index 969d43dd1..78ac934a1 100644
--- a/packages/contracts/src/utils/order_utils.ts
+++ b/packages/contracts/src/utils/order_utils.ts
@@ -1,3 +1,4 @@
+import { Order, SignedOrder, UnsignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import ethUtil = require('ethereumjs-util');
@@ -20,7 +21,7 @@ export const orderUtils = {
};
return cancel;
},
- getOrderStruct(signedOrder: SignedOrder): OrderStruct {
+ getOrderStruct(signedOrder: SignedOrder): Order {
const orderStruct = {
senderAddress: signedOrder.senderAddress,
makerAddress: signedOrder.makerAddress,
diff --git a/packages/contracts/src/utils/types.ts b/packages/contracts/src/utils/types.ts
index ef86b4f38..8c53b966f 100644
--- a/packages/contracts/src/utils/types.ts
+++ b/packages/contracts/src/utils/types.ts
@@ -1,4 +1,4 @@
-import { AbiDefinition, ContractAbi } from '@0xproject/types';
+import { AbiDefinition, ContractAbi, Order } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
export interface ERC20BalancesByOwner {
@@ -18,25 +18,25 @@ export interface SubmissionContractEventArgs {
}
export interface BatchFillOrders {
- orders: OrderStruct[];
+ orders: Order[];
signatures: string[];
takerAssetFillAmounts: BigNumber[];
}
export interface MarketSellOrders {
- orders: OrderStruct[];
+ orders: Order[];
signatures: string[];
takerAssetFillAmount: BigNumber;
}
export interface MarketBuyOrders {
- orders: OrderStruct[];
+ orders: Order[];
signatures: string[];
makerAssetFillAmount: BigNumber;
}
export interface BatchCancelOrders {
- orders: OrderStruct[];
+ orders: Order[];
}
export interface CancelOrdersBefore {
@@ -113,29 +113,6 @@ export enum ContractName {
Authorizable = 'Authorizable',
}
-export interface SignedOrder extends UnsignedOrder {
- signature: string;
-}
-
-export interface OrderStruct {
- senderAddress: string;
- makerAddress: string;
- takerAddress: string;
- feeRecipientAddress: string;
- makerAssetAmount: BigNumber;
- takerAssetAmount: BigNumber;
- makerFee: BigNumber;
- takerFee: BigNumber;
- expirationTimeSeconds: BigNumber;
- salt: BigNumber;
- makerAssetData: string;
- takerAssetData: string;
-}
-
-export interface UnsignedOrder extends OrderStruct {
- exchangeAddress: string;
-}
-
export enum SignatureType {
Illegal,
Invalid,
@@ -199,13 +176,13 @@ export interface ProxyData {
}
export interface CancelOrder {
- order: OrderStruct;
+ order: Order;
takerAssetCancelAmount: BigNumber;
}
export interface MatchOrder {
- left: OrderStruct;
- right: OrderStruct;
+ left: Order;
+ right: Order;
leftSignature: string;
rightSignature: string;
}
diff --git a/packages/contracts/test/exchange/core.ts b/packages/contracts/test/exchange/core.ts
index 4776216ca..f5cae7c7c 100644
--- a/packages/contracts/test/exchange/core.ts
+++ b/packages/contracts/test/exchange/core.ts
@@ -1,5 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { LogWithDecodedArgs } from '@0xproject/types';
+import { LogWithDecodedArgs, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
@@ -26,7 +26,7 @@ import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
import { OrderFactory } from '../../src/utils/order_factory';
import { orderUtils } from '../../src/utils/order_utils';
-import { AssetProxyId, ContractName, ERC20BalancesByOwner, ExchangeStatus, SignedOrder } from '../../src/utils/types';
+import { AssetProxyId, ContractName, ERC20BalancesByOwner, ExchangeStatus } from '../../src/utils/types';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
chaiSetup.configure();
diff --git a/packages/contracts/test/exchange/libs.ts b/packages/contracts/test/exchange/libs.ts
index ad971e08a..bbca54274 100644
--- a/packages/contracts/test/exchange/libs.ts
+++ b/packages/contracts/test/exchange/libs.ts
@@ -1,4 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
+import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
@@ -11,7 +12,6 @@ import { chaiSetup } from '../../src/utils/chai_setup';
import { constants } from '../../src/utils/constants';
import { OrderFactory } from '../../src/utils/order_factory';
import { orderUtils } from '../../src/utils/order_utils';
-import { SignedOrder } from '../../src/utils/types';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
chaiSetup.configure();
diff --git a/packages/contracts/test/exchange/match_orders.ts b/packages/contracts/test/exchange/match_orders.ts
index 1834e929c..0da0287bc 100644
--- a/packages/contracts/test/exchange/match_orders.ts
+++ b/packages/contracts/test/exchange/match_orders.ts
@@ -1,5 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { LogWithDecodedArgs } from '@0xproject/types';
+import { LogWithDecodedArgs, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
@@ -33,7 +33,6 @@ import {
ERC721TokenIdsByOwner,
ExchangeStatus,
OrderInfo,
- SignedOrder,
} from '../../src/utils/types';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts
index 91614c666..376fff438 100644
--- a/packages/contracts/test/exchange/signature_validator.ts
+++ b/packages/contracts/test/exchange/signature_validator.ts
@@ -1,4 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
+import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import ethUtil = require('ethereumjs-util');
@@ -11,7 +12,6 @@ import { chaiSetup } from '../../src/utils/chai_setup';
import { constants } from '../../src/utils/constants';
import { OrderFactory } from '../../src/utils/order_factory';
import { orderUtils } from '../../src/utils/order_utils';
-import { SignedOrder } from '../../src/utils/types';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
chaiSetup.configure();
diff --git a/packages/contracts/test/exchange/transactions.ts b/packages/contracts/test/exchange/transactions.ts
index 24f7230fa..33fe11bfa 100644
--- a/packages/contracts/test/exchange/transactions.ts
+++ b/packages/contracts/test/exchange/transactions.ts
@@ -1,4 +1,5 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
+import { Order, SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import * as chai from 'chai';
import * as ethUtil from 'ethereumjs-util';
@@ -20,9 +21,7 @@ import {
AssetProxyId,
ERC20BalancesByOwner,
ExchangeStatus,
- OrderStruct,
SignatureType,
- SignedOrder,
SignedTransaction,
} from '../../src/utils/types';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
@@ -47,7 +46,7 @@ describe('Exchange transactions', () => {
let erc20Balances: ERC20BalancesByOwner;
let signedOrder: SignedOrder;
let signedTx: SignedTransaction;
- let order: OrderStruct;
+ let order: Order;
let orderFactory: OrderFactory;
let makerTransactionFactory: TransactionFactory;
let takerTransactionFactory: TransactionFactory;
diff --git a/packages/contracts/test/exchange/wrapper.ts b/packages/contracts/test/exchange/wrapper.ts
index e7217c2a7..7e1818f4a 100644
--- a/packages/contracts/test/exchange/wrapper.ts
+++ b/packages/contracts/test/exchange/wrapper.ts
@@ -1,4 +1,5 @@
import { BlockchainLifecycle, devConstants, web3Factory } from '@0xproject/dev-utils';
+import { SignedOrder } from '@0xproject/types';
import { BigNumber } from '@0xproject/utils';
import { Web3Wrapper } from '@0xproject/web3-wrapper';
import * as chai from 'chai';
@@ -20,7 +21,7 @@ import { ERC20Wrapper } from '../../src/utils/erc20_wrapper';
import { ERC721Wrapper } from '../../src/utils/erc721_wrapper';
import { ExchangeWrapper } from '../../src/utils/exchange_wrapper';
import { OrderFactory } from '../../src/utils/order_factory';
-import { AssetProxyId, ERC20BalancesByOwner, SignedOrder } from '../../src/utils/types';
+import { AssetProxyId, ERC20BalancesByOwner } from '../../src/utils/types';
import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper';
chaiSetup.configure();