diff --git a/es/tx/builder/helpers.js b/es/tx/builder/helpers.js index ca4e99b5c6..d0624185af 100644 --- a/es/tx/builder/helpers.js +++ b/es/tx/builder/helpers.js @@ -297,11 +297,11 @@ export function computeBidFee (domain, startFee = NAME_FEE, increment = NAME_FEE export function computeAuctionEndBlock (domain, claimHeight) { return R.cond([ - [R.lt(5), R.always(NAME_BID_TIMEOUTS[4] + claimHeight)], - [R.lt(9), R.always(NAME_BID_TIMEOUTS[8] + claimHeight)], - [R.lte(NAME_BID_MAX_LENGTH), R.always(NAME_BID_TIMEOUTS[12] + claimHeight)], - [R.T, R.always(claimHeight)] - ])(domain.replace('.chain', '').length) + [R.lt(5), R.always(NAME_BID_TIMEOUTS[4].plus(claimHeight))], + [R.lt(9), R.always(NAME_BID_TIMEOUTS[8].plus(claimHeight))], + [R.lte(NAME_BID_MAX_LENGTH), R.always(NAME_BID_TIMEOUTS[12].plus(claimHeight))], + [R.T, R.always(BigNumber(claimHeight))] + ])(domain.replace('.chain', '').length).toString(10) } export default { diff --git a/es/tx/builder/schema.js b/es/tx/builder/schema.js index c730e6b902..af0f024b0d 100644 --- a/es/tx/builder/schema.js +++ b/es/tx/builder/schema.js @@ -70,10 +70,10 @@ export const NAME_BID_RANGES = { // # ref: https://github.com/aeternity/aeternity/blob/72e440b8731422e335f879a31ecbbee7ac23a1cf/apps/aecore/src/aec_governance.erl#L273 // # name bid timeouts export const NAME_BID_TIMEOUTS = { - 13: 0, - 12: NAME_BID_TIMEOUT_BLOCKS, // # 480 blocks - 8: 31 * NAME_BID_TIMEOUT_BLOCKS, // # 14880 blocks - 4: 62 * NAME_BID_TIMEOUT_BLOCKS // # 29760 blocks + 13: BigNumber(0), + 12: BigNumber(NAME_BID_TIMEOUT_BLOCKS), // # 480 blocks + 8: BigNumber(31).times(NAME_BID_TIMEOUT_BLOCKS), // # 14880 blocks + 4: BigNumber(62).times(NAME_BID_TIMEOUT_BLOCKS) // # 29760 blocks } // # Tag constant for ids (type uint8)