Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
devchenyan committed Jul 1, 2024
1 parent b79720a commit b2ab769
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,15 @@ const trackingStatus = async () => {

const failedTxs = txs.filter(
(tx): tx is (TransactionDetail | null) & { status: TransactionStatus.Failed; isRejected: boolean } =>
tx?.status === TransactionStatus.Failed && !tx?.isRejected
tx?.status === TransactionStatus.Failed
)
const successTxs = txs.filter(
(tx): tx is (TransactionDetail | null) & { status: TransactionStatus.Success; isRejected: boolean } =>
tx?.status === TransactionStatus.Success
)
const rejectedTxs = txs.filter(
(tx): tx is (TransactionDetail | null) & { status: TransactionStatus.Failed; isRejected: boolean } =>
tx?.status === TransactionStatus.Failed && !!tx?.isRejected
!!tx?.isRejected
)

if (failedTxs.length) {
Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/src/services/rpc-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default class RpcService {
if (result?.transaction) {
return TransactionWithStatus.fromSDK(result)
}
if (result?.txStatus && result.txStatus.status === TxStatusType.Rejected) {
if (result.txStatus.status === TxStatusType.Rejected) {
logger.warn(`Transaction[${hash}] was rejected`)
return {
transaction: null,
Expand All @@ -59,7 +59,7 @@ export default class RpcService {
if (result?.transaction) {
return TransactionWithStatus.fromSDK(result)
}
if (result?.txStatus && result.txStatus.status === TxStatusType.Rejected) {
if (result.txStatus.status === TxStatusType.Rejected) {
logger.warn(`Transaction[${hash}] was rejected`)
}
return undefined
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const resetMocks = () => {
}

stubbedRPCServiceConstructor.mockImplementation(() => ({
getTransaction: stubbedGetTransactionFn,
getTransactionIncludeRejected: stubbedGetTransactionFn,
getHeader: stubbedGetHeaderFn,
}))

Expand Down

1 comment on commit b2ab769

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

Please sign in to comment.