|
@ -5,12 +5,13 @@ import com.alexitc.playsonify.models.ordering.{FieldOrdering, OrderingCondition} |
|
|
import com.alexitc.playsonify.models.pagination.{Limit, PaginatedQuery, PaginatedResult} |
|
|
import com.alexitc.playsonify.models.pagination.{Limit, PaginatedQuery, PaginatedResult} |
|
|
import com.xsn.explorer.data.TransactionBlockingDataHandler |
|
|
import com.xsn.explorer.data.TransactionBlockingDataHandler |
|
|
import com.xsn.explorer.data.anorm.dao.{TransactionOutputPostgresDAO, TransactionPostgresDAO} |
|
|
import com.xsn.explorer.data.anorm.dao.{TransactionOutputPostgresDAO, TransactionPostgresDAO} |
|
|
|
|
|
import com.xsn.explorer.errors.TransactionNotFoundError |
|
|
import com.xsn.explorer.models._ |
|
|
import com.xsn.explorer.models._ |
|
|
import com.xsn.explorer.models.fields.TransactionField |
|
|
import com.xsn.explorer.models.fields.TransactionField |
|
|
import com.xsn.explorer.models.persisted.Transaction |
|
|
import com.xsn.explorer.models.persisted.Transaction |
|
|
import com.xsn.explorer.models.values.{Address, Blockhash, TransactionId} |
|
|
import com.xsn.explorer.models.values.{Address, Blockhash, TransactionId} |
|
|
import javax.inject.Inject |
|
|
import javax.inject.Inject |
|
|
import org.scalactic.Good |
|
|
import org.scalactic.{Good, One, Or} |
|
|
import play.api.db.Database |
|
|
import play.api.db.Database |
|
|
|
|
|
|
|
|
class TransactionPostgresDataHandler @Inject() ( |
|
|
class TransactionPostgresDataHandler @Inject() ( |
|
@ -50,6 +51,11 @@ class TransactionPostgresDataHandler @Inject() ( |
|
|
Good(result) |
|
|
Good(result) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override def getOutput(txid: TransactionId, index: Int): ApplicationResult[Transaction.Output] = withConnection { implicit conn => |
|
|
|
|
|
val maybe = transactionOutputDAO.getOutput(txid, index) |
|
|
|
|
|
Or.from(maybe, One(TransactionNotFoundError)) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
override def getByBlockhash( |
|
|
override def getByBlockhash( |
|
|
blockhash: Blockhash, |
|
|
blockhash: Blockhash, |
|
|
paginatedQuery: PaginatedQuery, |
|
|
paginatedQuery: PaginatedQuery, |
|
|