From cb11aec84df346d5180c7d5874859c1c34f0bf1c Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Wed, 20 Dec 2017 00:44:08 -0500 Subject: Add new underscore-privates rule to @0xproject/tslint-config and fix lint errors --- packages/contracts/util/order.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'packages/contracts/util/order.ts') diff --git a/packages/contracts/util/order.ts b/packages/contracts/util/order.ts index ec5362b66..52d611ade 100644 --- a/packages/contracts/util/order.ts +++ b/packages/contracts/util/order.ts @@ -21,7 +21,7 @@ export class Order { if (_.isUndefined(v) || _.isUndefined(r) || _.isUndefined(s)) { throw new Error('Cannot call isValidSignature on unsigned order'); } - const orderHash = this.getOrderHash(); + const orderHash = this._getOrderHash(); const msgHash = ethUtil.hashPersonalMessage(ethUtil.toBuffer(orderHash)); try { const pubKey = ethUtil.ecrecover(msgHash, v, ethUtil.toBuffer(r), ethUtil.toBuffer(s)); @@ -32,7 +32,7 @@ export class Order { } } public async signAsync() { - const orderHash = this.getOrderHash(); + const orderHash = this._getOrderHash(); const signature = await promisify(web3.eth.sign)(this.params.maker, orderHash); const {v, r, s} = ethUtil.fromRpcSig(signature); this.params = _.assign(this.params, { @@ -88,7 +88,7 @@ export class Order { }; return cancel; } - private getOrderHash(): string { + private _getOrderHash(): string { const orderHash = crypto.solSHA3([ this.params.exchangeContractAddress, this.params.maker, -- cgit From e744e4cd989bd3ae1070c59f7baa8097f18b8b06 Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Fri, 22 Dec 2017 15:05:32 +0100 Subject: Apply prettier config --- packages/contracts/util/order.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'packages/contracts/util/order.ts') diff --git a/packages/contracts/util/order.ts b/packages/contracts/util/order.ts index 52d611ade..2427ffb87 100644 --- a/packages/contracts/util/order.ts +++ b/packages/contracts/util/order.ts @@ -1,11 +1,11 @@ -import {promisify} from '@0xproject/utils'; -import {BigNumber} from 'bignumber.js'; +import { promisify } from '@0xproject/utils'; +import { BigNumber } from 'bignumber.js'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import Web3 = require('web3'); -import {crypto} from './crypto'; -import {OrderParams} from './types'; +import { crypto } from './crypto'; +import { OrderParams } from './types'; // In order to benefit from type-safety, we re-assign the global web3 instance injected by Truffle // with type `any` to a variable of type `Web3`. @@ -17,7 +17,7 @@ export class Order { this.params = params; } public isValidSignature() { - const {v, r, s} = this.params; + const { v, r, s } = this.params; if (_.isUndefined(v) || _.isUndefined(r) || _.isUndefined(s)) { throw new Error('Cannot call isValidSignature on unsigned order'); } @@ -34,7 +34,7 @@ export class Order { public async signAsync() { const orderHash = this._getOrderHash(); const signature = await promisify(web3.eth.sign)(this.params.maker, orderHash); - const {v, r, s} = ethUtil.fromRpcSig(signature); + const { v, r, s } = ethUtil.fromRpcSig(signature); this.params = _.assign(this.params, { orderHashHex: orderHash, v, -- cgit From 4dfa720f2dec2be0b0758633c087579a02e482bb Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 12:38:19 +0100 Subject: Use configured version of bignumber in all packages --- packages/contracts/util/order.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'packages/contracts/util/order.ts') diff --git a/packages/contracts/util/order.ts b/packages/contracts/util/order.ts index 2427ffb87..9d1814368 100644 --- a/packages/contracts/util/order.ts +++ b/packages/contracts/util/order.ts @@ -1,5 +1,5 @@ import { promisify } from '@0xproject/utils'; -import { BigNumber } from 'bignumber.js'; +import { BigNumber } from '@0xproject/utils'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import Web3 = require('web3'); -- cgit From e2ef0c5b9419fa1536a1b7e478f7950e69e8ff0e Mon Sep 17 00:00:00 2001 From: Leonid Logvinov Date: Thu, 4 Jan 2018 15:12:32 +0100 Subject: Fix linter errors --- packages/contracts/util/order.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'packages/contracts/util/order.ts') diff --git a/packages/contracts/util/order.ts b/packages/contracts/util/order.ts index 9d1814368..e202d485b 100644 --- a/packages/contracts/util/order.ts +++ b/packages/contracts/util/order.ts @@ -1,5 +1,4 @@ -import { promisify } from '@0xproject/utils'; -import { BigNumber } from '@0xproject/utils'; +import { BigNumber, promisify } from '@0xproject/utils'; import ethUtil = require('ethereumjs-util'); import * as _ from 'lodash'; import Web3 = require('web3'); -- cgit