Skip to content

Commit

Permalink
fix(neuron-ui): fix the yield of nervos dao records
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith-CY committed Nov 10, 2019
1 parent 3b72042 commit 544becd
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import calculateAPY from 'utils/calculateAPY'
import { shannonToCKBFormatter, uniformTimeFormatter, localNumberFormatter } from 'utils/formatters'
import calculateClaimEpochNumber from 'utils/calculateClaimEpochNumber'
import { epochParser } from 'utils/parsers'
// import { WITHDRAW_EPOCHS } from 'utils/const'

import * as styles from './daoRecordRow.module.scss'

Expand Down Expand Up @@ -39,8 +38,17 @@ const DAORecord = ({
if (!withdrawBlockHash) {
return
}
const formattedDepositOutPoint = depositOutPoint
? {
txHash: depositOutPoint.txHash,
index: BigInt(depositOutPoint.index),
}
: {
txHash,
index: BigInt(index),
}
;(ckbCore.rpc as any)
.calculateDaoMaximumWithdraw({ txHash, index: `0x${BigInt(index).toString(16)}` }, withdrawBlockHash)
.calculateDaoMaximumWithdraw(formattedDepositOutPoint, withdrawBlockHash)
.then((res: string) => {
setWithdrawValue(BigInt(res).toString())
})
Expand Down

0 comments on commit 544becd

Please sign in to comment.