Skip to content

Commit

Permalink
Merge branch 'develop' into log-ledger
Browse files Browse the repository at this point in the history
  • Loading branch information
homura authored Aug 2, 2024
2 parents 683cd24 + f470156 commit 3d3afc8
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,11 @@ export const useInitialize = ({
const fetchInitData = useCallback(async () => {
const res = await getOnChainTransaction(tx.hash)
const {
// @ts-expect-error Replace-By-Fee (RBF)
min_replace_fee: minFee,
minReplaceFee,
transaction: { outputsData },
} = res

if (!minFee) {
if (!minReplaceFee) {
setIsConfirmedAlertShown(true)
}

Expand All @@ -60,8 +59,8 @@ export const useInitialize = ({
})

setSize(txResult.size)
if (minFee) {
const mPrice = ((BigInt(minFee) * BigInt(FEE_RATIO)) / BigInt(txResult.size)).toString()
if (minReplaceFee) {
const mPrice = ((BigInt(minReplaceFee) * BigInt(FEE_RATIO)) / BigInt(txResult.size)).toString()
setMinPrice(mPrice)
setPrice(mPrice)
}
Expand All @@ -83,9 +82,8 @@ export const useInitialize = ({

const onSubmit = useCallback(async () => {
try {
// @ts-expect-error Replace-By-Fee (RBF)
const { min_replace_fee: minFee } = await getOnChainTransaction(tx.hash)
if (!minFee) {
const { minReplaceFee } = await getOnChainTransaction(tx.hash)
if (!minReplaceFee) {
setIsConfirmedAlertShown(true)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ $noticeHeight: 60px;
padding: 20px 16px 18px;
border-radius: 16px;
margin-bottom: 16px;
.addresstField {
font-family: 'JetBrains Mono';
}
.textFieldClass {
margin-bottom: 10px;
}
Expand Down
14 changes: 6 additions & 8 deletions packages/neuron-ui/src/components/AmendSUDTSend/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ export const useInitialize = ({

const fetchInitData = useCallback(async () => {
const {
// @ts-expect-error Replace-By-Fee (RBF)
min_replace_fee: minFee,
minReplaceFee,
transaction: { outputsData },
} = await getOnChainTransaction(hash)
if (!minFee) {
if (!minReplaceFee) {
setIsConfirmedAlertShown(true)
}

Expand All @@ -76,8 +75,8 @@ export const useInitialize = ({
setTransaction({ ...tx, outputsData })

setSize(tx.size)
if (minFee) {
const mPrice = ((BigInt(minFee) * BigInt(FEE_RATIO)) / BigInt(tx.size)).toString()
if (minReplaceFee) {
const mPrice = ((BigInt(minReplaceFee) * BigInt(FEE_RATIO)) / BigInt(tx.size)).toString()
setMinPrice(mPrice)
setPrice(mPrice)
}
Expand All @@ -98,9 +97,8 @@ export const useInitialize = ({
return
}
try {
// @ts-expect-error Replace-By-Fee (RBF)
const { min_replace_fee: minFee } = await getOnChainTransaction(hash)
if (!minFee) {
const { minReplaceFee } = await getOnChainTransaction(hash)
if (!minReplaceFee) {
setIsConfirmedAlertShown(true)
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ $noticeHeight: 60px;
padding: 20px 16px 18px;
border-radius: 16px;
margin-bottom: 16px;
.addresstField {
font-family: 'JetBrains Mono';
}
.textFieldClass {
margin-bottom: 10px;
}
Expand Down
14 changes: 6 additions & 8 deletions packages/neuron-ui/src/components/AmendSend/hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,10 @@ export const useInitialize = ({
const fetchInitData = useCallback(async () => {
const res = await getOnChainTransaction(hash)
const {
// @ts-expect-error Replace-By-Fee (RBF)
min_replace_fee: minFee,
minReplaceFee,
transaction: { outputsData },
} = res
if (!minFee) {
if (!minReplaceFee) {
setIsConfirmedAlertShown(true)
}

Expand All @@ -87,8 +86,8 @@ export const useInitialize = ({
})

setSize(tx.size)
if (minFee) {
const mPrice = ((BigInt(minFee) * BigInt(FEE_RATIO)) / BigInt(tx.size)).toString()
if (minReplaceFee) {
const mPrice = ((BigInt(minReplaceFee) * BigInt(FEE_RATIO)) / BigInt(tx.size)).toString()
setMinPrice(mPrice)
updateTransactionPrice(mPrice)
}
Expand All @@ -113,9 +112,8 @@ export const useInitialize = ({
return
}
try {
// @ts-expect-error Replace-By-Fee (RBF)
const { min_replace_fee: minFee } = await getOnChainTransaction(hash)
if (!minFee) {
const { minReplaceFee } = await getOnChainTransaction(hash)
if (!minReplaceFee) {
setIsConfirmedAlertShown(true)
return
}
Expand Down
3 changes: 1 addition & 2 deletions packages/neuron-ui/src/components/History/RowExtend.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ const RowExtend = ({ column, columns, isMainnet, id, bestBlockNumber, isWatchOnl
setAmendabled(false)
if (status !== 'success' && column.type !== 'receive' && !isWatchOnly) {
getOnChainTransaction(hash).then(tx => {
// @ts-expect-error Replace-By-Fee (RBF)
const { min_replace_fee: minReplaceFee } = tx
const { minReplaceFee } = tx
if (minReplaceFee) {
setAmendabled(true)
}
Expand Down
6 changes: 1 addition & 5 deletions packages/neuron-ui/src/components/MultisigAddress/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ const MultisigAddress = () => {
const { deleteAction, infoAction, sendAction, approveAction } = useActions({ deleteConfigById })
const [showDeleteDialog, setShowDeleteDialog] = useState(false)

const showMainDialog = useMemo(
() => !(infoAction.isDialogOpen || sendAction.isDialogOpen || approveAction.isDialogOpen || isCreateDialogOpen),
[infoAction.isDialogOpen, sendAction.isDialogOpen, approveAction.isDialogOpen, isCreateDialogOpen]
)
const onClickItem = useCallback(
(multisigConfig: MultisigConfig) => (e: React.SyntheticEvent<HTMLButtonElement>) => {
const {
Expand Down Expand Up @@ -226,7 +222,7 @@ const MultisigAddress = () => {
return (
<div>
<Dialog
show={showMainDialog}
show
title={
<div ref={titleRef} className={styles.title}>
{t('multisig-address.window-title')}
Expand Down
2 changes: 1 addition & 1 deletion packages/neuron-ui/src/components/SendFieldset/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const SendFieldset = ({
return (
<div className={clsx(styles.container, className)}>
<TextField
className={`${styles.addresstField} ${styles.textFieldClass}`}
className={`${styles.addressField} ${styles.textFieldClass}`}
placeholder={t('send.input-address')}
rows={item.address ? 2 : 1}
label={
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ $textfieldWidth: calc(100vw - 370px);
}
}

.addresstField {
.addressField {
font-family: 'JetBrains Mono';
}

Expand Down

1 comment on commit 3d3afc8

@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 10207871118

Please sign in to comment.