aboutsummaryrefslogtreecommitdiffstats
path: root/test/0x.js.ts
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-05-26 19:29:19 +0800
committerFabio Berger <me@fabioberger.com>2017-05-26 19:29:19 +0800
commit9f163165677ac0443938a61e426a593048366f83 (patch)
treef739d2f4da344b1abfccd2fbb912410e46ce3f86 /test/0x.js.ts
parent4465313df3689ccf356b516693a77925ea2f57ea (diff)
parentf338c68f126cba0f1b49c2928f276158b64d8ee7 (diff)
downloaddexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.tar
dexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.tar.gz
dexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.tar.bz2
dexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.tar.lz
dexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.tar.xz
dexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.tar.zst
dexon-sol-tools-9f163165677ac0443938a61e426a593048366f83.zip
Merge branch 'master' into implementFirstExchangeMethod
# Conflicts: # package.json # src/ts/0x.js.ts # src/ts/globals.d.ts # src/ts/types.ts
Diffstat (limited to 'test/0x.js.ts')
-rw-r--r--test/0x.js.ts38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/0x.js.ts b/test/0x.js.ts
index a913fd6b5..d5b2015fb 100644
--- a/test/0x.js.ts
+++ b/test/0x.js.ts
@@ -3,12 +3,50 @@ import * as chai from 'chai';
import 'mocha';
import * as BigNumber from 'bignumber.js';
import ChaiBigNumber = require('chai-bignumber');
+import {constants} from '../src/ts/utils/constants';
// Use BigNumber chai add-on
chai.use(ChaiBigNumber());
const expect = chai.expect;
describe('ZeroEx library', () => {
+ describe('#getOrderHash', () => {
+ const ORDER_HASH = '0x103a5e97dab5dbeb8f385636f86a7d1e458a7ccbe1bd194727f0b2f85ab116c7';
+ it('defaults takerAddress to NULL address', () => {
+ const orderHash = ZeroEx.getOrderHashHex(
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ '',
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ );
+ expect(orderHash).to.be.equal(ORDER_HASH);
+ });
+ it('calculates the order hash', () => {
+ const orderHash = ZeroEx.getOrderHashHex(
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ constants.NULL_ADDRESS,
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ new BigNumber(0),
+ );
+ expect(orderHash).to.be.equal(ORDER_HASH);
+ });
+ });
describe('#isValidSignature', () => {
// This test data was borrowed from the JSON RPC documentation
// Source: https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign