mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-26 21:42:48 +01:00
Update scala-library to 2.13.12 (#5235)
* Update scala-library to 2.13.12 * Fix compiler errors on scala 2.13.12 --------- Co-authored-by: Chris Stewart <stewart.chris1234@gmail.com>
This commit is contained in:
parent
a0b273e6b3
commit
d7037ede28
30 changed files with 77 additions and 78 deletions
|
@ -31,7 +31,7 @@ class ScanBitcoind()(implicit
|
|||
val bitcoindF = rpcAppConfig.clientF
|
||||
|
||||
// val startHeight = 675000
|
||||
val endHeightF: Future[Int] = bitcoindF.flatMap(_.getBlockCount)
|
||||
val endHeightF: Future[Int] = bitcoindF.flatMap(_.getBlockCount())
|
||||
|
||||
val f = for {
|
||||
bitcoind <- bitcoindF
|
||||
|
|
|
@ -643,7 +643,7 @@ class BitcoinSServerMain(override val serverArgParser: ServerArgParser)(implicit
|
|||
AsyncUtil.retryUntilSatisfiedF(
|
||||
conditionF = { () =>
|
||||
for {
|
||||
bitcoindHeight <- bitcoind.getBlockCount
|
||||
bitcoindHeight <- bitcoind.getBlockCount()
|
||||
walletStateOpt <- wallet.getSyncDescriptorOpt()
|
||||
} yield walletStateOpt.forall(bitcoindHeight >= _.height)
|
||||
},
|
||||
|
|
|
@ -40,7 +40,7 @@ object BitcoindRpcBackendUtil extends Logging {
|
|||
|
||||
val streamF: Future[RunnableGraph[Future[NeutrinoHDWalletApi]]] = for {
|
||||
_ <- setSyncingFlag(true, bitcoind, chainCallbacksOpt)
|
||||
bitcoindHeight <- bitcoind.getBlockCount
|
||||
bitcoindHeight <- bitcoind.getBlockCount()
|
||||
walletStateOpt <- wallet.getSyncDescriptorOpt()
|
||||
|
||||
heightRange <- {
|
||||
|
@ -508,7 +508,7 @@ object BitcoindRpcBackendUtil extends Logging {
|
|||
logger.debug("Polling bitcoind for block count")
|
||||
|
||||
val resF: Future[Unit] = for {
|
||||
count <- bitcoind.getBlockCount
|
||||
count <- bitcoind.getBlockCount()
|
||||
retval <- {
|
||||
if (prevCount < count) {
|
||||
logger.info(
|
||||
|
|
|
@ -51,8 +51,8 @@ class TestRpcUtilTest extends BitcoindFixturesCachedPairV21 {
|
|||
_ = assert(tx.confirmations > 0)
|
||||
rawTx <- second.getRawTransaction(txid)
|
||||
_ = assert(rawTx.confirmations.exists(_ > 0))
|
||||
firstBlock <- first.getBestBlockHash
|
||||
secondBlock <- second.getBestBlockHash
|
||||
firstBlock <- first.getBestBlockHash()
|
||||
secondBlock <- second.getBestBlockHash()
|
||||
} yield assert(firstBlock == secondBlock)
|
||||
}
|
||||
|
||||
|
@ -62,12 +62,12 @@ class TestRpcUtilTest extends BitcoindFixturesCachedPairV21 {
|
|||
val NodePair(first, second) = nodes
|
||||
val allClients = nodes.toVector
|
||||
for {
|
||||
heightPreGeneration <- first.getBlockCount
|
||||
heightPreGeneration <- first.getBlockCount()
|
||||
_ <- BitcoindRpcTestUtil.generateAllAndSync(allClients,
|
||||
blocks = blocksToGenerate)
|
||||
firstHash <- first.getBestBlockHash
|
||||
secondHash <- second.getBestBlockHash
|
||||
heightPostGeneration <- first.getBlockCount
|
||||
firstHash <- first.getBestBlockHash()
|
||||
secondHash <- second.getBestBlockHash()
|
||||
heightPostGeneration <- first.getBlockCount()
|
||||
} yield {
|
||||
assert(firstHash == secondHash)
|
||||
assert(
|
||||
|
|
|
@ -31,7 +31,7 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
val client = nodePair.node1
|
||||
for {
|
||||
info <- client.getBlockChainInfo
|
||||
bestHash <- client.getBestBlockHash
|
||||
bestHash <- client.getBestBlockHash()
|
||||
} yield {
|
||||
assert(info.isInstanceOf[GetBlockChainInfoResultPostV23])
|
||||
val postV23 = info.asInstanceOf[GetBlockChainInfoResultPostV23]
|
||||
|
@ -52,8 +52,8 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
mostRecentBlock <- client.getBlock(blocks.head)
|
||||
_ <- client.invalidateBlock(blocks.head)
|
||||
mempool <- client.getRawMemPool
|
||||
count1 <- client.getBlockCount
|
||||
count2 <- otherClient.getBlockCount
|
||||
count1 <- client.getBlockCount()
|
||||
count2 <- otherClient.getBlockCount()
|
||||
|
||||
_ <- client.generate(
|
||||
2
|
||||
|
@ -69,7 +69,7 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
val client = nodePair.node1
|
||||
for {
|
||||
blocks <- client.generate(2)
|
||||
count <- client.getBlockCount
|
||||
count <- client.getBlockCount()
|
||||
hash <- client.getBlockHash(count)
|
||||
prevhash <- client.getBlockHash(count - 1)
|
||||
} yield {
|
||||
|
@ -96,7 +96,7 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
val client = nodePair.node1
|
||||
for {
|
||||
result <- client.rescanBlockChain()
|
||||
count <- client.getBlockCount
|
||||
count <- client.getBlockCount()
|
||||
} yield {
|
||||
assert(result.start_height == 0)
|
||||
assert(count == result.stop_height)
|
||||
|
@ -142,7 +142,7 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
for {
|
||||
block <- BitcoindRpcTestUtil.getFirstBlock(client)
|
||||
tx <- client.getTransaction(block.tx.head.txid)
|
||||
count <- client.getBlockCount
|
||||
count <- client.getBlockCount()
|
||||
} yield {
|
||||
assert(tx.txid == block.tx.head.txid)
|
||||
assert(tx.amount == Bitcoins(50))
|
||||
|
@ -176,7 +176,7 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
it should "be able to get the best block hash" in { nodePair =>
|
||||
val client = nodePair.node1
|
||||
for {
|
||||
_ <- client.getBestBlockHash
|
||||
_ <- client.getBestBlockHash()
|
||||
} yield succeed
|
||||
}
|
||||
|
||||
|
@ -203,8 +203,8 @@ class BlockchainRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
val client = nodePair.node1
|
||||
for {
|
||||
info <- client.getTxOutSetInfo
|
||||
count <- client.getBlockCount
|
||||
hash <- client.getBestBlockHash
|
||||
count <- client.getBlockCount()
|
||||
hash <- client.getBestBlockHash()
|
||||
} yield {
|
||||
assert(info.height == count)
|
||||
assert(info.bestblock == hash)
|
||||
|
|
|
@ -183,12 +183,12 @@ class P2PRpcTest extends BitcoindRpcTest {
|
|||
BitcoindRpcTestUtil.createUnconnectedNodePair(clientAccum = clientAccum)
|
||||
hash <- client2.generate(1)
|
||||
block <- client2.getBlockRaw(hash.head)
|
||||
preCount1 <- client1.getBlockCount
|
||||
preCount2 <- client2.getBlockCount
|
||||
preCount1 <- client1.getBlockCount()
|
||||
preCount2 <- client2.getBlockCount()
|
||||
_ <- client1.submitBlock(block)
|
||||
|
||||
postCount1 <- client1.getBlockCount
|
||||
postCount2 <- client2.getBlockCount
|
||||
postCount1 <- client1.getBlockCount()
|
||||
postCount2 <- client2.getBlockCount()
|
||||
hash1 <- client1.getBlockHash(postCount1)
|
||||
hash2 <- client2.getBlockHash(postCount2)
|
||||
} yield {
|
||||
|
|
|
@ -21,9 +21,9 @@ class PreciousBlockRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
freshClient.generate(1)
|
||||
blocks2 <- otherFreshClient.generate(1)
|
||||
|
||||
bestHash1 <- freshClient.getBestBlockHash
|
||||
bestHash1 <- freshClient.getBestBlockHash()
|
||||
_ = assert(bestHash1 == blocks1.head)
|
||||
bestHash2 <- otherFreshClient.getBestBlockHash
|
||||
bestHash2 <- otherFreshClient.getBestBlockHash()
|
||||
_ = assert(bestHash2 == blocks2.head)
|
||||
|
||||
_ <-
|
||||
|
@ -33,7 +33,7 @@ class PreciousBlockRpcTest extends BitcoindFixturesCachedPairNewest {
|
|||
BitcoindRpcTestUtil.hasSeenBlock(otherFreshClient, bestHash1))
|
||||
|
||||
_ <- otherFreshClient.preciousBlock(bestHash1)
|
||||
newBestHash <- otherFreshClient.getBestBlockHash
|
||||
newBestHash <- otherFreshClient.getBestBlockHash()
|
||||
|
||||
} yield assert(newBestHash == bestHash1)
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ class UTXORpcTest extends BitcoindRpcTest {
|
|||
it should "correctly dump tx out set" in {
|
||||
for {
|
||||
client <- clientF
|
||||
hash <- client.getBestBlockHash
|
||||
hash <- client.getBestBlockHash()
|
||||
height <- client.getBestHashBlockHeight()
|
||||
result <- client.dumpTxOutSet(new File("utxo.dat").toPath)
|
||||
} yield {
|
||||
|
|
|
@ -112,7 +112,7 @@ class BitcoindV21RpcClientTest extends BitcoindFixturesFundedCachedV21 {
|
|||
client: BitcoindV21RpcClient =>
|
||||
for {
|
||||
info <- client.getBlockChainInfo
|
||||
bestHash <- client.getBestBlockHash
|
||||
bestHash <- client.getBestBlockHash()
|
||||
} yield {
|
||||
assert(info.isInstanceOf[GetBlockChainInfoResultPostV19])
|
||||
val preV19Info = info.asInstanceOf[GetBlockChainInfoResultPostV19]
|
||||
|
@ -186,7 +186,7 @@ class BitcoindV21RpcClientTest extends BitcoindFixturesFundedCachedV21 {
|
|||
|
||||
it should "correctly dump tx out set" in { client: BitcoindV21RpcClient =>
|
||||
for {
|
||||
hash <- client.getBestBlockHash
|
||||
hash <- client.getBestBlockHash()
|
||||
height <- client.getBestHashBlockHeight()
|
||||
result <- client.dumpTxOutSet(new File("utxo.dat").toPath)
|
||||
} yield {
|
||||
|
|
|
@ -216,7 +216,7 @@ class BitcoindRpcClient(override val instance: BitcoindInstance)(implicit
|
|||
|
||||
override def getBestBlockHeader(): Future[BlockHeaderDb] =
|
||||
for {
|
||||
hash <- getBestBlockHash
|
||||
hash <- getBestBlockHash()
|
||||
header <- getBlockHeader(hash)
|
||||
} yield header.blockHeaderDb
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import scala.concurrent.Future
|
|||
*/
|
||||
trait BlockchainRpc { self: Client =>
|
||||
|
||||
def getBestBlockHash: Future[DoubleSha256DigestBE] = {
|
||||
def getBestBlockHash(): Future[DoubleSha256DigestBE] = {
|
||||
bitcoindCall[DoubleSha256DigestBE]("getbestblockhash")
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ trait BlockchainRpc { self: Client =>
|
|||
}
|
||||
}
|
||||
|
||||
def getBlockCount: Future[Int] = {
|
||||
def getBlockCount(): Future[Int] = {
|
||||
bitcoindCall[Int]("getblockcount")
|
||||
}
|
||||
|
||||
|
|
|
@ -58,9 +58,9 @@ class BitcoindV21RpcClient(override val instance: BitcoindInstance)(implicit
|
|||
batchSize = FutureUtil.getParallelism)
|
||||
}
|
||||
|
||||
override def getFilterCount(): Future[Int] = getBlockCount
|
||||
override def getFilterCount(): Future[Int] = getBlockCount()
|
||||
|
||||
override def getFilterHeaderCount(): Future[Int] = getBlockCount
|
||||
override def getFilterHeaderCount(): Future[Int] = getBlockCount()
|
||||
|
||||
override def getFilter(
|
||||
hash: DoubleSha256DigestBE): Future[Option[CompactFilterDb]] = {
|
||||
|
|
|
@ -22,7 +22,7 @@ class BitcoindChainHandlerViaZmqTest extends ChainDbUnitTest {
|
|||
|
||||
val chainHandler = bitcoindChainHandler.chainHandler
|
||||
|
||||
val bitcoindBlockCountF = bitcoind.getBlockCount
|
||||
val bitcoindBlockCountF = bitcoind.getBlockCount()
|
||||
for {
|
||||
bitcoinSBlockCount <-
|
||||
chainHandler
|
||||
|
|
|
@ -36,7 +36,7 @@ class ChainSyncTest extends ChainWithBitcoindNewestCachedUnitTest {
|
|||
for {
|
||||
chainHandler <- newChainHandlerF
|
||||
count <- chainHandler.getBlockCount()
|
||||
bitcoindCount <- bitcoind.getBlockCount
|
||||
bitcoindCount <- bitcoind.getBlockCount()
|
||||
} yield {
|
||||
assert(bitcoindCount == count)
|
||||
}
|
||||
|
@ -48,7 +48,7 @@ class ChainSyncTest extends ChainWithBitcoindNewestCachedUnitTest {
|
|||
val chainHandler = bitcoindWithChainHandler.chainHandler
|
||||
//first we need to implement the 'getBestBlockHashFunc' and 'getBlockHeaderFunc' functions
|
||||
val getBestBlockHashFunc = { () =>
|
||||
bitcoind.getBestBlockHash
|
||||
bitcoind.getBestBlockHash()
|
||||
}
|
||||
|
||||
val getBlockHeaderFunc = { hash: DoubleSha256DigestBE =>
|
||||
|
@ -69,7 +69,7 @@ class ChainSyncTest extends ChainWithBitcoindNewestCachedUnitTest {
|
|||
getBlockHeaderFunc = getBlockHeaderFunc,
|
||||
getBestBlockHashFunc = getBestBlockHashFunc)
|
||||
bitcoinSCount <- newChainHandler2.getBlockCount()
|
||||
bitcoindCount <- bitcoind.getBlockCount
|
||||
bitcoindCount <- bitcoind.getBlockCount()
|
||||
} yield assert(bitcoinSCount == bitcoindCount)
|
||||
|
||||
newChainHandler2F
|
||||
|
@ -100,8 +100,8 @@ class ChainSyncTest extends ChainWithBitcoindNewestCachedUnitTest {
|
|||
chainApiSync1 <- sync1F
|
||||
count <- chainApiSync1.getBlockCount()
|
||||
bestHash <- chainApiSync1.getBestBlockHash()
|
||||
bitcoindBlockCount <- bitcoind.getBlockCount
|
||||
bitcoindBestBlockHash <- bitcoind.getBestBlockHash
|
||||
bitcoindBlockCount <- bitcoind.getBlockCount()
|
||||
bitcoindBestBlockHash <- bitcoind.getBestBlockHash()
|
||||
} yield {
|
||||
assert(count == bitcoindBlockCount)
|
||||
assert(bestHash == bitcoindBestBlockHash)
|
||||
|
@ -119,8 +119,8 @@ class ChainSyncTest extends ChainWithBitcoindNewestCachedUnitTest {
|
|||
count <- chainApiSync2.getBlockCount()
|
||||
_ <- generate1F
|
||||
bestHash <- chainApiSync2.getBestBlockHash()
|
||||
bitcoindBlockCount <- bitcoind.getBlockCount
|
||||
bitcoindBestBlockHash <- bitcoind.getBestBlockHash
|
||||
bitcoindBlockCount <- bitcoind.getBlockCount()
|
||||
bitcoindBestBlockHash <- bitcoind.getBestBlockHash()
|
||||
} yield {
|
||||
assert(count == bitcoindBlockCount)
|
||||
assert(bestHash == bitcoindBestBlockHash)
|
||||
|
|
|
@ -217,7 +217,7 @@ class DLCClientIntegrationTest extends BitcoindRpcTest with DLCTest {
|
|||
remoteFundingUtxos <- remoteFundingUtxosF
|
||||
feeRate <- feeRateF
|
||||
client <- clientF
|
||||
currentHeight <- client.getBlockCount
|
||||
currentHeight <- client.getBlockCount()
|
||||
} yield {
|
||||
val tomorrowInBlocks = BlockHeight(currentHeight + 144)
|
||||
val twoDaysInBlocks = BlockHeight(currentHeight + 288)
|
||||
|
|
|
@ -164,7 +164,7 @@ class EsploraClient(site: EsploraSite, proxyParams: Option[Socks5ProxyParams])(
|
|||
val url = baseUrl + s"/blocks/tip/height"
|
||||
val request = HttpRequest(uri = url, method = HttpMethods.GET)
|
||||
|
||||
sendRequest(request).map(_.toInt)(ec)
|
||||
sendRequest(request).map(_.toInt)(_ec)
|
||||
}
|
||||
|
||||
override def getBestBlockHash(): Future[DoubleSha256DigestBE] = {
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
import sbt.Keys.excludeLintKeys
|
||||
|
||||
|
||||
import scala.util.Properties
|
||||
|
||||
val scala2_13 = "2.13.11"
|
||||
val scala2_13 = "2.13.12"
|
||||
|
||||
ThisBuild / scalafmtOnCompile := !Properties.envOrNone("CI").contains("true")
|
||||
|
||||
|
|
|
@ -301,7 +301,7 @@ class LndRpcClientPairTest extends DualLndFixture with LndUtils {
|
|||
|
||||
tx <- lndA.sendOutputs(Vector(output), feeRate, spendUnconfirmed = false)
|
||||
_ <- lndA.publishTransaction(tx)
|
||||
height <- bitcoind.getBlockCount
|
||||
height <- bitcoind.getBlockCount()
|
||||
confirmedF = lndB.subscribeTxConfirmation(txId = tx.txId,
|
||||
script = addr.scriptPubKey,
|
||||
requiredConfs = 6,
|
||||
|
|
|
@ -364,7 +364,7 @@ class NeutrinoNodeTest extends NodeTestWithCachedBitcoindPair {
|
|||
val node = nodeConnectedWithBitcoind.node
|
||||
val bitcoinds = nodeConnectedWithBitcoind.bitcoinds
|
||||
val bitcoind0 = bitcoinds(0)
|
||||
val blockCountF = bitcoind0.getBlockCount
|
||||
val blockCountF = bitcoind0.getBlockCount()
|
||||
for {
|
||||
blockCount <- blockCountF
|
||||
_ <- AsyncUtil.retryUntilSatisfiedF(() => {
|
||||
|
|
|
@ -193,7 +193,7 @@ class NeutrinoNodeWithWalletTest extends NodeTestWithCachedBitcoindNewest {
|
|||
_ <-
|
||||
bitcoind.getNewAddress
|
||||
.flatMap(bitcoind.generateToAddress(1, _))
|
||||
bitcoindHeight <- bitcoind.getBlockCount
|
||||
bitcoindHeight <- bitcoind.getBlockCount()
|
||||
_ <- NodeTestUtil.awaitSync(node, bitcoind)
|
||||
_ <- AsyncUtil.retryUntilSatisfiedF(() => {
|
||||
// wait until the block is processed by the wallet
|
||||
|
|
|
@ -672,7 +672,7 @@ object ChainUnitTest extends ChainVerificationLogger {
|
|||
//sync headers
|
||||
//first we need to implement the 'getBestBlockHashFunc' and 'getBlockHeaderFunc' functions
|
||||
val getBestBlockHashFunc = { () =>
|
||||
bitcoind.getBestBlockHash
|
||||
bitcoind.getBestBlockHash()
|
||||
}
|
||||
|
||||
val getBlockHeaderFunc = { hash: DoubleSha256DigestBE =>
|
||||
|
|
|
@ -35,7 +35,7 @@ abstract class SyncUtil extends Logging {
|
|||
/** Creates a function that will retrun bitcoin's best block hash when called */
|
||||
def getBestBlockHashFunc(
|
||||
bitcoind: BitcoindRpcClient): () => Future[DoubleSha256DigestBE] = { () =>
|
||||
bitcoind.getBestBlockHash
|
||||
bitcoind.getBestBlockHash()
|
||||
}
|
||||
|
||||
/** Creates a function that you can pass a hash to and it returns the block header */
|
||||
|
@ -241,7 +241,7 @@ abstract class SyncUtil extends Logging {
|
|||
for {
|
||||
chainApi <- chainApiF
|
||||
filterSyncChainApi <- FilterSync.syncFilters(chainApi, getFilter)
|
||||
bestBlockHash <- bitcoindV19.getBestBlockHash
|
||||
bestBlockHash <- bitcoindV19.getBestBlockHash()
|
||||
ourBestFilter <- chainApi.getBestFilterHeader()
|
||||
_ = require(
|
||||
bestBlockHash == ourBestFilter.get.blockHashBE,
|
||||
|
|
|
@ -127,7 +127,7 @@ trait CLightningRpcTestUtil extends Logging {
|
|||
bitcoind: BitcoindRpcClient)(implicit
|
||||
ec: ExecutionContext): Future[Boolean] =
|
||||
for {
|
||||
blockCount <- bitcoind.getBlockCount
|
||||
blockCount <- bitcoind.getBlockCount()
|
||||
info <- client.getInfo
|
||||
} yield info.blockheight == blockCount
|
||||
|
||||
|
@ -214,7 +214,7 @@ trait CLightningRpcTestUtil extends Logging {
|
|||
|
||||
def isSynced: Future[Boolean] = for {
|
||||
(client, otherClient) <- clientsF
|
||||
height <- bitcoind.getBlockCount
|
||||
height <- bitcoind.getBlockCount()
|
||||
|
||||
infoA <- client.getInfo
|
||||
infoB <- otherClient.getInfo
|
||||
|
|
|
@ -714,7 +714,7 @@ trait EclairRpcTestUtil extends Logging {
|
|||
bitcoind: BitcoindRpcClient)(implicit
|
||||
ec: ExecutionContext): Future[Boolean] =
|
||||
for {
|
||||
blockCount <- bitcoind.getBlockCount
|
||||
blockCount <- bitcoind.getBlockCount()
|
||||
info <- client.getInfo
|
||||
} yield info.blockHeight == blockCount
|
||||
|
||||
|
|
|
@ -147,7 +147,7 @@ trait LndRpcTestUtil extends Logging {
|
|||
private def clientInSync(client: LndRpcClient, bitcoind: BitcoindRpcClient)(
|
||||
implicit ec: ExecutionContext): Future[Boolean] =
|
||||
for {
|
||||
blockCount <- bitcoind.getBlockCount
|
||||
blockCount <- bitcoind.getBlockCount()
|
||||
info <- client.getInfo
|
||||
} yield info.blockHeight == UInt32(blockCount)
|
||||
|
||||
|
|
|
@ -69,7 +69,7 @@ abstract class NodeTestUtil extends P2PLogger {
|
|||
/** Checks if the given node and bitcoind is synced */
|
||||
def isSameBestHash(node: Node, rpc: BitcoindRpcClient)(implicit
|
||||
ec: ExecutionContext): Future[Boolean] = {
|
||||
val hashF = rpc.getBestBlockHash
|
||||
val hashF = rpc.getBestBlockHash()
|
||||
for {
|
||||
chainApi <- node.chainApiFromDb()
|
||||
bestHash <- chainApi.getBestBlockHash()
|
||||
|
@ -81,7 +81,7 @@ abstract class NodeTestUtil extends P2PLogger {
|
|||
|
||||
def isSameBestFilterHeight(node: NeutrinoNode, rpc: BitcoindRpcClient)(
|
||||
implicit ec: ExecutionContext): Future[Boolean] = {
|
||||
val rpcCountF = rpc.getBlockCount
|
||||
val rpcCountF = rpc.getBlockCount()
|
||||
for {
|
||||
chainApi <- node.chainApiFromDb()
|
||||
filterCount <- chainApi.getFilterCount()
|
||||
|
@ -93,7 +93,7 @@ abstract class NodeTestUtil extends P2PLogger {
|
|||
|
||||
def isSameBestFilterHeaderHeight(node: NeutrinoNode, rpc: BitcoindRpcClient)(
|
||||
implicit ec: ExecutionContext): Future[Boolean] = {
|
||||
val rpcCountF = rpc.getBlockCount
|
||||
val rpcCountF = rpc.getBlockCount()
|
||||
for {
|
||||
chainApi <- node.chainApiFromDb()
|
||||
filterHeaderCount <- chainApi.getFilterHeaderCount()
|
||||
|
@ -108,7 +108,7 @@ abstract class NodeTestUtil extends P2PLogger {
|
|||
*/
|
||||
def isSameBlockCount(node: Node, rpc: BitcoindRpcClient)(implicit
|
||||
ec: ExecutionContext): Future[Boolean] = {
|
||||
val rpcCountF = rpc.getBlockCount
|
||||
val rpcCountF = rpc.getBlockCount()
|
||||
for {
|
||||
chainApi <- node.chainApiFromDb()
|
||||
count <- chainApi.getBlockCount()
|
||||
|
@ -154,7 +154,7 @@ abstract class NodeTestUtil extends P2PLogger {
|
|||
node.chainApiFromDb().flatMap(_.getBestBlockHash())
|
||||
}
|
||||
def bestBitcoindHashF: Future[DoubleSha256DigestBE] =
|
||||
bitcoind.getBestBlockHash
|
||||
bitcoind.getBestBlockHash()
|
||||
|
||||
TestAsyncUtil.retryUntilSatisfiedF(
|
||||
() => {
|
||||
|
|
|
@ -486,8 +486,8 @@ trait BitcoindRpcTestUtil extends Logging {
|
|||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
def isSynced(): Future[Boolean] = {
|
||||
client1.getBestBlockHash.flatMap { hash1 =>
|
||||
client2.getBestBlockHash.map { hash2 =>
|
||||
client1.getBestBlockHash().flatMap { hash1 =>
|
||||
client2.getBestBlockHash().map { hash2 =>
|
||||
hash1 == hash2
|
||||
}
|
||||
}
|
||||
|
@ -506,8 +506,8 @@ trait BitcoindRpcTestUtil extends Logging {
|
|||
import system.dispatcher
|
||||
|
||||
def isSameBlockHeight(): Future[Boolean] = {
|
||||
client1.getBlockCount.flatMap { count1 =>
|
||||
client2.getBlockCount.map { count2 =>
|
||||
client1.getBlockCount().flatMap { count1 =>
|
||||
client2.getBlockCount().map { count2 =>
|
||||
count1 == count2
|
||||
}
|
||||
}
|
||||
|
@ -905,7 +905,7 @@ trait BitcoindRpcTestUtil extends Logging {
|
|||
addressForMining: BitcoinAddress)(implicit
|
||||
ec: ExecutionContext): Future[Unit] = {
|
||||
for {
|
||||
currentCount <- client.getBlockCount
|
||||
currentCount <- client.getBlockCount()
|
||||
blocksToMine = blockHeight - currentCount
|
||||
_ <- client.generateToAddress(blocks = blocksToMine, addressForMining)
|
||||
} yield ()
|
||||
|
@ -1023,7 +1023,7 @@ trait BitcoindRpcTestUtil extends Logging {
|
|||
}
|
||||
|
||||
def areBlocksGenerated(): Future[Boolean] = {
|
||||
rpc.getBlockCount.map { count =>
|
||||
rpc.getBlockCount().map { count =>
|
||||
count >= blocksToGenerate
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,8 +61,8 @@ class BitcoindBackendTest extends WalletAppConfigWithBitcoindNewestFixtures {
|
|||
|
||||
balance <- wallet.getBalance()
|
||||
|
||||
height <- bitcoind.getBlockCount
|
||||
bestHash <- bitcoind.getBestBlockHash
|
||||
height <- bitcoind.getBlockCount()
|
||||
bestHash <- bitcoind.getBestBlockHash()
|
||||
syncHeightOpt <- wallet.getSyncDescriptorOpt()
|
||||
} yield {
|
||||
assert(balance == amountToSend)
|
||||
|
|
|
@ -51,8 +51,8 @@ class ProcessBlockTest extends BitcoinSWalletTestCachedBitcoindNewest {
|
|||
|
||||
_ <- wallet.processBlock(block)
|
||||
utxos <- wallet.listUtxos()
|
||||
height <- bitcoind.getBlockCount
|
||||
bestHash <- bitcoind.getBestBlockHash
|
||||
height <- bitcoind.getBlockCount()
|
||||
bestHash <- bitcoind.getBestBlockHash()
|
||||
syncHeightOpt <- wallet.getSyncDescriptorOpt()
|
||||
txDbOpt <- wallet.findByTxId(txId)
|
||||
} yield {
|
||||
|
@ -82,8 +82,8 @@ class ProcessBlockTest extends BitcoinSWalletTestCachedBitcoindNewest {
|
|||
confirmedUtxos <- wallet.listUtxos(TxoState.ConfirmedReceived)
|
||||
balance <- wallet.getConfirmedBalance()
|
||||
|
||||
height <- bitcoind.getBlockCount
|
||||
bestHash <- bitcoind.getBestBlockHash
|
||||
height <- bitcoind.getBlockCount()
|
||||
bestHash <- bitcoind.getBestBlockHash()
|
||||
syncHeightOpt <- wallet.getSyncDescriptorOpt()
|
||||
} yield {
|
||||
assert(syncHeightOpt.isDefined)
|
||||
|
@ -116,8 +116,8 @@ class ProcessBlockTest extends BitcoinSWalletTestCachedBitcoindNewest {
|
|||
confirmedUtxos <- wallet.listUtxos(TxoState.ConfirmedReceived)
|
||||
balance <- wallet.getConfirmedBalance()
|
||||
|
||||
height <- bitcoind.getBlockCount
|
||||
bestHash <- bitcoind.getBestBlockHash
|
||||
height <- bitcoind.getBlockCount()
|
||||
bestHash <- bitcoind.getBestBlockHash()
|
||||
syncHeightOpt <- wallet.getSyncDescriptorOpt()
|
||||
} yield {
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ class UTXOLifeCycleTest
|
|||
_ = assert(newTransactions.map(_.transaction).contains(tx))
|
||||
|
||||
// Give tx a fake hash so it can appear as it's in a block
|
||||
hash <- bitcoind.getBestBlockHash
|
||||
hash <- bitcoind.getBestBlockHash()
|
||||
_ <- wallet.processTransaction(tx, Some(hash))
|
||||
|
||||
_ <- wallet.updateUtxoPendingStates()
|
||||
|
@ -322,7 +322,7 @@ class UTXOLifeCycleTest
|
|||
_ = assert(newTransactions.map(_.transaction).contains(tx))
|
||||
|
||||
// Give tx a fake hash so it can appear as it's in a block
|
||||
hash <- bitcoind.getBestBlockHash
|
||||
hash <- bitcoind.getBestBlockHash()
|
||||
_ <- wallet.processTransaction(tx, Some(hash))
|
||||
|
||||
_ <- wallet.updateUtxoPendingStates()
|
||||
|
@ -424,7 +424,7 @@ class UTXOLifeCycleTest
|
|||
oldTransactions <- wallet.listTransactions()
|
||||
addr <- wallet.getNewAddress()
|
||||
|
||||
blockHash <- bitcoind.getBestBlockHash
|
||||
blockHash <- bitcoind.getBestBlockHash()
|
||||
|
||||
txId <- bitcoind.sendToAddress(addr, Satoshis(3000))
|
||||
tx <- bitcoind.getRawTransactionRaw(txId)
|
||||
|
|
Loading…
Add table
Reference in a new issue