aboutsummaryrefslogtreecommitdiffstats
path: root/test/0x.js_test.ts
diff options
context:
space:
mode:
authorLeonid <logvinov.leon@gmail.com>2017-06-06 21:14:53 +0800
committerGitHub <noreply@github.com>2017-06-06 21:14:53 +0800
commit692a0fd965f7c0cfc0eef79112d2abffdf9e90db (patch)
treea3a97eb6522bc887966da6575e4b2ac73560fdcf /test/0x.js_test.ts
parent2eb99f46f53984c1a54315f87059ef18b9d06349 (diff)
parentf54b513935dbba0dd1922566ed2fd4b4acbf6459 (diff)
downloaddexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.gz
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.bz2
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.lz
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.xz
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.tar.zst
dexon-sol-tools-692a0fd965f7c0cfc0eef79112d2abffdf9e90db.zip
Merge pull request #39 from 0xProject/senderAccount
Make methods accept senderAccount
Diffstat (limited to 'test/0x.js_test.ts')
-rw-r--r--test/0x.js_test.ts22
1 files changed, 10 insertions, 12 deletions
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts
index 42dbeee9f..5096d5df2 100644
--- a/test/0x.js_test.ts
+++ b/test/0x.js_test.ts
@@ -188,6 +188,13 @@ describe('ZeroEx library', () => {
});
describe('#signOrderHashAsync', () => {
let stubs: Sinon.SinonStub[] = [];
+ let makerAddress: string;
+ const web3 = web3Factory.create();
+ const zeroEx = new ZeroEx(web3);
+ before(async () => {
+ const availableAddreses = await zeroEx.getAvailableAddressesAsync();
+ makerAddress = availableAddreses[0];
+ });
afterEach(() => {
// clean up any stubs after the test has completed
_.each(stubs, s => s.restore());
@@ -200,10 +207,7 @@ describe('ZeroEx library', () => {
r: '0x61a3ed31b43c8780e905a260a35faefcc527be7516aa11c0256729b5b351bc33',
s: '0x40349190569279751135161d22529dc25add4f6069af05be04cacbda2ace2254',
};
-
- const web3 = web3Factory.create();
- const zeroEx = new ZeroEx(web3);
- const ecSignature = await zeroEx.signOrderHashAsync(orderHash);
+ const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
expect(ecSignature).to.deep.equal(expectedECSignature);
});
it ('should return the correct ECSignature on Parity > V1.6.6', async () => {
@@ -216,9 +220,6 @@ describe('ZeroEx library', () => {
r: '0x22109d11d79cb8bf96ed88625e1cd9558800c4073332a9a02857499883ee5ce3',
s: '0x050aa3cc1f2c435e67e114cdce54b9527b4f50548342401bc5d2b77adbdacb02',
};
-
- const web3 = web3Factory.create();
- const zeroEx = new ZeroEx(web3);
stubs = [
Sinon.stub((zeroEx as any).web3Wrapper, 'getNodeVersionAsync')
.returns(Promise.resolve(newParityNodeVersion)),
@@ -227,7 +228,7 @@ describe('ZeroEx library', () => {
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
];
- const ecSignature = await zeroEx.signOrderHashAsync(orderHash);
+ const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
expect(ecSignature).to.deep.equal(expectedECSignature);
});
it ('should return the correct ECSignature on Parity < V1.6.6', async () => {
@@ -240,9 +241,6 @@ describe('ZeroEx library', () => {
r: '0xc80bedc6756722672753413efdd749b5adbd4fd552595f59c13427407ee9aee0',
s: '0x2dea66f25a608bbae457e020fb6decb763deb8b7192abab624997242da248960',
};
-
- const web3 = web3Factory.create();
- const zeroEx = new ZeroEx(web3);
stubs = [
Sinon.stub((zeroEx as any).web3Wrapper, 'getNodeVersionAsync')
.returns(Promise.resolve(newParityNodeVersion)),
@@ -251,7 +249,7 @@ describe('ZeroEx library', () => {
Sinon.stub(ZeroEx, 'isValidSignature').returns(true),
];
- const ecSignature = await zeroEx.signOrderHashAsync(orderHash);
+ const ecSignature = await zeroEx.signOrderHashAsync(orderHash, makerAddress);
expect(ecSignature).to.deep.equal(expectedECSignature);
});
});