mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-15 12:20:06 +01:00
Use -rewrite for all of src
This commit is contained in:
parent
6f0762a81f
commit
dd5a20bd20
12 changed files with 23 additions and 23 deletions
|
@ -9,7 +9,7 @@ import scala.concurrent.Future
|
|||
|
||||
/** Chain unit test that requires a cached bitcoind type to be injected */
|
||||
trait ChainWithBitcoindUnitTest extends ChainDbUnitTest {
|
||||
self: CachedBitcoind[_] =>
|
||||
self: CachedBitcoind[?] =>
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -30,14 +30,14 @@ trait TestDbManagement extends DbManagement {
|
|||
|
||||
def ec: ExecutionContext
|
||||
|
||||
private lazy val testTable: TableQuery[Table[_]] =
|
||||
private lazy val testTable: TableQuery[Table[?]] =
|
||||
TestDAO()(ec, appConfig).table
|
||||
|
||||
private lazy val masterXpubTable: TableQuery[Table[_]] = {
|
||||
private lazy val masterXpubTable: TableQuery[Table[?]] = {
|
||||
MasterXPubDAO()(ec = ec, appConfig = appConfig).table
|
||||
}
|
||||
|
||||
override lazy val allTables: List[TableQuery[Table[_]]] =
|
||||
override lazy val allTables: List[TableQuery[Table[?]]] =
|
||||
List(testTable, masterXpubTable)
|
||||
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ trait CachedBitcoinSAppConfig { self: BitcoinSPekkoAsyncTest =>
|
|||
trait CachedChainAppConfig {
|
||||
self: BitcoinSPekkoAsyncTest =>
|
||||
|
||||
private[this] lazy val cachedConfig: BitcoinSAppConfig =
|
||||
private lazy val cachedConfig: BitcoinSAppConfig =
|
||||
BitcoinSTestAppConfig.getNeutrinoTestConfig()
|
||||
|
||||
implicit protected lazy val cachedChainConf: ChainAppConfig = {
|
||||
|
|
|
@ -27,7 +27,7 @@ import scala.concurrent.Future
|
|||
* extends this trait.
|
||||
*/
|
||||
trait NodeTestWithCachedBitcoind extends BaseNodeTest with CachedTor {
|
||||
self: CachedBitcoind[_] =>
|
||||
self: CachedBitcoind[?] =>
|
||||
|
||||
def withNeutrinoNodeConnectedToBitcoindCached(
|
||||
test: OneArgAsyncTest,
|
||||
|
|
|
@ -30,12 +30,12 @@ trait BitcoindFixtures extends BitcoinSFixture with EmbeddedPg {
|
|||
|
||||
/** Bitcoind fixtures with a cached a bitcoind instance */
|
||||
trait BitcoindFixturesCached extends BitcoindFixtures {
|
||||
self: BitcoinSAsyncFixtureTest with CachedBitcoind[_] =>
|
||||
self: BitcoinSAsyncFixtureTest & CachedBitcoind[?] =>
|
||||
}
|
||||
|
||||
/** Bitcoind fixtures with a cached a bitcoind instance that is funded */
|
||||
trait BitcoindFixturesFundedCached extends BitcoindFixtures {
|
||||
self: BitcoinSAsyncFixtureTest with CachedBitcoindFunded[_] =>
|
||||
self: BitcoinSAsyncFixtureTest & CachedBitcoindFunded[?] =>
|
||||
|
||||
override def withFixture(test: OneArgAsyncTest): FutureOutcome = {
|
||||
val f: Future[Outcome] = for {
|
||||
|
|
|
@ -20,7 +20,7 @@ object FileUtil extends BitcoinSLogger {
|
|||
* if the given directory isn't in the user temp dir location
|
||||
*/
|
||||
def deleteTmpDir(dir: File): Boolean = {
|
||||
val isTemp = dir.getPath startsWith Properties.tmpDir
|
||||
val isTemp = dir.getPath `startsWith` Properties.tmpDir
|
||||
if (!isTemp) {
|
||||
logger.warn(
|
||||
s"Directory $dir is not in the system temp dir location! You most likely didn't mean to delete this directory."
|
||||
|
|
|
@ -16,7 +16,7 @@ import scala.util.Random
|
|||
|
||||
/** Base test trait for all the tests in our walletTest module */
|
||||
trait BaseWalletTest extends EmbeddedPg {
|
||||
self: Suite with BitcoinSPekkoAsyncTest =>
|
||||
self: Suite & BitcoinSPekkoAsyncTest =>
|
||||
|
||||
override def beforeAll(): Unit = {
|
||||
AppConfig.throwIfDefaultDatadir(getFreshConfig.walletConf)
|
||||
|
|
|
@ -507,7 +507,7 @@ object BitcoinSWalletTest extends WalletLogger {
|
|||
* so it can be re-used in [[CachedBitcoind]] tests
|
||||
*/
|
||||
def destroyOnlyWalletWithBitcoindCached(
|
||||
walletWithBitcoind: WalletWithBitcoind[_]
|
||||
walletWithBitcoind: WalletWithBitcoind[?]
|
||||
)(implicit ec: ExecutionContext): Future[Unit] = {
|
||||
for {
|
||||
_ <- destroyWalletAppConfig(walletWithBitcoind.walletConfig)
|
||||
|
@ -546,7 +546,7 @@ object BitcoinSWalletTest extends WalletLogger {
|
|||
* balances satisfy [[isSameWalletBalances()]]
|
||||
*/
|
||||
def awaitWalletBalances(
|
||||
fundedWallet: WalletWithBitcoind[_]
|
||||
fundedWallet: WalletWithBitcoind[?]
|
||||
)(implicit config: WalletAppConfig, system: ActorSystem): Future[Unit] = {
|
||||
AsyncUtil.retryUntilSatisfiedF(
|
||||
conditionF = () => isSameWalletBalances(fundedWallet),
|
||||
|
@ -556,7 +556,7 @@ object BitcoinSWalletTest extends WalletLogger {
|
|||
}
|
||||
|
||||
private def isSameWalletBalances(
|
||||
fundedWallet: WalletWithBitcoind[_]
|
||||
fundedWallet: WalletWithBitcoind[?]
|
||||
)(implicit config: WalletAppConfig, system: ActorSystem): Future[Boolean] = {
|
||||
import system.dispatcher
|
||||
val defaultAccount = config.defaultAccount
|
||||
|
|
|
@ -29,7 +29,7 @@ import scala.util.{Failure, Success}
|
|||
trait BitcoinSWalletTestCachedBitcoind
|
||||
extends BitcoinSFixture
|
||||
with BaseWalletTest
|
||||
with EmbeddedPg { self: CachedBitcoind[_] =>
|
||||
with EmbeddedPg { self: CachedBitcoind[?] =>
|
||||
|
||||
/** Creates a funded wallet fixture with bitcoind This is different than
|
||||
* [[withFundedWalletAndBitcoind()]] in the sense that it does NOT destroy
|
||||
|
@ -40,7 +40,7 @@ trait BitcoinSWalletTestCachedBitcoind
|
|||
test: OneArgAsyncTest,
|
||||
bitcoind: BitcoindRpcClient
|
||||
)(implicit walletAppConfig: WalletAppConfig): FutureOutcome = {
|
||||
val builder: () => Future[WalletWithBitcoind[_]] = { () =>
|
||||
val builder: () => Future[WalletWithBitcoind[?]] = { () =>
|
||||
for {
|
||||
walletWithBitcoind <- createWalletWithBitcoindCallbacks(
|
||||
bitcoind = bitcoind
|
||||
|
@ -56,7 +56,7 @@ trait BitcoinSWalletTestCachedBitcoind
|
|||
} yield fundedWallet
|
||||
}
|
||||
|
||||
makeDependentFixture[WalletWithBitcoind[_]](
|
||||
makeDependentFixture[WalletWithBitcoind[?]](
|
||||
builder,
|
||||
{ case walletWithBitcoind: WalletWithBitcoind[_] =>
|
||||
destroyOnlyWalletWithBitcoindCached(walletWithBitcoind)
|
||||
|
@ -68,7 +68,7 @@ trait BitcoinSWalletTestCachedBitcoind
|
|||
test: OneArgAsyncTest,
|
||||
bitcoind: BitcoindRpcClient
|
||||
)(implicit walletAppConfig: WalletAppConfig): FutureOutcome = {
|
||||
val builder: () => Future[WalletWithBitcoind[_]] =
|
||||
val builder: () => Future[WalletWithBitcoind[?]] =
|
||||
BitcoinSFixture.composeBuildersAndWrap(
|
||||
builder = { () =>
|
||||
Future.successful(bitcoind)
|
||||
|
@ -77,11 +77,11 @@ trait BitcoinSWalletTestCachedBitcoind
|
|||
createWalletWithBitcoind(bitcoind)
|
||||
},
|
||||
wrap =
|
||||
(_: BitcoindRpcClient, walletWithBitcoind: WalletWithBitcoind[_]) =>
|
||||
(_: BitcoindRpcClient, walletWithBitcoind: WalletWithBitcoind[?]) =>
|
||||
walletWithBitcoind
|
||||
)
|
||||
|
||||
makeDependentFixture[WalletWithBitcoind[_]](
|
||||
makeDependentFixture[WalletWithBitcoind[?]](
|
||||
builder,
|
||||
{ case walletWithBitcoind: WalletWithBitcoind[_] =>
|
||||
destroyOnlyWalletWithBitcoindCached(walletWithBitcoind)
|
||||
|
|
|
@ -66,7 +66,7 @@ trait DualDLCWalletTestCachedBitcoind
|
|||
bitcoind
|
||||
)(config2, system)
|
||||
} yield (walletA, walletB, bitcoind),
|
||||
destroy = { (fundedWallets: (FundedDLCWallet, FundedDLCWallet, _)) =>
|
||||
destroy = { (fundedWallets: (FundedDLCWallet, FundedDLCWallet, ?)) =>
|
||||
for {
|
||||
_ <- destroyDLCWallet(fundedWallets._1.wallet)
|
||||
_ <- destroyDLCWallet(fundedWallets._2.wallet)
|
||||
|
@ -109,7 +109,7 @@ trait DualDLCWalletTestCachedBitcoind
|
|||
} yield (dlcWalletA, dlcWalletB, bitcoind)
|
||||
},
|
||||
destroy = {
|
||||
(dlcWallets: (InitializedDLCWallet, InitializedDLCWallet, _)) =>
|
||||
(dlcWallets: (InitializedDLCWallet, InitializedDLCWallet, ?)) =>
|
||||
for {
|
||||
_ <- destroyDLCWallet(dlcWallets._1.wallet)
|
||||
_ <- destroyDLCWallet(dlcWallets._2.wallet)
|
||||
|
|
|
@ -32,7 +32,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
trait FundWalletUtil extends BitcoinSLogger {
|
||||
|
||||
/** Funds the given wallet with money from the given bitcoind */
|
||||
def fundWalletWithBitcoind[T <: WalletWithBitcoind[_ <: BitcoindRpcClient]](
|
||||
def fundWalletWithBitcoind[T <: WalletWithBitcoind[? <: BitcoindRpcClient]](
|
||||
pair: T
|
||||
)(implicit ec: ExecutionContext): Future[T] = {
|
||||
val (wallet, bitcoind) = (pair.wallet, pair.bitcoind)
|
||||
|
|
|
@ -15,7 +15,7 @@ import scala.concurrent.Future
|
|||
trait WalletAppConfigWithBitcoindFixtures
|
||||
extends BitcoinSAsyncFixtureTest
|
||||
with BitcoindFixturesCached
|
||||
with EmbeddedPg { self: CachedBitcoind[_] =>
|
||||
with EmbeddedPg { self: CachedBitcoind[?] =>
|
||||
|
||||
override def afterAll(): Unit = {
|
||||
super[EmbeddedPg].afterAll()
|
||||
|
|
Loading…
Add table
Reference in a new issue