aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper/test/web3_wrapper_test.ts
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-11-21 23:43:36 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-11-21 23:43:36 +0800
commitfc123871ad9b1e791b8156d069c503e8d869139c (patch)
treef31546c91d6936432f18d2a2c224549c7f65c9c9 /packages/web3-wrapper/test/web3_wrapper_test.ts
parentb62fbd0b13dbef67d8df1177b1ca6b4d082faaa9 (diff)
parentf27fef0295243eeb85498ee09810a2f56afd88bd (diff)
downloaddexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.tar
dexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.tar.gz
dexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.tar.bz2
dexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.tar.lz
dexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.tar.xz
dexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.tar.zst
dexon-0x-contracts-fc123871ad9b1e791b8156d069c503e8d869139c.zip
Merge branch 'development' of https://github.com/0xProject/0x-monorepo into feature/instant/push-to-history
Diffstat (limited to 'packages/web3-wrapper/test/web3_wrapper_test.ts')
-rw-r--r--packages/web3-wrapper/test/web3_wrapper_test.ts14
1 files changed, 13 insertions, 1 deletions
diff --git a/packages/web3-wrapper/test/web3_wrapper_test.ts b/packages/web3-wrapper/test/web3_wrapper_test.ts
index 164253777..935c67636 100644
--- a/packages/web3-wrapper/test/web3_wrapper_test.ts
+++ b/packages/web3-wrapper/test/web3_wrapper_test.ts
@@ -1,5 +1,5 @@
import * as chai from 'chai';
-import { BlockParamLiteral, JSONRPCErrorCallback, JSONRPCRequestPayload } from 'ethereum-types';
+import { BlockParamLiteral, JSONRPCErrorCallback, JSONRPCRequestPayload, TransactionReceipt } from 'ethereum-types';
import * as Ganache from 'ganache-core';
import * as _ from 'lodash';
import 'mocha';
@@ -98,6 +98,18 @@ describe('Web3Wrapper tests', () => {
expect(typeof blockNumber).to.be.equal('number');
});
});
+ describe('#getTransactionReceiptAsync/awaitTransactionSuccessAsync', () => {
+ it('get block number', async () => {
+ const payload = { from: addresses[0], to: addresses[1], value: 1 };
+ const txHash = await web3Wrapper.sendTransactionAsync(payload);
+ await web3Wrapper.awaitTransactionSuccessAsync(txHash);
+ const receiptIfExists = await web3Wrapper.getTransactionReceiptIfExistsAsync(txHash);
+ expect(receiptIfExists).to.not.be.undefined();
+ const receipt = receiptIfExists as TransactionReceipt;
+ expect(receipt.transactionIndex).to.be.a('number');
+ expect(receipt.transactionHash).to.be.equal(txHash);
+ });
+ });
describe('#getBlockIfExistsAsync', () => {
it('gets block when supplied a valid BlockParamLiteral value', async () => {
const blockParamLiteral = BlockParamLiteral.Earliest;