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

Not working for Bitcoin testnet #54

Closed
paulkernfeld opened this issue Jul 30, 2016 · 2 comments
Closed

Not working for Bitcoin testnet #54

paulkernfeld opened this issue Jul 30, 2016 · 2 comments

Comments

@paulkernfeld
Copy link

When I run the tests w/ the Bitcoin testnet params, I get the error below.

It looks like some values in the test are hardcoded for the Bitcoin mainnet. However, I think that there might be actual functionality issues as well, because burnie seems to not work with bitcoin-net@4.

✓ PeerGroup constructor
✓ invalid params
✓ valid params, no options
✓ valid params, with options
✓ connect
✓ peer methods
✓ randomPeer
⨯ getBlocks
  not ok 19 no error
    ---
      operator: error
      expected: |-
        undefined
      actual: |-
        { [Error: Request timed out] timeout: true }
      at: Timeout._onTimeout (/Users/paul/repos/bitcoin-net/lib/peer.js:9:23770)
      stack: |-
        Error: Request timed out
            at Timeout._onTimeout (/Users/paul/repos/bitcoin-net/lib/peer.js:9:23640)
            at tryOnTimeout (timers.js:224:11)
            at Timer.listOnTimeout (timers.js:198:5)
    ...
  not ok 20 result is array
    ---
      operator: ok
      expected: true
      actual:   false
      at: Timeout._onTimeout (/Users/paul/repos/bitcoin-net/lib/peer.js:9:23770)
    ...
/Users/paul/repos/bitcoin-net/test/build/peerGroup.js:101
        t.equal(res.length, 1, 'result is correct length');
                   ^

TypeError: Cannot read property 'length' of undefined
    at /Users/paul/repos/bitcoin-net/test/build/peerGroup.js:101:20
    at Timeout._onTimeout (/Users/paul/repos/bitcoin-net/lib/peer.js:9:23770)
    at tryOnTimeout (timers.js:224:11)
    at Timer.listOnTimeout (timers.js:198:5)
  ------------------------|----------|----------|----------|----------|----------------|
  File                    |  % Stmts | % Branch |  % Funcs |  % Lines |Uncovered Lines |
  ------------------------|----------|----------|----------|----------|----------------|
   bitcoin-net/           |      100 |      100 |      100 |      100 |                |
    index.js              |      100 |      100 |      100 |      100 |                |
   bitcoin-net/lib/       |    52.11 |    34.26 |     46.9 |    52.29 |                |
    bridge.js             |    43.94 |    33.33 |    33.33 |    29.27 |... 56,59,60,67 |
    peer.js               |    59.38 |    42.07 |    63.27 |    60.36 |... 462,463,464 |
    peerGroup.js          |       50 |    30.81 |    41.94 |     51.6 |... 537,538,540 |
    protocolTransforms.js |    32.86 |     4.17 |       25 |    32.86 |... 103,115,116 |
    utils.js              |    72.73 |    71.43 |    66.67 |       80 |          11,12 |
  ------------------------|----------|----------|----------|----------|----------------|
  All files               |    52.17 |    34.26 |     46.9 |    52.36 |                |
  ------------------------|----------|----------|----------|----------|----------------|

not ok 21 no plan found
⨯ fail  3
npm ERR! Test failed.  See above for more details.
@Head
Copy link
Contributor

Head commented Aug 2, 2016

The actual code is working with testnet. Prove: I have it running here. Maybe just the tests are buggy.

@mappum
Copy link
Owner

mappum commented Aug 3, 2016

The tests aren't expected to work for testnet since they are hardcoded for mainnet blocks.

If you'd like to see the testnet params working, you can clone the webcoin-bitcoin-testnet repo and run the tests.

@mappum mappum closed this as completed Aug 3, 2016
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

No branches or pull requests

3 participants