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

add more alt currency support #215

Closed
wants to merge 3 commits into from
Closed

Conversation

mrose17
Copy link
Contributor

@mrose17 mrose17 commented May 2, 2018

ready: BCH, BTG, DASH, XRP

fixes #114

@mrose17 mrose17 self-assigned this May 2, 2018
@mrose17 mrose17 requested review from evq and aekeus May 2, 2018 21:30

return this.uphold.createCardAddress(cardId, network)
},
addAddress: async function (info, altcoin) {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we consolidate addAddress and createAddress?

it seems like the only difference is addAddress sets info.addresses[altcoin] - maybe we could remove from create and just use the consolidated function

Copy link
Contributor Author

Choose a reason for hiding this comment

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

short answer: no, because addAddress is called both internally and from the upper-layer...

Copy link
Contributor

@evq evq May 3, 2018

Choose a reason for hiding this comment

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

sorry I don't understand. if we put the functionality from createAddress in addAddress couldn't we continue to call it from internally and in the upper layer?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the upper layer calls both addAddress and create. both of these call createAddress, which wants a cardId as a parameter. create could pass the cardId; however addAddress being called by the upper layer is given an info object, in which info.providerId is the cardId. with the exception of create which returns an info object, all calls from the upper layer provider an info object. having the upper layer call address with a cardId rather than an info object, would violate the encapsulation being used.

the current code takes the maximal amount of code needed for both addAddress and create and puts it in createAddress, thereby allow maximal code reuse...

Copy link
Contributor

Choose a reason for hiding this comment

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

it seems like we have info in both places (being that create is the originator of the info - being it's return value)

@evq
Copy link
Contributor

evq commented May 2, 2018

@mrose17 can you add integration tests for the expected workflows? e.g. existing wallet needs to create uphold addresses for missing alt-currencies, new wallet creates all, etc?

Copy link
Contributor

@evq evq left a comment

Choose a reason for hiding this comment

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

tests

ready: BCH, BTG, DASH
waiting on uphold: XRP
@evq
Copy link
Contributor

evq commented May 16, 2018

I cleaned up the commit history by cherry-picking onto master

@mikel2000
Copy link

bat-utils/lib/runtime-wallet.js is not updated from master
@evq
Copy link
Contributor

evq commented Oct 16, 2018

closing as stale

@evq evq closed this Oct 16, 2018
@evq evq deleted the add-more-alturrencies branch March 12, 2019 06:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support additional uphold conversions to purchase BAT
3 participants