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

Added jsdoc, several tests and fix errors #3

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

elli-kolisnichenko
Copy link
Contributor

No description provided.

@gto90
Copy link
Member

gto90 commented Feb 24, 2022

Hello @elli-kolisnichenko , Could you retarget this PR at the develop branch? Thanks in advance!

@elli-kolisnichenko
Copy link
Contributor Author

It is already to develop branch. I created PR from my branch 1.4.1 to your develop

Copy link
Member

@gto90 gto90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Great job on this @elli-kolisnichenko and @SmartArray ! Thank you so very much for your hard work on this. This PR looks great, but there are a lot of out of date NPM packages that need to be updated. I do not believe we need to address that in this PR as we can open a new PR for that.

@digicontributer and @JaredTate can we get a review when you are able?

Copy link

@digicontributer digicontributer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Tested and code reviewed.

Awesome work, thanks very much!

@JaredTate
Copy link
Contributor

JaredTate commented Mar 18, 2022

So I was able to get this working on Mac OSX with yarn, kept getting errors with npm. Using node v16.14.2 (npm v8.5.0):

nvm install --lts
npm install -g yarn
yarn
yarn test

I get 301 passing, 12 failing.

301 passing (12s)
  12 failing

  1) Fetcher
       Test AccountBalanceRetry
         no failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at AccountApi.accountBalanceWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/AccountApi.js:67:29)
      at AccountApi.accountBalance (node_modules/rosetta-node-sdk-client/dist/api/promises/AccountApi.js:79:19)
      at RosettaFetcher.accountBalance (lib/fetcher/index.js:108:39)
      at BackOff.request (lib/fetcher/index.js:126:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  2) Fetcher
       Test AccountBalanceRetry
         retry failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at AccountApi.accountBalanceWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/AccountApi.js:67:29)
      at AccountApi.accountBalance (node_modules/rosetta-node-sdk-client/dist/api/promises/AccountApi.js:79:19)
      at RosettaFetcher.accountBalance (lib/fetcher/index.js:108:39)
      at BackOff.request (lib/fetcher/index.js:126:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  3) Fetcher
       Test AccountBalanceRetry
         exhausted failures:
     AssertionError: expected undefined to equal 500
      at Context.<anonymous> (test/fetcher.test.js:279:29)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  4) Fetcher
       Test BlockRetry
         no failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at BlockApi.blockWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/BlockApi.js:71:29)
      at BlockApi.block (node_modules/rosetta-node-sdk-client/dist/api/promises/BlockApi.js:83:19)
      at RosettaFetcher.block (lib/fetcher/index.js:137:42)
      at BackOff.request (lib/fetcher/index.js:192:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  5) Fetcher
       Test BlockRetry
         retry failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at BlockApi.blockWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/BlockApi.js:71:29)
      at BlockApi.block (node_modules/rosetta-node-sdk-client/dist/api/promises/BlockApi.js:83:19)
      at RosettaFetcher.block (lib/fetcher/index.js:137:42)
      at BackOff.request (lib/fetcher/index.js:192:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  6) Fetcher
       Test BlockRetry
         exhausted failures:
     AssertionError: expected undefined to equal 500
      at Context.<anonymous> (test/fetcher.test.js:364:29)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  7) Fetcher
       Test NetworkListRetry
         no failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at NetworkApi.networkListWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:73:29)
      at NetworkApi.networkList (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:85:19)
      at RosettaFetcher.networkList (lib/fetcher/index.js:287:42)
      at BackOff.request (lib/fetcher/index.js:295:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  8) Fetcher
       Test NetworkListRetry
         retry failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at NetworkApi.networkListWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:73:29)
      at NetworkApi.networkList (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:85:19)
      at RosettaFetcher.networkList (lib/fetcher/index.js:287:42)
      at BackOff.request (lib/fetcher/index.js:295:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  9) Fetcher
       Test NetworkListRetry
         exhausted retries:
     AssertionError: expected undefined to equal 500
      at Context.<anonymous> (test/fetcher.test.js:453:29)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)

  10) Fetcher
       Test NetworkStatusRetry
         no failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at NetworkApi.networkStatusWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:153:29)
      at NetworkApi.networkStatus (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:165:19)
      at RosettaFetcher.networkStatus (lib/fetcher/index.js:265:44)
      at BackOff.request (lib/fetcher/index.js:273:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  11) Fetcher
       Test NetworkStatusRetry
         retry failures:
     TypeError: Cannot read properties of undefined (reading 'toLowerCase')
      at RequestBase.set (node_modules/superagent/lib/request-base.js:291:22)
      at ApiClient.callApiPromised (node_modules/rosetta-node-sdk-client/dist/ApiClient.js:564:15)
      at NetworkApi.networkStatusWithHttpInfo (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:153:29)
      at NetworkApi.networkStatus (node_modules/rosetta-node-sdk-client/dist/api/promises/NetworkApi.js:165:19)
      at RosettaFetcher.networkStatus (lib/fetcher/index.js:265:44)
      at BackOff.request (lib/fetcher/index.js:273:12)
      at BackOff.<anonymous> (node_modules/exponential-backoff/dist/backoff.js:76:51)
      at step (node_modules/exponential-backoff/dist/backoff.js:33:23)
      at Object.next (node_modules/exponential-backoff/dist/backoff.js:14:53)
      at fulfilled (node_modules/exponential-backoff/dist/backoff.js:5:58)

  12) Fetcher
       Test NetworkStatusRetry
         exhausted retries:
     AssertionError: expected undefined to equal 500
      at Context.<anonymous> (test/fetcher.test.js:534:29)
      at processTicksAndRejections (node:internal/process/task_queues:96:5)```

Copy link
Contributor

@JaredTate JaredTate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I wiped directory and recloned... now it works with 359 passing. So good to go. Thank you for all the work on this!

git clone https://github.com/elli-kolisnichenko/digibyte-rosetta-nodeapi.git -b 1.4.1
cd  digibyte-rosetta-nodeapi
yarn
yarn test

@JaredTate JaredTate merged commit b116762 into DigiByte-Core:develop Mar 18, 2022
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.

4 participants