Skip to content

Commit

Permalink
Merge branch '1.x' into issue/3257
Browse files Browse the repository at this point in the history
  • Loading branch information
cgewecke authored May 22, 2020
2 parents 6e74e29 + 53e4cab commit 5c60d1f
Show file tree
Hide file tree
Showing 10 changed files with 563 additions and 57 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
e2e:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
testCmd:
[
Expand All @@ -60,7 +61,6 @@ jobs:

- run: bash ./scripts/install.sh
- run: bash ./scripts/ci.sh
continue-on-error: ${{ matrix.testCmd == 'e2e_ganache' || matrix.testCmd == 'e2e_mosaic' }}

- name: Send coverage reports to Coveralls
if: env.TEST == 'unit_and_e2e_clients'
Expand All @@ -79,4 +79,3 @@ jobs:
- uses: actions/checkout@v1
- run: bash ./scripts/install.sh
- run: bash ./scripts/ci.sh
continue-on-error: true
18 changes: 14 additions & 4 deletions packages/web3-core-method/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,12 +539,22 @@ Method.prototype._confirmTransaction = function (defer, result, payload) {

// start watching for confirmation depending on the support features of the provider
var startWatching = function (existingReceipt) {
// if provider allows PUB/SUB
if (_.isFunction(this.requestManager.provider.on)) {
_ethereumCall.subscribe('newBlockHeaders', checkConfirmation.bind(null, existingReceipt, false));
} else {
const startInterval = () => {
intervalId = setInterval(checkConfirmation.bind(null, existingReceipt, true), 1000);
}

if (!this.requestManager.provider.on) {
startInterval()
} else {
_ethereumCall.subscribe('newBlockHeaders', function (err, blockHeader, sub) {
if (err || !blockHeader) {
// fall back to polling
startInterval()
} else {
checkConfirmation(existingReceipt, false, err, blockHeader, sub);
}
})
}
}.bind(this);


Expand Down
7 changes: 4 additions & 3 deletions packages/web3-eth-accounts/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,9 +293,10 @@ Accounts.prototype.recoverTransaction = function recoverTransaction(rawTx) {
/* jshint ignore:end */

Accounts.prototype.hashMessage = function hashMessage(data) {
var message = utils.isHexStrict(data) ? utils.hexToBytes(data) : data;
var messageBuffer = Buffer.from(message);
var preamble = '\x19Ethereum Signed Message:\n' + message.length;
var messageHex = utils.isHexStrict(data) ? data : utils.utf8ToHex(data);
var messageBytes = utils.hexToBytes(messageHex)
var messageBuffer = Buffer.from(messageBytes);
var preamble = '\x19Ethereum Signed Message:\n' + messageBytes.length;
var preambleBuffer = Buffer.from(preamble);
var ethMessage = Buffer.concat([preambleBuffer, messageBuffer]);
return Hash.keccak256s(ethMessage);
Expand Down
Loading

0 comments on commit 5c60d1f

Please sign in to comment.