mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-25 07:17:32 +01:00
wallet: Remove unecessary type parameter to TxCRUDComponent#TxTable (#5650)
This commit is contained in:
parent
14f456dec3
commit
42b13a6a62
4 changed files with 10 additions and 12 deletions
|
@ -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")
|
||||
|
|
|
@ -24,7 +24,7 @@ case class IncomingTransactionDAO()(implicit
|
|||
}
|
||||
|
||||
class IncomingTransactionTable(tag: Tag)
|
||||
extends TxTable[IncomingTransactionDb](
|
||||
extends TxTable(
|
||||
tag,
|
||||
schemaName,
|
||||
"wallet_incoming_txs"
|
||||
|
|
|
@ -25,7 +25,7 @@ case class OutgoingTransactionDAO()(implicit
|
|||
}
|
||||
|
||||
class OutgoingTransactionTable(tag: Tag)
|
||||
extends TxTable[OutgoingTransactionDb](
|
||||
extends TxTable(
|
||||
tag,
|
||||
schemaName,
|
||||
"wallet_outgoing_txs"
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue