mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-03 10:46:42 +01:00
Adding TransactionFactory
This commit is contained in:
parent
0f9a87f971
commit
4702de636f
3 changed files with 21 additions and 2 deletions
|
@ -80,7 +80,14 @@ trait TransactionSignatureSerializer extends RawBitcoinSerializerHelper {
|
|||
// already. Perhaps it felt safer to him in some way, or is another leftover from how the code was written.
|
||||
val inputWithConnectedScript = inputToSign.factory(script)
|
||||
|
||||
//check the hash type of
|
||||
//check the hash type
|
||||
|
||||
hashType match {
|
||||
case SIGHASH_NONE =>
|
||||
//means that no outputs are signed at all
|
||||
val txWithNoOutputs = ???
|
||||
}
|
||||
???
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ import org.scalacoin.util.{ScalacoinUtil, CryptoUtil}
|
|||
*/
|
||||
|
||||
|
||||
trait Transaction extends TransactionElement {
|
||||
trait Transaction extends TransactionElement with TransactionFactory {
|
||||
def txId : String = ScalacoinUtil.encodeHex(CryptoUtil.doubleSHA256(hex).reverse)
|
||||
def version : Long
|
||||
def inputs : Seq[TransactionInput]
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
package org.scalacoin.protocol.transaction
|
||||
|
||||
/**
|
||||
* Created by chris on 2/21/16.
|
||||
*/
|
||||
trait TransactionFactory { this : Transaction =>
|
||||
|
||||
def factory(outputs : Seq[TransactionOutput]) = {
|
||||
TransactionImpl(version,inputs,outputs,lockTime)
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Reference in a new issue