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: stateful currency network for ETH and BTC #161

Merged
merged 1 commit into from
Mar 9, 2020

Conversation

benjlevesque
Copy link
Contributor

@benjlevesque benjlevesque commented Mar 9, 2020

Description of the changes

The currency network was stateful, because the value stored in the map, which is a global variable, was changed.
This PR removes the use of the global variable to avoid mistake.

Example

stringToCurrency('ETH')
// { type: RequestLogicTypes.CURRENCY.ETH, value: 'ETH' }
stringToCurrency('ETH-rinkeby')
// { type: RequestLogicTypes.CURRENCY.ETH, value: 'ETH', network: 'rinkeby' }
stringToCurrency('ETH')
// { type: RequestLogicTypes.CURRENCY.ETH, value: 'ETH', network: 'rinkeby' }
//                                                       ^~~~~~~~~~~~~~~~~~

@coveralls
Copy link

Coverage Status

Coverage increased (+0.005%) to 91.187% when pulling b6217d8 on fix-persisting-currency-state into 48efc12 on master.

Copy link
Contributor

@rittme rittme left a comment

Choose a reason for hiding this comment

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

Awesome job spotting this! It's a really tricky one :)

@benjlevesque benjlevesque merged commit 20ec53e into master Mar 9, 2020
@benjlevesque benjlevesque deleted the fix-persisting-currency-state branch March 9, 2020 11:58
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.

None yet

3 participants