Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions packages/neuron-ui/src/components/HardwareSign/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ const HardwareSign = ({
if (isSuccessResponse(res)) {
history!.push(RoutePath.History)
} else {
// @ts-ignore
setError(res.message.content)
setError(typeof res.message === 'string' ? res.message : res.message.content ?? 'migrate-acp error')
}
})
break
Expand Down Expand Up @@ -425,7 +424,6 @@ const HardwareSign = ({
}, [offlineSignType, generatedTx, onCancel, description, experimental])

useDidMount(() => {
// @ts-ignore
dialogRef.current?.showModal()
ensureDeviceAvailable(deviceInfo)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,6 @@ const VerifyHardwareAddress = ({ address, wallet, onDismiss }: VerifyHardwareAdd
}, [deviceInfo, address, userInputStatus, verifiedStatus, invalidStatus, ensureDeviceAvailable, t])

useDidMount(() => {
// @ts-ignore
dialogRef.current?.showModal()
ensureDeviceAvailable(deviceInfo)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
sendSUDTTransaction as sendSUDTTx,
migrateAcp as migrateAcpIpc,
} from 'services/remote'
import { FailureFromController } from 'services/remote/remoteApiWrapper'
import { AppActions, StateDispatch } from '../reducer'
import { addNotification } from './app'

Expand Down Expand Up @@ -42,7 +43,13 @@ export const migrateAcp = (params: Controller.MigrateAcp.Params) => async (dispa
return res
} catch (err) {
console.warn(err)
return { status: ResponseCode.FAILURE, message: err }
const res: FailureFromController = {
status: ResponseCode.FAILURE,
message: {
content: String(err),
},
}
return res
} finally {
dispatch({
type: AppActions.UpdateLoadings,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ export default class IndexerCacheService {
)

const fetchedTxHashes = await transactionCollector.getTransactionHashes()
//@ts-ignore
if (!fetchedTxHashes.length) {
continue
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
//@ts-nocheck
import Module from 'module'

const originalLoad = Module._load

Module._load = function (...args: unknown[]) {
Module._load = function (...args) {
if (args[0] === 'electron') {
return {}
}
Expand Down
8 changes: 8 additions & 0 deletions packages/neuron-wallet/src/types/module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import 'module'

declare module 'module' {
namespace Module {
function _load(...args: unknown[]): unknown
}
export = Module
}
3 changes: 2 additions & 1 deletion packages/neuron-wallet/tests/setupAndTeardown/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,15 @@ export const closeConnection = () => {
export const saveTransactions = async (txs: any) => {
for (const tx of txs) {
// TODO: do not use private methods
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore: Private method
await TransactionPersistor.saveWithFetch(tx)
}
}

export const createAccounts = async (assetAccounts: AssetAccount[], outputEntities: OutputEntity[]) => {
const entities = assetAccounts.map(aa => AssetAccountEntity.fromModel(aa))
const accountIds = []
const accountIds: number[] = []
for (const entity of entities) {
await getConnection().manager.save([entity.sudtTokenInfo])
const [assetAccount] = await getConnection().manager.save([entity])
Expand Down