Skip to content

Commit

Permalink
removes unused methods from walletDb
Browse files Browse the repository at this point in the history
cleans up the walletDb by removing unused methods

removes one unused wallet method that was the only usage of a walletDb method
  • Loading branch information
hughy committed Nov 12, 2024
1 parent ab377a4 commit 478abfa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 66 deletions.
10 changes: 0 additions & 10 deletions ironfish/src/wallet/account/account.ts
Original file line number Diff line number Diff line change
Expand Up @@ -845,16 +845,6 @@ export class Account {
}
}

async *getTransactionsOrderedBySequence(
tx?: IDatabaseTransaction,
): AsyncGenerator<Readonly<TransactionValue>> {
for await (const { hash } of this.walletDb.getTransactionHashesBySequence(this, tx)) {
const transaction = await this.getTransaction(hash, tx)
Assert.isNotUndefined(transaction)
yield transaction
}
}

getPendingTransactions(
headSequence: number,
tx?: IDatabaseTransaction,
Expand Down
56 changes: 0 additions & 56 deletions ironfish/src/wallet/walletdb/walletdb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -482,14 +482,6 @@ export class WalletDB {
await this.heads.del(account.id, tx)
}

async *loadHeads(
tx?: IDatabaseTransaction,
): AsyncGenerator<{ accountId: string; head: HeadValue | null }, void, unknown> {
for await (const [accountId, head] of this.heads.getAllIter(tx)) {
yield { accountId, head }
}
}

async saveTransaction(
account: Account,
transactionHash: Buffer,
Expand Down Expand Up @@ -542,19 +534,6 @@ export class WalletDB {
await this.transactions.del([account.prefix, transactionHash], tx)
}

async *getTransactionHashesBySequence(
account: Account,
tx?: IDatabaseTransaction,
): AsyncGenerator<{ sequence: number; hash: Buffer }> {
for await (const [, [sequence, hash]] of this.sequenceToTransactionHash.getAllKeysIter(
tx,
account.prefixRange,
{ ordered: true },
)) {
yield { sequence, hash }
}
}

async *loadTransactions(
account: Account,
range?: DatabaseKeyRange,
Expand Down Expand Up @@ -831,24 +810,6 @@ export class WalletDB {
}
}

async *loadNullifierToNoteHash(
account: Account,
tx?: IDatabaseTransaction,
): AsyncGenerator<{
nullifier: Buffer
noteHash: Buffer
}> {
for await (const [[_, nullifier], noteHash] of this.nullifierToNoteHash.getAllIter(
tx,
account.prefixRange,
)) {
yield {
nullifier,
noteHash,
}
}
}

async deleteNullifier(
account: Account,
nullifier: Buffer,
Expand Down Expand Up @@ -1142,19 +1103,6 @@ export class WalletDB {
}
}

async saveSequenceToTransactionHash(
account: Account,
sequence: number,
transactionHash: Buffer,
tx?: IDatabaseTransaction,
): Promise<void> {
await this.sequenceToTransactionHash.put(
[account.prefix, [sequence, transactionHash]],
null,
tx,
)
}

async deleteSequenceToTransactionHash(
account: Account,
sequence: number,
Expand Down Expand Up @@ -1406,10 +1354,6 @@ export class WalletDB {
return this.multisigIdentities.get(identity, tx)
}

async hasMultisigIdentity(identity: Buffer, tx?: IDatabaseTransaction): Promise<boolean> {
return (await this.getMultisigIdentity(identity, tx)) !== undefined
}

async deleteMultisigIdentity(identity: Buffer, tx?: IDatabaseTransaction): Promise<void> {
await this.multisigIdentities.del(identity, tx)
}
Expand Down

0 comments on commit 478abfa

Please sign in to comment.