Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit dd31d94

Browse files
committed
Fix name price satoshi to btc conversion. Increased price buffer.
1 parent d1ce0d4 commit dd31d94

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

app/js/profiles/store/availability/actions.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ import {
66
isNameAvailable, getNamePrices
77
} from '@utils/index'
88

9+
import { satoshisToBtc } from '@utils/bitcoin-utils'
10+
11+
912
const logger = log4js.getLogger(__filename)
1013

1114
function checkingNameAvailability(domainName) {
@@ -83,7 +86,7 @@ function checkNameAvailabilityAndPrice(api, domainName) {
8386
dispatch(namePrice(domainName, 0))
8487
} else {
8588
return getNamePrices(api.priceUrl, domainName).then((prices) => {
86-
const price = prices.name_price.satoshis * 0.000001
89+
const price = satoshisToBtc(prices.name_price.satoshis)
8790
dispatch(namePrice(domainName, price))
8891
}).catch((error) => {
8992
logger.error('checkNameAvailabilityAndPrice: getNamePrices: error', error)

test/profiles/store/availability/actions/async.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ describe('Availability Store: Async Actions', () => {
8787
{
8888
type: NAME_PRICE,
8989
domainName: 'satoshi.id',
90-
price: 1.5999999999999999
90+
price: 0.016
9191
}
9292
]
9393
assert.deepEqual(store.getActions(), expectedActions)

0 commit comments

Comments
 (0)