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

Implement redux logic for switching active token - closes #1947 #1968

Merged
merged 5 commits into from
Apr 30, 2019

Conversation

osvaldovega
Copy link
Contributor

What issue have I solved?

-- #1947

How have I implemented/fixed it?

This PR includes the following changes.

Added service actions, reducer and api service file.
Added settings middleware.

The intention of these files are for check/retrieve every time the token (LSK, BTC) switch change the settings of token to properly set the active one and after that retrieve the prices for BTC and LSK.
After the prices are retrieved these will be store in the service reducer where the application can get the the values and dynamics fees for BTC.

How has this been tested?

For test this I had to call the action creator pricesRetrieved from the service action file and see how update/retrieve the prices for the tokens for this the service reducer must be check and see how that get updated from.

service: {
  priceTicker: { BTC: {}, LSK: {} },
  dynamicFees: {},
}

to

service: {
  priceTicker: {
      BTC: { LSK: <value>, USD: <value>, EU: <value>, ... },
      LSK: { BTC: <value>, USD: <value>, EU: <value>, ... },
  },
  dynamicFees: {},
}

This PR is just for the add the functionality and needs to be tested as a whole once the BTC be available in the UI with the switcher.

Review checklist

@osvaldovega osvaldovega self-assigned this Apr 29, 2019
src/utils/api/functionMapper.js Outdated Show resolved Hide resolved
src/utils/api/functionMapper.js Outdated Show resolved Hide resolved
src/actions/service.js Outdated Show resolved Hide resolved
src/actions/service.js Outdated Show resolved Hide resolved
src/store/middlewares/settings.js Outdated Show resolved Hide resolved
src/store/middlewares/settings.test.js Outdated Show resolved Hide resolved
Copy link
Contributor

@slaweet slaweet left a comment

Choose a reason for hiding this comment

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

Thank you, Osvaldo 👍

@slaweet slaweet added the ready label Apr 30, 2019
@slaweet slaweet merged commit cb3945a into development Apr 30, 2019
@slaweet slaweet deleted the 1947-implement-logic-for-switching-active-token branch April 30, 2019 17:55
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.

2 participants