From 544becd4b3ff655aab2b67485a38b789a76c8ab7 Mon Sep 17 00:00:00 2001 From: Keith Date: Sun, 10 Nov 2019 13:09:37 +0800 Subject: [PATCH] fix(neuron-ui): fix the yield of nervos dao records --- .../src/components/CustomRows/DAORecordRow.tsx | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx index af02271ba9..640ce7a0ad 100644 --- a/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx +++ b/packages/neuron-ui/src/components/CustomRows/DAORecordRow.tsx @@ -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' @@ -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()) })