Skip to content

Create function coinList() to get list of coins from CryptoCompare API#10

Merged
jprichardson merged 1 commit into
ExodusOSS:masterfrom
owencraston:cryptocompare-add-coinlist
Nov 27, 2017
Merged

Create function coinList() to get list of coins from CryptoCompare API#10
jprichardson merged 1 commit into
ExodusOSS:masterfrom
owencraston:cryptocompare-add-coinlist

Conversation

@owencraston
Copy link
Copy Markdown
Contributor

@owencraston owencraston commented Nov 17, 2017

I needed to get a list of coins from CryptoCompare so I thought I'd abstract it into this library.

cc @RyanZim

Copy link
Copy Markdown
Contributor

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

Tests & linter are failing, please fix this. I left two comments below pointing out some of the problems.

Comment thread index.js Outdated
})
}

function coinList() {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This function needs to be exported at the bottom of the file.

Comment thread test/cryptocompare.test.js Outdated
const helpers = require('./helpers')

test('coinList()', t => {
t.plan(2)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This will make tests fail.

@owencraston
Copy link
Copy Markdown
Contributor Author

@RyanZim tests seem to still be failing? Is this a problem with the node version?

@RyanZim
Copy link
Copy Markdown
Contributor

RyanZim commented Nov 18, 2017

@owencraston The linter errors still aren't fixed, please run npm test locally and get everything fixed up before pushing here.

@owencraston owencraston force-pushed the cryptocompare-add-coinlist branch from ba1b036 to fd51081 Compare November 22, 2017 18:55
@owencraston
Copy link
Copy Markdown
Contributor Author

@RyanZim Does this look good to you?

Copy link
Copy Markdown
Contributor

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

Looks good overall; though I'm not sure if we want package-lock.json committed to the repo; @jprichardson?

Copy link
Copy Markdown
Contributor

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

Sorry, reviewed too quickly, there are broken tests here. Our travis config was messed up, so travis didn't run all the tests right. I fixed that in master.

Please rebase this onto master, and fix the tests as outlined below. Also talked to JP about this, we don't want the package-lock.json committed here, so remove that; also remove your changes to CHANGELOG while you're at it.

Comment thread test/cryptocompare.test.js Outdated
t.strictEqual(typeof coins.Data.ETH.Name, 'string', 'coins.Data.ETH.Name` is a string')
t.strictEqual(typeof coins.Data.ETH.Name, 'ETH', 'coins.Data.ETH.Name is \'ETH\'')
t.strictEqual(typeof coins.Data.ETH.FullName, 'Ethereum (ETH)', 'coins.Data.ETH.FullName is \'Ethereum (ETH)\'')
t.strictEqual(typeof coins.Data.ETH.Sponsored, false, 'coins.Data.ETH.Sponsored is \'false\'')
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You don't want typeof here, except for the top assertion.

@owencraston
Copy link
Copy Markdown
Contributor Author

owencraston commented Nov 22, 2017

Based on this doc I think I should remove it: https://docs.npmjs.com/files/package-lock.json
One key detail about package-lock.json is that it cannot be published, and it will be ignored if found in any place other than the toplevel package. It shares a format with npm-shrinkwrap.json, which is essentially the same file, but allows publication. This is not recommended unless deploying a CLI tool or otherwise using the publication process for producing production packages.
We should probably add this to the .gitignore file.

@owencraston owencraston force-pushed the cryptocompare-add-coinlist branch from fd51081 to 8150d8a Compare November 27, 2017 06:45
@owencraston
Copy link
Copy Markdown
Contributor Author

owencraston commented Nov 27, 2017

Why are these tests still failing? @RyanZim

@RyanZim
Copy link
Copy Markdown
Contributor

RyanZim commented Nov 27, 2017

Not sure, will take a look later.

@RyanZim RyanZim self-assigned this Nov 27, 2017
Copy link
Copy Markdown
Contributor

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

Your URL is wrong; that's why the tests are failing.

Comment thread index.js Outdated
}

function coinList () {
const url = `${baseUrl}coinlist/`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should be:

const url = `${baseUrl}all/coinlist`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Right. I made this change but the tests are still failing.

@owencraston owencraston force-pushed the cryptocompare-add-coinlist branch from 8150d8a to 25b53bf Compare November 27, 2017 19:21
@RyanZim
Copy link
Copy Markdown
Contributor

RyanZim commented Nov 27, 2017

@owencraston You need to remove the trailing slash from the URL. CryptoCompare doesn't like it.

- the coin list data is now available at
 https://min-api.cryptocompare.com/data/all/coinlist
- more information can be found here:
https://www.cryptocompare.com/api/#-api-data-coinlist-
- write tests for this function
- add documentation
@owencraston owencraston force-pushed the cryptocompare-add-coinlist branch from 25b53bf to 8c7becb Compare November 27, 2017 20:31
@owencraston
Copy link
Copy Markdown
Contributor Author

owencraston commented Nov 27, 2017

Thanks for all the help @RyanZim. Sorry this took so long. I think it should be good to go! I rebased all the commits into one atomic commit just for simplicity.

Copy link
Copy Markdown
Contributor

@RyanZim RyanZim left a comment

Choose a reason for hiding this comment

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

utACK LGTM, @jprichardson?

@jprichardson jprichardson merged commit edd64d1 into ExodusOSS:master Nov 27, 2017
@jprichardson
Copy link
Copy Markdown
Contributor

@RyanZim please release update to npm.

@jprichardson
Copy link
Copy Markdown
Contributor

Thanks @owencraston!

@owencraston owencraston deleted the cryptocompare-add-coinlist branch November 27, 2017 22:03
@owencraston
Copy link
Copy Markdown
Contributor Author

🚀

@RyanZim
Copy link
Copy Markdown
Contributor

RyanZim commented Nov 28, 2017

Released as 0.3.0 🎉

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.

3 participants