aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabio Berger <me@fabioberger.com>2017-05-26 23:10:02 +0800
committerFabio Berger <me@fabioberger.com>2017-05-26 23:10:02 +0800
commit5a6df03b64630b4ccfe1a211a113413b9f1d4e5c (patch)
tree16135ea884ab1c5a03d1dbb06fc8ba00da8a0eb7 /src
parent123cfb7c00bcfba0a24e2ac4593834b134a76806 (diff)
downloaddexon-0x-contracts-5a6df03b64630b4ccfe1a211a113413b9f1d4e5c.tar.gz
dexon-0x-contracts-5a6df03b64630b4ccfe1a211a113413b9f1d4e5c.tar.zst
dexon-0x-contracts-5a6df03b64630b4ccfe1a211a113413b9f1d4e5c.zip
cleanup isValidSignature method
Diffstat (limited to 'src')
-rw-r--r--src/ts/contract_wrappers/exchange_wrapper.ts11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ts/contract_wrappers/exchange_wrapper.ts b/src/ts/contract_wrappers/exchange_wrapper.ts
index 5a576a7fa..b02390eba 100644
--- a/src/ts/contract_wrappers/exchange_wrapper.ts
+++ b/src/ts/contract_wrappers/exchange_wrapper.ts
@@ -10,20 +10,21 @@ export class ExchangeWrapper extends ContractWrapper {
constructor(web3Wrapper: Web3Wrapper) {
super(web3Wrapper);
}
- public async isValidSignatureAsync(dataHex: string, ecSignature: ECSignature, maker: string) {
+ public async isValidSignatureAsync(dataHex: string, ecSignature: ECSignature,
+ signerAddressHex: string): Promise<boolean> {
assert.isHexString('dataHex', dataHex);
assert.doesConformToSchema('ecSignature', ecSignature, ECSignatureSchema);
- assert.isString('maker', maker);
+ assert.isETHAddressHex('signerAddressHex', signerAddressHex);
- const senderAddressIfExists = this.web3Wrapper.getSenderAddressIfExistsAsync();
+ const senderAddressIfExists = await this.web3Wrapper.getSenderAddressIfExistsAsync();
assert.assert(!_.isUndefined(senderAddressIfExists), ZeroExError.USER_HAS_NO_ASSOCIATED_ADDRESSES);
- // TODO: remove any here
+ // TODO: remove `any` here
const contractInstance = await this.instantiateContractIfExistsAsync((ExchangeArtifacts as any));
const exchangeInstance = contractInstance as ExchangeContract;
const isValidSignature = await exchangeInstance.isValidSignature.call(
- maker,
+ signerAddressHex,
dataHex,
ecSignature.v,
ecSignature.r,