aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web3-wrapper/test/web3_wrapper_test.ts
diff options
context:
space:
mode:
authorSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-21 05:26:00 +0800
committerSteve Klebanoff <steve.klebanoff@gmail.com>2018-11-21 05:26:00 +0800
commiteca63b1a5815c61901453837f9c2b737fa82eb20 (patch)
tree7763d95f1922f6c16848a8b506384e6e9992260b /packages/web3-wrapper/test/web3_wrapper_test.ts
parent2bda6dd719d748a4bfa5ff8e23e97924e0258af1 (diff)
parentba41fc9275bebe17577f87d72f54b7e7dc420acc (diff)
downloaddexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.gz
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.bz2
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.lz
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.xz
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.tar.zst
dexon-sol-tools-eca63b1a5815c61901453837f9c2b737fa82eb20.zip
Merge branch 'development' into feature/header-tweaks
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;