aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-06-07 23:23:59 +0800
committerFabio Berger <me@fabioberger.com>2017-06-07 23:23:59 +0800
commitbc441015b672c310bd4b4a67fcf9a98e28793883 (patch)
treef16e2385fb5267d60715c7aad829e29546d7c1b1
parent951d15b3cad954d995402e9379547fd2de90227f (diff)
downloaddexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.tar
dexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.tar.gz
dexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.tar.bz2
dexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.tar.lz
dexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.tar.xz
dexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.tar.zst
dexon-sol-tools-bc441015b672c310bd4b4a67fcf9a98e28793883.zip
add `hex` to function and variable name for clarity
-rw-r--r--src/0x.js.ts4
-rw-r--r--src/contract_wrappers/exchange_wrapper.ts8
-rw-r--r--test/0x.js_test.ts2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/0x.js.ts b/src/0x.js.ts
index 20bd2c985..8f1178b2a 100644
--- a/src/0x.js.ts
+++ b/src/0x.js.ts
@@ -134,8 +134,8 @@ export class ZeroEx {
orderSchema);
const exchangeContractAddr = await this.getExchangeAddressAsync();
- const orderHash = utils.getOrderHashHex(order, exchangeContractAddr);
- return orderHash;
+ const orderHashHex = utils.getOrderHashHex(order, exchangeContractAddr);
+ return orderHashHex;
}
/**
* Signs an orderHash and returns it's elliptic curve signature
diff --git a/src/contract_wrappers/exchange_wrapper.ts b/src/contract_wrappers/exchange_wrapper.ts
index f6451a3cc..d25b8aa29 100644
--- a/src/contract_wrappers/exchange_wrapper.ts
+++ b/src/contract_wrappers/exchange_wrapper.ts
@@ -292,11 +292,11 @@ export class ExchangeWrapper extends ContractWrapper {
logEventObj.watch(callback);
this.exchangeLogEventObjs.push(logEventObj);
}
- private async getOrderHashAsync(order: Order|SignedOrder): Promise<string> {
+ private async getOrderHashHexAsync(order: Order|SignedOrder): Promise<string> {
const [orderAddresses, orderValues] = ExchangeWrapper.getOrderAddressesAndValues(order);
const exchangeInstance = await this.getExchangeContractAsync();
- const orderHash = utils.getOrderHashHex(order, exchangeInstance.address);
- return orderHash;
+ const orderHashHex = utils.getOrderHashHex(order, exchangeInstance.address);
+ return orderHashHex;
}
private async stopWatchingExchangeLogEventsAsync() {
const stopWatchingPromises = _.map(this.exchangeLogEventObjs, logEventObj => {
@@ -334,7 +334,7 @@ export class ExchangeWrapper extends ContractWrapper {
if (takerTokenCancelAmount.eq(0)) {
throw new Error(ExchangeContractErrs.ORDER_CANCEL_AMOUNT_ZERO);
}
- const orderHash = await this.getOrderHashAsync(order);
+ const orderHash = await this.getOrderHashHexAsync(order);
const unavailableAmount = await this.getUnavailableTakerAmountAsync(orderHash);
if (order.takerTokenAmount.minus(unavailableAmount).eq(0)) {
throw new Error(ExchangeContractErrs.ORDER_ALREADY_CANCELLED_OR_FILLED);
diff --git a/test/0x.js_test.ts b/test/0x.js_test.ts
index 5096d5df2..58f259a11 100644
--- a/test/0x.js_test.ts
+++ b/test/0x.js_test.ts
@@ -151,7 +151,7 @@ describe('ZeroEx library', () => {
expect(baseUnitAmount).to.be.bignumber.equal(expectedUnitAmount);
});
});
- describe('#getOrderHashAsync', () => {
+ describe('#getOrderHashHexAsync', () => {
const exchangeContractAddress = constants.NULL_ADDRESS;
const expectedOrderHash = '0x103a5e97dab5dbeb8f385636f86a7d1e458a7ccbe1bd194727f0b2f85ab116c7';
const order: Order = {