mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-01-19 05:43:51 +01:00
Improve toString functions for schnorr data types (#4644)
This commit is contained in:
parent
e65346f558
commit
e5545cb3b9
@ -27,6 +27,8 @@ case class FieldElement(bytes: ByteVector)
|
|||||||
def getPublicKey: ECPublicKey = toPrivateKey.publicKey
|
def getPublicKey: ECPublicKey = toPrivateKey.publicKey
|
||||||
|
|
||||||
override def fieldObj: FiniteFieldObject[FieldElement] = FieldElement
|
override def fieldObj: FiniteFieldObject[FieldElement] = FieldElement
|
||||||
|
|
||||||
|
override def toString: String = s"FieldElement(${bytes.toHex})"
|
||||||
}
|
}
|
||||||
|
|
||||||
object FieldElement
|
object FieldElement
|
||||||
|
@ -12,6 +12,8 @@ case class SchnorrNonce(bytes: ByteVector) extends NetworkElement {
|
|||||||
def xCoord: CurveCoordinate = {
|
def xCoord: CurveCoordinate = {
|
||||||
CurveCoordinate(bytes)
|
CurveCoordinate(bytes)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override def toString: String = s"SchnorrNonce(${bytes.toHex})"
|
||||||
}
|
}
|
||||||
|
|
||||||
object SchnorrNonce extends Factory[SchnorrNonce] {
|
object SchnorrNonce extends Factory[SchnorrNonce] {
|
||||||
|
@ -69,6 +69,8 @@ case class SchnorrPublicKey(bytes: ByteVector) extends NetworkElement {
|
|||||||
def xCoord: CurveCoordinate = CurveCoordinate(bytes)
|
def xCoord: CurveCoordinate = CurveCoordinate(bytes)
|
||||||
|
|
||||||
def toXOnly: XOnlyPubKey = XOnlyPubKey(bytes)
|
def toXOnly: XOnlyPubKey = XOnlyPubKey(bytes)
|
||||||
|
|
||||||
|
override def toString: String = s"SchnorrPublicKey(${bytes.toHex})"
|
||||||
}
|
}
|
||||||
|
|
||||||
object SchnorrPublicKey extends Factory[SchnorrPublicKey] {
|
object SchnorrPublicKey extends Factory[SchnorrPublicKey] {
|
||||||
|
Loading…
Reference in New Issue
Block a user