Skip to content

Commit

Permalink
fix(BSV): add bsv to selectReceiveAddress for refund address generation
Browse files Browse the repository at this point in the history
  • Loading branch information
plondon committed Jan 3, 2019
1 parent 76d89f4 commit b847e17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ export default ({ api, coreSagas, networks }) => {
['payload', 'limits', currency],
yield take(AT.FETCH_LIMITS_SUCCESS)
)

return limitsR.map(prop(currency)).getOrFail(NO_LIMITS_ERROR)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export const convertBaseToStandard = (coin, value) => {
return Exchange.convertBchToBch({ value, fromUnit: 'SAT', toUnit: 'BCH' })
.value
case 'BSV':
return Exchange.convertBsvToBsv({ value, fromUnit: 'SAT', toUnit: 'BCH' })
return Exchange.convertBsvToBsv({ value, fromUnit: 'SAT', toUnit: 'BSV' })
.value
case 'BTC':
return Exchange.convertBitcoinToBitcoin({
Expand Down Expand Up @@ -54,7 +54,7 @@ export const convertStandardToBase = (coin, value) => {
return Exchange.convertBchToBch({ value, fromUnit: 'BCH', toUnit: 'SAT' })
.value
case 'BSV':
return Exchange.convertBsvToBsv({ value, fromUnit: 'BCH', toUnit: 'SAT' })
return Exchange.convertBsvToBsv({ value, fromUnit: 'BSV', toUnit: 'SAT' })
.value
case 'BTC':
return Exchange.convertBitcoinToBitcoin({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ export const selectReceiveAddress = function*(source, networks) {
}
return utils.bch.toCashAddr(bchReceiveAddress.getOrElse(''))
}
if (equals('BSV', coin)) {
const selector = selectors.core.common.bsv.getNextAvailableReceiveAddress
const bsvReceiveAddress = selector(settings.NETWORK_BCH, address, appState)
if (isEmpty(bsvReceiveAddress.getOrElse(''))) {
throw new Error('Could not generate bitcoin sv receive address')
}
return utils.bch.toCashAddr(bsvReceiveAddress.getOrElse(''))
}
if (equals('BTC', coin)) {
const selector =
type !== ADDRESS_TYPES.LOCKBOX
Expand Down

0 comments on commit b847e17

Please sign in to comment.