Skip to content

Commit

Permalink
Merge branch '1.0' into hotfix/provider-resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
nivida committed Jun 2, 2019
2 parents 406bf68 + 9f95015 commit 1814d79
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
14 changes: 7 additions & 7 deletions docs/web3-eth-miner.rst
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ Example
------------------------------------------------------------------------------


start
startMining
=====

.. code-block:: javascript
miner.start(miningThread, [, callback])
miner.startMining(miningThread, [, callback])
Start the CPU mining process with the given number of threads.
The RPC method used is ``miner_start``.
Expand Down Expand Up @@ -180,21 +180,21 @@ Example

.. code-block:: javascript
miner.start('0x1').then(console.log);
miner.startMining('0x1').then(console.log);
> true
miner.start(1).then(console.log);
miner.startMining(1).then(console.log);
> true
------------------------------------------------------------------------------


stop
stopMining
====

.. code-block:: javascript
miner.stop([callback])
miner.stopMining([callback])
Stop the CPU mining process.
The RPC method used is ``miner_stop``.
Expand Down Expand Up @@ -222,7 +222,7 @@ Example

.. code-block:: javascript
miner.stop().then(console.log);
miner.stopMining().then(console.log);
> true
------------------------------------------------------------------------------
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
/**
* @file TransactionObserver.js
* @author Samuel Furter <samuel@ethereum.org>
* @author Josh Stevens <joshstevens19@hotmail.co.uk>
* @date 2019
*/

Expand Down Expand Up @@ -147,8 +148,10 @@ export default class TransactionObserver {
this.getTransactionReceiptMethod.parameters = [transactionHash];

const receipt = await this.getTransactionReceiptMethod.execute();

if (receipt) {

// on parity nodes you can get the receipt without it being mined
// so the receipt may not have a block number at this point
if (receipt && receipt.blockNumber) {
if (this.lastBlock) {
const block = await this.getBlockByNumber(this.lastBlock.number + 1);

Expand Down
3 changes: 2 additions & 1 deletion packages/web3-providers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ Instead of setting a authorization header you could also define the credentials

```js
import {WebsocketProvider} from 'web3-providers';
const credentials = Buffer.from('username:password').toString('base64')
const options = {
timeout: 30000,
headers: {
authorization: 'Basic username:password'
authorization: `Basic ${credentials}`
}
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ export default class Web3EthereumProvider extends AbstractSocketProvider {
* @returns {Promise<Object>}
*/
async send(method, parameters) {
const response = this.connection.send(method, parameters);
const response = await this.connection.send(method, parameters);
const validationResult = JsonRpcResponseValidator.validate(response);

if (validationResult instanceof Error) {
Expand Down

0 comments on commit 1814d79

Please sign in to comment.