diff options
author | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-06 07:56:16 +0800 |
---|---|---|
committer | Alex Browne <stephenalexbrowne@gmail.com> | 2018-06-07 03:41:14 +0800 |
commit | 167a38e27d09af12af6c59f1b486c835420fbac1 (patch) | |
tree | 6804d8fb26e77cba221e0212db8facdacca34c0d /packages/contracts/test/libraries | |
parent | ba6806df5d2d4b31c125a0c58cc6cd65bf555933 (diff) | |
download | dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.tar dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.tar.gz dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.tar.bz2 dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.tar.lz dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.tar.xz dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.tar.zst dexon-sol-tools-167a38e27d09af12af6c59f1b486c835420fbac1.zip |
Add Async suffix to relevant assertions
Diffstat (limited to 'packages/contracts/test/libraries')
-rw-r--r-- | packages/contracts/test/libraries/lib_bytes.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/contracts/test/libraries/lib_bytes.ts b/packages/contracts/test/libraries/lib_bytes.ts index f5435a81e..156463130 100644 --- a/packages/contracts/test/libraries/lib_bytes.ts +++ b/packages/contracts/test/libraries/lib_bytes.ts @@ -10,7 +10,7 @@ import * as Web3 from 'web3'; import { TestLibBytesContract } from '../../src/contract_wrappers/generated/test_lib_bytes'; import { artifacts } from '../../src/utils/artifacts'; -import { expectRevertOrAlwaysFailingTransaction, expectRevertOrOtherError } from '../../src/utils/assertions'; +import { expectRevertOrAlwaysFailingTransactionAsync, expectRevertOrOtherErrorAsync } from '../../src/utils/assertions'; import { chaiSetup } from '../../src/utils/chai_setup'; import { constants } from '../../src/utils/constants'; import { provider, txDefaults, web3Wrapper } from '../../src/utils/web3_wrapper'; @@ -64,7 +64,7 @@ describe('LibBytes', () => { describe('popByte', () => { it('should revert if length is 0', async () => { - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicPopByte.callAsync(constants.NULL_BYTES), constants.LIB_BYTES_GT_ZERO_LENGTH_REQUIRED, ); @@ -81,7 +81,7 @@ describe('LibBytes', () => { describe('popAddress', () => { it('should revert if length is less than 20', async () => { - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicPopAddress.callAsync(byteArrayShorterThan20Bytes), constants.LIB_BYTES_GTE_20_LENGTH_REQUIRED, ); @@ -167,7 +167,7 @@ describe('LibBytes', () => { it('should fail if the byte array is too short to hold an address)', async () => { const shortByteArray = '0xabcdef'; const offset = new BigNumber(0); - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadAddress.callAsync(shortByteArray, offset), constants.LIB_BYTES_GTE_20_LENGTH_REQUIRED, ); @@ -176,7 +176,7 @@ describe('LibBytes', () => { it('should fail if the length between the offset and end of the byte array is too short to hold an address)', async () => { const byteArray = ethUtil.addHexPrefix(testAddress); const badOffset = new BigNumber(ethUtil.toBuffer(byteArray).byteLength); - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadAddress.callAsync(byteArray, badOffset), constants.LIB_BYTES_GTE_20_LENGTH_REQUIRED, ); @@ -213,7 +213,7 @@ describe('LibBytes', () => { it('should fail if the byte array is too short to hold a bytes32)', async () => { const offset = new BigNumber(0); - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadBytes32.callAsync(byteArrayShorterThan32Bytes, offset), constants.LIB_BYTES_GTE_32_LENGTH_REQUIRED, ); @@ -221,7 +221,7 @@ describe('LibBytes', () => { it('should fail if the length between the offset and end of the byte array is too short to hold a bytes32)', async () => { const badOffset = new BigNumber(ethUtil.toBuffer(testBytes32).byteLength); - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadBytes32.callAsync(testBytes32, badOffset), constants.LIB_BYTES_GTE_32_LENGTH_REQUIRED, ); @@ -262,7 +262,7 @@ describe('LibBytes', () => { it('should fail if the byte array is too short to hold a uint256)', async () => { const offset = new BigNumber(0); - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadUint256.callAsync(byteArrayShorterThan32Bytes, offset), constants.LIB_BYTES_GTE_32_LENGTH_REQUIRED, ); @@ -273,7 +273,7 @@ describe('LibBytes', () => { const testUint256AsBuffer = ethUtil.toBuffer(formattedTestUint256); const byteArray = ethUtil.bufferToHex(testUint256AsBuffer); const badOffset = new BigNumber(testUint256AsBuffer.byteLength); - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadUint256.callAsync(byteArray, badOffset), constants.LIB_BYTES_GTE_32_LENGTH_REQUIRED, ); @@ -295,7 +295,7 @@ describe('LibBytes', () => { // AssertionError: expected promise to be rejected with an error including 'revert' but it was fulfilled with '0x08c379a0' it('should revert if byte array has a length < 4', async () => { const byteArrayLessThan4Bytes = '0x010101'; - return expectRevertOrOtherError( + return expectRevertOrOtherErrorAsync( libBytes.publicReadFirst4.callAsync(byteArrayLessThan4Bytes), constants.LIB_BYTES_GTE_4_LENGTH_REQUIRED, ); |