From acfe4b0bf834297326864174b586df280cb17dd7 Mon Sep 17 00:00:00 2001 From: devchenyan Date: Sun, 7 Apr 2024 10:29:09 +0800 Subject: [PATCH] fix: typos error (#3104) --- _typos.toml | 2 ++ .../src/services/transaction-sender.ts | 16 ++++++++-------- .../neuron-wallet/tests/services/cells.test.ts | 4 ++-- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/_typos.toml b/_typos.toml index ae82742a0c..0afbdd74c5 100644 --- a/_typos.toml +++ b/_typos.toml @@ -1,6 +1,8 @@ [default.extend-words] thur = "thur" numer = "numer" +HD = "HD" +hd = "hd" # defined in database schema lastest = "lastest" diff --git a/packages/neuron-wallet/src/services/transaction-sender.ts b/packages/neuron-wallet/src/services/transaction-sender.ts index d91b4e7b74..139e6f8179 100644 --- a/packages/neuron-wallet/src/services/transaction-sender.ts +++ b/packages/neuron-wallet/src/services/transaction-sender.ts @@ -674,8 +674,8 @@ export default class TransactionSender { const currentNetwork = NetworksService.getInstance().getCurrent() const rpcService = new RpcService(currentNetwork.remote, currentNetwork.type) - const depositeOutput = await CellsService.getLiveCell(outPoint) - if (!depositeOutput) { + const depositOutput = await CellsService.getLiveCell(outPoint) + if (!depositOutput) { throw new CellIsNotYetLive() } const prevTx = await rpcService.getTransaction(outPoint.txHash) @@ -690,7 +690,7 @@ export default class TransactionSender { const tx: Transaction = await TransactionGenerator.startWithdrawFromDao( walletID, outPoint, - depositeOutput, + depositOutput, depositBlockHeader!.number, depositBlockHeader!.hash, changeAddress!.address, @@ -736,13 +736,13 @@ export default class TransactionSender { if (!withdrawOutput.depositOutPoint) { throw new Error('DAO has not finish step first withdraw') } - const depositeTx = await rpcService.getTransaction(withdrawOutput.depositOutPoint.txHash) - if (!depositeTx?.txStatus.blockHash) { - throw new Error(`Get deposite block hash failed with tx hash ${withdrawOutput.depositOutPoint.txHash}`) + const depositTx = await rpcService.getTransaction(withdrawOutput.depositOutPoint.txHash) + if (!depositTx?.txStatus.blockHash) { + throw new Error(`Get deposit block hash failed with tx hash ${withdrawOutput.depositOutPoint.txHash}`) } - const depositBlockHeader = await rpcService.getHeader(depositeTx.txStatus.blockHash) + const depositBlockHeader = await rpcService.getHeader(depositTx.txStatus.blockHash) if (!depositBlockHeader) { - throw new Error(`Get Header failed with blockHash ${depositeTx.txStatus.blockHash}`) + throw new Error(`Get Header failed with blockHash ${depositTx.txStatus.blockHash}`) } const depositEpoch = this.parseEpoch(BigInt(depositBlockHeader.epoch)) const depositCapacity: bigint = BigInt(withdrawOutput.capacity) diff --git a/packages/neuron-wallet/tests/services/cells.test.ts b/packages/neuron-wallet/tests/services/cells.test.ts index 3bb81943f1..8d3dcd17d1 100644 --- a/packages/neuron-wallet/tests/services/cells.test.ts +++ b/packages/neuron-wallet/tests/services/cells.test.ts @@ -630,7 +630,7 @@ describe('CellsService', () => { ) ).rejects.toThrow(new LiveCapacityNotEnough()) }) - it('left capcity not enough for a cell throw CapacityNotEnoughForChange', async () => { + it('left capacity not enough for a cell throw CapacityNotEnoughForChange', async () => { await createMultisigCell(toShannon('1000'), OutputStatus.Sent, multisigInfo) await expect( CellsService.gatherInputs( @@ -660,7 +660,7 @@ describe('CellsService', () => { ) ).rejects.toThrow(new LiveCapacityNotEnough()) }) - it('left capcity not enough for a cell throw CapacityNotEnoughForChange', async () => { + it('left capacity not enough for a cell throw CapacityNotEnoughForChange', async () => { await expect( CellsService.gatherInputs( toShannon('990'),