Factoring out TransactionSignatureCheckerResult into it's own file

This commit is contained in:
Chris Stewart 2016-03-27 10:48:42 -05:00
parent 0af48b52f6
commit 89b9c7f29f
2 changed files with 38 additions and 34 deletions

View file

@ -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
}

View file

@ -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
}