Pull over docs/ from #5713 (#5722)

This commit is contained in:
Chris Stewart 2024-10-18 13:11:12 -05:00 committed by GitHub
parent 9e61e9bab7
commit 613e19c281
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 12 additions and 12 deletions

View File

@ -132,14 +132,14 @@ val chainApi = new ChainQueryApi {
/** Gets the hash of the block that is what we consider "best" */
override def getBestBlockHash(): Future[DoubleSha256DigestBE] = {
bitcoind.getBestBlockHash
bitcoind.getBestBlockHash()
}
/** Gets number of confirmations for the given block hash */
override def getNumberOfConfirmations(
blockHash: DoubleSha256DigestBE): Future[Option[Int]] = {
for {
tip <- bitcoind.getBlockCount
tip <- bitcoind.getBlockCount()
block <- bitcoind.getBlock(blockHash)
} yield {
Some(tip - block.height + 1)
@ -150,7 +150,7 @@ val chainApi = new ChainQueryApi {
override def getFilterCount(): Future[Int] = {
// since bitcoind should have the filter for
// every block we can just return the block height
bitcoind.getBlockCount
bitcoind.getBlockCount()
}
/** Returns the block height of the given block stamp */

View File

@ -81,7 +81,7 @@ val syncedChainApiF = for {
val syncResultF = syncedChainApiF.flatMap { chainApi =>
chainApi.getBlockCount().map(count => println(s"chain api blockcount=${count}"))
rpcCli.getBlockCount.map(count => println(s"bitcoind blockcount=${count}"))
rpcCli.getBlockCount().map(count => println(s"bitcoind blockcount=${count}"))
}
syncResultF.onComplete { case result =>

View File

@ -674,7 +674,7 @@ object ConditionalSigner extends ConditionalSigner
We must now add the new signing functionality from the previous step to the general-purpose signing functions by adding a new `case` for your new `InputInfo` type in the `match` within `BitcoinSigner.sign`. In the case of `P2PKWithTimeout`, this looks like:
```scala mdoc:compile-only
spendingInfoToSatisfy match {
spendingInfoToSatisfy.inputInfo match {
//...
case p2pKWithTimeout: P2PKWithTimeoutInputInfo =>
P2PKWithTimeoutSigner.sign(spendingInfo,

View File

@ -50,7 +50,7 @@ val bitcoindRpcClientF = BitcoindRpcTestUtil.startedBitcoindRpcClient(Some(insta
//let's just grab the block count for an example
val blockCountF = for {
bitcoind <- bitcoindRpcClientF
count <- bitcoind.getBlockCount
count <- bitcoind.getBlockCount()
} yield {
//run a test against the block count
assert(count > 0, s"Block count was not more than zero!")

View File

@ -103,7 +103,7 @@ val bitcoindRpcClientF: Future[BitcoindRpcClient] = client.start()
//wait for bitcoind to get started
val bitcoind = Await.result(bitcoindRpcClientF, 10.seconds)
val getBestBlockHashFunc = () => bitcoind.getBestBlockHash
val getBestBlockHashFunc = () => bitcoind.getBestBlockHash()
val getBlockHeaderFunc = { (hash: DoubleSha256DigestBE) => bitcoind.getBlockHeaderRaw(hash) }

View File

@ -122,7 +122,7 @@ val bitcoind = BitcoindRpcClient(bitcoindInstance)
// peer
val syncF: Future[ChainApi] = configF.flatMap { _ =>
val getBestBlockHashFunc = { () =>
bitcoind.getBestBlockHash
bitcoind.getBestBlockHash()
}