Skip to content

Commit 7e7179d

Browse files
committed
fix
1 parent 126a779 commit 7e7179d

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

packages/neuron-wallet/src/services/sync-progress.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,6 @@ export default class SyncProgressService {
7272
return res
7373
}
7474

75-
static async getExistingSyncArgses() {
76-
const syncProgresses = await getConnection().getRepository(SyncProgress).createQueryBuilder().getMany()
77-
return new Set(syncProgresses.map(v => v.args))
78-
}
79-
8075
static async getExistingSyncScripts() {
8176
const syncProgresses = await getConnection().getRepository(SyncProgress).createQueryBuilder().getMany()
8277
return new Set(syncProgresses.map(v => Script.fromObject(v).computeHash()))

packages/neuron-wallet/tests/block-sync-renderer/light-synchronizer.test.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import type { Script } from '@ckb-lumos/lumos'
22
import LightSynchronizer from '../../src/block-sync-renderer/sync/light-synchronizer'
33
import AddressMeta from '../../src/database/address/meta'
4+
import { computeScriptHash } from '@ckb-lumos/lumos/utils'
45

56
const getSyncStatusMock = jest.fn()
67
const getCurrentWalletMinSyncedBlockNumberMock = jest.fn()
@@ -12,7 +13,7 @@ const getWalletMinLocalSavedBlockNumberMock = jest.fn()
1213
const removeByHashesAndAddressType = jest.fn()
1314
const getOtherTypeSyncProgressMock = jest.fn()
1415
const getOtherTypeSyncBlockNumberMock = jest.fn()
15-
const getExistingSyncArgsesMock = jest.fn()
16+
const getExistingSyncScriptsMock = jest.fn()
1617

1718
const setScriptsMock = jest.fn()
1819
const getScriptsMock = jest.fn()
@@ -65,7 +66,7 @@ jest.mock('../../src/services/sync-progress', () => {
6566

6667
static getOtherTypeSyncProgress: any = () => getOtherTypeSyncProgressMock()
6768
static getOtherTypeSyncBlockNumber: any = () => getOtherTypeSyncBlockNumberMock()
68-
static getExistingSyncArgses: any = () => getExistingSyncArgsesMock()
69+
static getExistingSyncScripts: any = () => getExistingSyncScriptsMock()
6970
}
7071
})
7172

@@ -145,7 +146,7 @@ describe('test light synchronizer', () => {
145146
it('when syncing script in the local DB', async () => {
146147
getScriptsMock.mockResolvedValue([{ script, blockNumber: '0xaa' }])
147148
walletGetAllMock.mockReturnValue([{ id: 'walletId' }])
148-
getExistingSyncArgsesMock.mockResolvedValue(new Set([script.args]))
149+
getExistingSyncScriptsMock.mockResolvedValue(new Set([computeScriptHash(script)]))
149150
const addressMeta = AddressMeta.fromObject({
150151
walletId: 'walletId',
151152
address,
@@ -195,7 +196,7 @@ describe('test light synchronizer', () => {
195196
it('when syncing script not in the local DB', async () => {
196197
getScriptsMock.mockResolvedValue([{ script, blockNumber: '0xaa' }])
197198
walletGetAllMock.mockReturnValue([{ id: 'walletId' }])
198-
getExistingSyncArgsesMock.mockResolvedValue(new Set())
199+
getExistingSyncScriptsMock.mockResolvedValue(new Set())
199200
const addressMeta = AddressMeta.fromObject({
200201
walletId: 'walletId',
201202
address,
@@ -397,7 +398,7 @@ describe('test light synchronizer', () => {
397398
}
398399
const getScriptsResult = [{ script: script2, blockNumber: '0xaa', scriptType: 'lock' }]
399400
getScriptsMock.mockResolvedValue(getScriptsResult)
400-
getExistingSyncArgsesMock.mockResolvedValue(new Set([script2.args]))
401+
getExistingSyncScriptsMock.mockResolvedValue(new Set([computeScriptHash(script2)]))
401402
const addressMeta2 = AddressMeta.fromObject({
402403
walletId: 'walletId2',
403404
address,
@@ -481,7 +482,7 @@ describe('test light synchronizer', () => {
481482
}
482483
const getScriptsResult = [{ script: script2, blockNumber: '0xab', scriptType: 'lock' }]
483484
getScriptsMock.mockResolvedValue(getScriptsResult)
484-
getExistingSyncArgsesMock.mockResolvedValue(new Set([script2.args]))
485+
getExistingSyncScriptsMock.mockResolvedValue(new Set([computeScriptHash(script2)]))
485486
const addressMeta2 = AddressMeta.fromObject({
486487
walletId: 'walletId2',
487488
address,

packages/neuron-wallet/tests/services/tx/transaction-sender.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -699,7 +699,7 @@ describe('TransactionSender Test', () => {
699699
walletID: '',
700700
targetOutputs,
701701
fee: '0',
702-
feeRate: '1000',
702+
feeRate: '2000',
703703
multisigConfig,
704704
})
705705
})

0 commit comments

Comments
 (0)