From bf722ec21285c81bcfe1e0a3376148aa4f30ee05 Mon Sep 17 00:00:00 2001 From: Alexis Hernandez Date: Fri, 30 Mar 2018 18:39:59 -0600 Subject: [PATCH] server: Refactor tests to load transactions and blocks from files --- .../xsn/explorer/helpers/BlockLoader.scala | 19 ++ .../explorer/helpers/TransactionLoader.scala | 19 ++ .../services/XSNServiceRPCImplSpec.scala | 167 +++++----------- .../controllers/BlocksControllerSpec.scala | 187 ++---------------- .../TransactionsControllerSpec.scala | 59 +----- ...3c642a4c6e473bf25c653ff8e8c114a3006040ffb8 | 19 ++ ...757852b21c5e08b88b2f4de9d3fa9517d8463e472b | 21 ++ ...b5069d653ba224bf86989125d1dfbb0973b7d6a5e0 | 20 ++ ...926e0b95528b082c6323de35516de0fc321f5d8058 | 20 ++ ...4be20422ee71029333283e2360975bc6073bdb2b81 | 20 ++ ...5d46a828a57b00e1df012d7a2d158e0f7484173f7c | 34 ++++ ...617599670445ee94ed7736e146c13be260c576c641 | 72 +++++++ ...953e0cfbf51bfe83400ab27d61084222451045116c | 72 +++++++ ...0570f175701d120a0da31c8222d2d99fc60bf96577 | 89 +++++++++ ...3af44600e050c28ddb7d929d93d43a9148e2ba6638 | 72 +++++++ ...d282a6a8de65eb2ca007b54d6572167703768967d9 | 72 +++++++ ...e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8 | 37 ++++ ...4214827f930a69802c1c43d1fb2ff7b7075b2d1701 | 66 +++++++ ...f8aa89feaac1a3fad7d5da77d1fe773219a0e9d864 | 86 ++++++++ ...1daf8bece68e005396880376260872352db0c005c1 | 89 +++++++++ ...87d869dc5aceb57d5d1c2117036fe60f31369a284e | 83 ++++++++ 21 files changed, 982 insertions(+), 341 deletions(-) create mode 100644 server/test/com/xsn/explorer/helpers/BlockLoader.scala create mode 100644 server/test/com/xsn/explorer/helpers/TransactionLoader.scala create mode 100644 server/test/resources/blocks/000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8 create mode 100644 server/test/resources/blocks/19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b create mode 100644 server/test/resources/blocks/1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0 create mode 100644 server/test/resources/blocks/25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058 create mode 100644 server/test/resources/blocks/b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81 create mode 100644 server/test/resources/transactions/024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c create mode 100644 server/test/resources/transactions/0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641 create mode 100644 server/test/resources/transactions/0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c create mode 100644 server/test/resources/transactions/0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577 create mode 100644 server/test/resources/transactions/1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638 create mode 100644 server/test/resources/transactions/585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9 create mode 100644 server/test/resources/transactions/67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8 create mode 100644 server/test/resources/transactions/7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701 create mode 100644 server/test/resources/transactions/8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864 create mode 100644 server/test/resources/transactions/9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1 create mode 100644 server/test/resources/transactions/9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e diff --git a/server/test/com/xsn/explorer/helpers/BlockLoader.scala b/server/test/com/xsn/explorer/helpers/BlockLoader.scala new file mode 100644 index 0000000..6608eff --- /dev/null +++ b/server/test/com/xsn/explorer/helpers/BlockLoader.scala @@ -0,0 +1,19 @@ +package com.xsn.explorer.helpers + +import com.xsn.explorer.models.rpc.Block +import play.api.libs.json.{JsValue, Json} + +object BlockLoader { + + private val BasePath = "blocks" + + def get(blockhash: String): Block = { + json(blockhash).as[Block] + } + + def json(blockhash: String): JsValue = { + val resource = s"$BasePath/$blockhash" + val json = scala.io.Source.fromResource(resource).getLines().mkString("\n") + Json.parse(json) + } +} diff --git a/server/test/com/xsn/explorer/helpers/TransactionLoader.scala b/server/test/com/xsn/explorer/helpers/TransactionLoader.scala new file mode 100644 index 0000000..e9d1b67 --- /dev/null +++ b/server/test/com/xsn/explorer/helpers/TransactionLoader.scala @@ -0,0 +1,19 @@ +package com.xsn.explorer.helpers + +import com.xsn.explorer.models.rpc.Transaction +import play.api.libs.json.{JsValue, Json} + +object TransactionLoader { + + private val BasePath = "transactions" + + def get(txid: String): Transaction = { + json(txid).as[Transaction] + } + + def json(txid: String): JsValue = { + val resource = s"$BasePath/$txid" + val json = scala.io.Source.fromResource(resource).getLines().mkString("\n") + Json.parse(json) + } +} diff --git a/server/test/com/xsn/explorer/services/XSNServiceRPCImplSpec.scala b/server/test/com/xsn/explorer/services/XSNServiceRPCImplSpec.scala index 7f6906a..f80c375 100644 --- a/server/test/com/xsn/explorer/services/XSNServiceRPCImplSpec.scala +++ b/server/test/com/xsn/explorer/services/XSNServiceRPCImplSpec.scala @@ -2,21 +2,23 @@ package com.xsn.explorer.services import com.xsn.explorer.config.RPCConfig import com.xsn.explorer.errors._ -import com.xsn.explorer.helpers.Executors -import com.xsn.explorer.models.{Address, Blockhash, TransactionId} +import com.xsn.explorer.helpers.{DataHelper, Executors, TransactionLoader} +import com.xsn.explorer.models.{Address, Blockhash} import org.mockito.ArgumentMatchers._ import org.mockito.Mockito._ import org.scalactic.Bad import org.scalatest.concurrent.ScalaFutures import org.scalatest.mockito.MockitoSugar import org.scalatest.{MustMatchers, OptionValues, WordSpec} -import play.api.libs.json.{JsNull, Json} +import play.api.libs.json.{JsNull, JsValue, Json} import play.api.libs.ws.{WSClient, WSRequest, WSResponse} import scala.concurrent.Future class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures with MockitoSugar with OptionValues { + import DataHelper._ + val ws = mock[WSClient] val ec = Executors.externalServiceEC val config = new RPCConfig { @@ -32,52 +34,34 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures when(request.withHttpHeaders(any())).thenReturn(request) val service = new XSNServiceRPCImpl(ws, config)(ec) - val txid = TransactionId.from("024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c").get + + def createRPCSuccessfulResponse(result: JsValue): String = { + s""" + |{ + | "result": ${Json.prettyPrint(result)}, + | "id": null, + | "error": null + |} + """.stripMargin + } + + def createRPCErrorResponse(errorCode: Int, message: String): String = { + s""" + |{ + | "result": null, + | "id": null, + | "error": { + | "code": $errorCode, + | "message": "$message" + | } + |} + """.stripMargin + } "getTransaction" should { "handle coinbase" in { - val responseBody = - """ - |{ - | "result": { - | "blockhash": "000003fb382f6892ae96594b81aa916a8923c70701de4e7054aac556c7271ef7", - | "blocktime": 1520276270, - | "confirmations": 5347, - | "height": 1, - | "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff010000000000000000232103e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029ac00000000", - | "locktime": 0, - | "size": 98, - | "time": 1520276270, - | "txid": "024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c", - | "version": 1, - | "vin": [ - | { - | "coinbase": "510101", - | "sequence": 4294967295 - | } - | ], - | "vout": [ - | { - | "n": 0, - | "scriptPubKey": { - | "addresses": [ - | "XdJnCKYNwzCz8ATv8Eu75gonaHyfr9qXg9" - | ], - | "asm": "03e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029 OP_CHECKSIG", - | "hex": "2103e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029ac", - | "reqSigs": 1, - | "type": "pubkey" - | }, - | "value": 0, - | "valueSat": 0 - | } - | ] - | }, - | "error": null, - | "id": null - |} - """.stripMargin.trim - + val txid = createTransactionId("024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c") + val responseBody = createRPCSuccessfulResponse(TransactionLoader.json(txid.string)) val json = Json.parse(responseBody) when(response.status).thenReturn(200) @@ -93,77 +77,10 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures tx.vout.size mustEqual 1 } } + "handle non-coinbase result" in { - val responseBody = - """ - |{ - | "result": { - | "hex": "0100000001d967897603771672654db507a02ceb65dea8a682d2333ee819cac80950ec5c58020000006a473044022059a0cc21ad24ae18726d128c85328a0b54dab62aeb41ffbcad368ece6fdf9d2602200e477332401ce1296d379dc5f797720e854e40fc5af0a268f585e7dae64d38e5012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1ffffffff03000000000000000000220935d7946a00001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac220935d7946a00001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac00000000", - | "txid": "0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641", - | "size": 234, - | "version": 1, - | "locktime": 0, - | "vin": [ - | { - | "txid": "585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9", - | "vout": 2, - | "scriptSig": { - | "asm": "3044022059a0cc21ad24ae18726d128c85328a0b54dab62aeb41ffbcad368ece6fdf9d2602200e477332401ce1296d379dc5f797720e854e40fc5af0a268f585e7dae64d38e5[ALL] 03624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1", - | "hex": "473044022059a0cc21ad24ae18726d128c85328a0b54dab62aeb41ffbcad368ece6fdf9d2602200e477332401ce1296d379dc5f797720e854e40fc5af0a268f585e7dae64d38e5012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1" - | }, - | "sequence": 4294967295 - | } - | ], - | "vout": [ - | { - | "value": 0.00000000, - | "valueSat": 0, - | "n": 0, - | "scriptPubKey": { - | "asm": "", - | "hex": "", - | "type": "nonstandard" - | } - | }, - | { - | "value": 1171874.98281250, - | "valueSat": 117187498281250, - | "n": 1, - | "scriptPubKey": { - | "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", - | "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", - | "reqSigs": 1, - | "type": "pubkeyhash", - | "addresses": [ - | "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" - | ] - | } - | }, - | { - | "value": 1171874.98281250, - | "valueSat": 117187498281250, - | "n": 2, - | "scriptPubKey": { - | "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", - | "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", - | "reqSigs": 1, - | "type": "pubkeyhash", - | "addresses": [ - | "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" - | ] - | } - | } - | ], - | "blockhash": "b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81", - | "height": 809, - | "confirmations": 1950, - | "time": 1520318120, - | "blocktime": 1520318120 - | }, - | "error": null, - | "id": null - |} - """.stripMargin.trim + val txid = createTransactionId("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641") + val responseBody = createRPCSuccessfulResponse(TransactionLoader.json(txid.string)) val json = Json.parse(responseBody) @@ -175,14 +92,15 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures result.isGood mustEqual true val tx = result.get - tx.id.string mustEqual "0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641" + tx.id.string mustEqual txid.string tx.vin.value.txid.string mustEqual "585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9" tx.vout.size mustEqual 3 } } "handle transaction not found" in { - val responseBody = """{"result":null,"error":{"code":-5,"message":"No information available about transaction"},"id":null}""" + val txid = createTransactionId("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641") + val responseBody = createRPCErrorResponse(-5, "No information available about transaction") val json = Json.parse(responseBody) when(response.status).thenReturn(500) when(response.json).thenReturn(json) @@ -194,7 +112,9 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures } "handle error with message" in { - val responseBody = """{"result":null,"error":{"code":-32600,"message":"Params must be an array"},"id":null}""" + val errorMessage = "Params must be an array" + val txid = createTransactionId("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641") + val responseBody = createRPCErrorResponse(-32600, errorMessage) val json = Json.parse(responseBody) when(response.status).thenReturn(200) @@ -202,12 +122,14 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures when(request.post[String](anyString())(any())).thenReturn(Future.successful(response)) whenReady(service.getTransaction(txid)) { result => - val error = XSNMessageError("Params must be an array") + val error = XSNMessageError(errorMessage) result mustEqual Bad(error).accumulating } } "handle non successful status" in { + val txid = createTransactionId("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641") + when(response.status).thenReturn(403) when(response.json).thenReturn(JsNull) when(request.post[String](anyString())(any())).thenReturn(Future.successful(response)) @@ -218,6 +140,8 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures } "handle unexpected error" in { + val txid = createTransactionId("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641") + val responseBody = """{"result":null,"error":{},"id":null}""" val json = Json.parse(responseBody) @@ -263,8 +187,7 @@ class XSNServiceRPCImplSpec extends WordSpec with MustMatchers with ScalaFutures } "fail on invalid address" in { - val responseBody = """{"result":null,"error":{"code":-5,"message":"Invalid address"},"id":null}""" - + val responseBody = createRPCErrorResponse(-5, "Invalid address") val address = Address.from("Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLW").get val json = Json.parse(responseBody) diff --git a/server/test/controllers/BlocksControllerSpec.scala b/server/test/controllers/BlocksControllerSpec.scala index be338d1..1bb85d5 100644 --- a/server/test/controllers/BlocksControllerSpec.scala +++ b/server/test/controllers/BlocksControllerSpec.scala @@ -3,9 +3,9 @@ package controllers import com.alexitc.playsonify.PublicErrorRenderer import com.alexitc.playsonify.core.FutureApplicationResult import com.xsn.explorer.errors.{BlockNotFoundError, TransactionNotFoundError} -import com.xsn.explorer.helpers.{DataHelper, DummyXSNService} +import com.xsn.explorer.helpers.{BlockLoader, DummyXSNService, TransactionLoader} import com.xsn.explorer.models._ -import com.xsn.explorer.models.rpc.{Block, Transaction, TransactionVIN, TransactionVOUT} +import com.xsn.explorer.models.rpc.{Block, Transaction} import com.xsn.explorer.services.XSNService import controllers.common.MyAPISpec import org.scalactic.{Bad, Good} @@ -17,138 +17,25 @@ import scala.concurrent.Future class BlocksControllerSpec extends MyAPISpec { - import DataHelper._ - // PoS block - val posBlock = createBlock( - hash = Blockhash.from("b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81").get, - transactions = List( - TransactionId.from("7f12adbb63d443502cf151c76946d5faa0b1c662a5d67afc7da085c74e06f1ce").get, - TransactionId.from("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641").get - ) - ) - - val posBlockCoinstakeTx = createTx( - id = TransactionId.from("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641").get, - vin = TransactionVIN(TransactionId.from("585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9").get, 2), - vout = List( - TransactionVOUT(n = 0, value = BigDecimal("0")), - createTransactionVOUT(1, BigDecimal(600), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(2, BigDecimal(600), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(3, BigDecimal(10), createScriptPubKey("pubkeyhash", createAddress("XnH3bC9NruJ4wnu4Dgi8F3wemmJtcxpKp6"))) - ) - ) - - val posBlockCoinstakeTxInput = createTx( - id = TransactionId.from("585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9").get, - vin = TransactionVIN(TransactionId.from("fd74206866fc4ed986d39084eb9f20de6cb324b028693f33d60897ac995fff4f").get, 2), - vout = List( - TransactionVOUT(BigDecimal("0"), 0, None), - createTransactionVOUT(1, BigDecimal(1), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(2, BigDecimal(1000), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))) - ) - ) + val posBlock = BlockLoader.get("1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0") + val posBlockCoinstakeTx = TransactionLoader.get("9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1") + val posBlockCoinstakeTxInput = TransactionLoader.get("0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577") // PoS block with rounding error - val posBlockRoundingError = createBlock( - hash = Blockhash.from("25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058").get, - transactions = List( - TransactionId.from("df275d713fcf5e78e7e8369d640201d46736c0d2255e31ce45bd5aa0206f861f").get, - TransactionId.from("0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c").get - ) - ) - - val posBlockRoundingErrorCoinstakeTx = createTx( - id = TransactionId.from("0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c").get, - vin = TransactionVIN(TransactionId.from("1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638").get, 1), - vout = List( - TransactionVOUT(BigDecimal("0"), 0, None), - createTransactionVOUT(1, BigDecimal("292968.74570312"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(2, BigDecimal("292968.74570312"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))) - ) - ) - - val posBlockRoundingErrorCoinstakeTxInput = createTx( - id = TransactionId.from("1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638").get, - vin = TransactionVIN(TransactionId.from("ef157f5ec0b3a6cdf669ff799988ee94d9fa2af8adaf2408ae9e34b47310831f").get, 2), - vout = List( - TransactionVOUT(BigDecimal("0"), 0, None), - createTransactionVOUT(1, BigDecimal("585937.49140625"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(2, BigDecimal("585937.49140625"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))) - ) - ) + val posBlockRoundingError = BlockLoader.get("25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058") + val posBlockRoundingErrorCoinstakeTx = TransactionLoader.get("0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c") + val posBlockRoundingErrorCoinstakeTxInput = TransactionLoader.get("1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638") // TPoS - val tposBlock = posBlock.copy( - hash = Blockhash.from("19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b").get, - tposContract = Some(createTransactionId("7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701")), - transactions = List( - createTransactionId("28568eb4a2c69a292b7d56daa45e3b17fbfc8af9310d5c2d444600e64266c87f"), - createTransactionId("8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864") - ) - ) - - val tposBlockContractTx = createTx( - createTransactionId("7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701"), - None, - List( - TransactionVOUT( - n = 0, - value = BigDecimal(0), - scriptPubKey = Some(createScriptPubKey("nulldata", "OP_RETURN 5869337351664d51737932437a4d5a54726e4b573648464770315671465468644c77 58794a4338786e664672484e634d696e68366778755052595939484361593944416f 99")) - ) - ) - ) - - val tposBlockCoinstakeTx = createTx( - createTransactionId("8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864"), - Some(TransactionVIN(createTransactionId("9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e"), 1)), - List( - TransactionVOUT(BigDecimal(0), 0, None), - TransactionVOUT( - n = 1, - value = BigDecimal("1022.27500000"), - scriptPubKey = Some(createScriptPubKey("pubkeyhash", createAddress("Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw"))) - ), - - TransactionVOUT( - n = 2, - value = BigDecimal("0.22500000"), - scriptPubKey = Some(createScriptPubKey("pubkeyhash", createAddress("XyJC8xnfFrHNcMinh6gxuPRYY9HCaY9DAo"))) - ), - - TransactionVOUT( - n = 3, - value = BigDecimal("22.50000000"), - scriptPubKey = Some(createScriptPubKey("pubkeyhash", createAddress("XydZnssXHCxxRtB4rk7evfKT9XP7GqyA9N"))) - ) - ) - ) - - val tposBlockCoinstakeTxInput = createTx( - createTransactionId("9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e"), - None, - List( - TransactionVOUT(n = 1, value = BigDecimal(1000)) - ) - ) + val tposBlock = BlockLoader.get("19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b") + val tposBlockContractTx = TransactionLoader.get("7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701") + val tposBlockCoinstakeTx = TransactionLoader.get("8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864") + val tposBlockCoinstakeTxInput = TransactionLoader.get("9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e") // PoW - val powBlock = posBlock.copy( - hash = Blockhash.from("000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8").get, - transactions = List( - TransactionId.from("67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8").get - ), - height = Height(2) - ) - - val powBlockPreviousTx = createTx( - id = TransactionId.from("67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8").get, - vin = None, - vout = List( - createTransactionVOUT(0, BigDecimal("76500000.00000000"), createScriptPubKey("pubkey", createAddress("XdJnCKYNwzCz8ATv8Eu75gonaHyfr9qXg9"))) - ) - ) + val powBlock = BlockLoader.get("000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8") + val powBlockPreviousTx = TransactionLoader.get("67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8") val customXSNService = new DummyXSNService { val blocks = Map( @@ -223,12 +110,12 @@ class BlocksControllerSpec extends MyAPISpec { (jsonBlock \ "nextBlockhash").asOpt[Blockhash] mustEqual block.nextBlockhash val jsonCoinstake = (jsonRewards \ "coinstake").as[JsValue] - (jsonCoinstake \ "address").as[String] mustEqual "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" - (jsonCoinstake \ "value").as[BigDecimal] mustEqual BigDecimal("200") + (jsonCoinstake \ "address").as[String] mustEqual "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3" + (jsonCoinstake \ "value").as[BigDecimal] mustEqual BigDecimal("22.49999999") val jsonMasternode = (jsonRewards \ "masternode").as[JsValue] - (jsonMasternode \ "address").as[String] mustEqual "XnH3bC9NruJ4wnu4Dgi8F3wemmJtcxpKp6" - (jsonMasternode \ "value").as[BigDecimal] mustEqual BigDecimal("10") + (jsonMasternode \ "address").as[String] mustEqual "XjUDDq221NwqRtp85wfvoDrMaaxvUCDRrY" + (jsonMasternode \ "value").as[BigDecimal] mustEqual BigDecimal("22.5") } "retrieve a PoS block having a rounding error" in { @@ -366,42 +253,4 @@ class BlocksControllerSpec extends MyAPISpec { (error \ "message").as[String].nonEmpty mustEqual true } } - - private def createTx(id: TransactionId, vin: TransactionVIN, vout: List[TransactionVOUT]): Transaction = { - createTx(id, Some(vin), vout) - } - - private def createTx(id: TransactionId, vin: Option[TransactionVIN], vout: List[TransactionVOUT]): Transaction = { - Transaction( - id = id, - size = Size(234), - blockhash = Blockhash.from("b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81").get, - time = 1520318120, - blocktime = 1520318120, - confirmations = Confirmations(1950), - vin = vin, - vout = vout - ) - } - - private def createBlock(hash: Blockhash, transactions: List[TransactionId]): Block = { - Block( - hash = hash, - transactions = transactions, - confirmations = Confirmations(11189), - size = Size(478), - height = Height(809), - version = 536870912, - merkleRoot = Blockhash.from("598cc6ba8238d87641b0dbd02485b7d635b5417429df3145c98c3ff8779ab4b8").get, - time = 1520318054, - medianTime = 1520318054, - nonce = 0, - bits = "1d011212", - chainwork = "00000000000000000000000000000000000000000000000000000084c71ff420", - difficulty = BigDecimal("0.9340526210769362"), - previousBlockhash = Some(Blockhash.from("000003dc4c2fc449dededaaad6efc33ce1b64b88a060652dc47edc63d6d6b524").get), - nextBlockhash = Some(Blockhash.from("000000125c06cedf38b07bff174bdb61027935dbcb34831d28cff40bedb519d5").get), - tposContract = None - ) - } } diff --git a/server/test/controllers/TransactionsControllerSpec.scala b/server/test/controllers/TransactionsControllerSpec.scala index 87f4918..2a4b004 100644 --- a/server/test/controllers/TransactionsControllerSpec.scala +++ b/server/test/controllers/TransactionsControllerSpec.scala @@ -3,9 +3,9 @@ package controllers import com.alexitc.playsonify.PublicErrorRenderer import com.alexitc.playsonify.core.FutureApplicationResult import com.xsn.explorer.errors.TransactionNotFoundError -import com.xsn.explorer.helpers.{DataHelper, DummyXSNService} +import com.xsn.explorer.helpers.{DummyXSNService, TransactionLoader} import com.xsn.explorer.models._ -import com.xsn.explorer.models.rpc.{Transaction, TransactionVIN} +import com.xsn.explorer.models.rpc.Transaction import com.xsn.explorer.services.XSNService import controllers.common.MyAPISpec import org.scalactic.{Bad, Good} @@ -17,60 +17,19 @@ import scala.concurrent.Future class TransactionsControllerSpec extends MyAPISpec { - import DataHelper._ - - val coinbaseTx: Transaction = Transaction( - id = TransactionId.from("024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c").get, - size = Size(98), - blockhash = Blockhash.from("000003fb382f6892ae96594b81aa916a8923c70701de4e7054aac556c7271ef7").get, - time = 1520276270L, - blocktime = 1520276270L, - confirmations = Confirmations(5347), - vin = None, - vout = List( - createTransactionVOUT(0, BigDecimal(0), createScriptPubKey("pubkey", createAddress("XdJnCKYNwzCz8ATv8Eu75gonaHyfr9qXg9"))) - ) - ) - - val nonCoinbaseTx: Transaction = Transaction( - id = TransactionId.from("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641").get, - size = Size(234), - blockhash = Blockhash.from("b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81").get, - time = 1520318120, - blocktime = 1520318120, - confirmations = Confirmations(1950), - vin = Some( - TransactionVIN(TransactionId.from("585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9").get, 2)), - vout = List( - createTransactionVOUT(1, BigDecimal("1171874.98281250"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(2, BigDecimal("1171874.98281250"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))) - ) - ) - - val nonCoinbasePreviousTx: Transaction = Transaction( - id = TransactionId.from("585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9").get, - size = Size(235), - blockhash = Blockhash.from("cc4ccf19cfb9fa373ba8da68c7d25266d675a2414db603edb3cc88f866a782ea").get, - time = 1520314409, - blocktime = 1520314409, - confirmations = Confirmations(11239), - vin = Some( - TransactionVIN(createTransactionId("fd74206866fc4ed986d39084eb9f20de6cb324b028693f33d60897ac995fff4f"), 2)), - vout = List( - createTransactionVOUT(1, BigDecimal("2343749.96562500"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))), - createTransactionVOUT(2, BigDecimal("2343749.96562500"), createScriptPubKey("pubkeyhash", createAddress("XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL"))) - ) - ) + val coinbaseTx = TransactionLoader.get("024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c") + val nonCoinbaseTx = TransactionLoader.get("0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641") + val nonCoinbasePreviousTx = TransactionLoader.get("585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9") val customXSNService = new DummyXSNService { val map = Map( - "024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c" -> coinbaseTx, - "0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641" -> nonCoinbaseTx, - "585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9" -> nonCoinbasePreviousTx + coinbaseTx.id -> coinbaseTx, + nonCoinbaseTx.id -> nonCoinbaseTx, + nonCoinbasePreviousTx.id -> nonCoinbasePreviousTx ) override def getTransaction(txid: TransactionId): FutureApplicationResult[Transaction] = { - val result = map.get(txid.string) + val result = map.get(txid) .map(Good(_)) .getOrElse { Bad(TransactionNotFoundError).accumulating diff --git a/server/test/resources/blocks/000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8 b/server/test/resources/blocks/000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8 new file mode 100644 index 0000000..2b9636d --- /dev/null +++ b/server/test/resources/blocks/000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8 @@ -0,0 +1,19 @@ +{ + "hash": "000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8", + "confirmations": 33960, + "size": 179, + "height": 2, + "version": 536870912, + "merkleroot": "67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8", + "tx": [ + "67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8" + ], + "time": 1520276299, + "mediantime": 1520276270, + "nonce": 1161702, + "bits": "1e0ffff0", + "difficulty": 0.000244140625, + "chainwork": "0000000000000000000000000000000000000000000000000000000000300030", + "previousblockhash": "000003fb382f6892ae96594b81aa916a8923c70701de4e7054aac556c7271ef7", + "nextblockhash": "00000766115b26ecbc09cd3a3db6870fdaf2f049d65a910eb2f2b48b566ca7bd" +} \ No newline at end of file diff --git a/server/test/resources/blocks/19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b b/server/test/resources/blocks/19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b new file mode 100644 index 0000000..02096bf --- /dev/null +++ b/server/test/resources/blocks/19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b @@ -0,0 +1,21 @@ +{ + "hash": "19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b", + "confirmations": 12073, + "size": 406, + "height": 21888, + "version": 536870912, + "merkleroot": "edf0af189c459c0c48750a1612b0bd1f1444928295ce4995d26630e6231fed72", + "tx": [ + "28568eb4a2c69a292b7d56daa45e3b17fbfc8af9310d5c2d444600e64266c87f", + "8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864" + ], + "time": 1521716682, + "mediantime": 1521716483, + "nonce": 0, + "bits": "1c0bfa57", + "difficulty": 21.37238640836808, + "chainwork": "0000000000000000000000000000000000000000000000000003680e5ba6bdb8", + "tposcontract": "7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701", + "previousblockhash": "2e4def90cf4c8dcd70d5204e50783688be175ee67bbe0fb1e0eefa831fdb89a8", + "nextblockhash": "7e6245001a1ff853bd0ccb05575afc22a64970781a4c6c82a601a89a43a1fa0a" +} \ No newline at end of file diff --git a/server/test/resources/blocks/1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0 b/server/test/resources/blocks/1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0 new file mode 100644 index 0000000..f9f7a57 --- /dev/null +++ b/server/test/resources/blocks/1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0 @@ -0,0 +1,20 @@ +{ + "hash": "1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0", + "confirmations": 10975, + "size": 512, + "height": 23000, + "version": 536870912, + "merkleroot": "bbf712d809a897a32fef65f82d62e6e9052e28fd314c66fa3d62edddb25f0e18", + "tx": [ + "d868e31f5161d049b8afdabedeefe8ccf8caef15d1f80ef34405e97110feebc6", + "9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1" + ], + "time": 1521784448, + "mediantime": 1521784176, + "nonce": 0, + "bits": "1c093c4d", + "difficulty": 27.71855447484639, + "chainwork": "0000000000000000000000000000000000000000000000000003e06502dbec26", + "previousblockhash": "c7b95170a8221a782710adf6cb7b3ec43dbb2d90fbafd10d324a43aa720e1ac2", + "nextblockhash": "3eeb24d4968128b934631b1560a4ae6127b97d74fbfa9f6cfca292024c34c036" +} \ No newline at end of file diff --git a/server/test/resources/blocks/25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058 b/server/test/resources/blocks/25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058 new file mode 100644 index 0000000..9874ea4 --- /dev/null +++ b/server/test/resources/blocks/25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058 @@ -0,0 +1,20 @@ +{ + "hash": "25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058", + "confirmations": 32959, + "size": 478, + "height": 1000, + "version": 536870912, + "merkleroot": "9b796ca07ef58650dd895f421e0499d109a7d1e7de8fcc5184df9b39bef85c4a", + "tx": [ + "df275d713fcf5e78e7e8369d640201d46736c0d2255e31ce45bd5aa0206f861f", + "0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c" + ], + "time": 1520327156, + "mediantime": 1520326898, + "nonce": 0, + "bits": "1c19ba1e", + "difficulty": 9.950475847040947, + "chainwork": "00000000000000000000000000000000000000000000000000000279be833826", + "previousblockhash": "913724ed5aef0c8cf81c4faeb0d8b5268a9644c4d5533133b9cb71daeaa20bc4", + "nextblockhash": "d42f0442cf6e534ebeb72946a895a0ba6b03fcef0b3f112f0831fb381bf10f55" +} \ No newline at end of file diff --git a/server/test/resources/blocks/b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81 b/server/test/resources/blocks/b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81 new file mode 100644 index 0000000..a4c49e8 --- /dev/null +++ b/server/test/resources/blocks/b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81 @@ -0,0 +1,20 @@ +{ + "hash": "b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81", + "confirmations": 33141, + "size": 478, + "height": 809, + "version": 536870912, + "merkleroot": "598cc6ba8238d87641b0dbd02485b7d635b5417429df3145c98c3ff8779ab4b8", + "tx": [ + "7f12adbb63d443502cf151c76946d5faa0b1c662a5d67afc7da085c74e06f1ce", + "0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641" + ], + "time": 1520318120, + "mediantime": 1520318054, + "nonce": 0, + "bits": "1d011212", + "difficulty": 0.9340526210769362, + "chainwork": "00000000000000000000000000000000000000000000000000000084c71ff420", + "previousblockhash": "9490ce5d14bb5e79a790ddede03fc3a9bde3f7156f34a57ae3ceb56ae7426c14", + "nextblockhash": "f6e3199c241131e79640fe027a6ef993c02b3520c3d4ba08cd67abfbb98ec07e" +} \ No newline at end of file diff --git a/server/test/resources/transactions/024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c b/server/test/resources/transactions/024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c new file mode 100644 index 0000000..15e0d93 --- /dev/null +++ b/server/test/resources/transactions/024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c @@ -0,0 +1,34 @@ +{ + "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03510101ffffffff010000000000000000232103e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029ac00000000", + "txid": "024aba1d535cfe5dd3ea465d46a828a57b00e1df012d7a2d158e0f7484173f7c", + "size": 98, + "version": 1, + "locktime": 0, + "vin": [ + { + "coinbase": "510101", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "03e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029 OP_CHECKSIG", + "hex": "2103e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029ac", + "reqSigs": 1, + "type": "pubkey", + "addresses": [ + "XdJnCKYNwzCz8ATv8Eu75gonaHyfr9qXg9" + ] + } + } + ], + "blockhash": "000003fb382f6892ae96594b81aa916a8923c70701de4e7054aac556c7271ef7", + "height": 1, + "confirmations": 33908, + "time": 1520276270, + "blocktime": 1520276270 +} \ No newline at end of file diff --git a/server/test/resources/transactions/0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641 b/server/test/resources/transactions/0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641 new file mode 100644 index 0000000..37cffaf --- /dev/null +++ b/server/test/resources/transactions/0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641 @@ -0,0 +1,72 @@ +{ + "hex": "0100000001d967897603771672654db507a02ceb65dea8a682d2333ee819cac80950ec5c58020000006a473044022059a0cc21ad24ae18726d128c85328a0b54dab62aeb41ffbcad368ece6fdf9d2602200e477332401ce1296d379dc5f797720e854e40fc5af0a268f585e7dae64d38e5012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1ffffffff03000000000000000000220935d7946a00001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac220935d7946a00001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac00000000", + "txid": "0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641", + "size": 234, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9", + "vout": 2, + "scriptSig": { + "asm": "3044022059a0cc21ad24ae18726d128c85328a0b54dab62aeb41ffbcad368ece6fdf9d2602200e477332401ce1296d379dc5f797720e854e40fc5af0a268f585e7dae64d38e5[ALL] 03624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1", + "hex": "473044022059a0cc21ad24ae18726d128c85328a0b54dab62aeb41ffbcad368ece6fdf9d2602200e477332401ce1296d379dc5f797720e854e40fc5af0a268f585e7dae64d38e5012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1" + }, + "value": 2343749.96562500, + "valueSat": 234374996562500, + "address": "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 1171874.98281250, + "valueSat": 117187498281250, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "5b8d857b64870f01263eb3b1e22adc32fc942df5b4aab709d80e15e828878c79", + "spentIndex": 0, + "spentHeight": 893 + }, + { + "value": 1171874.98281250, + "valueSat": 117187498281250, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "5fd7c87b26f60acfdc665b956405d587b8638191327aa504add325ef93cbf7f9", + "spentIndex": 0, + "spentHeight": 890 + } + ], + "blockhash": "b72dd1655408e9307ef5874be20422ee71029333283e2360975bc6073bdb2b81", + "height": 809, + "confirmations": 33131, + "time": 1520318120, + "blocktime": 1520318120 +} \ No newline at end of file diff --git a/server/test/resources/transactions/0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c b/server/test/resources/transactions/0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c new file mode 100644 index 0000000..60787b8 --- /dev/null +++ b/server/test/resources/transactions/0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c @@ -0,0 +1,72 @@ +{ + "hex": "01000000013866bae248913ad4939d927ddb8dc250e00046f43a747f619ec7875a8a286018010000006a4730440220135daeb816d7badca27fdf4d5edce94a6f21cb61d1e5ff188f3d0bbbe142d47302206d67ef9b428e6c3d7241be1d208bab29296445990813ec55e54527b6ecba4fca012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1ffffffff030000000000000000004842cd35a51a00001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac4842cd35a51a00001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac00000000", + "txid": "0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c", + "size": 234, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638", + "vout": 1, + "scriptSig": { + "asm": "30440220135daeb816d7badca27fdf4d5edce94a6f21cb61d1e5ff188f3d0bbbe142d47302206d67ef9b428e6c3d7241be1d208bab29296445990813ec55e54527b6ecba4fca[ALL] 03624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1", + "hex": "4730440220135daeb816d7badca27fdf4d5edce94a6f21cb61d1e5ff188f3d0bbbe142d47302206d67ef9b428e6c3d7241be1d208bab29296445990813ec55e54527b6ecba4fca012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1" + }, + "value": 585937.49140625, + "valueSat": 58593749140625, + "address": "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 292968.74570312, + "valueSat": 29296874570312, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "d16825f4cd83a297946fa18b77948e9e4be9b7707ee5cb5ece9d8c90eb952941", + "spentIndex": 0, + "spentHeight": 1086 + }, + { + "value": 292968.74570312, + "valueSat": 29296874570312, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "4aa087c2a0ca449395a239f77065819b4e1e83245b82d62a0edc6817ff571870", + "spentIndex": 0, + "spentHeight": 1352 + } + ], + "blockhash": "25762bf01143f7fe34912c926e0b95528b082c6323de35516de0fc321f5d8058", + "height": 1000, + "confirmations": 32959, + "time": 1520327156, + "blocktime": 1520327156 +} \ No newline at end of file diff --git a/server/test/resources/transactions/0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577 b/server/test/resources/transactions/0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577 new file mode 100644 index 0000000..33015c9 --- /dev/null +++ b/server/test/resources/transactions/0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577 @@ -0,0 +1,89 @@ +{ + "hex": "0100000001ba6523da653a4b2a2390c9a51922c37b92313ed606b86525c3ae3da9e28db139020000006a4730440220628b6d6829634b5f49abd50f4a25e8fc4fa6465e0b17c807f5bf1fe04c42d7a202203d05594a5c97244479771609fb370b4c4ca87d130cb630826c930b555902ee490121031810683b84cd1306250970702942d435a1a64ca75304830b55c73dea5340c20dffffffff0400000000000000000091663b7d6c0100001976a9145356fa18a159ac621882928d307a54474a53b0f388ac11201ff76b0100001976a9145356fa18a159ac621882928d307a54474a53b0f388ac80461c86000000001976a914328b5ebc85625004e37ecb6de1ae45f11e4d19e688ac00000000", + "txid": "0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577", + "size": 268, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "39b18de2a93daec32565b806d63e31927bc32219a5c990232a4b3a65da2365ba", + "vout": 2, + "scriptSig": { + "asm": "30440220628b6d6829634b5f49abd50f4a25e8fc4fa6465e0b17c807f5bf1fe04c42d7a202203d05594a5c97244479771609fb370b4c4ca87d130cb630826c930b555902ee49[ALL] 031810683b84cd1306250970702942d435a1a64ca75304830b55c73dea5340c20d", + "hex": "4730440220628b6d6829634b5f49abd50f4a25e8fc4fa6465e0b17c807f5bf1fe04c42d7a202203d05594a5c97244479771609fb370b4c4ca87d130cb630826c930b555902ee490121031810683b84cd1306250970702942d435a1a64ca75304830b55c73dea5340c20d" + }, + "value": 31264.38281250, + "valueSat": 3126438281250, + "address": "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 15654.69140625, + "valueSat": 1565469140625, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 5356fa18a159ac621882928d307a54474a53b0f3 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9145356fa18a159ac621882928d307a54474a53b0f388ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3" + ] + }, + "spentTxId": "9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1", + "spentIndex": 0, + "spentHeight": 23000 + }, + { + "value": 15632.19140625, + "valueSat": 1563219140625, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 5356fa18a159ac621882928d307a54474a53b0f3 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9145356fa18a159ac621882928d307a54474a53b0f388ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3" + ] + }, + "spentTxId": "b9c446be69eb353086eab9e72bdddc4f7a38ab0201cdb44685db6185c0e565d2", + "spentIndex": 0, + "spentHeight": 22473 + }, + { + "value": 22.50000000, + "valueSat": 2250000000, + "n": 3, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 328b5ebc85625004e37ecb6de1ae45f11e4d19e6 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914328b5ebc85625004e37ecb6de1ae45f11e4d19e688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XfJ6aSsHsXpLWMXM7QbC2M9SxedyJTmFXR" + ] + }, + "spentTxId": "ca4a4e6a1d45b65d31fcd83d1f1189b77f54ccbe8c1f411498601c31ff61bbee", + "spentIndex": 12, + "spentHeight": 22885 + } + ], + "blockhash": "e2df117061eb6ed4d2832616dd7a5f07b01ad3d148c9d7f9a1628d339d6caedb", + "height": 21620, + "confirmations": 12357, + "time": 1521700630, + "blocktime": 1521700630 +} \ No newline at end of file diff --git a/server/test/resources/transactions/1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638 b/server/test/resources/transactions/1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638 new file mode 100644 index 0000000..90c8599 --- /dev/null +++ b/server/test/resources/transactions/1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638 @@ -0,0 +1,72 @@ +{ + "hex": "01000000011f831073b4349eae0824afadf82afad994ee889979ff69f6cda6b3c05e7f15ef020000006a4730440220427bdecddf4dd207aaa226cd4a39d14612b36a1cd7b153c75d60b125baf1bb2f0220761682b959b5df3377564564b4bb2ffe9d2d15f2e7c8f257948916f47f38788b012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1ffffffff0300000000000000000091849a6b4a3500001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac91849a6b4a3500001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac00000000", + "txid": "1860288a5a87c79e617f743af44600e050c28ddb7d929d93d43a9148e2ba6638", + "size": 234, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "ef157f5ec0b3a6cdf669ff799988ee94d9fa2af8adaf2408ae9e34b47310831f", + "vout": 2, + "scriptSig": { + "asm": "30440220427bdecddf4dd207aaa226cd4a39d14612b36a1cd7b153c75d60b125baf1bb2f0220761682b959b5df3377564564b4bb2ffe9d2d15f2e7c8f257948916f47f38788b[ALL] 03624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1", + "hex": "4730440220427bdecddf4dd207aaa226cd4a39d14612b36a1cd7b153c75d60b125baf1bb2f0220761682b959b5df3377564564b4bb2ffe9d2d15f2e7c8f257948916f47f38788b012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1" + }, + "value": 1171874.98281250, + "valueSat": 117187498281250, + "address": "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 585937.49140625, + "valueSat": 58593749140625, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "0b761343c7be39116d5429953e0cfbf51bfe83400ab27d61084222451045116c", + "spentIndex": 0, + "spentHeight": 1000 + }, + { + "value": 585937.49140625, + "valueSat": 58593749140625, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "9248c417d64f816714a13c07d31fb0f40e6dc014102771d7d72fc5b5a50df9e2", + "spentIndex": 0, + "spentHeight": 962 + } + ], + "blockhash": "632e6ad5017ccf80ca37a0183f427e5102947a1ea54ae6ad95f42f28340c08fb", + "height": 874, + "confirmations": 33085, + "time": 1520321705, + "blocktime": 1520321705 +} \ No newline at end of file diff --git a/server/test/resources/transactions/585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9 b/server/test/resources/transactions/585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9 new file mode 100644 index 0000000..0a7e218 --- /dev/null +++ b/server/test/resources/transactions/585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9 @@ -0,0 +1,72 @@ +{ + "hex": "01000000014fff5f99ac9708d6333f6928b024b36cde209feb8490d386d94efc66682074fd020000006b483045022100cdf82e52b1257ccf132d6a2b60c001bb17b8bb179df806ecb00390094c70fda502202376f6740881efdb56b2144e06195de403e18d5980effc05e3b9e78d785399b8012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1ffffffff0300000000000000000044126aae29d500001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac44126aae29d500001976a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac00000000", + "txid": "585cec5009c8ca19e83e33d282a6a8de65eb2ca007b54d6572167703768967d9", + "size": 235, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "fd74206866fc4ed986d39084eb9f20de6cb324b028693f33d60897ac995fff4f", + "vout": 2, + "scriptSig": { + "asm": "3045022100cdf82e52b1257ccf132d6a2b60c001bb17b8bb179df806ecb00390094c70fda502202376f6740881efdb56b2144e06195de403e18d5980effc05e3b9e78d785399b8[ALL] 03624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1", + "hex": "483045022100cdf82e52b1257ccf132d6a2b60c001bb17b8bb179df806ecb00390094c70fda502202376f6740881efdb56b2144e06195de403e18d5980effc05e3b9e78d785399b8012103624fbfb0079e85bbc9aaeba6f48581326ad01194b3c54ce22852a27b1d2892d1" + }, + "value": 4687499.93125000, + "valueSat": 468749993125000, + "address": "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 2343749.96562500, + "valueSat": 234374996562500, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "24625cf8c2544406b0439340af2cd06da8c91655165af4320b7254ea2cb88dba", + "spentIndex": 0, + "spentHeight": 804 + }, + { + "value": 2343749.96562500, + "valueSat": 234374996562500, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 3cc9ede1da2d7351aaebaf6a25d2657e0b05a716 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9143cc9ede1da2d7351aaebaf6a25d2657e0b05a71688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XgEGH3y7RfeKEdn2hkYEvBnrnmGBr7zvjL" + ] + }, + "spentTxId": "0834641a7d30d8a2d2b451617599670445ee94ed7736e146c13be260c576c641", + "spentIndex": 0, + "spentHeight": 809 + } + ], + "blockhash": "cc4ccf19cfb9fa373ba8da68c7d25266d675a2414db603edb3cc88f866a782ea", + "height": 733, + "confirmations": 33221, + "time": 1520314409, + "blocktime": 1520314409 +} \ No newline at end of file diff --git a/server/test/resources/transactions/67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8 b/server/test/resources/transactions/67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8 new file mode 100644 index 0000000..f0c7b32 --- /dev/null +++ b/server/test/resources/transactions/67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8 @@ -0,0 +1,37 @@ +{ + "hex": "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff03520101ffffffff010020886ca22d1b00232103e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029ac00000000", + "txid": "67aa0bd8b9297ca6ee25a1e5c2e3a8dbbcc1e20eab76b6d1bdf9d69f8a5356b8", + "size": 98, + "version": 1, + "locktime": 0, + "vin": [ + { + "coinbase": "520101", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 76500000.00000000, + "valueSat": 7650000000000000, + "n": 0, + "scriptPubKey": { + "asm": "03e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029 OP_CHECKSIG", + "hex": "2103e8c52f2c5155771492907095753a43ce776e1fa7c5e769a67a9f3db4467ec029ac", + "reqSigs": 1, + "type": "pubkey", + "addresses": [ + "XdJnCKYNwzCz8ATv8Eu75gonaHyfr9qXg9" + ] + }, + "spentTxId": "095048976d1e4e47ba1124c2e6a7cef309ac22fbddc73082165bc589e44db726", + "spentIndex": 0, + "spentHeight": 26 + } + ], + "blockhash": "000004645e2717b556682e3c642a4c6e473bf25c653ff8e8c114a3006040ffb8", + "height": 2, + "confirmations": 33960, + "time": 1520276299, + "blocktime": 1520276299 +} \ No newline at end of file diff --git a/server/test/resources/transactions/7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701 b/server/test/resources/transactions/7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701 new file mode 100644 index 0000000..61bd1b7 --- /dev/null +++ b/server/test/resources/transactions/7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701 @@ -0,0 +1,66 @@ +{ + "hex": "010000000117f0b323487abc8471a02eebbe492fbd68cc9a22c58ac979020b9ed9fdb901521d0000006b483045022100ab77008477930b172fe0e58373fad7fb951dba4985d3f15c09d8f6dd635f1fab02205b4a6143cc1111f7c27c72891b0f2d82b37a8048839d1c7705e88228a02a106b012103a93081050d08f8d56b6acc4d13bd451b8fb912c9c4cda36895b0db6566dcecccfeffffff030000000000000000496a225869337351664d51737932437a4d5a54726e4b573648464770315671465468644c772258794a4338786e664672484e634d696e68366778755052595939484361593944416f016300e1f505000000001976a91450c2ee67c90dc44c29a2e54a1e92ac7160cb3f6688accc058142170000001976a9144a246b936e26e373aff00fa17715e34e7572ec7d88ac2b000000", + "txid": "7f2b5f25b0ae24a417633e4214827f930a69802c1c43d1fb2ff7b7075b2d1701", + "size": 308, + "version": 1, + "locktime": 43, + "vin": [ + { + "txid": "5201b9fdd99e0b0279c98ac5229acc68bd2f49beeb2ea07184bc7a4823b3f017", + "vout": 29, + "scriptSig": { + "asm": "3045022100ab77008477930b172fe0e58373fad7fb951dba4985d3f15c09d8f6dd635f1fab02205b4a6143cc1111f7c27c72891b0f2d82b37a8048839d1c7705e88228a02a106b[ALL] 03a93081050d08f8d56b6acc4d13bd451b8fb912c9c4cda36895b0db6566dceccc", + "hex": "483045022100ab77008477930b172fe0e58373fad7fb951dba4985d3f15c09d8f6dd635f1fab02205b4a6143cc1111f7c27c72891b0f2d82b37a8048839d1c7705e88228a02a106b012103a93081050d08f8d56b6acc4d13bd451b8fb912c9c4cda36895b0db6566dceccc" + }, + "value": 1000.00000000, + "valueSat": 100000000000, + "address": "Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw", + "sequence": 4294967294 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "OP_RETURN 5869337351664d51737932437a4d5a54726e4b573648464770315671465468644c77 58794a4338786e664672484e634d696e68366778755052595939484361593944416f 99", + "hex": "6a225869337351664d51737932437a4d5a54726e4b573648464770315671465468644c772258794a4338786e664672484e634d696e68366778755052595939484361593944416f0163", + "type": "nulldata" + } + }, + { + "value": 1.00000000, + "valueSat": 100000000, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 50c2ee67c90dc44c29a2e54a1e92ac7160cb3f66 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91450c2ee67c90dc44c29a2e54a1e92ac7160cb3f6688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw" + ] + } + }, + { + "value": 998.99999692, + "valueSat": 99899999692, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 4a246b936e26e373aff00fa17715e34e7572ec7d OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9144a246b936e26e373aff00fa17715e34e7572ec7d88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XhSsTyDVQEuLmcqqvWYcaHiu2ekNjDeMQR" + ] + } + } + ], + "blockhash": "00000342ba8e453b8e758e70d7c84e42a678304b9480d35cb6307d1ba2f46042", + "height": 46, + "confirmations": 33915, + "time": 1520277648, + "blocktime": 1520277648 +} \ No newline at end of file diff --git a/server/test/resources/transactions/8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864 b/server/test/resources/transactions/8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864 new file mode 100644 index 0000000..0275f6f --- /dev/null +++ b/server/test/resources/transactions/8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864 @@ -0,0 +1,86 @@ +{ + "hex": "01000000014e289a36310fe66f0317211c5d7db5ce5adc69d8873a8f8cccdc67649110cf9e0100000000ffffffff04000000000000000000e0db3bcd170000001976a91450c2ee67c90dc44c29a2e54a1e92ac7160cb3f6688aca0525701000000001976a914f80246a42bb0d6de131282b4e1bef064f01a39f988ac80461c86000000001976a914fbac413c28d5220ffd49a43952f7680625de545d88ac00000000", + "txid": "8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864", + "size": 162, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e", + "vout": 1, + "scriptSig": { + "asm": "", + "hex": "" + }, + "value": 1000.00000000, + "valueSat": 100000000000, + "address": "Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 1022.27500000, + "valueSat": 102227500000, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 50c2ee67c90dc44c29a2e54a1e92ac7160cb3f66 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91450c2ee67c90dc44c29a2e54a1e92ac7160cb3f6688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw" + ] + }, + "spentTxId": "10d74101353252748645a91d570b8ba949e51853487e1060e1e2b66b6ba838d8", + "spentIndex": 59, + "spentHeight": 25035 + }, + { + "value": 0.22500000, + "valueSat": 22500000, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 f80246a42bb0d6de131282b4e1bef064f01a39f9 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914f80246a42bb0d6de131282b4e1bef064f01a39f988ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XyJC8xnfFrHNcMinh6gxuPRYY9HCaY9DAo" + ] + } + }, + { + "value": 22.50000000, + "valueSat": 2250000000, + "n": 3, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 fbac413c28d5220ffd49a43952f7680625de545d OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914fbac413c28d5220ffd49a43952f7680625de545d88ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XydZnssXHCxxRtB4rk7evfKT9XP7GqyA9N" + ] + }, + "spentTxId": "2e4193dd0330b2c392d0015fb2857bd708fad339a6e04cfac1980276cf6af75e", + "spentIndex": 206, + "spentHeight": 28754 + } + ], + "blockhash": "19f320185015d146237efe757852b21c5e08b88b2f4de9d3fa9517d8463e472b", + "height": 21888, + "confirmations": 12073, + "time": 1521716682, + "blocktime": 1521716682 +} \ No newline at end of file diff --git a/server/test/resources/transactions/9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1 b/server/test/resources/transactions/9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1 new file mode 100644 index 0000000..af5c0c5 --- /dev/null +++ b/server/test/resources/transactions/9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1 @@ -0,0 +1,89 @@ +{ + "hex": "01000000017765f90bc69fd9d222821ca30d0a121d7075f17005a72ef65cab4e005a590f0c010000006a47304402200a44383e48fe2df47423dad95b7dd8f17dd9facfb70c2d279a83418e5e0439eb02202c1863f54c752dcfcf7b1c74384f97a21bfc1e97fc66257a2c7d9d5c2851a2600121031810683b84cd1306250970702942d435a1a64ca75304830b55c73dea5340c20dffffffff04000000000000000000c8f9b9c4b60000001976a9145356fa18a159ac621882928d307a54474a53b0f388ac48b39d3eb60000001976a9145356fa18a159ac621882928d307a54474a53b0f388ac80461c86000000001976a9146055945235585a7cf8f8c1d9e513f531d61ab55588ac00000000", + "txid": "9165692aa53f0db6be61521daf8bece68e005396880376260872352db0c005c1", + "size": 268, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "0c0f595a004eab5cf62ea70570f175701d120a0da31c8222d2d99fc60bf96577", + "vout": 1, + "scriptSig": { + "asm": "304402200a44383e48fe2df47423dad95b7dd8f17dd9facfb70c2d279a83418e5e0439eb02202c1863f54c752dcfcf7b1c74384f97a21bfc1e97fc66257a2c7d9d5c2851a260[ALL] 031810683b84cd1306250970702942d435a1a64ca75304830b55c73dea5340c20d", + "hex": "47304402200a44383e48fe2df47423dad95b7dd8f17dd9facfb70c2d279a83418e5e0439eb02202c1863f54c752dcfcf7b1c74384f97a21bfc1e97fc66257a2c7d9d5c2851a2600121031810683b84cd1306250970702942d435a1a64ca75304830b55c73dea5340c20d" + }, + "value": 15654.69140625, + "valueSat": 1565469140625, + "address": "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 7849.84570312, + "valueSat": 784984570312, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 5356fa18a159ac621882928d307a54474a53b0f3 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9145356fa18a159ac621882928d307a54474a53b0f388ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3" + ] + }, + "spentTxId": "b08f9eeba01e5b50ceaeb436c3a08f9bcc1726fbf8306d9177f7739487d16b50", + "spentIndex": 0, + "spentHeight": 23391 + }, + { + "value": 7827.34570312, + "valueSat": 782734570312, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 5356fa18a159ac621882928d307a54474a53b0f3 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9145356fa18a159ac621882928d307a54474a53b0f388ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XiHW7SR56UPHeXKwcpeVsE4nUfkHv5RqE3" + ] + }, + "spentTxId": "4853304417ab040cce26f7be7fbbfc36b6e2c3ea40ca481c776ba9be8f2b7c46", + "spentIndex": 0, + "spentHeight": 23953 + }, + { + "value": 22.50000000, + "valueSat": 2250000000, + "n": 3, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 6055945235585a7cf8f8c1d9e513f531d61ab555 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a9146055945235585a7cf8f8c1d9e513f531d61ab55588ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XjUDDq221NwqRtp85wfvoDrMaaxvUCDRrY" + ] + }, + "spentTxId": "067db2757842b4bd1e1966de3c7c1f2f6ee09387e06699bfb0a075a8399a55fc", + "spentIndex": 0, + "spentHeight": 30867 + } + ], + "blockhash": "1ca318b7a26ed67ca7c8c9b5069d653ba224bf86989125d1dfbb0973b7d6a5e0", + "height": 23000, + "confirmations": 10976, + "time": 1521784448, + "blocktime": 1521784448 +} \ No newline at end of file diff --git a/server/test/resources/transactions/9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e b/server/test/resources/transactions/9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e new file mode 100644 index 0000000..ee2573f --- /dev/null +++ b/server/test/resources/transactions/9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e @@ -0,0 +1,83 @@ +{ + "hex": "01000000012fc5fa7c3c9e0edda402bfdc6c16040f8dd013c5c036f7b8d78f94f8c76014780100000000ffffffff0400000000000000000000e87648170000001976a91450c2ee67c90dc44c29a2e54a1e92ac7160cb3f6688ac00000000000000001976a914f80246a42bb0d6de131282b4e1bef064f01a39f988ac00000000000000001976a914f7fdf918bc701980aeaf07085654f5e289d2102388ac00000000", + "txid": "9ecf10916467dccc8c8f3a87d869dc5aceb57d5d1c2117036fe60f31369a284e", + "size": 162, + "version": 1, + "locktime": 0, + "vin": [ + { + "txid": "781460c7f8948fd7b8f736c0c513d08d0f04166cdcbf02a4dd0e9e3c7cfac52f", + "vout": 1, + "scriptSig": { + "asm": "", + "hex": "" + }, + "value": 1000.00000000, + "valueSat": 100000000000, + "address": "Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw", + "sequence": 4294967295 + } + ], + "vout": [ + { + "value": 0.00000000, + "valueSat": 0, + "n": 0, + "scriptPubKey": { + "asm": "", + "hex": "", + "type": "nonstandard" + } + }, + { + "value": 1000.00000000, + "valueSat": 100000000000, + "n": 1, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 50c2ee67c90dc44c29a2e54a1e92ac7160cb3f66 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a91450c2ee67c90dc44c29a2e54a1e92ac7160cb3f6688ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "Xi3sQfMQsy2CzMZTrnKW6HFGp1VqFThdLw" + ] + }, + "spentTxId": "8c7feafc18576b89bf87faf8aa89feaac1a3fad7d5da77d1fe773219a0e9d864", + "spentIndex": 0, + "spentHeight": 21888 + }, + { + "value": 0.00000000, + "valueSat": 0, + "n": 2, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 f80246a42bb0d6de131282b4e1bef064f01a39f9 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914f80246a42bb0d6de131282b4e1bef064f01a39f988ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XyJC8xnfFrHNcMinh6gxuPRYY9HCaY9DAo" + ] + } + }, + { + "value": 0.00000000, + "valueSat": 0, + "n": 3, + "scriptPubKey": { + "asm": "OP_DUP OP_HASH160 f7fdf918bc701980aeaf07085654f5e289d21023 OP_EQUALVERIFY OP_CHECKSIG", + "hex": "76a914f7fdf918bc701980aeaf07085654f5e289d2102388ac", + "reqSigs": 1, + "type": "pubkeyhash", + "addresses": [ + "XyJ6yzT3XNcX4npq15eyZJstW6RQ2bUKGA" + ] + } + } + ], + "blockhash": "0f5e8615bd871a20b4ebb63693aa81361d8bdb7c6913785a61cde90e3455e4d8", + "height": 19677, + "confirmations": 14285, + "time": 1521586596, + "blocktime": 1521586596 +} \ No newline at end of file