aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/utils/assert.ts7
-rw-r--r--test/assert_test.ts2
2 files changed, 5 insertions, 4 deletions
diff --git a/src/utils/assert.ts b/src/utils/assert.ts
index 5b4a6fca6..aee53f30c 100644
--- a/src/utils/assert.ts
+++ b/src/utils/assert.ts
@@ -29,11 +29,12 @@ export const assert = {
async isSenderAddressHexAsync(variableName: string, senderAddress: string,
web3Wrapper: Web3Wrapper): Promise<void> {
assert.isETHAddressHex(variableName, senderAddress);
- await assert.isSenderAddressAvailableAsync(web3Wrapper, senderAddress);
+ await assert.isSenderAddressAvailableAsync(web3Wrapper, variableName, senderAddress);
},
- async isSenderAddressAvailableAsync(web3Wrapper: Web3Wrapper, senderAddress: string): Promise<void> {
+ async isSenderAddressAvailableAsync(web3Wrapper: Web3Wrapper, variableName: string,
+ senderAddress: string): Promise<void> {
const isSenderAddressAvailable = await web3Wrapper.isSenderAddressAvailableAsync(senderAddress);
- assert.assert(isSenderAddressAvailable, `Specified sender account ${senderAddress} isn't available through the \
+ assert.assert(isSenderAddressAvailable, `Specified ${variableName} ${senderAddress} isn't available through the \
supplied web3 instance`);
},
isNumber(variableName: string, value: number): void {
diff --git a/test/assert_test.ts b/test/assert_test.ts
index c8f698730..147c9832f 100644
--- a/test/assert_test.ts
+++ b/test/assert_test.ts
@@ -20,7 +20,7 @@ describe('Assertion library', () => {
const validUnrelatedAddress = '0x8b0292b11a196601eddce54b665cafeca0347d42';
const varName = 'account';
return expect(assert.isSenderAddressHexAsync(varName, validUnrelatedAddress, (zeroEx as any).web3Wrapper))
- .to.be.rejectedWith(`Specified sender account ${validUnrelatedAddress} \
+ .to.be.rejectedWith(`Specified ${varName} ${validUnrelatedAddress} \
isn't available through the supplied web3 instance`);
});
it('doesn\'t throw if account is available', async () => {