mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-25 07:17:32 +01:00
Factoring out TransactionSignatureCheckerResult into it's own file
This commit is contained in:
parent
0af48b52f6
commit
89b9c7f29f
2 changed files with 38 additions and 34 deletions
|
@ -265,38 +265,4 @@ trait TransactionSignatureChecker extends BitcoinSLogger {
|
|||
|
||||
object TransactionSignatureChecker extends TransactionSignatureChecker
|
||||
|
||||
/**
|
||||
* The result type returned by checking a signature
|
||||
*/
|
||||
sealed trait TransactionSignatureCheckerResult {
|
||||
/**
|
||||
* Indicates if the transaction signature checker was successful or failed
|
||||
* @return
|
||||
*/
|
||||
def isValid : Boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the case that the signatures checked inside of the transaction were
|
||||
* all validly encoded as per the script verify flag & that the signatures
|
||||
* were valid when checked against the public keys
|
||||
*/
|
||||
case object SignatureValidationSuccess extends TransactionSignatureCheckerResult {
|
||||
def isValid = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Signature validation failed because a signature was not encoded
|
||||
* per the BIP66 rules https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki#specification
|
||||
*/
|
||||
case object SignatureValidationFailureNotStrictDerEncoding extends TransactionSignatureCheckerResult {
|
||||
def isValid = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Signature validation failed because there were not enough correct signatures for the transaction
|
||||
* we were given
|
||||
*/
|
||||
case object SignatureValidationfailureIncorrectSignatures extends TransactionSignatureCheckerResult {
|
||||
def isValid = false
|
||||
}
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
package org.scalacoin.crypto
|
||||
|
||||
|
||||
/**
|
||||
* The result type returned by checking a signature
|
||||
*/
|
||||
sealed trait TransactionSignatureCheckerResult {
|
||||
/**
|
||||
* Indicates if the transaction signature checker was successful or failed
|
||||
* @return
|
||||
*/
|
||||
def isValid : Boolean
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents the case that the signatures checked inside of the transaction were
|
||||
* all validly encoded as per the script verify flag & that the signatures
|
||||
* were valid when checked against the public keys
|
||||
*/
|
||||
case object SignatureValidationSuccess extends TransactionSignatureCheckerResult {
|
||||
def isValid = true
|
||||
}
|
||||
|
||||
/**
|
||||
* Signature validation failed because a signature was not encoded
|
||||
* per the BIP66 rules https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki#specification
|
||||
*/
|
||||
case object SignatureValidationFailureNotStrictDerEncoding extends TransactionSignatureCheckerResult {
|
||||
def isValid = false
|
||||
}
|
||||
|
||||
/**
|
||||
* Signature validation failed because there were not enough correct signatures for the transaction
|
||||
* we were given
|
||||
*/
|
||||
case object SignatureValidationfailureIncorrectSignatures extends TransactionSignatureCheckerResult {
|
||||
def isValid = false
|
||||
}
|
Loading…
Add table
Reference in a new issue