Skip to content

Commit

Permalink
fix: comments
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jan 22, 2025
1 parent 814420e commit 214c7e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { AppActions, StateAction } from 'states/stateProvider/reducer'
import { showGlobalAlertDialog } from 'states/stateProvider/actionCreators'

import { type CKBComponents } from '@ckb-lumos/lumos/rpc'
import { CONSTANTS, isSuccessResponse, getExplorerUrl } from 'utils'
import { isSuccessResponse, getExplorerUrl } from 'utils'

import { rpc } from 'services/chain'
import {
Expand All @@ -14,8 +14,6 @@ import {
} from 'services/remote'
import { calculateMaximumWithdrawCompatible } from '@ckb-lumos/lumos/common-scripts/dao'

const { MEDIUM_FEE_RATE } = CONSTANTS

const getRecordKey = ({ depositOutPoint, outPoint }: State.NervosDAORecord) => {
return depositOutPoint ? `${depositOutPoint.txHash}-${depositOutPoint.index}` : `${outPoint.txHash}-${outPoint.index}`
}
Expand All @@ -25,7 +23,7 @@ export const useOnWithdrawDialogDismiss = (setActiveRecord: React.Dispatch<null>
setActiveRecord(null)
}, [setActiveRecord])

export const useOnWithdrawDialogSubmit = ({
export const useGenerateDaoWithdrawTx = ({
activeRecord,
setActiveRecord,
clearGeneratedTx,
Expand Down Expand Up @@ -89,6 +87,7 @@ export const useOnActionClick = ({
setActiveRecord,
isMainnet,
multisigConfig,
suggestFeeRate,
}: {
records: Readonly<State.NervosDAORecord[]>
clearGeneratedTx: () => void
Expand All @@ -97,6 +96,7 @@ export const useOnActionClick = ({
setActiveRecord: React.Dispatch<State.NervosDAORecord>
isMainnet: boolean
multisigConfig: MultisigConfig
suggestFeeRate: number | string
}) =>
useCallback(
(e: any) => {
Expand All @@ -113,7 +113,7 @@ export const useOnActionClick = ({
generateMultisigDaoClaimTx({
withdrawingOutPoint: record.outPoint,
depositOutPoint: record.depositOutPoint,
feeRate: `${MEDIUM_FEE_RATE}`,
feeRate: `${suggestFeeRate}`,
multisigConfig,
})
.then(res => {
Expand Down Expand Up @@ -300,7 +300,7 @@ export const useUpdateDepositEpochList = ({

export default {
useOnWithdrawDialogDismiss,
useOnWithdrawDialogSubmit,
useGenerateDaoWithdrawTx,
useOnActionClick,
useUpdateWithdrawList,
useUpdateDepositEpochList,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const MultisigAddressNervosDAODialog = ({

const genesisBlockHash = useMemo(() => networks.find(v => v.id === networkID)?.genesisHash, [networkID, networks])

const onWithdrawDialogSubmit = hooks.useOnWithdrawDialogSubmit({
const onWithdrawDialogSubmit = hooks.useGenerateDaoWithdrawTx({
activeRecord,
setActiveRecord,
clearGeneratedTx,
Expand All @@ -64,6 +64,7 @@ const MultisigAddressNervosDAODialog = ({
setActiveRecord,
isMainnet,
multisigConfig,
suggestFeeRate,
})

hooks.useUpdateDepositEpochList({ records, setDepositEpochList, connectionStatus })
Expand Down

1 comment on commit 214c7e8

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 12902291128

Please sign in to comment.