aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/test
diff options
context:
space:
mode:
authorJacob Evans <dekz@dekz.net>2018-08-14 07:36:11 +0800
committerGitHub <noreply@github.com>2018-08-14 07:36:11 +0800
commite51deb93eef2e59a3577195becfb6d602df3892a (patch)
treea74ca989588877d3552f28144d40b015f1f5b67e /packages/contracts/test
parent0025c6640b3a5840bacfb4ab5f6e937fc9af8eff (diff)
parenta3517574936aa6a4911003dbff06302926b04cb4 (diff)
downloaddexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.tar
dexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.tar.gz
dexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.tar.bz2
dexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.tar.lz
dexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.tar.xz
dexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.tar.zst
dexon-sol-tools-e51deb93eef2e59a3577195becfb6d602df3892a.zip
Merge pull request #914 from 0xProject/feature/0x.js/ec-signature-string
0x.js Return signature as a hex encoded string
Diffstat (limited to 'packages/contracts/test')
-rw-r--r--packages/contracts/test/exchange/signature_validator.ts12
1 files changed, 6 insertions, 6 deletions
diff --git a/packages/contracts/test/exchange/signature_validator.ts b/packages/contracts/test/exchange/signature_validator.ts
index bef0547bd..56a06c247 100644
--- a/packages/contracts/test/exchange/signature_validator.ts
+++ b/packages/contracts/test/exchange/signature_validator.ts
@@ -1,6 +1,6 @@
import { BlockchainLifecycle } from '@0xproject/dev-utils';
-import { addSignedMessagePrefix, assetDataUtils, MessagePrefixType, orderHashUtils } from '@0xproject/order-utils';
-import { RevertReason, SignatureType, SignedOrder } from '@0xproject/types';
+import { addSignedMessagePrefix, assetDataUtils, orderHashUtils } from '@0xproject/order-utils';
+import { RevertReason, SignatureType, SignedOrder, SignerType } from '@0xproject/types';
import * as chai from 'chai';
import { LogWithDecodedArgs } from 'ethereum-types';
import ethUtil = require('ethereumjs-util');
@@ -213,7 +213,7 @@ describe('MixinSignatureValidator', () => {
it('should return true when SignatureType=EthSign and signature is valid', async () => {
// Create EthSign signature
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
- const orderHashWithEthSignPrefixHex = addSignedMessagePrefix(orderHashHex, MessagePrefixType.EthSign);
+ const orderHashWithEthSignPrefixHex = addSignedMessagePrefix(orderHashHex, SignerType.Default);
const orderHashWithEthSignPrefixBuffer = ethUtil.toBuffer(orderHashWithEthSignPrefixHex);
const ecSignature = ethUtil.ecsign(orderHashWithEthSignPrefixBuffer, signerPrivateKey);
// Create 0x signature from EthSign signature
@@ -236,7 +236,7 @@ describe('MixinSignatureValidator', () => {
it('should return false when SignatureType=EthSign and signature is invalid', async () => {
// Create EthSign signature
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
- const orderHashWithEthSignPrefixHex = addSignedMessagePrefix(orderHashHex, MessagePrefixType.EthSign);
+ const orderHashWithEthSignPrefixHex = addSignedMessagePrefix(orderHashHex, SignerType.Default);
const orderHashWithEthSignPrefixBuffer = ethUtil.toBuffer(orderHashWithEthSignPrefixHex);
const ecSignature = ethUtil.ecsign(orderHashWithEthSignPrefixBuffer, signerPrivateKey);
// Create 0x signature from EthSign signature
@@ -385,7 +385,7 @@ describe('MixinSignatureValidator', () => {
it('should return true when SignatureType=Trezor and signature is valid', async () => {
// Create Trezor signature
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
- const orderHashWithTrezorPrefixHex = addSignedMessagePrefix(orderHashHex, MessagePrefixType.Trezor);
+ const orderHashWithTrezorPrefixHex = addSignedMessagePrefix(orderHashHex, SignerType.Trezor);
const orderHashWithTrezorPrefixBuffer = ethUtil.toBuffer(orderHashWithTrezorPrefixHex);
const ecSignature = ethUtil.ecsign(orderHashWithTrezorPrefixBuffer, signerPrivateKey);
// Create 0x signature from Trezor signature
@@ -408,7 +408,7 @@ describe('MixinSignatureValidator', () => {
it('should return false when SignatureType=Trezor and signature is invalid', async () => {
// Create Trezor signature
const orderHashHex = orderHashUtils.getOrderHashHex(signedOrder);
- const orderHashWithTrezorPrefixHex = addSignedMessagePrefix(orderHashHex, MessagePrefixType.Trezor);
+ const orderHashWithTrezorPrefixHex = addSignedMessagePrefix(orderHashHex, SignerType.Trezor);
const orderHashWithTrezorPrefixBuffer = ethUtil.toBuffer(orderHashWithTrezorPrefixHex);
const ecSignature = ethUtil.ecsign(orderHashWithTrezorPrefixBuffer, signerPrivateKey);
// Create 0x signature from Trezor signature