mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2024-11-19 01:40:55 +01:00
2024 10 13 rm bitcoind v25 support (#5707)
* Remove support for bitcoind v25 * Remove bitcoind-rpc.sbt support for v25
This commit is contained in:
parent
38f0f4d692
commit
f85953e527
@ -23,7 +23,7 @@ TaskKeys.downloadBitcoind := {
|
||||
}
|
||||
|
||||
val versions =
|
||||
List("28.0", "27.1", "26.1", "25.2")
|
||||
List("28.0", "27.1", "26.1")
|
||||
|
||||
logger.debug(
|
||||
s"(Maybe) downloading Bitcoin Core binaries for versions: ${versions.mkString(",")}")
|
||||
@ -94,17 +94,12 @@ TaskKeys.downloadBitcoind := {
|
||||
val expectedHash =
|
||||
if (Properties.isLinux)
|
||||
Map(
|
||||
"25.2" -> "8d8c387e597e0edfc256f0bbace1dac3ad1ebf4a3c06da3e2975fda333817dea",
|
||||
"26.1" -> "a5b7d206384a8100058d3f2e2f02123a8e49e83f523499e70e86e121a4897d5b",
|
||||
"27.1" -> "c9840607d230d65f6938b81deaec0b98fe9cb14c3a41a5b13b2c05d044a48422",
|
||||
"28.0" -> "7fe294b02b25b51acb8e8e0a0eb5af6bbafa7cd0c5b0e5fcbb61263104a82fbc"
|
||||
)
|
||||
else if (Properties.isMac)
|
||||
Map(
|
||||
"25.2" -> (if (System.getProperty("os.arch") == "aarch64")
|
||||
"f55b394eebaa11d4b717d68aad9f75b824aaf3a7841dac7c26b1ef3d6d2915f5"
|
||||
else
|
||||
"e06ba379f6039ca99bc32d3e7974d420a31363498936f88aac7bab6f239de0f5"),
|
||||
"26.1" -> (if (System.getProperty("os.arch") == "aarch64")
|
||||
"8a8e415763b7ffd5988153cf03967d812eca629016dd3b0ddf6da3ab6f4a3621"
|
||||
else
|
||||
@ -120,7 +115,6 @@ TaskKeys.downloadBitcoind := {
|
||||
)
|
||||
else if (Properties.isWin)
|
||||
Map(
|
||||
"25.2" -> "c2ac84f55ee879caefd4414868d318a741c52a7286da190bf7233d86a2ffca69",
|
||||
"26.1" -> "7bd0849e47472aeff99a0ea2c0cefd98f5be829e5a2d3b0168b5a54456cc638a",
|
||||
"27.1" -> "9719871a2c9a45c741e33d670d2319dcd3f8f52a6059e9c435a9a2841188b932",
|
||||
"28.0" -> "85282f4ec1bcb0cfe8db0f195e8e0f6fb77cfbe89242a81fff2bc2e9292f7acf"
|
||||
|
@ -22,7 +22,6 @@ import org.bitcoins.core.wallet.fee.FeeUnit
|
||||
import org.bitcoins.crypto.{DoubleSha256DigestBE, StringFactory}
|
||||
import org.bitcoins.rpc.client.v18.V18AssortedRpc
|
||||
import org.bitcoins.rpc.client.v20.V20MultisigRpc
|
||||
import org.bitcoins.rpc.client.v25.BitcoindV25RpcClient
|
||||
import org.bitcoins.rpc.client.v26.BitcoindV26RpcClient
|
||||
import org.bitcoins.rpc.client.v27.BitcoindV27RpcClient
|
||||
import org.bitcoins.rpc.client.v28.BitcoindV28RpcClient
|
||||
@ -353,7 +352,6 @@ object BitcoindRpcClient {
|
||||
implicit system: ActorSystem
|
||||
): BitcoindRpcClient = {
|
||||
val bitcoind = version match {
|
||||
case BitcoindVersion.V25 => BitcoindV25RpcClient(instance)
|
||||
case BitcoindVersion.V26 => BitcoindV26RpcClient(instance)
|
||||
case BitcoindVersion.V27 => BitcoindV27RpcClient(instance)
|
||||
case BitcoindVersion.V28 => BitcoindV28RpcClient(instance)
|
||||
@ -374,7 +372,6 @@ object BitcoindRpcClient {
|
||||
bitcoindRpcAppConfig: BitcoindRpcAppConfig
|
||||
): BitcoindRpcClient = {
|
||||
val bitcoind = version match {
|
||||
case BitcoindVersion.V25 => new BitcoindV25RpcClient(instance)
|
||||
case BitcoindVersion.V26 => new BitcoindV26RpcClient(instance)
|
||||
case BitcoindVersion.V27 => new BitcoindV27RpcClient(instance)
|
||||
case BitcoindVersion.V28 => new BitcoindV28RpcClient(instance)
|
||||
@ -397,14 +394,10 @@ object BitcoindVersion
|
||||
val newest: BitcoindVersion = V28
|
||||
|
||||
val standard: Vector[BitcoindVersion] =
|
||||
Vector(V28, V27, V26, V25)
|
||||
Vector(V28, V27, V26)
|
||||
|
||||
val known: Vector[BitcoindVersion] = standard
|
||||
|
||||
case object V25 extends BitcoindVersion {
|
||||
override def toString: String = "v25.2"
|
||||
}
|
||||
|
||||
case object V26 extends BitcoindVersion {
|
||||
override def toString: String = "v26.1"
|
||||
}
|
||||
@ -435,7 +428,6 @@ object BitcoindVersion
|
||||
def fromNetworkVersion(int: Int): BitcoindVersion = {
|
||||
// need to translate the int 210100 (as an example) to a BitcoindVersion
|
||||
int.toString.substring(0, 2) match {
|
||||
case "25" => V25
|
||||
case "26" => V26
|
||||
case "27" => V27
|
||||
case "28" => V28
|
||||
|
@ -14,13 +14,7 @@ import org.bitcoins.core.gcs.{BlockFilter, FilterHeader, FilterType}
|
||||
import org.bitcoins.core.protocol.blockchain.{Block, BlockHeader}
|
||||
import org.bitcoins.core.util.FutureUtil
|
||||
import org.bitcoins.crypto.{DoubleSha256Digest, DoubleSha256DigestBE}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{
|
||||
Unknown,
|
||||
V25,
|
||||
V26,
|
||||
V27,
|
||||
V28
|
||||
}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{Unknown, V26, V27, V28}
|
||||
import play.api.libs.json.*
|
||||
|
||||
import scala.concurrent.Future
|
||||
@ -47,7 +41,7 @@ trait BlockchainRpc extends ChainApi { self: Client =>
|
||||
|
||||
def getBlockChainInfo: Future[GetBlockChainInfoResult] = {
|
||||
self.version.flatMap {
|
||||
case V25 | V26 | V27 | Unknown =>
|
||||
case V26 | V27 | Unknown =>
|
||||
bitcoindCall[GetBlockChainInfoResultPostV23]("getblockchaininfo")
|
||||
case V28 =>
|
||||
bitcoindCall[GetBlockChainInfoResultPostV27]("getblockchaininfo")
|
||||
|
@ -15,13 +15,7 @@ import org.bitcoins.core.currency.Satoshis
|
||||
import org.bitcoins.core.protocol.BitcoinAddress
|
||||
import org.bitcoins.core.protocol.transaction.Transaction
|
||||
import org.bitcoins.crypto.{DoubleSha256Digest, DoubleSha256DigestBE}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{
|
||||
Unknown,
|
||||
V25,
|
||||
V26,
|
||||
V27,
|
||||
V28
|
||||
}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{Unknown, V26, V27, V28}
|
||||
import play.api.libs.json.{JsArray, JsNumber, JsString, Json}
|
||||
|
||||
import scala.concurrent.Future
|
||||
@ -85,7 +79,7 @@ trait MiningRpc { self: Client with BlockchainRpc =>
|
||||
|
||||
def getMiningInfo: Future[GetMiningInfoResult] = {
|
||||
self.version.flatMap {
|
||||
case V25 | V26 | V27 | Unknown =>
|
||||
case V26 | V27 | Unknown =>
|
||||
bitcoindCall[GetMiningInfoResultPre28]("getmininginfo")
|
||||
case V28 =>
|
||||
bitcoindCall[GetMiningInfoResultV28]("getmininginfo")
|
||||
|
@ -8,13 +8,7 @@ import org.bitcoins.commons.jsonmodels.bitcoind.*
|
||||
import org.bitcoins.commons.serializers.JsonSerializers
|
||||
import org.bitcoins.commons.serializers.JsonSerializers.*
|
||||
import org.bitcoins.core.protocol.blockchain.Block
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{
|
||||
Unknown,
|
||||
V25,
|
||||
V26,
|
||||
V27,
|
||||
V28
|
||||
}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{Unknown, V26, V27, V28}
|
||||
import play.api.libs.json.{JsBoolean, JsNumber, JsString}
|
||||
|
||||
import java.net.URI
|
||||
@ -70,7 +64,7 @@ trait P2PRpc { self: Client =>
|
||||
|
||||
def getNetworkInfo: Future[GetNetworkInfoResult] = {
|
||||
self.version.flatMap {
|
||||
case V25 | V26 | V27 | Unknown =>
|
||||
case V26 | V27 | Unknown =>
|
||||
bitcoindCall[GetNetworkInfoResultPostV21]("getnetworkinfo")
|
||||
case V28 =>
|
||||
bitcoindCall[GetNetworkInfoResultV28]("getnetworkinfo")
|
||||
|
@ -6,7 +6,7 @@ import org.bitcoins.commons.serializers.JsonSerializers.*
|
||||
import org.bitcoins.core.currency.Satoshis
|
||||
import org.bitcoins.core.protocol.blockchain.MerkleBlock
|
||||
import org.bitcoins.crypto.{DoubleSha256Digest, DoubleSha256DigestBE}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{V25, V26, V27, V28}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{V26, V27, V28}
|
||||
import play.api.libs.json.*
|
||||
|
||||
import scala.concurrent.Future
|
||||
@ -79,7 +79,7 @@ trait TransactionRpc { self: Client =>
|
||||
walletName: String = BitcoindRpcClient.DEFAULT_WALLET_NAME
|
||||
): Future[GetTransactionResult] = {
|
||||
self.version.flatMap {
|
||||
case V25 | V26 | V27 | BitcoindVersion.Unknown =>
|
||||
case V26 | V27 | BitcoindVersion.Unknown =>
|
||||
bitcoindCall[GetTransactionResultPreV28](
|
||||
"gettransaction",
|
||||
List(JsString(txid.hex), JsBoolean(watchOnly)),
|
||||
|
@ -1,33 +0,0 @@
|
||||
package org.bitcoins.rpc.client.v25
|
||||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.rpc.client.common.{BitcoindRpcClient, BitcoindVersion}
|
||||
import org.bitcoins.rpc.config.{
|
||||
BitcoindInstance,
|
||||
BitcoindInstanceLocal,
|
||||
BitcoindRpcAppConfig
|
||||
}
|
||||
|
||||
import scala.concurrent.Future
|
||||
|
||||
class BitcoindV25RpcClient(override val instance: BitcoindInstance)(implicit
|
||||
actorSystem: ActorSystem,
|
||||
bitcoindRpcAppConfig: BitcoindRpcAppConfig
|
||||
) extends BitcoindRpcClient(instance) {
|
||||
|
||||
override lazy val version: Future[BitcoindVersion] =
|
||||
Future.successful(BitcoindVersion.V25)
|
||||
}
|
||||
|
||||
object BitcoindV25RpcClient {
|
||||
|
||||
/** Creates an RPC client from the given instance, together with the given
|
||||
* actor system. This is for advanced users, where you need fine grained
|
||||
* control over the RPC client.
|
||||
*/
|
||||
def apply(instance: BitcoindInstanceLocal)(implicit
|
||||
system: ActorSystem
|
||||
): BitcoindV25RpcClient =
|
||||
new BitcoindV25RpcClient(instance)(system, instance.bitcoindRpcAppConfig)
|
||||
|
||||
}
|
@ -1097,5 +1097,5 @@ object EclairRpcClient {
|
||||
* @see
|
||||
* https://github.com/ACINQ/eclair/releases/tag/v0.8.0
|
||||
*/
|
||||
val bitcoindV: BitcoindVersion = BitcoindVersion.V25
|
||||
val bitcoindV: BitcoindVersion = BitcoindVersion.V26
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import org.bitcoins.core.protocol.transaction.TransactionOutPoint
|
||||
import org.bitcoins.core.wallet.fee.SatoshisPerVirtualByte
|
||||
import org.bitcoins.lnd.rpc.LndRpcClient
|
||||
import org.bitcoins.lnd.rpc.config.{LndInstanceLocal, LndInstanceRemote}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{V25, V26, V27, V28}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.{V26, V27, V28}
|
||||
import org.bitcoins.rpc.client.common.{BitcoindRpcClient, BitcoindVersion}
|
||||
import org.bitcoins.rpc.config.{
|
||||
BitcoindAuthCredentials,
|
||||
@ -51,7 +51,6 @@ trait LndRpcTestUtil extends BitcoinSLogger {
|
||||
def startedBitcoindRpcClient(version: BitcoindVersion)(implicit
|
||||
system: ActorSystem): Future[BitcoindRpcClient] = {
|
||||
val instance = version match {
|
||||
case V25 => BitcoindRpcTestUtil.v25Instance()
|
||||
case V26 => BitcoindRpcTestUtil.v26Instance()
|
||||
case V27 => BitcoindRpcTestUtil.v27Instance()
|
||||
case V28 => BitcoindRpcTestUtil.v28Instance()
|
||||
|
@ -2,7 +2,6 @@ package org.bitcoins.testkit.rpc
|
||||
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.RpcOpts.AddNodeArgument
|
||||
import org.bitcoins.rpc.client.common.{BitcoindRpcClient, BitcoindVersion}
|
||||
import org.bitcoins.rpc.client.v25.BitcoindV25RpcClient
|
||||
import org.bitcoins.rpc.util.{NodePair, NodeTriple}
|
||||
import org.bitcoins.testkit.EmbeddedPg
|
||||
import org.bitcoins.testkit.fixtures.BitcoinSFixture
|
||||
@ -162,27 +161,6 @@ trait BitcoindFixturesCachedPairNewest
|
||||
}
|
||||
}
|
||||
|
||||
trait BitcoindFixturesCachedPairV25
|
||||
extends BitcoinSAsyncFixtureTest
|
||||
with BitcoindFixturesCachedPair[BitcoindV25RpcClient] {
|
||||
override type FixtureParam = NodePair[BitcoindV25RpcClient]
|
||||
override val version: BitcoindVersion = BitcoindVersion.V25
|
||||
|
||||
override def withFixture(test: OneArgAsyncTest): FutureOutcome = {
|
||||
val futOutcome = for {
|
||||
pair <- clientsF
|
||||
futOutcome = with2BitcoindsCached(test, pair)
|
||||
f <- futOutcome.toFuture
|
||||
} yield f
|
||||
new FutureOutcome(futOutcome)
|
||||
}
|
||||
|
||||
override def afterAll(): Unit = {
|
||||
super[BitcoindFixturesCachedPair].afterAll()
|
||||
super[BitcoinSAsyncFixtureTest].afterAll()
|
||||
}
|
||||
}
|
||||
|
||||
/** A pair of bitcoinds that are disconnected on the p2p network when given to
|
||||
* the test case
|
||||
*/
|
||||
|
@ -29,7 +29,6 @@ import org.bitcoins.crypto.{
|
||||
}
|
||||
import org.bitcoins.rpc.client.common.BitcoindVersion.*
|
||||
import org.bitcoins.rpc.client.common.{BitcoindRpcClient, BitcoindVersion}
|
||||
import org.bitcoins.rpc.client.v25.BitcoindV25RpcClient
|
||||
import org.bitcoins.rpc.client.v26.BitcoindV26RpcClient
|
||||
import org.bitcoins.rpc.client.v27.BitcoindV27RpcClient
|
||||
import org.bitcoins.rpc.client.v28.BitcoindV28RpcClient
|
||||
@ -179,7 +178,7 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger {
|
||||
version match {
|
||||
// default to newest version
|
||||
case Unknown => getBinary(BitcoindVersion.newest, binaryDirectory)
|
||||
case known @ (V25 | V26 | V27 | V28) =>
|
||||
case known @ (V26 | V27 | V28) =>
|
||||
val fileList: List[(Path, String)] = Files
|
||||
.list(binaryDirectory)
|
||||
.iterator()
|
||||
@ -254,22 +253,6 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger {
|
||||
BitcoindInstanceLocal.fromConfig(conf, binary)
|
||||
}
|
||||
|
||||
def v25Instance(
|
||||
port: Int = RpcUtil.randomPort,
|
||||
rpcPort: Int = RpcUtil.randomPort,
|
||||
zmqConfig: ZmqConfig = RpcUtil.zmqConfig,
|
||||
pruneMode: Boolean = false,
|
||||
binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory
|
||||
)(implicit system: ActorSystem): BitcoindInstanceLocal =
|
||||
instance(
|
||||
port = port,
|
||||
rpcPort = rpcPort,
|
||||
zmqConfig = zmqConfig,
|
||||
pruneMode = pruneMode,
|
||||
versionOpt = Some(BitcoindVersion.V25),
|
||||
binaryDirectory = binaryDirectory
|
||||
)
|
||||
|
||||
def v26Instance(
|
||||
port: Int = RpcUtil.randomPort,
|
||||
rpcPort: Int = RpcUtil.randomPort,
|
||||
@ -328,14 +311,6 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger {
|
||||
binaryDirectory: Path = BitcoindRpcTestClient.sbtBinaryDirectory
|
||||
)(implicit system: ActorSystem): BitcoindInstanceLocal = {
|
||||
bitcoindVersion match {
|
||||
case BitcoindVersion.V25 =>
|
||||
BitcoindRpcTestUtil.v25Instance(
|
||||
port,
|
||||
rpcPort,
|
||||
zmqConfig,
|
||||
pruneMode,
|
||||
binaryDirectory = binaryDirectory
|
||||
)
|
||||
case BitcoindVersion.V26 =>
|
||||
BitcoindRpcTestUtil.v26Instance(
|
||||
port,
|
||||
@ -702,9 +677,6 @@ trait BitcoindRpcTestUtil extends BitcoinSLogger {
|
||||
case BitcoindVersion.Unknown =>
|
||||
val instance = BitcoindRpcTestUtil.instance()
|
||||
BitcoindRpcClient(instance)
|
||||
case BitcoindVersion.V25 =>
|
||||
val instance = BitcoindRpcTestUtil.v25Instance()
|
||||
BitcoindV25RpcClient(instance)
|
||||
case BitcoindVersion.V26 =>
|
||||
val instance = BitcoindRpcTestUtil.v26Instance()
|
||||
BitcoindV26RpcClient(instance)
|
||||
|
Loading…
Reference in New Issue
Block a user