mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-20 10:13:26 +01:00
Fixing merge conflict with master
This commit is contained in:
commit
16c131e595
10
README.md
10
README.md
@ -13,23 +13,25 @@ This repostitory includes the following functionality:
|
||||
- Passes all tests found in Bitcoin Core's regression test suite called [script_test.json](https://github.com/bitcoin/bitcoin/blob/master/src/test/data/script_tests.json)
|
||||
- Passes all tests inside of Bitcoin Core's transaction regression test suite [tx_valid.json](https://github.com/bitcoin/bitcoin/blob/master/src/test/data/tx_valid.json) / [tx_invalid.json](https://github.com/bitcoin/bitcoin/blob/master/src/test/data/tx_invalid.json) /
|
||||
[sighash.json](https://github.com/bitcoin/bitcoin/blob/master/src/test/data/sighash.json)
|
||||
- Currently up to date through OP_CHECKSEQUENCEVERIFY
|
||||
- Currently up to date through segregated witness
|
||||
- 90% test coverage throughout the codebase to ensure high quality code.
|
||||
- Functions documented with Scaladocs for user friendliness
|
||||
|
||||
# Design Principles
|
||||
- Immutable data structures everywhere
|
||||
- Using Algebraic Data Types to allow the compiler to check for exhaustiveness on match statements
|
||||
- Algebraic Data Types to allow the compiler to check for exhaustiveness on match statements
|
||||
- Favoring readability over terseness
|
||||
|
||||
# TODO
|
||||
- Segwit support
|
||||
- [Libsecp256k1](https://github.com/bitcoin-core/secp256k1/tree/master/src/java/org/bitcoin) support
|
||||
- Simplified payment channel support
|
||||
- [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) HD keys
|
||||
- Java support
|
||||
- Android support
|
||||
|
||||
# Examples
|
||||
|
||||
Here is an example scala console session with bitcoin-core-s
|
||||
Here is an example scala console session with bitcoins-core
|
||||
|
||||
```scala
|
||||
chris@chris:~/dev/bitcoins-core-chris$ sbt console
|
||||
|
1
project/build.properties
Normal file
1
project/build.properties
Normal file
@ -0,0 +1 @@
|
||||
sbt.version=0.13.13
|
@ -9,8 +9,7 @@ import org.bitcoins.core.script.locktime.LocktimeOperation
|
||||
import org.bitcoins.core.script.reserved.ReservedOperation
|
||||
import org.bitcoins.core.script.splice.SpliceOperation
|
||||
import org.bitcoins.core.script.stack.StackOperation
|
||||
import org.bitcoins.core.util.{BitcoinSUtil, BitcoinSLogger}
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
|
||||
/**
|
||||
* Created by chris on 1/8/16.
|
||||
|
@ -50,7 +50,7 @@ trait ArithmeticInterpreter extends ControlOperationsInterpreter {
|
||||
/** Negates the stack top. */
|
||||
def opNegate(program : ScriptProgram) : ScriptProgram = {
|
||||
require(program.script.headOption.contains(OP_NEGATE), "Script top must be OP_NEGATE")
|
||||
performUnaryArithmeticOperation(program, x => x -)
|
||||
performUnaryArithmeticOperation(program, x => -x)
|
||||
}
|
||||
|
||||
/** If the input is 0 or 1, it is flipped. Otherwise the output will be 0. */
|
||||
|
@ -44,7 +44,7 @@ sealed trait ScriptNumber extends ScriptConstant {
|
||||
def underlying : Long
|
||||
|
||||
def + (that : ScriptNumber) : ScriptNumber = ScriptNumber(underlying + that.underlying)
|
||||
def - = ScriptNumber(-underlying)
|
||||
def unary_- = ScriptNumber(-underlying)
|
||||
def - (that : ScriptNumber) : ScriptNumber = ScriptNumber(underlying - that.underlying)
|
||||
def * (that : ScriptNumber) : ScriptNumber = ScriptNumber(underlying * that.underlying)
|
||||
|
||||
|
@ -1,12 +1,11 @@
|
||||
package org.bitcoins.core.script.control
|
||||
|
||||
import org.bitcoins.core.protocol.script.SigVersionWitnessV0
|
||||
import org.bitcoins.core.script.result._
|
||||
import org.bitcoins.core.script.ScriptProgram
|
||||
import org.bitcoins.core.script.constant._
|
||||
import org.bitcoins.core.script.flag.ScriptFlagUtil
|
||||
import org.bitcoins.core.script.result._
|
||||
import org.bitcoins.core.util._
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
||||
|
@ -1,11 +1,9 @@
|
||||
package org.bitcoins.core.serializers.script
|
||||
|
||||
import org.bitcoins.core.protocol.CompactSizeUInt
|
||||
import org.bitcoins.core.serializers.RawBitcoinSerializer
|
||||
import org.bitcoins.core.protocol.script.{EmptyScriptPubKey, ScriptPubKey}
|
||||
import org.bitcoins.core.script.constant.ScriptToken
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.bitcoins.core.serializers.RawBitcoinSerializer
|
||||
|
||||
import scala.util.Try
|
||||
|
||||
|
@ -1,12 +1,10 @@
|
||||
package org.bitcoins.core.serializers.script
|
||||
|
||||
import org.bitcoins.core.protocol.CompactSizeUInt
|
||||
import org.bitcoins.core.serializers.RawBitcoinSerializer
|
||||
import org.bitcoins.core.protocol.script._
|
||||
import org.bitcoins.core.script.constant.{ScriptConstant, ScriptToken}
|
||||
import org.bitcoins.core.script.crypto.{OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY}
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.bitcoins.core.script.constant.ScriptToken
|
||||
import org.bitcoins.core.serializers.RawBitcoinSerializer
|
||||
import org.bitcoins.core.util.BitcoinSLogger
|
||||
|
||||
import scala.util.Try
|
||||
|
||||
|
@ -3,12 +3,10 @@ package org.bitcoins.core.serializers.script
|
||||
import org.bitcoins.core.number.UInt32
|
||||
import org.bitcoins.core.script._
|
||||
import org.bitcoins.core.script.constant._
|
||||
import org.bitcoins.core.script.crypto.{OP_CHECKMULTISIG, OP_CHECKMULTISIGVERIFY}
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, BitcoinSUtil, Factory, NumberUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, BitcoinSUtil, Factory}
|
||||
|
||||
import scala.annotation.tailrec
|
||||
import scala.util.{Failure, Success, Try}
|
||||
import scala.util.Try
|
||||
|
||||
/**
|
||||
* Created by chris on 1/7/16.
|
||||
|
@ -2,12 +2,11 @@ package org.bitcoins.core.serializers.transaction
|
||||
|
||||
import org.bitcoins.core.currency.{CurrencyUnits, Satoshis}
|
||||
import org.bitcoins.core.number.UInt64
|
||||
import org.bitcoins.core.serializers.{RawBitcoinSerializer, RawSatoshisSerializer}
|
||||
import org.bitcoins.core.serializers.script.{RawScriptPubKeyParser, ScriptParser}
|
||||
import org.bitcoins.core.protocol.CompactSizeUInt
|
||||
import org.bitcoins.core.protocol.transaction.{TransactionOutput, TransactionOutputImpl}
|
||||
import org.bitcoins.core.protocol.transaction.TransactionOutput
|
||||
import org.bitcoins.core.serializers.script.{RawScriptPubKeyParser, ScriptParser}
|
||||
import org.bitcoins.core.serializers.{RawBitcoinSerializer, RawSatoshisSerializer}
|
||||
import org.bitcoins.core.util.{BitcoinSLogger, BitcoinSUtil}
|
||||
import org.slf4j.LoggerFactory
|
||||
|
||||
import scala.annotation.tailrec
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user