Skip to content

Commit

Permalink
chore(core): cleanup unused 'wallet' helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
vindard committed Feb 6, 2024
1 parent ed8a95a commit f66247b
Showing 1 changed file with 2 additions and 27 deletions.
29 changes: 2 additions & 27 deletions core/api/test/helpers/wallet.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { createChainAddress } from "lightning"

import {
getBalanceForWallet,
getPendingIncomingOnChainTransactionsForWallets,
getTransactionsForWallets,
} from "@/app/wallets"
import { RepositoryError } from "@/domain/errors"
import { WalletsRepository, WalletOnChainAddressesRepository } from "@/services/mongoose"
import { getBalanceForWallet } from "@/app/wallets"
import { WalletOnChainAddressesRepository } from "@/services/mongoose"
import { getActiveLnd } from "@/services/lnd/config"

export const getBalanceHelper = async (
Expand All @@ -17,26 +12,6 @@ export const getBalanceHelper = async (
return balance
}

export const getTransactionsForWalletId = async (
walletId: WalletId,
): Promise<PaginatedQueryResult<WalletTransaction> | ApplicationError> => {
const wallets = WalletsRepository()
const wallet = await wallets.findById(walletId)
if (wallet instanceof RepositoryError) return wallet
return getTransactionsForWallets({ wallets: [wallet], rawPaginationArgs: {} })
}

export const getPendingTransactionsForWalletId = async (
walletId: WalletId,
): Promise<WalletTransaction[] | ApplicationError> => {
const wallets = WalletsRepository()
const wallet = await wallets.findById(walletId)
if (wallet instanceof RepositoryError) return wallet
return getPendingIncomingOnChainTransactionsForWallets({
wallets: [wallet],
})
}

// This is to test detection of funds coming in on legacy addresses
// via LND. Remove once all on chain wallets are migrated to Bria
export const lndCreateOnChainAddress = async (
Expand Down

0 comments on commit f66247b

Please sign in to comment.