Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: truffle test failure #651

Merged
merged 18 commits into from
Jul 1, 2020
Merged

fix: truffle test failure #651

merged 18 commits into from
Jul 1, 2020

Conversation

boolafish
Copy link
Contributor

@boolafish boolafish commented Jun 26, 2020

Seems like there is some dependency trouble. Try blindly solving it with npm audit fix.

closes #652

Seems like there is some dependency trouble. Try blindly solving it with npm audit fix.
@boolafish boolafish force-pushed the boolafish/fix_npm_failure branch 2 times, most recently from 1994f48 to 05fe05d Compare June 26, 2020 05:58
@boolafish boolafish changed the title fix: npm install && npm audit fix fix: truffle test failure Jun 26, 2020
@kevsul
Copy link
Contributor

kevsul commented Jun 26, 2020

Quick update before I give up for now:
The problem is that sometimes calling eth_getBlockByNumber returns a null block (and no error).
It appears to only happen when the provider is remote i.e. using Infura

I think it's an Infura timing issue - we get a notification that a new block has been produced, but when we try to get it, it returns null.

I can "fix" it by hacking a sleep call into the Web3ProviderEngine code:

Web3ProviderEngine.prototype.start = function(cb = noop){
  const self = this

  // trigger start
  self._ready.go()

  // on new block, request block body and emit as events
  self._blockTracker.on('latest', async (blockNumber) => {

    await sleep(1000) // Come on Infura!

    // get block body
    self._getBlockByNumber(blockNumber, (err, block) => {

but obviously that's horrible.

I don't know why this is only showing up now though...

@boolafish
Copy link
Contributor Author

okay, seems like the new HDWalletProvider would fix this.

@boolafish boolafish marked this pull request as ready for review June 30, 2020 09:28
InoMurko
InoMurko previously approved these changes Jun 30, 2020
@kevsul kevsul requested a review from InoMurko June 30, 2020 12:32
@boolafish boolafish requested a review from thec00n July 1, 2020 02:06
@boolafish boolafish merged commit 5ce7d0b into master Jul 1, 2020
@boolafish boolafish deleted the boolafish/fix_npm_failure branch July 1, 2020 05:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fix truffle test failure
3 participants