Improve toString functions for schnorr data types (#4644)

This commit is contained in:
benthecarman 2022-08-23 07:05:04 -05:00 committed by GitHub
parent e65346f558
commit e5545cb3b9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,8 @@ case class FieldElement(bytes: ByteVector)
def getPublicKey: ECPublicKey = toPrivateKey.publicKey
override def fieldObj: FiniteFieldObject[FieldElement] = FieldElement
override def toString: String = s"FieldElement(${bytes.toHex})"
}
object FieldElement

View File

@ -12,6 +12,8 @@ case class SchnorrNonce(bytes: ByteVector) extends NetworkElement {
def xCoord: CurveCoordinate = {
CurveCoordinate(bytes)
}
override def toString: String = s"SchnorrNonce(${bytes.toHex})"
}
object SchnorrNonce extends Factory[SchnorrNonce] {

View File

@ -69,6 +69,8 @@ case class SchnorrPublicKey(bytes: ByteVector) extends NetworkElement {
def xCoord: CurveCoordinate = CurveCoordinate(bytes)
def toXOnly: XOnlyPubKey = XOnlyPubKey(bytes)
override def toString: String = s"SchnorrPublicKey(${bytes.toHex})"
}
object SchnorrPublicKey extends Factory[SchnorrPublicKey] {