Adding ScriptSignature, ScriptPubKey

This commit is contained in:
Chris Stewart 2015-12-26 22:01:35 -06:00
parent 8f1cf4295d
commit 37cc7e4b50
5 changed files with 37 additions and 10 deletions

View File

@ -0,0 +1,16 @@
package org.scalacoin.protocol.script
import org.scalacoin.protocol.BitcoinAddress
/**
* Created by chris on 12/26/15.
*/
trait ScriptPubKey extends ScriptSignature {
def reqSigs : Int
def addressType : String
def addresses : Seq[BitcoinAddress]
}
case class ScriptPubKeyImpl(reqSigs : Int, addressType : String, addresses : Seq[BitcoinAddress])

View File

@ -0,0 +1,11 @@
package org.scalacoin.protocol.script
/**
* Created by chris on 12/26/15.
*/
trait ScriptSignature {
def asm : String
def hex : String
}
case class ScriptSignatureImpl(asm : String, hex : String) extends ScriptSignature

View File

@ -1,16 +1,16 @@
package org.scalacoin.protocol.transaction
import org.scalacoin.protocol.VarInt
import org.scalacoin.protocol.script.ScriptSignature
/**
* Created by chris on 12/26/15.
*/
trait TransactionInput {
def previousOutput : TransactionOutPoint
def scriptLength : VarInt
def scriptSignature : Seq[Char]
def scriptSignature : ScriptSignature
def sequence : Long
}
case class TransactionInputImpl(previousOutput : TransactionOutPoint, scriptLength : VarInt,
scriptSignature : Seq[Char], sequence : Long) extends TransactionInput
case class TransactionInputImpl(previousOutput : TransactionOutPoint,
scriptSignature : Seq[String], sequence : Long) extends TransactionInput

View File

@ -4,8 +4,8 @@ package org.scalacoin.protocol.transaction
* Created by chris on 12/26/15.
*/
trait TransactionOutPoint {
def hash : Seq[Char]
def hash : Seq[String]
def index : Long
}
case class TransactionOutPointImpl(hash : Seq[Char], index : Long) extends TransactionOutPoint
case class TransactionOutPointImpl(hash : Seq[String], index : Long) extends TransactionOutPoint

View File

@ -1,6 +1,6 @@
package org.scalacoin.protocol.transaction
import org.scalacoin.currency.Satoshis
import org.scalacoin.currency.{CurrencyUnit, Satoshis}
import org.scalacoin.protocol.VarInt
/**
@ -8,11 +8,11 @@ import org.scalacoin.protocol.VarInt
*/
trait TransactionOutput {
def value : Satoshis
def value : CurrencyUnit
def pkScriptLength : VarInt
def pkScript : Seq[Char]
def pkScript : Seq[String]
}
case class TransactionOutputImpl(value : Satoshis, pkScriptLength : VarInt, pkScript : Seq[Char]) extends TransactionOutput
case class TransactionOutputImpl(value : Satoshis, pkScriptLength : VarInt, pkScript : Seq[String]) extends TransactionOutput