mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-25 07:17:32 +01:00
rename package to bitcoins
This commit is contained in:
parent
2efaf14f49
commit
f73639d23f
143 changed files with 978 additions and 522 deletions
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.config
|
||||
package org.bitcoins.config
|
||||
|
||||
import org.bitcoinj.params.{MainNetParams, RegTestParams, TestNet3Params}
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.spongycastle.asn1.sec.SECNamedCurves
|
||||
import org.spongycastle.crypto.params.ECDomainParameters
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.spongycastle.asn1.{ASN1Primitive, ASN1Integer, DLSequence, ASN1InputStream}
|
||||
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
@ -13,6 +13,7 @@ trait DERSignatureUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Checks if this signature is encoded to DER correctly
|
||||
* https://crypto.stackexchange.com/questions/1795/how-can-i-convert-a-der-ecdsa-signature-to-asn-1
|
||||
*
|
||||
* @return boolean representing if the signature is a valid
|
||||
*/
|
||||
def isDEREncoded(signature : ECDigitalSignature) : Boolean = isDEREncoded(signature.bytes)
|
||||
|
@ -20,6 +21,7 @@ trait DERSignatureUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Checks if the bytes are encoded to DER correctly
|
||||
* https://crypto.stackexchange.com/questions/1795/how-can-i-convert-a-der-ecdsa-signature-to-asn-1
|
||||
*
|
||||
* @return boolean representing if the signature is a valid
|
||||
*/
|
||||
def isDEREncoded(bytes : Seq[Byte]) : Boolean = {
|
||||
|
@ -63,6 +65,7 @@ trait DERSignatureUtil extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Decodes the given digital signature into it's r and s points
|
||||
*
|
||||
* @param signature
|
||||
* @return
|
||||
*/
|
||||
|
@ -71,6 +74,7 @@ trait DERSignatureUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Decodes the given sequence of bytes into it's r and s points
|
||||
* throws an exception if the given sequence of bytes is not a DER encoded signature
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -115,6 +119,7 @@ trait DERSignatureUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* This functions implements the strict der encoding rules that were created in BIP66
|
||||
* https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
|
||||
*
|
||||
* @param signature the signature to check if they are strictly der encoded
|
||||
* @return boolean indicating whether the signature was der encoded or not
|
||||
*/
|
||||
|
@ -129,6 +134,7 @@ trait DERSignatureUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* This functions implements the strict der encoding rules that were created in BIP66
|
||||
* https://github.com/bitcoin/bips/blob/master/bip-0066.mediawiki
|
||||
*
|
||||
* @param bytes the bytes to check if they are strictly der encoded
|
||||
* @return boolean indicating whether the bytes were der encoded or not
|
||||
*/
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 2/26/16.
|
||||
|
@ -16,6 +16,7 @@ sealed trait ECDigitalSignature extends BitcoinSLogger {
|
|||
/**
|
||||
* Checks if this signature is encoded to DER correctly
|
||||
* https://crypto.stackexchange.com/questions/1795/how-can-i-convert-a-der-ecdsa-signature-to-asn-1
|
||||
*
|
||||
* @return boolean representing if the signature is a valid
|
||||
*/
|
||||
def isDEREncoded : Boolean = DERSignatureUtil.isDEREncoded(this)
|
||||
|
@ -24,6 +25,7 @@ sealed trait ECDigitalSignature extends BitcoinSLogger {
|
|||
/**
|
||||
* Decodes the digital signature into it's r and s points
|
||||
* throws an exception if the given sequence of bytes is not a DER encoded signature
|
||||
*
|
||||
* @return the (r,s) values for the elliptic curve digital signature
|
||||
*/
|
||||
def decodeSignature : (BigInt,BigInt) = DERSignatureUtil.decodeSignature(this)
|
||||
|
@ -37,6 +39,7 @@ sealed trait ECDigitalSignature extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Represents the s value found in a elliptic curve digital signature
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def s = decodeSignature._2
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
/**
|
||||
* Created by chris on 2/16/16.
|
|
@ -1,12 +1,12 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.config.TestNet3
|
||||
import org.scalacoin.protocol.script._
|
||||
import org.scalacoin.protocol.transaction.{Transaction, TransactionInput}
|
||||
import org.scalacoin.script.{ScriptProgram}
|
||||
import org.scalacoin.script.crypto._
|
||||
import org.scalacoin.script.flag.{ScriptFlagUtil, ScriptFlag, ScriptVerifyDerSig}
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.config.TestNet3
|
||||
import org.bitcoins.protocol.script._
|
||||
import org.bitcoins.protocol.transaction.{Transaction, TransactionInput}
|
||||
import org.bitcoins.script.{ScriptProgram}
|
||||
import org.bitcoins.script.crypto._
|
||||
import org.bitcoins.script.flag.{ScriptFlagUtil, ScriptFlag, ScriptVerifyDerSig}
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -22,6 +22,7 @@ trait TransactionSignatureChecker extends BitcoinSLogger {
|
|||
* Checks the signature of a scriptSig in the spending transaction against the
|
||||
* given scriptPubKey & explicitly given public key
|
||||
* This is useful for instances of non standard scriptSigs
|
||||
*
|
||||
* @param txSignatureComponent the tx signature component that contains all relevant tx information
|
||||
* @param pubKey
|
||||
* @return
|
||||
|
@ -60,6 +61,7 @@ trait TransactionSignatureChecker extends BitcoinSLogger {
|
|||
* This is a helper function to check digital signatures against public keys
|
||||
* if the signature does not match this public key, check it against the next
|
||||
* public key in the sequence
|
||||
*
|
||||
* @param txSignatureComponent the tx signature component that contains all relevant transaction information
|
||||
* @param sigs the signatures that are being checked for validity
|
||||
* @param pubKeys the public keys which are needed to verify that the signatures are correct
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.protocol.script.ScriptPubKey
|
||||
import org.scalacoin.protocol.transaction.Transaction
|
||||
import org.scalacoin.script.flag.ScriptFlag
|
||||
import org.bitcoins.protocol.script.ScriptPubKey
|
||||
import org.bitcoins.protocol.transaction.Transaction
|
||||
import org.bitcoins.script.flag.ScriptFlag
|
||||
|
||||
/**
|
||||
* Created by chris on 4/6/16.
|
||||
|
@ -13,29 +13,34 @@ trait TransactionSignatureComponent {
|
|||
|
||||
/**
|
||||
* The transaction being checked for the validity of signatures
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def transaction : Transaction
|
||||
|
||||
/**
|
||||
* The index of the input whose script signature is being checked
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def inputIndex : Int
|
||||
|
||||
/**
|
||||
* The script signature being checked
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def scriptSignature = transaction.inputs(inputIndex).scriptSignature
|
||||
/**
|
||||
* The scriptPubKey for which the input is being checked against
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def scriptPubKey : ScriptPubKey
|
||||
|
||||
/**
|
||||
* The flags that are needed to verify if the signature is correct
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def flags : Seq[ScriptFlag]
|
|
@ -1,14 +1,14 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.currency.CurrencyUnits
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializerHelper
|
||||
import org.scalacoin.marshallers.transaction.RawTransactionOutputParser
|
||||
import org.scalacoin.protocol.script._
|
||||
import org.scalacoin.protocol.transaction._
|
||||
import org.scalacoin.script.constant.ScriptToken
|
||||
import org.scalacoin.script.crypto._
|
||||
import org.scalacoin.script.stack.OP_DUP
|
||||
import org.scalacoin.util.{BitcoinSLogger, BitcoinScriptUtil, BitcoinSUtil, CryptoUtil}
|
||||
import org.bitcoins.currency.CurrencyUnits
|
||||
import org.bitcoins.marshallers.RawBitcoinSerializerHelper
|
||||
import org.bitcoins.marshallers.transaction.RawTransactionOutputParser
|
||||
import org.bitcoins.protocol.script._
|
||||
import org.bitcoins.protocol.transaction._
|
||||
import org.bitcoins.script.constant.ScriptToken
|
||||
import org.bitcoins.script.crypto._
|
||||
import org.bitcoins.script.stack.OP_DUP
|
||||
import org.bitcoins.util.{BitcoinSLogger, BitcoinScriptUtil, BitcoinSUtil, CryptoUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
||||
|
@ -24,6 +24,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
/**
|
||||
* Bitcoin Core's bug is that SignatureHash was supposed to return a hash and on this codepath it
|
||||
* actually returns the constant "1" to indicate an error
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
private def errorHash : Seq[Byte] = BitcoinSUtil.decodeHex("0100000000000000000000000000000000000000000000000000000000000000")
|
||||
|
@ -31,6 +32,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
/**
|
||||
* Serialized the passed in script code, skipping OP_CODESEPARATORs
|
||||
* definition for CScript https://github.com/bitcoin/bitcoin/blob/93c85d458ac3e2c496c1a053e1f5925f55e29100/src/script/script.h#L373
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -42,6 +44,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
* follows the bitcoinj implementation which can be found here
|
||||
* hashing is done in the hashForSignature function
|
||||
* hashing is NOT done in this function
|
||||
*
|
||||
* @param inputIndex
|
||||
* @param script
|
||||
* @param hashType
|
||||
|
@ -144,6 +147,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
* Serializes then hashes a transaction for signing
|
||||
* this is an implementation of it's bitcoinj equivalent found here
|
||||
* https://github.com/bitcoinj/bitcoinj/blob/master/core/src/main/java/org/bitcoinj/core/Transaction.java#L924
|
||||
*
|
||||
* @param inputIndex
|
||||
* @param script
|
||||
* @param hashType
|
||||
|
@ -157,6 +161,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
/**
|
||||
* Removes OP_CODESEPARATOR operations then returns the script
|
||||
* format
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def removeOpCodeSeparators(script : ScriptPubKey) : ScriptPubKey = {
|
||||
|
@ -172,6 +177,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
|
||||
/**
|
||||
* Sets the input's sequence number to zero EXCEPT for the input at inputIndex
|
||||
*
|
||||
* @param inputs
|
||||
* @param inputIndex
|
||||
* @return
|
||||
|
@ -187,6 +193,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
|
||||
/**
|
||||
* Updates an input at the given inputIndex and returns the updated sequence of inputs
|
||||
*
|
||||
* @param inputs
|
||||
* @param updatedInput
|
||||
* @param inputIndex
|
||||
|
@ -203,6 +210,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
|
||||
/**
|
||||
* Executes the SIGHASH_NONE procedure on a spending transaction for the input specified by inputIndex
|
||||
*
|
||||
* @param spendingTransaction
|
||||
* @param inputIndex
|
||||
* @return
|
||||
|
@ -221,6 +229,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
|
||||
/**
|
||||
* Executes the SIGHASH_SINGLE procedure on a spending transaction for the input specified by inputIndex
|
||||
*
|
||||
* @param spendingTransaction
|
||||
* @param inputIndex
|
||||
* @return
|
||||
|
@ -251,6 +260,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
|
||||
/**
|
||||
* Executes the SIGHASH_ALL procedure on a spending transaction at inputIndex
|
||||
*
|
||||
* @param spendingTransaction
|
||||
* @param inputIndex
|
||||
* @return
|
||||
|
@ -261,6 +271,7 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper with Bit
|
|||
|
||||
/**
|
||||
* Executes the SIGHASH_ANYONECANPAY procedure on a spending transaction at inputIndex
|
||||
*
|
||||
* @param spendingTransaction
|
||||
* @param input
|
||||
* @return
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.currency
|
||||
package org.bitcoins.currency
|
||||
|
||||
import scala.math.BigDecimal.RoundingMode
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.marshallers
|
||||
package org.bitcoins.marshallers
|
||||
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
|
||||
/**
|
||||
* Created by chris on 1/11/16.
|
||||
|
@ -11,6 +11,7 @@ trait RawBitcoinSerializer[T] extends RawBitcoinSerializerHelper {
|
|||
/**
|
||||
* Reads a hexadecimal value and transforms it into the native
|
||||
* scala type T
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -18,6 +19,7 @@ trait RawBitcoinSerializer[T] extends RawBitcoinSerializerHelper {
|
|||
|
||||
/**
|
||||
* Reads in bytes and transforms it into the approriate scala type T
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -25,6 +27,7 @@ trait RawBitcoinSerializer[T] extends RawBitcoinSerializerHelper {
|
|||
|
||||
/**
|
||||
* Reads in bytes and transforms it into the approriate scala type T
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -32,6 +35,7 @@ trait RawBitcoinSerializer[T] extends RawBitcoinSerializerHelper {
|
|||
|
||||
/**
|
||||
* Takes a type T and writes it into the appropriate hexadecimal serialization for type T
|
||||
*
|
||||
* @param t
|
||||
* @return
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.marshallers
|
||||
package org.bitcoins.marshallers
|
||||
|
||||
/**
|
||||
* Created by chris on 2/18/16.
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.marshallers.script
|
||||
package org.bitcoins.marshallers.script
|
||||
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializer
|
||||
import org.scalacoin.protocol.script.{ScriptPubKey}
|
||||
import org.scalacoin.script.constant.ScriptToken
|
||||
import org.scalacoin.util.BitcoinSLogger
|
||||
import org.bitcoins.marshallers.RawBitcoinSerializer
|
||||
import org.bitcoins.protocol.script.{ScriptPubKey}
|
||||
import org.bitcoins.script.constant.ScriptToken
|
||||
import org.bitcoins.util.BitcoinSLogger
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.marshallers.script
|
||||
package org.bitcoins.marshallers.script
|
||||
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializer
|
||||
import org.scalacoin.protocol.script._
|
||||
import org.scalacoin.script.constant.{ScriptConstant, ScriptToken}
|
||||
import org.scalacoin.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG}
|
||||
import org.scalacoin.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.marshallers.RawBitcoinSerializer
|
||||
import org.bitcoins.protocol.script._
|
||||
import org.bitcoins.script.constant.{ScriptConstant, ScriptToken}
|
||||
import org.bitcoins.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG}
|
||||
import org.bitcoins.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.marshallers.script
|
||||
package org.bitcoins.marshallers.script
|
||||
|
||||
import org.scalacoin.script._
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG}
|
||||
import org.scalacoin.util.{BitcoinSLogger, Factory, BitcoinSUtil}
|
||||
import org.bitcoins.script._
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG}
|
||||
import org.bitcoins.util.{BitcoinSLogger, Factory, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -17,6 +17,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses a list of bytes into a list of script tokens
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -30,6 +31,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
* Parses an asm output script of a transaction
|
||||
* example: "OP_DUP OP_HASH160 e2e7c1ab3f807151e832dd1accb3d4f5d7d19b4b OP_EQUALVERIFY OP_CHECKSIG"
|
||||
* example: ["0", "IF 0x50 ENDIF 1", "P2SH,STRICTENC", "0x50 is reserved (ok if not executed)"] (from script_valid.json)
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
|
@ -55,6 +57,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
* Parses a string to a sequence of script tokens
|
||||
* example: "OP_DUP OP_HASH160 e2e7c1ab3f807151e832dd1accb3d4f5d7d19b4b OP_EQUALVERIFY OP_CHECKSIG"
|
||||
* example: ["0", "IF 0x50 ENDIF 1", "P2SH,STRICTENC", "0x50 is reserved (ok if not executed)"] (from script_valid.json)
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
|
@ -147,6 +150,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
/**
|
||||
* Parses a byte array into a the asm operations for a script
|
||||
* will throw an exception if it fails to parse a op code
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -174,6 +178,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses a redeem script from the given script token
|
||||
*
|
||||
* @param scriptToken
|
||||
* @return
|
||||
*/
|
||||
|
@ -186,6 +191,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
/**
|
||||
* Slices the amount of bytes specified in the bytesToPushOntoStack parameter and then creates a script constant
|
||||
* from those bytes. Returns the script constant and the byte array without the script constant
|
||||
*
|
||||
* @param bytesToPushOntoStack
|
||||
* @param data
|
||||
* @tparam T
|
||||
|
@ -203,6 +209,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
* "0x09 0x00000000 0x00000000 0x10"
|
||||
* see https://github.com/bitcoin/bitcoin/blob/master/src/test/data/script_valid.json#L21-L25
|
||||
* for examples of this
|
||||
*
|
||||
* @param s
|
||||
* @return
|
||||
*/
|
||||
|
@ -232,6 +239,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
* specified by the bytesToPushOntoStack
|
||||
* i.e. If the operation was BytesToPushOntoStackImpl(5), it would slice 5 bytes off of the tail and
|
||||
* places them into a ScriptConstant and add them to the accumulator.
|
||||
*
|
||||
* @param op
|
||||
* @param accum
|
||||
* @param tail
|
||||
|
@ -258,6 +266,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
/**
|
||||
* Parses OP_PUSHDATA operations correctly. Slices the appropriate amount of bytes off of the tail and pushes
|
||||
* them onto the accumulator.
|
||||
*
|
||||
* @param op
|
||||
* @param accum
|
||||
* @param tail
|
||||
|
@ -294,6 +303,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Helper function to build the parsing helper for parsing an OP_PUSHDATA operation
|
||||
*
|
||||
* @param op the OP_PUSHDATA operation being added to the accum
|
||||
* @param bytesToPushOntoStack the number of bytes that are pushed onto the stack by the OP_PUSHDATA operation
|
||||
* @param scriptConstant the constant that is being pushed onto the stack by the OP_PUSHDATA operation
|
||||
|
@ -317,6 +327,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
* specified by the bytesToPushOntoStack
|
||||
* i.e. If the operation was BytesToPushOntoStackImpl(5), it would slice 5 bytes off of the tail and
|
||||
* places them into a ScriptConstant and add them to the accumulator.
|
||||
*
|
||||
* @param op
|
||||
* @param accum
|
||||
* @param tail
|
||||
|
@ -339,6 +350,7 @@ trait ScriptParser extends Factory[List[ScriptToken]] with BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Checks if a string can be cast to an int
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializer
|
||||
import org.scalacoin.marshallers.script.RawScriptSignatureParser
|
||||
import org.scalacoin.protocol.{CompactSizeUInt}
|
||||
import org.scalacoin.protocol.script.ScriptSignature
|
||||
import org.scalacoin.protocol.transaction.{TransactionInputImpl, TransactionOutPoint, TransactionInput}
|
||||
import org.scalacoin.util.{BitcoinSUtil}
|
||||
import org.bitcoins.marshallers.RawBitcoinSerializer
|
||||
import org.bitcoins.marshallers.script.RawScriptSignatureParser
|
||||
import org.bitcoins.protocol.{CompactSizeUInt}
|
||||
import org.bitcoins.protocol.script.ScriptSignature
|
||||
import org.bitcoins.protocol.transaction.{TransactionInputImpl, TransactionOutPoint, TransactionInput}
|
||||
import org.bitcoins.util.{BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -75,6 +75,7 @@ trait RawTransactionInputParser extends RawBitcoinSerializer[Seq[TransactionInpu
|
|||
|
||||
/**
|
||||
* Writes a single transaction input
|
||||
*
|
||||
* @param input
|
||||
* @return
|
||||
*/
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializer
|
||||
import org.scalacoin.protocol.transaction.{TransactionOutPointImpl, TransactionOutPoint}
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.marshallers.RawBitcoinSerializer
|
||||
import org.bitcoins.protocol.transaction.{TransactionOutPointImpl, TransactionOutPoint}
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
|
||||
|
||||
/**
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.currency.{CurrencyUnits, Satoshis}
|
||||
import org.scalacoin.marshallers.RawBitcoinSerializer
|
||||
import org.scalacoin.marshallers.script.{RawScriptPubKeyParser, ScriptParser}
|
||||
import org.scalacoin.protocol.CompactSizeUInt
|
||||
import org.scalacoin.protocol.transaction.{TransactionOutputImpl, TransactionOutput}
|
||||
import org.scalacoin.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.currency.{CurrencyUnits, Satoshis}
|
||||
import org.bitcoins.marshallers.RawBitcoinSerializer
|
||||
import org.bitcoins.marshallers.script.{RawScriptPubKeyParser, ScriptParser}
|
||||
import org.bitcoins.protocol.CompactSizeUInt
|
||||
import org.bitcoins.protocol.transaction.{TransactionOutputImpl, TransactionOutput}
|
||||
import org.bitcoins.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -59,6 +59,7 @@ trait RawTransactionOutputParser extends RawBitcoinSerializer[Seq[TransactionOut
|
|||
|
||||
/**
|
||||
* Writes a single transaction output
|
||||
*
|
||||
* @param output
|
||||
* @return
|
||||
*/
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.util.{BitcoinSUtil}
|
||||
import org.bitcoins.util.{BitcoinSUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 1/14/16.
|
||||
|
@ -11,18 +11,21 @@ trait TransactionElement {
|
|||
|
||||
/**
|
||||
* The size of the TransactionElement in bytes.
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def size : Int = bytes.size
|
||||
|
||||
/**
|
||||
* The hexadecimal representation of the transaction element
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def hex : String
|
||||
|
||||
/**
|
||||
* The byte representation of the transaction element
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def bytes : Seq[Byte] = BitcoinSUtil.decodeHex(hex)
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.policy
|
||||
package org.bitcoins.policy
|
||||
|
||||
import org.scalacoin.script.flag._
|
||||
import org.bitcoins.script.flag._
|
||||
|
||||
/**
|
||||
* Created by chris on 4/6/16.
|
||||
|
@ -23,6 +23,7 @@ trait Policy {
|
|||
/**
|
||||
* The default script verify flags used to validate the blockchain
|
||||
* and bitcoin transactions
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def standardScriptVerifyFlags : Seq[ScriptFlag] = Seq(ScriptVerifyDerSig, ScriptVerifyStrictEnc,
|
||||
|
@ -33,6 +34,7 @@ trait Policy {
|
|||
|
||||
/**
|
||||
* Returns the non mandatory script verify flags
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def standardNotMandatoryScriptVerifyFlags : Seq[ScriptFlag] = {
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.protocol
|
||||
package org.bitcoins.protocol
|
||||
|
||||
import org.bitcoinj.core.{VersionedChecksummedBytes, Base58, Utils}
|
||||
import org.scalacoin.config.{RegTest, TestNet3, MainNet}
|
||||
import org.scalacoin.util.{Factory, BitcoinSUtil}
|
||||
import org.bitcoins.config.{RegTest, TestNet3, MainNet}
|
||||
import org.bitcoins.util.{Factory, BitcoinSUtil}
|
||||
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.protocol
|
||||
package org.bitcoins.protocol
|
||||
|
||||
import org.scalacoin.util.{BitcoinSUtil}
|
||||
import org.bitcoins.util.{BitcoinSUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 7/14/15.
|
||||
|
@ -11,11 +11,13 @@ trait CompactSizeUInt {
|
|||
|
||||
/**
|
||||
* The number parsed from VarInt
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def num : Long
|
||||
/**
|
||||
* The length of the VarInt in bytes
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def size : Long
|
|
@ -1,14 +1,14 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.{ECFactory, ECPublicKey}
|
||||
import org.scalacoin.marshallers.script.{ScriptParser, RawScriptPubKeyParser}
|
||||
import org.scalacoin.marshallers.transaction.TransactionElement
|
||||
import org.scalacoin.protocol._
|
||||
import org.scalacoin.script.bitwise.{OP_EQUAL, OP_EQUALVERIFY}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG, OP_CHECKSIG, OP_HASH160}
|
||||
import org.scalacoin.script.stack.OP_DUP
|
||||
import org.scalacoin.util.{Factory, BitcoinScriptUtil, BitcoinSLogger}
|
||||
import org.bitcoins.crypto.{ECFactory, ECPublicKey}
|
||||
import org.bitcoins.marshallers.script.{ScriptParser, RawScriptPubKeyParser}
|
||||
import org.bitcoins.marshallers.transaction.TransactionElement
|
||||
import org.bitcoins.protocol._
|
||||
import org.bitcoins.script.bitwise.{OP_EQUAL, OP_EQUALVERIFY}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG, OP_CHECKSIG, OP_HASH160}
|
||||
import org.bitcoins.script.stack.OP_DUP
|
||||
import org.bitcoins.util.{Factory, BitcoinScriptUtil, BitcoinSLogger}
|
||||
|
||||
/**
|
||||
* Created by chris on 12/26/15.
|
||||
|
@ -19,6 +19,7 @@ sealed trait ScriptPubKey extends TransactionElement with BitcoinSLogger {
|
|||
* Representation of a scriptSignature in a parsed assembly format
|
||||
* this data structure can be run through the script interpreter to
|
||||
* see if a script evaluates to true
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def asm : Seq[ScriptToken]
|
||||
|
@ -43,6 +44,7 @@ trait MultiSignatureScriptPubKey extends ScriptPubKey {
|
|||
|
||||
/**
|
||||
* Returns the amount of required signatures for this multisignature script pubkey output
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def requiredSigs : Long = {
|
||||
|
@ -63,6 +65,7 @@ trait MultiSignatureScriptPubKey extends ScriptPubKey {
|
|||
|
||||
/**
|
||||
* The maximum amount of signatures for this multisignature script pubkey output
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def maxSigs : Long = {
|
||||
|
@ -80,6 +83,7 @@ trait MultiSignatureScriptPubKey extends ScriptPubKey {
|
|||
|
||||
/**
|
||||
* Gives the OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY index inside of asm
|
||||
*
|
||||
* @return the index of OP_CHECKMULTISIG or OP_CHECKMULTISIGVERIFY
|
||||
*/
|
||||
private def checkMultiSigIndex : Int = {
|
||||
|
@ -88,6 +92,7 @@ trait MultiSignatureScriptPubKey extends ScriptPubKey {
|
|||
|
||||
/**
|
||||
* Returns the public keys encoded into the scriptPubKey
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def publicKeys : Seq[ECPublicKey] = {
|
||||
|
@ -158,6 +163,7 @@ object ScriptPubKey extends Factory[ScriptPubKey] {
|
|||
|
||||
/**
|
||||
* Creates a scriptPubKey from its asm representation
|
||||
*
|
||||
* @param asm
|
||||
* @return
|
||||
*/
|
||||
|
@ -179,6 +185,7 @@ object ScriptPubKey extends Factory[ScriptPubKey] {
|
|||
|
||||
/**
|
||||
* Determines if the given script tokens are a multisignature scriptPubKey
|
||||
*
|
||||
* @param asm the tokens to check
|
||||
* @return a boolean indicating if the given tokens are a multisignature scriptPubKey
|
||||
*/
|
|
@ -1,12 +1,12 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.{EmptyDigitalSignature, ECPublicKey, ECFactory, ECDigitalSignature}
|
||||
import org.scalacoin.marshallers.script.{RawScriptSignatureParser, RawScriptPubKeyParser, ScriptParser}
|
||||
import org.scalacoin.marshallers.transaction.TransactionElement
|
||||
import org.bitcoins.crypto.{EmptyDigitalSignature, ECPublicKey, ECFactory, ECDigitalSignature}
|
||||
import org.bitcoins.marshallers.script.{RawScriptSignatureParser, RawScriptPubKeyParser, ScriptParser}
|
||||
import org.bitcoins.marshallers.transaction.TransactionElement
|
||||
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto.{SIGHASH_ALL, OP_CHECKMULTISIG, HashType, HashTypeFactory}
|
||||
import org.scalacoin.util.{Factory, BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto.{SIGHASH_ALL, OP_CHECKMULTISIG, HashType, HashTypeFactory}
|
||||
import org.bitcoins.util.{Factory, BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.util.{Failure, Success, Try}
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.marshallers.transaction.{RawTransactionParser, TransactionElement}
|
||||
import org.scalacoin.util.{Factory, BitcoinSUtil, CryptoUtil}
|
||||
import org.bitcoins.marshallers.transaction.{RawTransactionParser, TransactionElement}
|
||||
import org.bitcoins.util.{Factory, BitcoinSUtil, CryptoUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 7/14/15.
|
||||
|
@ -31,6 +31,7 @@ sealed case class TransactionImpl(version : Long, inputs : Seq[TransactionInput]
|
|||
object Transaction extends Factory[Transaction] {
|
||||
/**
|
||||
* Updates a transaction outputs
|
||||
*
|
||||
* @param updatedOutputs
|
||||
* @return
|
||||
*/
|
||||
|
@ -40,6 +41,7 @@ object Transaction extends Factory[Transaction] {
|
|||
|
||||
/**
|
||||
* Updates a transaction's inputs
|
||||
*
|
||||
* @param updatedInputs
|
||||
* @return
|
||||
*/
|
||||
|
@ -49,6 +51,7 @@ object Transaction extends Factory[Transaction] {
|
|||
|
||||
/**
|
||||
* Factory function that modifies a transactions locktime
|
||||
*
|
||||
* @param oldTx
|
||||
* @param lockTime
|
||||
* @return
|
||||
|
@ -60,12 +63,14 @@ object Transaction extends Factory[Transaction] {
|
|||
|
||||
/**
|
||||
* Removes the inputs of the transactions
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def emptyInputs(oldTx : Transaction) : Transaction = TransactionImpl(oldTx.version,Seq(),oldTx.outputs,oldTx.lockTime)
|
||||
|
||||
/**
|
||||
* Removes the outputs of the transactions
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def emptyOutputs(oldTx : Transaction) : Transaction = TransactionImpl(oldTx.version,oldTx.inputs,Seq(),oldTx.lockTime)
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
/**
|
||||
* Created by chris on 2/12/16.
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.marshallers.transaction.{RawTransactionParser, RawTransactionInputParser}
|
||||
import org.scalacoin.util.Factory
|
||||
import org.bitcoins.marshallers.transaction.{RawTransactionParser, RawTransactionInputParser}
|
||||
import org.bitcoins.util.Factory
|
||||
|
||||
/**
|
||||
* Created by chris on 2/21/16.
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.marshallers.transaction.{RawTransactionInputParser, TransactionElement}
|
||||
import org.scalacoin.protocol.{CompactSizeUInt}
|
||||
import org.scalacoin.protocol.script.{ScriptSignature, ScriptPubKey}
|
||||
import org.bitcoins.marshallers.transaction.{RawTransactionInputParser, TransactionElement}
|
||||
import org.bitcoins.protocol.{CompactSizeUInt}
|
||||
import org.bitcoins.protocol.script.{ScriptSignature, ScriptPubKey}
|
||||
|
||||
import org.scalacoin.util.{Factory, BitcoinSUtil}
|
||||
import org.bitcoins.util.{Factory, BitcoinSUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 12/26/15.
|
||||
|
@ -50,6 +50,7 @@ object TransactionInput extends Factory[TransactionInput] {
|
|||
|
||||
/**
|
||||
* Creates a transaction input from a given output and the output's transaction
|
||||
*
|
||||
* @param oldInput
|
||||
* @param output
|
||||
* @param outputsTransaction
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.marshallers.transaction.{RawTransactionOutPointParser, TransactionElement}
|
||||
import org.scalacoin.util.Factory
|
||||
import org.bitcoins.marshallers.transaction.{RawTransactionOutPointParser, TransactionElement}
|
||||
import org.bitcoins.util.Factory
|
||||
|
||||
/**
|
||||
* Created by chris on 12/26/15.
|
||||
|
@ -26,6 +26,7 @@ object TransactionOutPoint extends Factory[TransactionOutPoint] {
|
|||
|
||||
/**
|
||||
* Creates a transaction outpoint from a TransactionOutput & it's Transaction
|
||||
*
|
||||
* @param output
|
||||
* @return
|
||||
*/
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.currency.{CurrencyUnits, CurrencyUnit, Satoshis}
|
||||
import org.scalacoin.marshallers.transaction.{RawTransactionOutputParser, TransactionElement}
|
||||
import org.scalacoin.protocol.CompactSizeUInt
|
||||
import org.bitcoins.currency.{CurrencyUnits, CurrencyUnit, Satoshis}
|
||||
import org.bitcoins.marshallers.transaction.{RawTransactionOutputParser, TransactionElement}
|
||||
import org.bitcoins.protocol.CompactSizeUInt
|
||||
|
||||
import org.scalacoin.protocol.script.{ScriptPubKey}
|
||||
import org.scalacoin.util.{Factory, BitcoinSUtil}
|
||||
import org.bitcoins.protocol.script.{ScriptPubKey}
|
||||
import org.bitcoins.util.{Factory, BitcoinSUtil}
|
||||
|
||||
|
||||
/**
|
|
@ -1,15 +1,15 @@
|
|||
package org.scalacoin.script
|
||||
package org.bitcoins.script
|
||||
|
||||
import org.scalacoin.script.arithmetic.ArithmeticOperation
|
||||
import org.scalacoin.script.bitwise.BitwiseOperation
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.control.ControlOperations
|
||||
import org.scalacoin.script.crypto.CryptoOperation
|
||||
import org.scalacoin.script.locktime.LocktimeOperation
|
||||
import org.scalacoin.script.reserved.ReservedOperation
|
||||
import org.scalacoin.script.splice.SpliceOperation
|
||||
import org.scalacoin.script.stack.StackOperation
|
||||
import org.scalacoin.util.{BitcoinSUtil, BitcoinSLogger}
|
||||
import org.bitcoins.script.arithmetic.ArithmeticOperation
|
||||
import org.bitcoins.script.bitwise.BitwiseOperation
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.control.ControlOperations
|
||||
import org.bitcoins.script.crypto.CryptoOperation
|
||||
import org.bitcoins.script.locktime.LocktimeOperation
|
||||
import org.bitcoins.script.reserved.ReservedOperation
|
||||
import org.bitcoins.script.splice.SpliceOperation
|
||||
import org.bitcoins.script.stack.StackOperation
|
||||
import org.bitcoins.util.{BitcoinSUtil, BitcoinSLogger}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
|
@ -1,12 +1,12 @@
|
|||
package org.scalacoin.script
|
||||
package org.bitcoins.script
|
||||
|
||||
import org.scalacoin.crypto.{TransactionSignatureComponentFactory, TransactionSignatureComponent}
|
||||
import org.scalacoin.protocol.script.{ScriptSignature, ScriptPubKey}
|
||||
import org.scalacoin.protocol.transaction.Transaction
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.error.ScriptError
|
||||
import org.scalacoin.script.flag.ScriptFlag
|
||||
import org.scalacoin.util.Factory
|
||||
import org.bitcoins.crypto.{TransactionSignatureComponentFactory, TransactionSignatureComponent}
|
||||
import org.bitcoins.protocol.script.{ScriptSignature, ScriptPubKey}
|
||||
import org.bitcoins.protocol.transaction.Transaction
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.error.ScriptError
|
||||
import org.bitcoins.script.flag.ScriptFlag
|
||||
import org.bitcoins.util.Factory
|
||||
|
||||
/**
|
||||
* Created by chris on 2/3/16.
|
||||
|
@ -91,6 +91,7 @@ sealed trait PreExecutionScriptProgram extends ScriptProgram
|
|||
sealed trait ExecutionInProgressScriptProgram extends ScriptProgram {
|
||||
/**
|
||||
* The index of the last OP_CODESEPARATOR
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def lastCodeSeparator : Int
|
||||
|
@ -100,6 +101,7 @@ sealed trait ExecutionInProgressScriptProgram extends ScriptProgram {
|
|||
sealed trait ExecutedScriptProgram extends ScriptProgram {
|
||||
/**
|
||||
* Indicates if the program has encountered a ScriptError in its execution
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def error : Option[ScriptError]
|
||||
|
@ -112,6 +114,7 @@ sealed trait ExecutedScriptProgram extends ScriptProgram {
|
|||
object ScriptProgram {
|
||||
/**
|
||||
* Implentation type for a script program that has not been executed at all
|
||||
*
|
||||
* @param txSignatureComponent
|
||||
* @param stack
|
||||
* @param script
|
||||
|
@ -125,6 +128,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Implementation type for a script program that is currently being executed by the script interpreter
|
||||
*
|
||||
* @param txSignatureComponent
|
||||
* @param stack
|
||||
* @param script
|
||||
|
@ -139,6 +143,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* The implementation type for a script program that is finished being executed by the script interpreter
|
||||
*
|
||||
* @param txSignatureComponent
|
||||
* @param stack
|
||||
* @param script
|
||||
|
@ -161,6 +166,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Sets an error on the script program
|
||||
*
|
||||
* @param oldProgram the program who has hit an invalid state
|
||||
* @param error the error that thet program hit while being executed in the script interpreter
|
||||
* @return the ExecutedScriptProgram with the given error set inside of the trait
|
||||
|
@ -179,6 +185,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Updates the program script verify flags
|
||||
*
|
||||
* @param oldProgram
|
||||
* @param flags
|
||||
* @return
|
||||
|
@ -197,6 +204,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Changes the tokens in either the Stack or the Script depending in the indicator
|
||||
*
|
||||
* @param oldProgram
|
||||
* @param tokens
|
||||
* @param indicator
|
||||
|
@ -243,6 +251,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Changes the stack tokens and script tokens in a ScriptProgram
|
||||
*
|
||||
* @param oldProgram
|
||||
* @param stackTokens
|
||||
* @param scriptTokens
|
||||
|
@ -257,6 +266,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Updates the last OP_CODESEPARATOR index
|
||||
*
|
||||
* @param oldProgram
|
||||
* @param lastCodeSeparator
|
||||
* @return
|
||||
|
@ -269,6 +279,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Updates the tokens in either the stack or script and the last OP_CODESEPARATOR index
|
||||
*
|
||||
* @param oldProgram
|
||||
* @param tokens
|
||||
* @param indicator
|
||||
|
@ -288,6 +299,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Updates the stack, script, alt stack of the given oldProgram
|
||||
*
|
||||
* @param oldProgram
|
||||
* @param stack
|
||||
* @param script
|
||||
|
@ -340,6 +352,7 @@ object ScriptProgram {
|
|||
* The intention for this factory function is to allow us to create a program that already has a stack state. This
|
||||
* is useful for after execution of a scriptSig, copying the stack into this program with the scriptPubKey read to
|
||||
* run inside the script variable
|
||||
*
|
||||
* @param transaction the transaction being checked
|
||||
* @param scriptPubKey the scriptPubKey which the input is spending
|
||||
* @param inputIndex the input's index inside of the transaction we are spending
|
||||
|
@ -402,6 +415,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Changes a program that is being executed inside o
|
||||
*
|
||||
* @param executionInProgressScriptProgram
|
||||
* @return
|
||||
*/
|
||||
|
@ -413,6 +427,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Takes a script program that is pre execution and changes it to an execution in progress script program
|
||||
*
|
||||
* @param preExecutionScriptProgram
|
||||
* @return
|
||||
*/
|
||||
|
@ -422,6 +437,7 @@ object ScriptProgram {
|
|||
|
||||
/**
|
||||
* Changes a pre execution script program to a execution in progress script program with the given stack state
|
||||
*
|
||||
* @param preExecutionScriptProgram
|
||||
* @param stack
|
||||
* @return
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.script.arithmetic
|
||||
package org.bitcoins.script.arithmetic
|
||||
|
||||
import org.scalacoin.script.control.{ControlOperationsInterpreter, OP_VERIFY}
|
||||
import org.scalacoin.script.error.{ScriptErrorMinimalData, ScriptErrorUnknownError, ScriptErrorInvalidStackOperation}
|
||||
import org.scalacoin.script.flag.ScriptFlagUtil
|
||||
import org.scalacoin.script.{ExecutedScriptProgram, PreExecutionScriptProgram, ExecutionInProgressScriptProgram, ScriptProgram}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, BitcoinSUtil}
|
||||
import org.bitcoins.script.control.{ControlOperationsInterpreter, OP_VERIFY}
|
||||
import org.bitcoins.script.error.{ScriptErrorMinimalData, ScriptErrorUnknownError, ScriptErrorInvalidStackOperation}
|
||||
import org.bitcoins.script.flag.ScriptFlagUtil
|
||||
import org.bitcoins.script.{ExecutedScriptProgram, PreExecutionScriptProgram, ExecutionInProgressScriptProgram, ScriptProgram}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, BitcoinSUtil}
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
||||
|
@ -17,6 +17,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* a is added to b
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -27,6 +28,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Increments the stack top by 1
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -37,6 +39,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Decrements the stack top by 1
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -48,6 +51,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* b is subtracted from a.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -58,6 +62,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Takes the absolute value of the stack top
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -71,6 +76,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Negates the stack top
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -81,6 +87,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* If the input is 0 or 1, it is flipped. Otherwise the output will be 0.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -92,6 +99,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 0 if the input is 0. 1 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -103,6 +111,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* If both a and b are not 0, the output is 1. Otherwise 0.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -118,6 +127,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* If a or b is not 0, the output is 1. Otherwise 0.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -130,6 +140,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if the numbers are equal, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -141,6 +152,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Same as OP_NUMEQUAL, but runs OP_VERIFY afterward.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -167,6 +179,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if the numbers are not equal, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -181,6 +194,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if a is less than b, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -193,6 +207,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if a is greater than b, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -204,6 +219,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if a is less than or equal to b, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -215,6 +231,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if a is greater than or equal to b, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -227,6 +244,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns the smaller of a and b.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -246,6 +264,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns the larger of a and b.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -263,6 +282,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if x is within the specified range (left-inclusive), 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -304,6 +324,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
* This function checks if a number is <= 4 bytes in size
|
||||
* We cannot perform arithmetic operations on bitcoin numbers that are larger than 4 bytes.
|
||||
* https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/src/script/script.h#L214-L239
|
||||
*
|
||||
* @param scriptNumber the script number to be checked
|
||||
* @return false if the number is larger than 4 bytes
|
||||
*/
|
||||
|
@ -312,6 +333,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Performs the given arithmetic operation on the stack head
|
||||
*
|
||||
* @param program the program whose stack top is used as an argument for the arithmetic operation
|
||||
* @param op the arithmetic ooperation that needs to be executed on the number, for instance incrementing by 1
|
||||
* @return the program with the result from performing the arithmetic operation pushed onto the top of the stack
|
||||
|
@ -355,6 +377,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Performs the given arithmetic operation on the top two stack items
|
||||
*
|
||||
* @param program the program whose stack top is used as an argument for the arithmetic operation
|
||||
* @param op the arithmetic ooperation that needs to be executed on the number, for instance incrementing by 1
|
||||
* @return the program with the result from performing the arithmetic operation pushed onto the top of the stack
|
||||
|
@ -425,6 +448,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Compares two script numbers with the given boolean operation
|
||||
*
|
||||
* @param program the program whose two top stack elements are used for the comparison
|
||||
* @param op the operation which compares the two script numbers
|
||||
* @return the program with either OP_FALSE or OP_TRUE on the stack top
|
||||
|
@ -454,6 +478,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
/**
|
||||
* Takes the top two stack items, parses them to numbers then executes the op function on them and places the result
|
||||
* onto the stack top
|
||||
*
|
||||
* @param program the script program whose two top stack items are used as arguments for op
|
||||
* @param op the operation that needs to be executed on the two stack top items
|
||||
* @return the program with the result of op pushed onto the top of the stack
|
||||
|
@ -466,6 +491,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Takes the top two stack elements and parses them as script numbers
|
||||
*
|
||||
* @param program the program whose top two stack elements are being parsed as script numbers
|
||||
* @return the tuple with the first element being the first stack element, the second element in the tuple being the second stack element
|
||||
*/
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.arithmetic
|
||||
package org.bitcoins.script.arithmetic
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.script.bitwise
|
||||
package org.bitcoins.script.bitwise
|
||||
|
||||
import org.scalacoin.script.error.ScriptErrorInvalidStackOperation
|
||||
import org.scalacoin.script.{ScriptProgram}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.control.{OP_VERIFY, ControlOperationsInterpreter}
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.script.error.ScriptErrorInvalidStackOperation
|
||||
import org.bitcoins.script.{ScriptProgram}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.control.{OP_VERIFY, ControlOperationsInterpreter}
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
||||
|
@ -14,6 +14,7 @@ trait BitwiseInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Returns 1 if the inputs are exactly equal, 0 otherwise.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -53,6 +54,7 @@ trait BitwiseInterpreter extends ControlOperationsInterpreter {
|
|||
|
||||
/**
|
||||
* Same as OP_EQUAL, but runs OP_VERIFY afterward.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.bitwise
|
||||
package org.bitcoins.script.bitwise
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.script.constant
|
||||
package org.bitcoins.script.constant
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
|
||||
/**
|
||||
* Created by chris on 1/9/16.
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.script.constant
|
||||
package org.bitcoins.script.constant
|
||||
|
||||
import org.scalacoin.script.error.{ScriptErrorMinimalData, ScriptErrorInvalidStackOperation}
|
||||
import org.scalacoin.script.flag.{ScriptFlagUtil, ScriptVerifyMinimalData}
|
||||
import org.scalacoin.script.ScriptProgram
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.script.error.{ScriptErrorMinimalData, ScriptErrorInvalidStackOperation}
|
||||
import org.bitcoins.script.flag.{ScriptFlagUtil, ScriptVerifyMinimalData}
|
||||
import org.bitcoins.script.ScriptProgram
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -15,6 +15,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The next byte contains the number of bytes to be pushed onto the stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -25,6 +26,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The next two bytes contain the number of bytes to be pushed onto the stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -35,6 +37,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The next four bytes contain the number of bytes to be pushed onto the stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -46,6 +49,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Pushes the number of bytes onto the stack that is specified by script number on the script stack
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -60,6 +64,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses the script tokens that need to be pushed onto our stack
|
||||
*
|
||||
* @param scriptTokens
|
||||
* @param accum
|
||||
* @return
|
||||
|
@ -113,6 +118,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
/**
|
||||
* Checks if the MINIMALDATA script flag is set, if so checks if we are using the minimal push operation
|
||||
* if we are, then we push the bytes onto the stack
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -150,6 +156,7 @@ trait ConstantInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses the bytes needed for a push op (for instance OP_PUSHDATA1)
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.constant
|
||||
package org.bitcoins.script.constant
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, Factory, BitcoinSUtil}
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, Factory, BitcoinSUtil}
|
||||
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
||||
|
@ -16,18 +16,21 @@ import scala.util.{Failure, Success, Try}
|
|||
sealed trait ScriptToken {
|
||||
/**
|
||||
* The hexadecimal representation of this script token
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def hex : String
|
||||
|
||||
/**
|
||||
* The byte representation of this script token
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def bytes = BitcoinSUtil.decodeHex(hex)
|
||||
|
||||
/**
|
||||
* The conversion from the byte representation of a token to a number
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def toLong = BitcoinSUtil.hexToLong(hex)
|
||||
|
@ -48,6 +51,7 @@ trait ScriptOperation extends ScriptToken {
|
|||
sealed trait ScriptConstant extends ScriptToken {
|
||||
/**
|
||||
* Returns if the constant is encoded in the shortest possible way
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def isShortestEncoding : Boolean = BitcoinScriptUtil.isShortestEncoding(this)
|
||||
|
@ -60,6 +64,7 @@ sealed trait ScriptConstant extends ScriptToken {
|
|||
sealed trait ScriptNumber extends ScriptConstant {
|
||||
/**
|
||||
* The underlying number of the ScriptNumber
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def num : Long
|
||||
|
@ -79,6 +84,7 @@ sealed trait ScriptNumber extends ScriptConstant {
|
|||
* This equality just checks that the underlying scala numbers are equivalent, NOT if the numbers
|
||||
* are bitwise equivalent in Script. For instance ScriptNumber(0x01).numEqual(ScriptNumber(0x00000000001)) == true
|
||||
* but (ScriptNumber(0x01) == (ScriptNumber(0x00000000001))) == false
|
||||
*
|
||||
* @param that
|
||||
* @return
|
||||
*/
|
||||
|
@ -94,12 +100,14 @@ sealed trait ScriptNumber extends ScriptConstant {
|
|||
object ScriptNumber extends Factory[ScriptNumber] {
|
||||
/**
|
||||
* Represents the number zero inside of bitcoin's script language
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
lazy val zero = ScriptNumberImpl(0,"")
|
||||
|
||||
/**
|
||||
* Represents the number one inside of bitcoin's script language
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
lazy val one = ScriptNumberImpl(1)
|
||||
|
@ -138,6 +146,7 @@ object ScriptNumber extends Factory[ScriptNumber] {
|
|||
|
||||
/**
|
||||
* This represents a script number inside of bitcoin
|
||||
*
|
||||
* @param num the number being represented
|
||||
* @param hex the hex representation of the number - this can be different than the obvious value for
|
||||
* the number. For instance we could have padded the number with another word of zeros
|
||||
|
@ -157,6 +166,7 @@ object ScriptNumberImpl {
|
|||
|
||||
/**
|
||||
* Represent a pubkey or hash of a pub key on our stack
|
||||
*
|
||||
* @param hex
|
||||
*/
|
||||
case class ScriptConstantImpl(hex : String) extends ScriptConstant {
|
||||
|
@ -366,6 +376,7 @@ object ScriptNumberOperation extends ScriptOperationFactory[ScriptNumberOperatio
|
|||
|
||||
/**
|
||||
* Finds the script number operation based on the given integer
|
||||
*
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
|
@ -379,6 +390,7 @@ object ScriptConstant extends Factory[ScriptConstant] {
|
|||
lazy val negativeOne = ScriptConstant("81")
|
||||
/**
|
||||
* Creates a script constant from a sequence of bytes
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.script.constant
|
||||
package org.bitcoins.script.constant
|
||||
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.control
|
||||
package org.bitcoins.script.control
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.script.control
|
||||
package org.bitcoins.script.control
|
||||
|
||||
import org.scalacoin.script.error.{ScriptErrorVerify, ScriptErrorOpReturn, ScriptErrorInvalidStackOperation, ScriptErrorUnbalancedConditional}
|
||||
import org.scalacoin.script.{ScriptProgram}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.util._
|
||||
import org.bitcoins.script.error.{ScriptErrorVerify, ScriptErrorOpReturn, ScriptErrorInvalidStackOperation, ScriptErrorUnbalancedConditional}
|
||||
import org.bitcoins.script.{ScriptProgram}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.util._
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -17,6 +17,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* If the top stack value is not 0, the statements are executed. The top stack value is removed.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -51,6 +52,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* If the top stack value is 0, the statements are executed. The top stack value is removed.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -80,6 +82,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Evaluates the OP_ELSE operator
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -107,6 +110,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Evaluates an OP_ENDIF operator
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -126,6 +130,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
* with a scriptPubKey consisting of OP_RETURN followed by exactly one pushdata op. Such outputs are provably unspendable,
|
||||
* reducing their cost to the network. Currently it is usually considered non-standard (though valid) for a transaction to
|
||||
* have more than one OP_RETURN output or an OP_RETURN output with more than one pushdata op.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -137,6 +142,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Marks transaction as invalid if top stack value is not true.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -157,6 +163,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses a list of script tokens into its corresponding binary tree
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -167,6 +174,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The loop that parses a list of script tokens into a binary tree
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -201,6 +209,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Inserts a sub tree into the parse tree of Script.
|
||||
*
|
||||
* @param tree the parse tree of the control flow of the Script program
|
||||
* @param subTree the parse tree that needs to be inserted into the control flow of the program
|
||||
* @return the full parse tree combined
|
||||
|
@ -235,6 +244,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses an OP_IF script token
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -247,6 +257,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses an OP_NOTIF script token
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -258,6 +269,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Parses and OP_ELSE expression
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -276,6 +288,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Checks if an OP_IF/OP_NOTIF script token has a matching OP_ENDIF
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -287,6 +300,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Returns the first index of an OP_ENDIF
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -301,6 +315,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Finds the last OP_ENDIF in the given script
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -312,6 +327,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Returns the first index of an OP_ENDIF
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -325,6 +341,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the first OP_ELSE expression encountered in the script
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -345,6 +362,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the first OP_ELSE {expression} in a binary tree
|
||||
*
|
||||
* @param tree
|
||||
* @return
|
||||
*/
|
||||
|
@ -375,6 +393,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the first OP_IF { expression } encountered in the script
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -398,6 +417,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the first occurrence of OP_IF or OP_NOTIF in the binary tree
|
||||
*
|
||||
* @param tree
|
||||
* @return
|
||||
*/
|
||||
|
@ -409,6 +429,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Finds the indexes of our OP_ELSE (if it exists) and our OP_ENDIF
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -421,6 +442,7 @@ trait ControlOperationsInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Returns the index of the matching OP_ENDIF for the OP_IF statement
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
|
@ -1,14 +1,14 @@
|
|||
package org.scalacoin.script.crypto
|
||||
package org.bitcoins.script.crypto
|
||||
|
||||
import org.scalacoin.crypto._
|
||||
import org.scalacoin.protocol.script._
|
||||
import org.scalacoin.protocol.transaction.Transaction
|
||||
import org.scalacoin.script.control.{ControlOperationsInterpreter, OP_VERIFY}
|
||||
import org.scalacoin.script.error._
|
||||
import org.scalacoin.script.flag.{ScriptFlagUtil, ScriptVerifyNullDummy, ScriptVerifyDerSig}
|
||||
import org.scalacoin.script._
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil, CryptoUtil}
|
||||
import org.bitcoins.crypto._
|
||||
import org.bitcoins.protocol.script._
|
||||
import org.bitcoins.protocol.transaction.Transaction
|
||||
import org.bitcoins.script.control.{ControlOperationsInterpreter, OP_VERIFY}
|
||||
import org.bitcoins.script.error._
|
||||
import org.bitcoins.script.flag.{ScriptFlagUtil, ScriptVerifyNullDummy, ScriptVerifyDerSig}
|
||||
import org.bitcoins.script._
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil, CryptoUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
|
||||
|
@ -19,6 +19,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
|
||||
/**
|
||||
* The input is hashed twice: first with SHA-256 and then with RIPEMD-160.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -30,6 +31,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
|
||||
/**
|
||||
* The input is hashed using RIPEMD-160.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -40,6 +42,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
|
||||
/**
|
||||
* The input is hashed using SHA-256.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -50,6 +53,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
|
||||
/**
|
||||
* The input is hashed two times with SHA-256.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -60,6 +64,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
|
||||
/**
|
||||
* The input is hashed using SHA-1.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -74,6 +79,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
* The signature used by OP_CHECKSIG must be a valid signature for this hash and public key.
|
||||
* If it is, 1 is returned, 0 otherwise.
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L818
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -123,6 +129,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
/**
|
||||
* All of the signature checking words will only match signatures to the data
|
||||
* after the most recently-executed OP_CODESEPARATOR.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -151,6 +158,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
* signatures must be placed in the scriptSig using the same order as their corresponding public keys
|
||||
* were placed in the scriptPubKey or redeemScript. If all signatures are valid, 1 is returned, 0 otherwise.
|
||||
* Due to a bug, one extra unused value is removed from the stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -241,6 +249,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
|
||||
/**
|
||||
* Runs OP_CHECKMULTISIG with an OP_VERIFY afterwards
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -267,6 +276,7 @@ trait CryptoInterpreter extends ControlOperationsInterpreter with BitcoinSLogger
|
|||
* This is a higher order function designed to execute a hash function on the stack top of the program
|
||||
* For instance, we could pass in CryptoUtil.sha256 function as the 'hashFunction' argument, which would then
|
||||
* apply sha256 to the stack top
|
||||
*
|
||||
* @param program the script program whose stack top needs to be hashed
|
||||
* @param hashFunction the hash function which needs to be used on the stack top (sha256,ripemd160,etc..)
|
||||
* @return
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.crypto
|
||||
package org.bitcoins.script.crypto
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.crypto
|
||||
package org.bitcoins.script.crypto
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.util.Factory
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.util.Factory
|
||||
|
||||
/**
|
||||
* Created by chris on 3/24/16.
|
||||
|
@ -10,6 +10,7 @@ trait CryptoSignatureEvaluationFactory extends ScriptOperationFactory[CryptoSign
|
|||
|
||||
/**
|
||||
* The current crypto signature evaluation operations
|
||||
*
|
||||
* @return the sequence of crypto signature evaluation operations
|
||||
*/
|
||||
def operations = Seq(OP_CHECKMULTISIG,OP_CHECKMULTISIGVERIFY,OP_CHECKSIG, OP_CHECKSIGVERIFY)
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.script.crypto
|
||||
package org.bitcoins.script.crypto
|
||||
|
||||
import org.scalacoin.util.{BitcoinSUtil}
|
||||
import org.bitcoins.util.{BitcoinSUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 1/18/16.
|
||||
|
@ -15,6 +15,7 @@ sealed trait HashType {
|
|||
* SIGHASH_ALL is essentially a catch all if the none of the other hash types are matched.
|
||||
* Therefore SIGHASH_ALL could be represented by the byte 0x05 since 0x05 does not match
|
||||
* any of the other hash types. The default byte for SIGHASH_ALL is 0x01
|
||||
*
|
||||
* @param byte
|
||||
*/
|
||||
case class SIGHASH_ALL(byte : Byte = 0x01.toByte) extends HashType
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.script.flag
|
||||
package org.bitcoins.script.flag
|
||||
|
||||
/**
|
||||
* Created by chris on 3/23/16.
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.script.flag
|
||||
package org.bitcoins.script.flag
|
||||
|
||||
/**
|
||||
* Created by chris on 4/6/16.
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.script.flag
|
||||
package org.bitcoins.script.flag
|
||||
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
|
||||
/**
|
||||
* Created by chris on 3/23/16.
|
||||
|
@ -11,12 +11,14 @@ import org.scalacoin.util.BitcoinSUtil
|
|||
sealed trait ScriptFlag {
|
||||
/**
|
||||
* The flag's representation represented as an integer
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def flag : Int
|
||||
|
||||
/**
|
||||
* The name of the flag as found in bitcoin core
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
def name : String
|
|
@ -1,20 +1,20 @@
|
|||
package org.scalacoin.script.interpreter
|
||||
package org.bitcoins.script.interpreter
|
||||
|
||||
import org.scalacoin.protocol.script._
|
||||
import org.scalacoin.protocol.transaction.Transaction
|
||||
import org.scalacoin.script.error._
|
||||
import org.scalacoin.script.flag._
|
||||
import org.scalacoin.script.locktime.{OP_CHECKLOCKTIMEVERIFY, LockTimeInterpreter}
|
||||
import org.scalacoin.script.splice._
|
||||
import org.scalacoin.script.{ExecutionInProgressScriptProgram, PreExecutionScriptProgram, ExecutedScriptProgram, ScriptProgram}
|
||||
import org.scalacoin.script.arithmetic._
|
||||
import org.scalacoin.script.bitwise._
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.control._
|
||||
import org.scalacoin.script.crypto._
|
||||
import org.scalacoin.script.reserved._
|
||||
import org.scalacoin.script.stack._
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, BitcoinSLogger}
|
||||
import org.bitcoins.protocol.script._
|
||||
import org.bitcoins.protocol.transaction.Transaction
|
||||
import org.bitcoins.script.error._
|
||||
import org.bitcoins.script.flag._
|
||||
import org.bitcoins.script.locktime.{OP_CHECKLOCKTIMEVERIFY, LockTimeInterpreter}
|
||||
import org.bitcoins.script.splice._
|
||||
import org.bitcoins.script.{ExecutionInProgressScriptProgram, PreExecutionScriptProgram, ExecutedScriptProgram, ScriptProgram}
|
||||
import org.bitcoins.script.arithmetic._
|
||||
import org.bitcoins.script.bitwise._
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.control._
|
||||
import org.bitcoins.script.crypto._
|
||||
import org.bitcoins.script.reserved._
|
||||
import org.bitcoins.script.stack._
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, BitcoinSLogger}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
@ -36,6 +36,7 @@ trait ScriptInterpreter extends CryptoInterpreter with StackInterpreter with Con
|
|||
/**
|
||||
* Runs an entire script though our script programming language and
|
||||
* returns true or false depending on if the script was valid
|
||||
*
|
||||
* @param program the program to be interpreted
|
||||
* @return
|
||||
*/
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.script.locktime
|
||||
package org.bitcoins.script.locktime
|
||||
|
||||
import org.scalacoin.protocol.transaction.TransactionConstants
|
||||
import org.scalacoin.script.constant.{ScriptToken, ScriptNumberImpl, ScriptNumber}
|
||||
import org.scalacoin.script.error.{ScriptError, ScriptErrorNegativeLockTime, ScriptErrorUnsatisfiedLocktime, ScriptErrorInvalidStackOperation}
|
||||
import org.scalacoin.script.{ScriptProgram}
|
||||
import org.scalacoin.util.BitcoinSLogger
|
||||
import org.bitcoins.protocol.transaction.TransactionConstants
|
||||
import org.bitcoins.script.constant.{ScriptToken, ScriptNumberImpl, ScriptNumber}
|
||||
import org.bitcoins.script.error.{ScriptError, ScriptErrorNegativeLockTime, ScriptErrorUnsatisfiedLocktime, ScriptErrorInvalidStackOperation}
|
||||
import org.bitcoins.script.{ScriptProgram}
|
||||
import org.bitcoins.util.BitcoinSLogger
|
||||
|
||||
/**
|
||||
* Created by chris on 2/8/16.
|
||||
|
@ -21,6 +21,7 @@ trait LockTimeInterpreter extends BitcoinSLogger {
|
|||
* or vice versa; or
|
||||
* 4. the input's nSequence field is equal to 0xffffffff.
|
||||
* The precise semantics are described in BIP 0065
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.locktime
|
||||
package org.bitcoins.script.locktime
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.reserved
|
||||
package org.bitcoins.script.reserved
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/22/16.
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.script.splice
|
||||
package org.bitcoins.script.splice
|
||||
|
||||
import org.scalacoin.script.error.ScriptErrorInvalidStackOperation
|
||||
import org.scalacoin.script.{ScriptOperationFactory, ScriptProgram}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.bitcoins.script.error.ScriptErrorInvalidStackOperation
|
||||
import org.bitcoins.script.{ScriptOperationFactory, ScriptProgram}
|
||||
import org.bitcoins.script.constant._
|
||||
import Math._
|
||||
|
||||
import org.scalacoin.util.BitcoinSLogger
|
||||
import org.bitcoins.util.BitcoinSLogger
|
||||
|
||||
/**
|
||||
* Created by chris on 2/4/16.
|
||||
|
@ -14,6 +14,7 @@ trait SpliceInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Pushes the string length of the top element of the stack (without popping it).
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.splice
|
||||
package org.bitcoins.script.splice
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/22/16.
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.script.stack
|
||||
package org.bitcoins.script.stack
|
||||
|
||||
import org.scalacoin.script.error.{ScriptErrorMinimalData, ScriptErrorInvalidStackOperation}
|
||||
import org.scalacoin.script.flag.ScriptFlagUtil
|
||||
import org.scalacoin.script.{ScriptProgram}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
import org.bitcoins.script.error.{ScriptErrorMinimalData, ScriptErrorInvalidStackOperation}
|
||||
import org.bitcoins.script.flag.ScriptFlagUtil
|
||||
import org.bitcoins.script.{ScriptProgram}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, BitcoinSLogger, BitcoinSUtil}
|
||||
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
||||
|
@ -18,6 +18,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
/**
|
||||
* Duplicates the element on top of the stack
|
||||
* expects the first element in script to be the OP_DUP operation
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -33,6 +34,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* If the top stack value is not 0, duplicate it.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -52,6 +54,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Puts the number of stack items onto the stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -66,6 +69,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Puts the input onto the top of the alt stack. Removes it from the main stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -83,6 +87,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Puts the input onto the top of the main stack. Removes it from the alt stack.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -99,6 +104,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the top stack item.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -116,6 +122,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the second-to-top stack item
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -135,6 +142,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Copies the second-to-top stack item to the top.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -152,6 +160,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The item n back in the stack is copied to the top.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -173,6 +182,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The item n back in the stack is moved to the top
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -196,6 +206,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
/**
|
||||
* The top three items on the stack are rotated to the left.
|
||||
* x1 x2 x3 -> x2 x3 x1
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -216,6 +227,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
/**
|
||||
* The fifth and sixth items back are moved to the top of the stack.
|
||||
* x1 x2 x3 x4 x5 x6 -> x3 x4 x5 x6 x1 x2
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -234,6 +246,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Removes the top two stack items.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -252,6 +265,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* The top two items on the stack are swapped.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -272,6 +286,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
/**
|
||||
* The item at the top of the stack is copied and inserted before the second-to-top item.
|
||||
* x1 x2 -> x1 x2 x1
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -292,6 +307,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Duplicates the top two stack items.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -311,6 +327,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Duplicates the top three stack items.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -331,6 +348,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
/**
|
||||
* Copies the pair of items two spaces back in the stack to the front.
|
||||
* x1 x2 x3 x4 -> x1 x2 x3 x4 x1 x2
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -350,6 +368,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Swaps the top two pairs of items.
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -368,6 +387,7 @@ trait StackInterpreter extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Executes an operation with the stack top inside of the program as the argument
|
||||
*
|
||||
* @param program the program whose stack top is used as an argument for the operation
|
||||
* @param op the operation that is executed with the script number on the top of the stack
|
||||
* @return the program with the result of the op pushed onto to the top of the stack
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script.stack
|
||||
package org.bitcoins.script.stack
|
||||
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.constant.ScriptOperation
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.constant.ScriptOperation
|
||||
|
||||
/**
|
||||
* Created by chris on 1/6/16.
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.util
|
||||
package org.bitcoins.util
|
||||
|
||||
import scala.annotation.tailrec
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.util
|
||||
package org.bitcoins.util
|
||||
|
||||
import org.bitcoinj.core.{Base58, Utils}
|
||||
import org.scalacoin.currency.{CurrencyUnits, CurrencyUnit}
|
||||
import org.bitcoins.currency.{CurrencyUnits, CurrencyUnit}
|
||||
|
||||
import scala.collection.mutable.ArrayBuffer
|
||||
import scala.math.BigInt
|
||||
|
@ -31,6 +31,7 @@ trait BitcoinSUtil extends NumberUtil {
|
|||
|
||||
/**
|
||||
* Tests if a given string is a hexadecimal string
|
||||
*
|
||||
* @param str
|
||||
* @return
|
||||
*/
|
||||
|
@ -53,6 +54,7 @@ trait BitcoinSUtil extends NumberUtil {
|
|||
|
||||
/**
|
||||
* Flips the endianess of the give hex string
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -60,6 +62,7 @@ trait BitcoinSUtil extends NumberUtil {
|
|||
|
||||
/**
|
||||
* Flips the endianess of the given sequence of bytes
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -68,6 +71,7 @@ trait BitcoinSUtil extends NumberUtil {
|
|||
* Flips the hex chars in a hex strings
|
||||
* Example: abcd would become badc
|
||||
* https://stackoverflow.com/questions/34799611/easiest-way-to-flip-the-endianness-of-a-byte-in-scala/34802270#34802270
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.util
|
||||
package org.bitcoins.util
|
||||
|
||||
import org.scalacoin.crypto.ECPublicKey
|
||||
import org.scalacoin.script.flag.{ScriptFlag, ScriptFlagUtil}
|
||||
import org.scalacoin.script.{ScriptProgram, ExecutionInProgressScriptProgram, ScriptSettings}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG, OP_CHECKSIG, OP_CHECKSIGVERIFY}
|
||||
import org.scalacoin.script.reserved.{OP_RESERVED, NOP, ReservedOperation}
|
||||
import org.bitcoins.crypto.ECPublicKey
|
||||
import org.bitcoins.script.flag.{ScriptFlag, ScriptFlagUtil}
|
||||
import org.bitcoins.script.{ScriptProgram, ExecutionInProgressScriptProgram, ScriptSettings}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto.{OP_CHECKMULTISIGVERIFY, OP_CHECKMULTISIG, OP_CHECKSIG, OP_CHECKSIGVERIFY}
|
||||
import org.bitcoins.script.reserved.{OP_RESERVED, NOP, ReservedOperation}
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
||||
|
@ -16,6 +16,7 @@ trait BitcoinScriptUtil {
|
|||
|
||||
/**
|
||||
* Takes in a sequence of script tokens and converts them to their hexadecimal value
|
||||
*
|
||||
* @param asm
|
||||
* @return
|
||||
*/
|
||||
|
@ -27,6 +28,7 @@ trait BitcoinScriptUtil {
|
|||
|
||||
/**
|
||||
* Converts a sequence of script tokens to them to their byte values
|
||||
*
|
||||
* @param asm
|
||||
* @return
|
||||
*/
|
||||
|
@ -35,6 +37,7 @@ trait BitcoinScriptUtil {
|
|||
/**
|
||||
* Filters out push operations in our sequence of script tokens
|
||||
* this removes OP_PUSHDATA1, OP_PUSHDATA2, OP_PUSHDATA4 and all ByteToPushOntoStack tokens
|
||||
*
|
||||
* @param asm
|
||||
* @return
|
||||
*/
|
||||
|
@ -49,6 +52,7 @@ trait BitcoinScriptUtil {
|
|||
* Returns true if the given script token counts towards our max script operations in a script
|
||||
* See https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L269-L271
|
||||
* which is how bitcoin core handles this
|
||||
*
|
||||
* @param token
|
||||
* @return
|
||||
*/
|
||||
|
@ -61,6 +65,7 @@ trait BitcoinScriptUtil {
|
|||
/**
|
||||
* Counts the amount of sigops in a script
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/script.cpp#L156-L202
|
||||
*
|
||||
* @param script the script whose sigops are being counted
|
||||
* @return the number of signature operations in the script
|
||||
*/
|
||||
|
@ -85,6 +90,7 @@ trait BitcoinScriptUtil {
|
|||
* This can only be called when an OP_CHECKMULTISIG operation is about to be executed
|
||||
* on the stack
|
||||
* For instance if this was a 2/3 multisignature script, it would return the number 3
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -102,6 +108,7 @@ trait BitcoinScriptUtil {
|
|||
/**
|
||||
* Returns the number of required signatures on the stack, for instance if this was a
|
||||
* 2/3 multisignature script, it would return the number 2
|
||||
*
|
||||
* @param program
|
||||
* @return
|
||||
*/
|
||||
|
@ -123,6 +130,7 @@ trait BitcoinScriptUtil {
|
|||
* Determines if a script contains only script operations
|
||||
* This is equivalent to
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/script.cpp#L213
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -142,6 +150,7 @@ trait BitcoinScriptUtil {
|
|||
* Determines if the token being pushed onto the stack is being pushed by the SMALLEST push operation possible
|
||||
* This is equivalent to
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L209
|
||||
*
|
||||
* @param pushOp the operation that is pushing the data onto the stack
|
||||
* @param token the token that is being pushed onto the stack by the pushOp
|
||||
* @return
|
||||
|
@ -174,6 +183,7 @@ trait BitcoinScriptUtil {
|
|||
* Whenever a script constant is interpreted to a number BIP62 could enforce that number to be encoded
|
||||
* in the smallest encoding possible
|
||||
* https://github.com/bitcoin/bitcoin/blob/a6a860796a44a2805a58391a009ba22752f64e32/src/script/script.h#L220-L237
|
||||
*
|
||||
* @param constant
|
||||
* @return
|
||||
*/
|
||||
|
@ -196,6 +206,7 @@ trait BitcoinScriptUtil {
|
|||
/**
|
||||
* Checks the public key encoding according to bitcoin core's function
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L202
|
||||
*
|
||||
* @param key the key whose encoding we are checking
|
||||
* @param program the program whose flags which dictate the rules for the public keys encoding
|
||||
* @return if the key is encoded correctly against the rules give in the flags parameter
|
||||
|
@ -205,6 +216,7 @@ trait BitcoinScriptUtil {
|
|||
/**
|
||||
* Checks the public key encoding according to bitcoin core's function
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L202
|
||||
*
|
||||
* @param key the key whose encoding we are checking
|
||||
* @param flags the flags which dictate the rules for the public keys encoding
|
||||
* @return if the key is encoded correctly against the rules givein the flags parameter
|
||||
|
@ -218,6 +230,7 @@ trait BitcoinScriptUtil {
|
|||
/**
|
||||
* Returns true if the key is compressed or uncompressed, false otherwise
|
||||
* https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L66
|
||||
*
|
||||
* @param key the public key that is being checked
|
||||
* @return true if the key is compressed/uncompressed otherwise false
|
||||
*/
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.util
|
||||
package org.bitcoins.util
|
||||
|
||||
import java.security.MessageDigest
|
||||
|
||||
import org.bitcoinj.core.Sha256Hash
|
||||
import org.scalacoin.script.constant.{ScriptConstantImpl, ScriptConstant}
|
||||
import org.bitcoins.script.constant.{ScriptConstantImpl, ScriptConstant}
|
||||
import org.spongycastle.crypto.digests.RIPEMD160Digest
|
||||
|
||||
/**
|
||||
|
@ -15,6 +15,7 @@ trait CryptoUtil {
|
|||
/**
|
||||
* Does the following computation
|
||||
* RIPEMD160(SHA256(hex))
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -26,12 +27,14 @@ trait CryptoUtil {
|
|||
}
|
||||
/**
|
||||
* Performs sha256(sha256(hex))
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
def doubleSHA256(hex : String) : List[Byte] = doubleSHA256(BitcoinSUtil.decodeHex(hex))
|
||||
/**
|
||||
* Performs sha256(sha256(hex))
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -39,6 +42,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Performs sha256(sha256(bytes))
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -49,6 +53,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Takes sha256(hex)
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -56,6 +61,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Takes sha256(bytes)
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -66,6 +72,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Performs SHA1(bytes)
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -75,6 +82,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Performs SHA1(hex)
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -83,6 +91,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Performs RIPEMD160(hex)
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -91,6 +100,7 @@ trait CryptoUtil {
|
|||
|
||||
/**
|
||||
* Performs RIPEMD160(bytes)
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.util
|
||||
package org.bitcoins.util
|
||||
|
||||
/**
|
||||
* Created by chris on 2/26/16.
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.util
|
||||
package org.bitcoins.util
|
||||
|
||||
import org.scalacoin.protocol.script.{ScriptPubKey, ScriptSignature}
|
||||
import org.scalacoin.protocol.{CompactSizeUInt, CompactSizeUIntImpl}
|
||||
import org.bitcoins.protocol.script.{ScriptPubKey, ScriptSignature}
|
||||
import org.bitcoins.protocol.{CompactSizeUInt, CompactSizeUIntImpl}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
/**
|
||||
|
@ -12,6 +12,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Takes a hex number and converts it into a signed number
|
||||
* used in the bitcoin numbering system
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -20,6 +21,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Takes a list of bytes and converts it in to signed number inside of bitcoins
|
||||
* numbering system
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -44,6 +46,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Converts a long number to the representation of number inside of Bitcoin's number system
|
||||
*
|
||||
* @param long
|
||||
* @return
|
||||
*/
|
||||
|
@ -62,6 +65,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Determines if a given hex string is a positive number
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -69,6 +73,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Determines if a byte array is a positive or negative number
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -89,6 +94,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
|
||||
/**
|
||||
* Change sign bit to positive
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -121,6 +127,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Parses a VarInt from a string of hex characters
|
||||
* https://bitcoin.org/en/developer-reference#compactsize-unsigned-integers
|
||||
*
|
||||
* @param hex
|
||||
* @return
|
||||
*/
|
||||
|
@ -129,6 +136,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Parses a CompactSizeUInt from a sequence of bytes
|
||||
* https://bitcoin.org/en/developer-reference#compactsize-unsigned-integers
|
||||
*
|
||||
* @param bytes
|
||||
* @return
|
||||
*/
|
||||
|
@ -147,6 +155,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Returns the size of a VarInt in the number of bytes
|
||||
* https://en.bitcoin.it/wiki/Protocol_documentation#Variable_length_integer
|
||||
*
|
||||
* @param byte
|
||||
* @return
|
||||
*/
|
||||
|
@ -165,6 +174,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Parses the compact size uint from a script signature
|
||||
* https://bitcoin.org/en/developer-reference#compactsize-unsigned-integers
|
||||
*
|
||||
* @param script
|
||||
* @return
|
||||
*/
|
||||
|
@ -182,6 +192,7 @@ trait NumberUtil extends BitcoinSLogger {
|
|||
/**
|
||||
* Parses a compact size uint from a script pubkey
|
||||
* https://bitcoin.org/en/developer-reference#compactsize-unsigned-integers
|
||||
*
|
||||
* @param scriptPubKey
|
||||
* @return
|
||||
*/
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.util.{BitcoinSUtil, CryptoTestUtil}
|
||||
import org.bitcoins.util.{BitcoinSUtil, CryptoTestUtil}
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.bitcoinj.core.Sha256Hash
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import org.scalacoin.policy.Policy
|
||||
import org.scalacoin.protocol.script.ScriptSignature
|
||||
import org.scalacoin.protocol.transaction._
|
||||
import org.scalacoin.script.flag.ScriptVerifyDerSig
|
||||
import org.scalacoin.util._
|
||||
import org.bitcoins.policy.Policy
|
||||
import org.bitcoins.protocol.script.ScriptSignature
|
||||
import org.bitcoins.protocol.transaction._
|
||||
import org.bitcoins.script.flag.ScriptVerifyDerSig
|
||||
import org.bitcoins.util._
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.crypto
|
||||
package org.bitcoins.crypto
|
||||
|
||||
import java.util
|
||||
|
||||
|
@ -6,14 +6,14 @@ import org.bitcoinj.core.{Sha256Hash, Utils, DumpedPrivateKey}
|
|||
import org.bitcoinj.core.Transaction.SigHash
|
||||
import org.bitcoinj.params.TestNet3Params
|
||||
import org.bitcoinj.script.{ScriptOpCodes, ScriptChunk, ScriptBuilder}
|
||||
import org.scalacoin.protocol.script.{UpdateScriptPubKeyAsm, UpdateScriptPubKeyBytes, ScriptPubKey}
|
||||
import org.scalacoin.protocol.transaction._
|
||||
import org.scalacoin.script.ScriptOperationFactory
|
||||
import org.scalacoin.script.bitwise.OP_EQUALVERIFY
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto._
|
||||
import org.scalacoin.script.stack.OP_DUP
|
||||
import org.scalacoin.util._
|
||||
import org.bitcoins.protocol.script.{UpdateScriptPubKeyAsm, UpdateScriptPubKeyBytes, ScriptPubKey}
|
||||
import org.bitcoins.protocol.transaction._
|
||||
import org.bitcoins.script.ScriptOperationFactory
|
||||
import org.bitcoins.script.bitwise.OP_EQUALVERIFY
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto._
|
||||
import org.bitcoins.script.stack.OP_DUP
|
||||
import org.bitcoins.util._
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
import scala.collection.JavaConversions._
|
||||
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.marshallers.script
|
||||
package org.bitcoins.marshallers.script
|
||||
|
||||
import org.scalacoin.protocol.script.ScriptPubKey
|
||||
import org.scalacoin.script.bitwise.OP_EQUALVERIFY
|
||||
import org.scalacoin.script.constant.{ScriptToken, BytesToPushOntoStackImpl, ScriptConstantImpl}
|
||||
import org.scalacoin.script.crypto.{OP_CHECKSIG, OP_HASH160}
|
||||
import org.scalacoin.script.stack.OP_DUP
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.protocol.script.ScriptPubKey
|
||||
import org.bitcoins.script.bitwise.OP_EQUALVERIFY
|
||||
import org.bitcoins.script.constant.{ScriptToken, BytesToPushOntoStackImpl, ScriptConstantImpl}
|
||||
import org.bitcoins.script.crypto.{OP_CHECKSIG, OP_HASH160}
|
||||
import org.bitcoins.script.stack.OP_DUP
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.marshallers.script
|
||||
package org.bitcoins.marshallers.script
|
||||
|
||||
import org.scalacoin.protocol.script.ScriptSignature
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto.OP_CHECKMULTISIG
|
||||
import org.scalacoin.util.{BitcoinSLogger, TestUtil}
|
||||
import org.bitcoins.protocol.script.ScriptSignature
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto.OP_CHECKMULTISIG
|
||||
import org.bitcoins.util.{BitcoinSLogger, TestUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,14 +1,14 @@
|
|||
package org.scalacoin.marshallers.script
|
||||
package org.bitcoins.marshallers.script
|
||||
|
||||
import org.scalacoin.protocol.script.ScriptSignature
|
||||
import org.scalacoin.script.arithmetic.{OP_1ADD, OP_ADD}
|
||||
import org.scalacoin.script.bitwise.OP_EQUAL
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.control.{OP_ENDIF, OP_IF}
|
||||
import org.scalacoin.script.crypto.{OP_CHECKMULTISIG, OP_HASH160}
|
||||
import org.scalacoin.script.reserved.{OP_NOP10, OP_NOP}
|
||||
import org.scalacoin.script.stack.OP_PICK
|
||||
import org.scalacoin.util.{BitcoinSUtil, TestUtil}
|
||||
import org.bitcoins.protocol.script.ScriptSignature
|
||||
import org.bitcoins.script.arithmetic.{OP_1ADD, OP_ADD}
|
||||
import org.bitcoins.script.bitwise.OP_EQUAL
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.control.{OP_ENDIF, OP_IF}
|
||||
import org.bitcoins.script.crypto.{OP_CHECKMULTISIG, OP_HASH160}
|
||||
import org.bitcoins.script.reserved.{OP_NOP10, OP_NOP}
|
||||
import org.bitcoins.script.stack.OP_PICK
|
||||
import org.bitcoins.util.{BitcoinSUtil, TestUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,9 +1,9 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.protocol.transaction.{TransactionConstants, TransactionInput}
|
||||
import org.scalacoin.script.constant.{OP_1, BytesToPushOntoStackImpl, ScriptConstantImpl, OP_0}
|
||||
import org.scalacoin.script.crypto.OP_CHECKMULTISIG
|
||||
import org.scalacoin.util.{BitcoinSUtil, TestUtil}
|
||||
import org.bitcoins.protocol.transaction.{TransactionConstants, TransactionInput}
|
||||
import org.bitcoins.script.constant.{OP_1, BytesToPushOntoStackImpl, ScriptConstantImpl, OP_0}
|
||||
import org.bitcoins.script.crypto.OP_CHECKMULTISIG
|
||||
import org.bitcoins.util.{BitcoinSUtil, TestUtil}
|
||||
import org.scalatest.{ FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.protocol.transaction.TransactionOutPointImpl
|
||||
import org.bitcoins.protocol.transaction.TransactionOutPointImpl
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.currency.{Satoshis, CurrencyUnits, Bitcoins}
|
||||
import org.scalacoin.protocol.transaction.TransactionOutput
|
||||
import org.scalacoin.script.bitwise.OP_EQUAL
|
||||
import org.scalacoin.script.constant.{BytesToPushOntoStackImpl, ScriptConstantImpl}
|
||||
import org.scalacoin.script.crypto.OP_HASH160
|
||||
import org.bitcoins.currency.{Satoshis, CurrencyUnits, Bitcoins}
|
||||
import org.bitcoins.protocol.transaction.TransactionOutput
|
||||
import org.bitcoins.script.bitwise.OP_EQUAL
|
||||
import org.bitcoins.script.constant.{BytesToPushOntoStackImpl, ScriptConstantImpl}
|
||||
import org.bitcoins.script.crypto.OP_HASH160
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.marshallers.transaction
|
||||
package org.bitcoins.marshallers.transaction
|
||||
|
||||
import org.scalacoin.protocol.transaction.{TransactionConstants, Transaction}
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.protocol.transaction.{TransactionConstants, Transaction}
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.protocol
|
||||
package org.bitcoins.protocol
|
||||
|
||||
import org.scalacoin.util.{BitcoinSUtil, TestUtil}
|
||||
import org.bitcoins.util.{BitcoinSUtil, TestUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.protocol
|
||||
package org.bitcoins.protocol
|
||||
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.protocol
|
||||
package org.bitcoins.protocol
|
||||
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.ECFactory
|
||||
import org.bitcoins.crypto.ECFactory
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.{EmptyDigitalSignature, ECFactory}
|
||||
import org.scalacoin.script.constant.{ScriptConstantImpl, BytesToPushOntoStackImpl, OP_0}
|
||||
import org.scalacoin.util.TransactionTestUtil
|
||||
import org.bitcoins.crypto.{EmptyDigitalSignature, ECFactory}
|
||||
import org.bitcoins.script.constant.{ScriptConstantImpl, BytesToPushOntoStackImpl, OP_0}
|
||||
import org.bitcoins.util.TransactionTestUtil
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.ECFactory
|
||||
import org.scalacoin.script.crypto.SIGHASH_ALL
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.crypto.ECFactory
|
||||
import org.bitcoins.script.crypto.SIGHASH_ALL
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.ECFactory
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.crypto.ECFactory
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.ECFactory
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.crypto.ECFactory
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.{ECFactory}
|
||||
import org.scalacoin.script.constant.{OP_0, BytesToPushOntoStackImpl, ScriptConstantImpl}
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.crypto.{ECFactory}
|
||||
import org.bitcoins.script.constant.{OP_0, BytesToPushOntoStackImpl, ScriptConstantImpl}
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.util.{TestUtil, BitcoinjConversions, BitcoinJTestUtil, BitcoinSUtil}
|
||||
import org.bitcoins.util.{TestUtil, BitcoinjConversions, BitcoinJTestUtil, BitcoinSUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto.ECFactory
|
||||
import org.scalacoin.script.bitwise.OP_EQUALVERIFY
|
||||
import org.scalacoin.script.constant.{ScriptConstantImpl, BytesToPushOntoStackImpl, ScriptToken}
|
||||
import org.scalacoin.script.crypto.{OP_CHECKSIG, OP_HASH160, OP_CODESEPARATOR}
|
||||
import org.scalacoin.script.stack.OP_DUP
|
||||
import org.scalacoin.util.{TestUtil}
|
||||
import org.bitcoins.crypto.ECFactory
|
||||
import org.bitcoins.script.bitwise.OP_EQUALVERIFY
|
||||
import org.bitcoins.script.constant.{ScriptConstantImpl, BytesToPushOntoStackImpl, ScriptToken}
|
||||
import org.bitcoins.script.crypto.{OP_CHECKSIG, OP_HASH160, OP_CODESEPARATOR}
|
||||
import org.bitcoins.script.stack.OP_DUP
|
||||
import org.bitcoins.util.{TestUtil}
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
import org.scalacoin.crypto._
|
||||
import org.scalacoin.script.constant.{ScriptConstant}
|
||||
import org.scalacoin.util.{TestUtil, BitcoinSUtil}
|
||||
import org.bitcoins.crypto._
|
||||
import org.bitcoins.script.constant.{ScriptConstant}
|
||||
import org.bitcoins.util.{TestUtil, BitcoinSUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,11 +1,11 @@
|
|||
package org.scalacoin.protocol.script
|
||||
package org.bitcoins.protocol.script
|
||||
|
||||
|
||||
import org.scalacoin.crypto.ECFactory
|
||||
import org.scalacoin.marshallers.script.RawScriptSignatureParser
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.crypto.{SIGHASH_SINGLE, SIGHASH_ALL}
|
||||
import org.scalacoin.util.{BitcoinScriptUtil, TransactionTestUtil, TestUtil}
|
||||
import org.bitcoins.crypto.ECFactory
|
||||
import org.bitcoins.marshallers.script.RawScriptSignatureParser
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.crypto.{SIGHASH_SINGLE, SIGHASH_ALL}
|
||||
import org.bitcoins.util.{BitcoinScriptUtil, TransactionTestUtil, TestUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.protocol.script.EmptyScriptSignature
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.protocol.script.EmptyScriptSignature
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,6 +1,6 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.currency.CurrencyUnits
|
||||
import org.scalacoin.protocol.script.EmptyScriptPubKey
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.currency.CurrencyUnits
|
||||
import org.bitcoins.protocol.script.EmptyScriptPubKey
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
package org.bitcoins.protocol.transaction
|
||||
|
||||
import org.scalacoin.marshallers.transaction.RawTransactionParser
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.marshallers.transaction.RawTransactionParser
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script
|
||||
package org.bitcoins.script
|
||||
|
||||
import org.scalacoin.script.constant.ScriptConstant
|
||||
import org.scalacoin.util.BitcoinSUtil
|
||||
import org.bitcoins.script.constant.ScriptConstant
|
||||
import org.bitcoins.util.BitcoinSUtil
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,14 +1,14 @@
|
|||
package org.scalacoin.script
|
||||
package org.bitcoins.script
|
||||
|
||||
import org.scalacoin.script.arithmetic.OP_1ADD
|
||||
import org.scalacoin.script.bitwise.OP_EQUAL
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.script.control.OP_IF
|
||||
import org.scalacoin.script.crypto.OP_RIPEMD160
|
||||
import org.scalacoin.script.locktime.OP_CHECKLOCKTIMEVERIFY
|
||||
import org.scalacoin.script.splice.OP_SUBSTR
|
||||
import org.scalacoin.script.stack.OP_TOALTSTACK
|
||||
import org.scalacoin.util.{BitcoinSUtil}
|
||||
import org.bitcoins.script.arithmetic.OP_1ADD
|
||||
import org.bitcoins.script.bitwise.OP_EQUAL
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.script.control.OP_IF
|
||||
import org.bitcoins.script.crypto.OP_RIPEMD160
|
||||
import org.bitcoins.script.locktime.OP_CHECKLOCKTIMEVERIFY
|
||||
import org.bitcoins.script.splice.OP_SUBSTR
|
||||
import org.bitcoins.script.stack.OP_TOALTSTACK
|
||||
import org.bitcoins.util.{BitcoinSUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,8 +1,8 @@
|
|||
package org.scalacoin.script
|
||||
package org.bitcoins.script
|
||||
|
||||
import org.scalacoin.script.constant.{OP_1, OP_0}
|
||||
import org.scalacoin.script.flag.ScriptFlagFactory
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.script.constant.{OP_1, OP_0}
|
||||
import org.bitcoins.script.flag.ScriptFlagFactory
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package org.scalacoin.script
|
||||
package org.bitcoins.script
|
||||
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.util.TestUtil
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.util.TestUtil
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,10 +1,10 @@
|
|||
package org.scalacoin.script.arithmetic
|
||||
package org.bitcoins.script.arithmetic
|
||||
|
||||
import org.scalacoin.script.error.ScriptErrorInvalidStackOperation
|
||||
import org.scalacoin.script.flag.ScriptFlag
|
||||
import org.scalacoin.script.{ScriptProgram}
|
||||
import org.scalacoin.script.constant._
|
||||
import org.scalacoin.util.{ScriptProgramTestUtil, TestUtil}
|
||||
import org.bitcoins.script.error.ScriptErrorInvalidStackOperation
|
||||
import org.bitcoins.script.flag.ScriptFlag
|
||||
import org.bitcoins.script.{ScriptProgram}
|
||||
import org.bitcoins.script.constant._
|
||||
import org.bitcoins.util.{ScriptProgramTestUtil, TestUtil}
|
||||
import org.scalatest.{FlatSpec, MustMatchers}
|
||||
|
||||
/**
|
|
@ -1,4 +1,4 @@
|
|||
package org.scalacoin.script.arithmetic
|
||||
package org.bitcoins.script.arithmetic
|
||||
|
||||
import org.scalatest.{MustMatchers, FlatSpec}
|
||||
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue