wallet: Remove unecessary type parameter to TxCRUDComponent#TxTable (#5650)

This commit is contained in:
Chris Stewart 2024-08-24 15:09:14 -05:00 committed by GitHub
parent 14f456dec3
commit 42b13a6a62
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 10 additions and 12 deletions

View file

@ -25,7 +25,7 @@ case class DLCRemoteTxDAO()(implicit
TableQuery[DLCRemoteTxTable]
class DLCRemoteTxTable(tag: Tag)
extends TxTable[TransactionDb](tag, schemaName, "watch_only_tx_table") {
extends TxTable(tag, schemaName, "watch_only_tx_table") {
def txIdBE: Rep[DoubleSha256DigestBE] = column("txIdBE", O.PrimaryKey)
def transaction: Rep[Transaction] = column("transaction")

View file

@ -24,7 +24,7 @@ case class IncomingTransactionDAO()(implicit
}
class IncomingTransactionTable(tag: Tag)
extends TxTable[IncomingTransactionDb](
extends TxTable(
tag,
schemaName,
"wallet_incoming_txs"

View file

@ -25,7 +25,7 @@ case class OutgoingTransactionDAO()(implicit
}
class OutgoingTransactionTable(tag: Tag)
extends TxTable[OutgoingTransactionDb](
extends TxTable(
tag,
schemaName,
"wallet_outgoing_txs"

View file

@ -15,7 +15,7 @@ trait TxCRUDComponent[DbEntryType <: TxDB] {
self: CRUD[DbEntryType, DoubleSha256DigestBE] =>
import profile.api._
abstract class TxTable[DbEntryType <: TxDB](
abstract class TxTable(
tag: profile.api.Tag,
schemaName: Option[String],
tableName: String
@ -34,26 +34,25 @@ trait TxDAO[DbEntryType <: TxDB]
private val mappers = new org.bitcoins.db.DbCommonsColumnMappers(profile)
import mappers._
type DbTable = TxTable[DbEntryType]
override val table: TableQuery[_ <: DbTable]
override val table: TableQuery[? <: TxTable]
override def createAll(ts: Vector[DbEntryType]): Future[Vector[DbEntryType]] =
createAllNoAutoInc(ts, safeDatabase)
override def findByPrimaryKeys(
txIdBEs: Vector[DoubleSha256DigestBE]
): Query[DbTable, DbEntryType, Seq] =
): Query[TxTable, DbEntryType, Seq] =
table.filter(_.txIdBE.inSet(txIdBEs))
override def findByPrimaryKey(
txIdBE: DoubleSha256DigestBE
): Query[DbTable, DbEntryType, Seq] = {
): Query[TxTable, DbEntryType, Seq] = {
table.filter(_.txIdBE === txIdBE)
}
override def findAll(
txs: Vector[DbEntryType]
): Query[DbTable, DbEntryType, Seq] =
): Query[TxTable, DbEntryType, Seq] =
findByPrimaryKeys(txs.map(_.txIdBE))
def findByOutPoint(
@ -118,8 +117,7 @@ case class TransactionDAO()(implicit
private val mappers = new org.bitcoins.db.DbCommonsColumnMappers(profile)
import mappers._
override val table
: slick.lifted.TableQuery[TransactionDAO.this.TransactionTable] =
override val table: slick.lifted.TableQuery[TransactionTable] =
TableQuery[TransactionTable]
def findAllUnconfirmed(): Future[Vector[TransactionDb]] = {
@ -135,7 +133,7 @@ case class TransactionDAO()(implicit
}
class TransactionTable(tag: Tag)
extends TxTable[TransactionDb](tag, schemaName, "tx_table") {
extends TxTable(tag, schemaName, "tx_table") {
def txIdBE: Rep[DoubleSha256DigestBE] = column("txIdBE", O.PrimaryKey)