diff --git a/packages/neuron-wallet/src/services/node.ts b/packages/neuron-wallet/src/services/node.ts index 97a013ca9b..5559907199 100644 --- a/packages/neuron-wallet/src/services/node.ts +++ b/packages/neuron-wallet/src/services/node.ts @@ -263,7 +263,7 @@ class NodeService { } } - private isCkbCompatibility(neuronVersion: string, externalCKBVersion: string, type: CKBNodeType) { + private isCkbCompatibility(neuronVersion: string, externalCKBVersion: string, type: CKBNodeType = 'full') { const compatibilities = this.getNeuronCompatibilityCKB() const neuronCompatibleVersion = neuronVersion.split('.').slice(0, 2).join('.') const externalCKBCompatibleVersion = externalCKBVersion.split('.').slice(0, 2).join('.') diff --git a/packages/neuron-wallet/tests/services/node.test.ts b/packages/neuron-wallet/tests/services/node.test.ts index bff33582fb..549c1e95dd 100644 --- a/packages/neuron-wallet/tests/services/node.test.ts +++ b/packages/neuron-wallet/tests/services/node.test.ts @@ -473,6 +473,7 @@ describe('NodeService', () => { nodeService.getNeuronCompatibilityCKB = () => ({ '0.110': { full: ['0.110', '0.109'], + light: ['0.3', '0.2'], }, }) stubbedNetworsServiceGet.mockReturnValueOnce({ remote: BUNDLED_CKB_URL, readonly: true }) @@ -489,6 +490,12 @@ describe('NodeService', () => { it('is compatible', () => { expect(nodeService.isCkbCompatibility('0.110.0', '0.109.0 (30e1255 2023-01-30)')).toBeTruthy() }) + it('is not compatible', () => { + expect(nodeService.isCkbCompatibility('0.110.0', '0.1', 'light')).toBeFalsy() + }) + it('is compatible', () => { + expect(nodeService.isCkbCompatibility('0.110.0', '0.3', 'light')).toBeTruthy() + }) }) describe('test should update', () => { beforeEach(() => {