Skip to content

Commit dc683ca

Browse files
authored
removes unused methods from walletDb (#5641)
* removes unused methods from walletDb cleans up the walletDb by removing unused methods removes one unused wallet method that was the only usage of a walletDb method * puts 'loadHeads' back it's used in the 'debug' CLI command
1 parent af1527c commit dc683ca

File tree

2 files changed

+0
-58
lines changed

2 files changed

+0
-58
lines changed

ironfish/src/wallet/account/account.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -845,16 +845,6 @@ export class Account {
845845
}
846846
}
847847

848-
async *getTransactionsOrderedBySequence(
849-
tx?: IDatabaseTransaction,
850-
): AsyncGenerator<Readonly<TransactionValue>> {
851-
for await (const { hash } of this.walletDb.getTransactionHashesBySequence(this, tx)) {
852-
const transaction = await this.getTransaction(hash, tx)
853-
Assert.isNotUndefined(transaction)
854-
yield transaction
855-
}
856-
}
857-
858848
getPendingTransactions(
859849
headSequence: number,
860850
tx?: IDatabaseTransaction,

ironfish/src/wallet/walletdb/walletdb.ts

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -542,19 +542,6 @@ export class WalletDB {
542542
await this.transactions.del([account.prefix, transactionHash], tx)
543543
}
544544

545-
async *getTransactionHashesBySequence(
546-
account: Account,
547-
tx?: IDatabaseTransaction,
548-
): AsyncGenerator<{ sequence: number; hash: Buffer }> {
549-
for await (const [, [sequence, hash]] of this.sequenceToTransactionHash.getAllKeysIter(
550-
tx,
551-
account.prefixRange,
552-
{ ordered: true },
553-
)) {
554-
yield { sequence, hash }
555-
}
556-
}
557-
558545
async *loadTransactions(
559546
account: Account,
560547
range?: DatabaseKeyRange,
@@ -831,24 +818,6 @@ export class WalletDB {
831818
}
832819
}
833820

834-
async *loadNullifierToNoteHash(
835-
account: Account,
836-
tx?: IDatabaseTransaction,
837-
): AsyncGenerator<{
838-
nullifier: Buffer
839-
noteHash: Buffer
840-
}> {
841-
for await (const [[_, nullifier], noteHash] of this.nullifierToNoteHash.getAllIter(
842-
tx,
843-
account.prefixRange,
844-
)) {
845-
yield {
846-
nullifier,
847-
noteHash,
848-
}
849-
}
850-
}
851-
852821
async deleteNullifier(
853822
account: Account,
854823
nullifier: Buffer,
@@ -1142,19 +1111,6 @@ export class WalletDB {
11421111
}
11431112
}
11441113

1145-
async saveSequenceToTransactionHash(
1146-
account: Account,
1147-
sequence: number,
1148-
transactionHash: Buffer,
1149-
tx?: IDatabaseTransaction,
1150-
): Promise<void> {
1151-
await this.sequenceToTransactionHash.put(
1152-
[account.prefix, [sequence, transactionHash]],
1153-
null,
1154-
tx,
1155-
)
1156-
}
1157-
11581114
async deleteSequenceToTransactionHash(
11591115
account: Account,
11601116
sequence: number,
@@ -1406,10 +1362,6 @@ export class WalletDB {
14061362
return this.multisigIdentities.get(identity, tx)
14071363
}
14081364

1409-
async hasMultisigIdentity(identity: Buffer, tx?: IDatabaseTransaction): Promise<boolean> {
1410-
return (await this.getMultisigIdentity(identity, tx)) !== undefined
1411-
}
1412-
14131365
async deleteMultisigIdentity(identity: Buffer, tx?: IDatabaseTransaction): Promise<void> {
14141366
await this.multisigIdentities.del(identity, tx)
14151367
}

0 commit comments

Comments
 (0)