mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-20 10:13:26 +01:00
fixing compliation issue, adding unit tests for parsing
This commit is contained in:
parent
327844fa3b
commit
7159df8e6b
@ -7,7 +7,7 @@ trait ScriptParser {
|
||||
|
||||
|
||||
/**
|
||||
* Parses a script inside of a transaction
|
||||
* Parses a script inside of a transaction
|
||||
* @param str
|
||||
* @tparam T
|
||||
* @return
|
||||
|
@ -10,7 +10,12 @@ class ScriptParserTest extends FlatSpec with MustMatchers with ScriptParser {
|
||||
|
||||
|
||||
"ScriptParser" must "parse an input script" in {
|
||||
val parsedInput = parse(TestUtil.p2khInputScriptNotParsed)
|
||||
val parsedInput = parse(TestUtil.p2pkhInputScriptNotParsed)
|
||||
parsedInput must be (TestUtil.p2pkhInputScript)
|
||||
}
|
||||
|
||||
it must "parse an output script" in {
|
||||
val parsedOutput = parse(TestUtil.p2pkhOutputScriptNotParsed)
|
||||
parsedOutput must be (TestUtil.p2pkhOutputScript)
|
||||
}
|
||||
}
|
||||
|
@ -17,11 +17,11 @@ object TestUtil {
|
||||
val multiSigAddress = BitcoinAddress("342ftSRCvFHfCeFFBuz4xwbeqnDw6BGUey")
|
||||
val assetAddress = AssetAddress("akJsoCcyh34FGPotxfEoSXGwFPCNAkyCgTA")
|
||||
|
||||
val p2khInputScriptNotParsed =
|
||||
val p2pkhInputScriptNotParsed =
|
||||
"3044022016ffdbb7c57634903c5e018fcfc48d59f4e37dc4bc3bbc9ba4e6ee39150bca030220119c2241a931819bc1a75d3596e4029d803d1cd6de123bf8a1a1a2c3665e1fac01" +
|
||||
" 02af7dad03e682fcd0427b5c24140c220ac9d8abe286c15f8cf5bf77eed19c365
|
||||
val p2khInputScript = List("3044022016ffdbb7c57634903c5e018fcfc48d59f4e37dc4bc3bbc9ba4e6ee39150bca030220119c2241a931819bc1a75d3596e4029d803d1cd6de123bf8a1a1a2c3665e1fac01",
|
||||
"02af7dad03e682fcd0427b5c24140c220ac9d8abe286c15f8cf5bf77eed19c3652")2"
|
||||
val p2pkhOutputScriptNotParsed = "OP_DUP OP_HASH160 e2e7c1ab3f807151e832dd1accb3d4f5d7d19b4b OP_EQUALVERIFY OP_CHECKSI
|
||||
val p2khOutputScript = List(OP_DUP,OP_HASH160,ConstantImpl("e2e7c1ab3f807151e832dd1accb3d4f5d7d19b4b"),OP_EQUALVERIFY, OP_CHECKSIG)
|
||||
" 02af7dad03e682fcd0427b5c24140c220ac9d8abe286c15f8cf5bf77eed19c365"
|
||||
val p2pkhInputScript = List("3044022016ffdbb7c57634903c5e018fcfc48d59f4e37dc4bc3bbc9ba4e6ee39150bca030220119c2241a931819bc1a75d3596e4029d803d1cd6de123bf8a1a1a2c3665e1fac01",
|
||||
"02af7dad03e682fcd0427b5c24140c220ac9d8abe286c15f8cf5bf77eed19c3652")
|
||||
val p2pkhOutputScriptNotParsed = "OP_DUP OP_HASH160 e2e7c1ab3f807151e832dd1accb3d4f5d7d19b4b OP_EQUALVERIFY OP_CHECKSIG"
|
||||
val p2pkhOutputScript = List(OP_DUP,OP_HASH160,ConstantImpl("e2e7c1ab3f807151e832dd1accb3d4f5d7d19b4b"),OP_EQUALVERIFY, OP_CHECKSIG)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user