mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 09:52:09 +01:00
Add better exception messages (#4053)
This commit is contained in:
parent
7a6f0430d6
commit
d213e9935d
@ -1614,7 +1614,7 @@ abstract class DLCWallet
|
||||
Vector[DLCAnnouncementDb],
|
||||
Vector[OracleAnnouncementDataDb],
|
||||
Vector[OracleNonceDb])] =
|
||||
dlcDataManagement.getDLCAnnouncementDbs(dlcDb.dlcId)
|
||||
dlcDataManagement.getDLCAnnouncementDbs(dlcId)
|
||||
|
||||
val contractInfoAndAnnouncementsF: Future[
|
||||
(ContractInfo, Vector[(OracleAnnouncementV0TLV, Long)])] = {
|
||||
|
@ -211,14 +211,15 @@ object DLCStatusBuilder {
|
||||
nonceDbs: Vector[OracleNonceDb]): (
|
||||
OracleOutcome,
|
||||
Vector[SchnorrDigitalSignature]) = {
|
||||
val noncesByAnnouncement =
|
||||
val noncesByAnnouncement: Map[Long, Vector[OracleNonceDb]] =
|
||||
nonceDbs.sortBy(_.index).groupBy(_.announcementId)
|
||||
val oracleOutcome = {
|
||||
val usedOracleIds = announcementIds.filter(_.used)
|
||||
val usedOracles = usedOracleIds.sortBy(_.index).map { used =>
|
||||
announcementsWithId.find(_._2 == used.announcementId).get
|
||||
}
|
||||
require(usedOracles.nonEmpty, "Error, no oracles used")
|
||||
require(usedOracles.nonEmpty,
|
||||
s"Error, no oracles used, dlcIds=${announcementIds.map(_.dlcId)}")
|
||||
announcementsWithId.head._1.eventTLV.eventDescriptor match {
|
||||
case _: EnumEventDescriptorV0TLV =>
|
||||
val oracleInfos = usedOracles.map(t => EnumSingleOracleInfo(t._1))
|
||||
|
Loading…
Reference in New Issue
Block a user