Skip to content

Commit

Permalink
Merge branch 'feat/account-price-clac' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sjatsh committed Apr 16, 2024
2 parents 550a44b + 7799d4d commit 0db0977
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions txtool/pre_register.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,8 @@ func (t *TxTool) buildOrderPreRegisterTx(p *preRegisterTxParams) (*txbuilder.Bui
}
newPrice, _, _ := priceBuilder.AccountPrice(accountLength)
priceCapacity := uint128.From64(newPrice).Mul(uint128.From64(common.OneCkb)).Div(uint128.From64(quote))
if invitedDiscount > 0 {
priceCapacity = priceCapacity.Div(uint128.From64(common.PercentRateBase).Mul(uint128.From64(common.PercentRateBase - uint64(invitedDiscount))))
}
totalDiscount := priceCapacity.Mul(uint128.From64(uint64(invitedDiscount))).Div(uint128.From64(common.PercentRateBase))
priceCapacity = priceCapacity.Sub(totalDiscount)
priceCapacity = priceCapacity.Mul(uint128.From64(uint64(p.registerYears)))
log.Info("buildOrderPreRegisterTx:", priceCapacity, newPrice, p.registerYears, quote, invitedDiscount)
// basicCapacity
Expand Down

0 comments on commit 0db0977

Please sign in to comment.