Skip to content
This repository has been archived by the owner on Jul 9, 2021. It is now read-only.

Commit

Permalink
Added SignatureValidator test case - should return false if hash was …
Browse files Browse the repository at this point in the history
…not presigned
  • Loading branch information
hysz committed Feb 4, 2019
1 parent 74293d5 commit a149c0c
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions contracts/exchange/test/signature_validator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
web3Wrapper,
} from '@0x/contracts-test-utils';
import { BlockchainLifecycle } from '@0x/dev-utils';
import { assetDataUtils, orderHashUtils, signatureUtils } from '@0x/order-utils';
import { assetDataUtils, orderHashUtils, signatureUtils } from '@0x/order-utils';
import { RevertReason, SignatureType, SignedOrder } from '@0x/types';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
Expand All @@ -31,7 +31,7 @@ const expect = chai.expect;

const blockchainLifecycle = new BlockchainLifecycle(web3Wrapper);
// tslint:disable:no-unnecessary-type-assertion
describe('MixinSignatureValidator', () => {
describe.only('MixinSignatureValidator', () => {
let signedOrder: SignedOrder;
let orderFactory: OrderFactory;
let signatureValidator: TestSignatureValidatorContract;
Expand Down Expand Up @@ -522,6 +522,15 @@ describe('MixinSignatureValidator', () => {
expect(logArgs.approved).to.equal(approval);
});
});

describe.only('preSigned', () => {
it('should return false if hash was not presigned', async () => {
const nonExistentrderHashHex = '0x2ca5224993ec001fddc77d441947abb55133c91fa46589f5cd6e56c980fa5e45';
const nonExistentSignerAddress = addressUtils.generatePseudoRandomAddress();
const isPreSigned = await signatureValidator.preSigned.callAsync(nonExistentrderHashHex, nonExistentSignerAddress);
expect(isPreSigned).to.be.false();
});
});
});
// tslint:disable:max-file-line-count
// tslint:enable:no-unnecessary-type-assertion

0 comments on commit a149c0c

Please sign in to comment.