mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-02-23 22:56:52 +01:00
Remove grizzled.sl4fj was its no longer maintained (#5482)
This commit is contained in:
parent
a875f08d2e
commit
177542a13c
80 changed files with 207 additions and 210 deletions
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.commons.config
|
||||
|
||||
import com.typesafe.config.{Config, ConfigFactory, ConfigParseOptions}
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.config._
|
||||
import org.bitcoins.core.protocol.blockchain.BitcoinChainParams
|
||||
import org.bitcoins.core.util.StartStopAsync
|
||||
|
@ -9,6 +9,7 @@ import org.bitcoins.core.util.StartStopAsync
|
|||
import java.nio.file._
|
||||
import scala.concurrent.Future
|
||||
import org.bitcoins.core.compat.JavaConverters._
|
||||
|
||||
import scala.util.Properties
|
||||
import scala.util.matching.Regex
|
||||
|
||||
|
@ -18,7 +19,7 @@ import scala.util.matching.Regex
|
|||
* @see [[https://github.com/bitcoin-s/bitcoin-s-core/blob/master/doc/configuration.md `configuration.md`]]
|
||||
* for more information.
|
||||
*/
|
||||
abstract class AppConfig extends StartStopAsync[Unit] with Logging {
|
||||
abstract class AppConfig extends StartStopAsync[Unit] with BitcoinSLogger {
|
||||
|
||||
/** Starts this project.
|
||||
* After this future resolves, all operations should be
|
||||
|
@ -62,7 +63,7 @@ abstract class AppConfig extends StartStopAsync[Unit] with Logging {
|
|||
*/
|
||||
def withOverrides(configOverrides: Vector[Config]): ConfigType = {
|
||||
val numOverrides = configOverrides.length
|
||||
if (logger.logger.isDebugEnabled()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
// force lazy evaluation before we print
|
||||
// our lines
|
||||
val oldConfStr = this.config.asReadableJson
|
||||
|
@ -72,7 +73,7 @@ abstract class AppConfig extends StartStopAsync[Unit] with Logging {
|
|||
logger.trace(oldConfStr)
|
||||
}
|
||||
|
||||
if (logger.logger.isTraceEnabled()) {
|
||||
if (logger.isTraceEnabled()) {
|
||||
configOverrides.zipWithIndex.foreach { case (c, idx) =>
|
||||
logger.trace(s"Override no. $idx: ${c.asReadableJson}")
|
||||
}
|
||||
|
@ -90,7 +91,7 @@ abstract class AppConfig extends StartStopAsync[Unit] with Logging {
|
|||
}
|
||||
|
||||
// to avoid non-necessary lazy load
|
||||
if (logger.logger.isDebugEnabled()) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
// force lazy load before we print
|
||||
val newConfStr = newConf.config.asReadableJson
|
||||
|
||||
|
@ -159,7 +160,7 @@ abstract class AppConfig extends StartStopAsync[Unit] with Logging {
|
|||
}
|
||||
}
|
||||
|
||||
object AppConfig extends Logging {
|
||||
object AppConfig extends BitcoinSLogger {
|
||||
|
||||
def safePathToString(path: Path): String = {
|
||||
val pathStr = path.toString.replace("\\", "/")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.commons.file
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import java.io.{FileOutputStream, IOException}
|
||||
import java.nio.file.attribute.BasicFileAttributes
|
||||
|
@ -9,7 +9,7 @@ import java.util.zip.{ZipEntry, ZipOutputStream}
|
|||
import scala.reflect.io.Directory
|
||||
import scala.util.matching.Regex
|
||||
|
||||
object FileUtil extends Logging {
|
||||
object FileUtil extends BitcoinSLogger {
|
||||
|
||||
/** Zips the [[directory]] into a zip file and then stores it at [[target]]
|
||||
*
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package org.bitcoins.commons.rpc
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.RpcOpts.LockUnspentOutputParameter
|
||||
import org.bitcoins.commons.jsonmodels.cli.ContractDescriptorParser
|
||||
import org.bitcoins.commons.serializers.JsonReaders
|
||||
import org.bitcoins.commons.util.WalletNames
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, WalletNames}
|
||||
import org.bitcoins.core.api.dlc.wallet.db.DLCContactDb
|
||||
import org.bitcoins.core.api.wallet.CoinSelectionAlgo
|
||||
import org.bitcoins.core.crypto.{ExtPrivateKey, MnemonicCode}
|
||||
|
@ -1631,7 +1630,7 @@ case class LoadWallet(
|
|||
extends CommandRpc
|
||||
with AppServerCliCommand
|
||||
|
||||
object LoadWallet extends ServerJsonModels with Logging {
|
||||
object LoadWallet extends ServerJsonModels with BitcoinSLogger {
|
||||
|
||||
def fromJsArr(arr: ujson.Arr): Try[LoadWallet] = Try {
|
||||
arr.arr.toList match {
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
package org.bitcoins.commons.util
|
||||
|
||||
import org.slf4j.{Logger, LoggerFactory}
|
||||
|
||||
trait BitcoinSLogger {
|
||||
|
||||
def logger: Logger = LoggerFactory.getLogger(getClass)
|
||||
}
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.commons.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.core.util.FutureUtil
|
||||
|
||||
import java.io.File
|
||||
|
@ -8,7 +7,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
import scala.sys.process.{Process, ProcessBuilder, ProcessLogger}
|
||||
|
||||
/** A trait that helps start bitcoind/eclair when it is started via bitcoin-s */
|
||||
trait NativeProcessFactory extends Logging {
|
||||
trait NativeProcessFactory extends BitcoinSLogger {
|
||||
implicit protected def executionContext: ExecutionContext
|
||||
|
||||
private[this] var processOpt: Option[Process] = None
|
||||
|
@ -66,7 +65,7 @@ trait NativeProcessFactory extends Logging {
|
|||
|
||||
}
|
||||
|
||||
object NativeProcessFactory extends Logging {
|
||||
object NativeProcessFactory extends BitcoinSLogger {
|
||||
|
||||
val processLogger: ProcessLogger =
|
||||
ProcessLogger(logger.info(_), logger.error(_))
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.bitcoins.cli
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.cli.CliCommand._
|
||||
import org.bitcoins.cli.CliReaders._
|
||||
import org.bitcoins.cli.ConsoleCli.RequestParam
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.RpcOpts.LockUnspentOutputParameter
|
||||
import org.bitcoins.commons.rpc._
|
||||
import org.bitcoins.commons.serializers.Picklers._
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.wallet.CoinSelectionAlgo
|
||||
import org.bitcoins.core.config.NetworkParameters
|
||||
import org.bitcoins.core.crypto._
|
||||
|
@ -42,7 +42,7 @@ import java.util.Date
|
|||
import scala.collection.mutable
|
||||
import scala.util.{Failure, Success, Try}
|
||||
|
||||
object ConsoleCli extends Logging {
|
||||
object ConsoleCli extends BitcoinSLogger {
|
||||
|
||||
def parser: OParser[Unit, Config] = {
|
||||
val builder = OParser.builder[Config]
|
||||
|
|
|
@ -1,13 +1,12 @@
|
|||
package org.bitcoins.server.routes
|
||||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.ServerArgParser
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, ServerArgParser}
|
||||
import org.bitcoins.core.util.{EnvUtil, StartStopAsync}
|
||||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
trait BitcoinSRunner[T] extends StartStopAsync[T] with Logging {
|
||||
trait BitcoinSRunner[T] extends StartStopAsync[T] with BitcoinSLogger {
|
||||
|
||||
implicit def system: ActorSystem
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.server.routes
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
/** Exposes access to the HTTP RPC server logger */
|
||||
private[bitcoins] trait HttpLogger extends Logging
|
||||
private[bitcoins] trait HttpLogger extends BitcoinSLogger
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.bitcoins.server.routes
|
||||
|
||||
import de.heikoseeberger.akkahttpupickle.UpickleSupport._
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.{Done, NotUsed}
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.event.Logging
|
||||
|
@ -40,6 +39,7 @@ import org.apache.pekko.http.scaladsl.unmarshalling.FromRequestUnmarshaller
|
|||
import org.apache.pekko.stream.scaladsl.{Flow, Keep, Sink, Source}
|
||||
import org.bitcoins.commons.config.AppConfig
|
||||
import org.bitcoins.commons.jsonmodels.ws.WsNotification
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.server.util.{ServerBindings, WsServerConfig}
|
||||
import upickle.{default => up}
|
||||
|
||||
|
@ -245,7 +245,7 @@ case class Server(
|
|||
|
||||
}
|
||||
|
||||
object Server extends Logging {
|
||||
object Server extends BitcoinSLogger {
|
||||
|
||||
// TODO id parameter
|
||||
case class Response(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.server.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
trait BitcoinSApp {
|
||||
def actorSystemName: String
|
||||
|
@ -15,6 +15,6 @@ trait BitcoinSApp {
|
|||
}
|
||||
|
||||
/** Trait for using BitcoinS app with a daemon backend */
|
||||
trait BitcoinSAppScalaDaemon extends App with BitcoinSApp with Logging {
|
||||
trait BitcoinSAppScalaDaemon extends App with BitcoinSApp with BitcoinSLogger {
|
||||
final override def commandLineArgs: Array[String] = args
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.server.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.http.scaladsl.Http
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import scala.concurrent.duration.DurationInt
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
@ -9,7 +9,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
case class ServerBindings(
|
||||
httpServer: Http.ServerBinding,
|
||||
webSocketServerOpt: Option[Http.ServerBinding])
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
|
||||
private val terminateTimeout = 5.seconds
|
||||
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package org.bitcoins.server
|
||||
|
||||
import com.typesafe.config.{Config, ConfigFactory}
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.chain.config.ChainAppConfig
|
||||
import org.bitcoins.commons.config.AppConfig.DEFAULT_BITCOIN_S_CONF_FILE
|
||||
import org.bitcoins.commons.config.{AppConfig, ConfigOps}
|
||||
import org.bitcoins.commons.util.ServerArgParser
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, ServerArgParser}
|
||||
import org.bitcoins.core.config.NetworkParameters
|
||||
import org.bitcoins.core.util.{StartStopAsync, TimeUtil}
|
||||
import org.bitcoins.db.DbManagement
|
||||
|
@ -41,7 +40,7 @@ case class BitcoinSAppConfig(
|
|||
baseDatadir: Path,
|
||||
configOverrides: Vector[Config])(implicit system: ActorSystem)
|
||||
extends StartStopAsync[AppConfigMarker]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
import system.dispatcher
|
||||
|
||||
lazy val walletConf: WalletAppConfig =
|
||||
|
@ -194,7 +193,7 @@ case class BitcoinSAppConfig(
|
|||
/** Implicit conversions that allow a unified configuration
|
||||
* to be passed in wherever a specializes one is required
|
||||
*/
|
||||
object BitcoinSAppConfig extends Logging {
|
||||
object BitcoinSAppConfig extends BitcoinSLogger {
|
||||
|
||||
def fromConfig(config: Config)(implicit
|
||||
system: ActorSystem): BitcoinSAppConfig = {
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.server
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.{ActorSystem, Cancellable}
|
||||
import org.apache.pekko.stream.OverflowStrategy
|
||||
import org.apache.pekko.stream.scaladsl.{
|
||||
|
@ -14,6 +13,7 @@ import org.apache.pekko.stream.scaladsl.{
|
|||
import org.apache.pekko.{Done, NotUsed}
|
||||
import org.bitcoins.chain.ChainCallbacks
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.GetBlockHeaderResult
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.node.NodeApi
|
||||
import org.bitcoins.core.api.wallet.{NeutrinoHDWalletApi, WalletApi}
|
||||
import org.bitcoins.core.gcs.FilterType
|
||||
|
@ -34,7 +34,7 @@ import scala.concurrent.duration.{DurationInt, FiniteDuration}
|
|||
import scala.concurrent.{ExecutionContext, Future, Promise}
|
||||
|
||||
/** Useful utilities to use in the wallet project for syncing things against bitcoind */
|
||||
object BitcoindRpcBackendUtil extends Logging {
|
||||
object BitcoindRpcBackendUtil extends BitcoinSLogger {
|
||||
|
||||
/** Has the wallet process all the blocks it has not seen up until bitcoind's chain tip */
|
||||
def syncWalletToBitcoind(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.server
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.chain.ChainQueryApi
|
||||
import org.bitcoins.core.api.commons.ArgumentSource
|
||||
import org.bitcoins.core.api.dlc.wallet.DLCNeutrinoHDWalletApi
|
||||
|
@ -25,7 +25,9 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
/** A trait used to help load a different load and discard the current wallet in memory
|
||||
* This trait encapsulates the heavy lifting done in the 'loadwallet' RPC command
|
||||
*/
|
||||
sealed trait DLCWalletLoaderApi extends Logging with StartStopAsync[Unit] {
|
||||
sealed trait DLCWalletLoaderApi
|
||||
extends BitcoinSLogger
|
||||
with StartStopAsync[Unit] {
|
||||
|
||||
override def start(): Future[Unit] = Future.unit
|
||||
def conf: BitcoinSAppConfig
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.server
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.http.scaladsl.model.HttpEntity
|
||||
import org.apache.pekko.http.scaladsl.server.Directives.complete
|
||||
|
@ -8,6 +7,7 @@ import org.apache.pekko.http.scaladsl.server.Route
|
|||
import org.apache.pekko.stream.Materializer
|
||||
import org.bitcoins.commons.rpc._
|
||||
import org.bitcoins.commons.serializers.Picklers._
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.wallet.db.SpendingInfoDb
|
||||
import org.bitcoins.core.currency._
|
||||
import org.bitcoins.core.protocol.tlv._
|
||||
|
@ -39,7 +39,7 @@ case class WalletRoutes(loadWalletApi: DLCWalletLoaderApi)(implicit
|
|||
system: ActorSystem,
|
||||
walletConf: WalletAppConfig)
|
||||
extends ServerRoute
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
import system.dispatcher
|
||||
|
||||
/** The loaded wallet that requests should be directed against */
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package org.bitcoins.server.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.Cancellable
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
case class BitcoindPollingCancellable(
|
||||
blockPollingCancellable: Cancellable,
|
||||
mempoolPollingCancelable: Cancellable)
|
||||
extends Cancellable
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
override def cancel(): Boolean = {
|
||||
logger.info(s"Cancelling bitcoind polling jobs")
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.bitcoins.server.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.stream.scaladsl.{Sink, Source}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.wallet.DLCNeutrinoHDWalletApi
|
||||
import org.bitcoins.core.api.wallet.{NeutrinoWalletApi, WalletApi}
|
||||
import org.bitcoins.core.gcs.GolombFilter
|
||||
|
@ -15,7 +15,7 @@ import org.bitcoins.wallet.WalletNotInitialized
|
|||
|
||||
import scala.concurrent.Future
|
||||
|
||||
object CallbackUtil extends Logging {
|
||||
object CallbackUtil extends BitcoinSLogger {
|
||||
|
||||
def createNeutrinoNodeCallbacksForWallet(
|
||||
wallet: WalletApi with NeutrinoWalletApi)(implicit
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.server.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.stream.scaladsl.SourceQueueWithComplete
|
||||
import org.bitcoins.chain.config.ChainAppConfig
|
||||
|
@ -24,6 +23,7 @@ import org.bitcoins.commons.jsonmodels.ws.{
|
|||
WalletWsType,
|
||||
WsNotification
|
||||
}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.chain.ChainApi
|
||||
import org.bitcoins.core.api.chain.db.{CompactFilterDb, CompactFilterHeaderDb}
|
||||
import org.bitcoins.core.api.dlc.wallet.db.IncomingDLCOfferDb
|
||||
|
@ -65,7 +65,7 @@ import org.bitcoins.wallet.callback.{
|
|||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
object WebsocketUtil extends Logging {
|
||||
object WebsocketUtil extends BitcoinSLogger {
|
||||
|
||||
private def sendHeadersToWs(
|
||||
notifications: Vector[ChainNotification[_]],
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.rpc.client.common
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.chain.db.{
|
||||
BlockHeaderDb,
|
||||
CompactFilterDb,
|
||||
|
@ -385,7 +385,9 @@ object BitcoindRpcClient {
|
|||
|
||||
sealed trait BitcoindVersion
|
||||
|
||||
object BitcoindVersion extends StringFactory[BitcoindVersion] with Logging {
|
||||
object BitcoindVersion
|
||||
extends StringFactory[BitcoindVersion]
|
||||
with BitcoinSLogger {
|
||||
|
||||
/** The newest version of `bitcoind` we support */
|
||||
val newest: BitcoindVersion = V24
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.bitcoins.rpc.client.common
|
||||
|
||||
import com.fasterxml.jackson.core.JsonParseException
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.http.javadsl.model.headers.HttpCredentials
|
||||
import org.apache.pekko.http.scaladsl.{Http, HttpExt}
|
||||
|
@ -18,7 +17,7 @@ import org.apache.pekko.stream.StreamTcpException
|
|||
import org.bitcoins.asyncutil.AsyncUtil
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.RpcOpts
|
||||
import org.bitcoins.commons.serializers.JsonSerializers._
|
||||
import org.bitcoins.commons.util.NativeProcessFactory
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, NativeProcessFactory}
|
||||
import org.bitcoins.core.config._
|
||||
import org.bitcoins.core.crypto.ECPrivateKeyUtil
|
||||
import org.bitcoins.core.util.StartStopAsync
|
||||
|
@ -53,7 +52,7 @@ import scala.util.{Failure, Success}
|
|||
* and whether or not the client is started.
|
||||
*/
|
||||
trait Client
|
||||
extends Logging
|
||||
extends BitcoinSLogger
|
||||
with StartStopAsync[BitcoindRpcClient]
|
||||
with NativeProcessFactory {
|
||||
def version: Future[BitcoindVersion]
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
package org.bitcoins.rpc.config
|
||||
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.{Files, Paths}
|
||||
import org.bitcoins.core.config._
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.crypto.MaskedToString
|
||||
|
||||
/** This trait contains the information we need to authenticate
|
||||
|
@ -15,7 +16,7 @@ sealed trait BitcoindAuthCredentials {
|
|||
def username: String
|
||||
}
|
||||
|
||||
object BitcoindAuthCredentials extends Logging {
|
||||
object BitcoindAuthCredentials extends BitcoinSLogger {
|
||||
import org.bitcoins.core.compat.JavaConverters._
|
||||
|
||||
/** Authenticate by providing a username and password.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.rpc.config
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.commons.ConfigFactory
|
||||
import org.bitcoins.core.config._
|
||||
|
||||
|
@ -25,7 +25,7 @@ import scala.util.Properties
|
|||
case class BitcoindConfig(
|
||||
private[bitcoins] val lines: Seq[String],
|
||||
datadir: File)
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
|
||||
//create datadir and config if it DNE on disk
|
||||
if (!datadir.exists()) {
|
||||
|
@ -285,7 +285,9 @@ case class BitcoindConfig(
|
|||
|
||||
}
|
||||
|
||||
object BitcoindConfig extends ConfigFactory[BitcoindConfig] with Logging {
|
||||
object BitcoindConfig
|
||||
extends ConfigFactory[BitcoindConfig]
|
||||
with BitcoinSLogger {
|
||||
|
||||
/** The empty `bitcoind` config */
|
||||
lazy val empty: BitcoindConfig = BitcoindConfig("", DEFAULT_DATADIR)
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package org.bitcoins.rpc.config
|
||||
|
||||
import com.typesafe.config.ConfigFactory
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.commons.util.NativeProcessFactory
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, NativeProcessFactory}
|
||||
import org.bitcoins.core.api.commons.{InstanceFactory, InstanceFactoryLocal}
|
||||
import org.bitcoins.core.api.tor.Socks5ProxyParams
|
||||
import org.bitcoins.core.config.NetworkParameters
|
||||
|
@ -17,7 +16,7 @@ import scala.util.{Failure, Properties, Success, Try}
|
|||
|
||||
/** Created by chris on 4/29/17.
|
||||
*/
|
||||
sealed trait BitcoindInstance extends Logging {
|
||||
sealed trait BitcoindInstance extends BitcoinSLogger {
|
||||
|
||||
def network: NetworkParameters
|
||||
def uri: URI
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.bitcoins.rpc.config
|
||||
|
||||
import java.net.InetSocketAddress
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import java.net.InetSocketAddress
|
||||
|
||||
sealed trait ZmqConfig {
|
||||
def hashBlock: Option[InetSocketAddress]
|
||||
|
@ -11,7 +11,7 @@ sealed trait ZmqConfig {
|
|||
def rawTx: Option[InetSocketAddress]
|
||||
}
|
||||
|
||||
object ZmqConfig extends Logging {
|
||||
object ZmqConfig extends BitcoinSLogger {
|
||||
|
||||
val empty: ZmqConfig = ZmqConfig()
|
||||
|
||||
|
|
|
@ -543,7 +543,8 @@ lazy val zmq = project
|
|||
.settings(name := "bitcoin-s-zmq",
|
||||
libraryDependencies ++= Deps.bitcoindZmq.value)
|
||||
.dependsOn(
|
||||
coreJVM % testAndCompile
|
||||
coreJVM % testAndCompile,
|
||||
appCommons
|
||||
)
|
||||
|
||||
def isCI = {
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
package org.bitcoins.chain
|
||||
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.callback.{CallbackFactory, ModuleCallbacks}
|
||||
import org.bitcoins.core.api.chain.db.{CompactFilterDb, CompactFilterHeaderDb}
|
||||
import org.bitcoins.core.api.{Callback, CallbackHandler}
|
||||
import org.bitcoins.core.protocol.blockchain.BlockHeader
|
||||
import slick.util.Logging
|
||||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
trait ChainCallbacks extends ModuleCallbacks[ChainCallbacks] with Logging {
|
||||
trait ChainCallbacks
|
||||
extends ModuleCallbacks[ChainCallbacks]
|
||||
with BitcoinSLogger {
|
||||
|
||||
def onBlockHeaderConnected: CallbackHandler[
|
||||
Vector[(Int, BlockHeader)],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.chain
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
/** Exposes access to the chain verification logger */
|
||||
private[bitcoins] trait ChainVerificationLogger extends Logging
|
||||
private[bitcoins] trait ChainVerificationLogger extends BitcoinSLogger
|
||||
|
|
|
@ -2,10 +2,9 @@ package com.bitcoins.clightning.rpc
|
|||
|
||||
import com.bitcoins.clightning.rpc.CLightningRpcClient.feeRateToJson
|
||||
import com.bitcoins.clightning.rpc.config._
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.jsonmodels.clightning.CLightningJsonModels._
|
||||
import org.bitcoins.commons.serializers.JsonSerializers._
|
||||
import org.bitcoins.commons.util.NativeProcessFactory
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, NativeProcessFactory}
|
||||
import org.bitcoins.core.currency.{CurrencyUnit, Satoshis}
|
||||
import org.bitcoins.core.hd.AddressType
|
||||
import org.bitcoins.core.protocol._
|
||||
|
@ -30,7 +29,7 @@ class CLightningRpcClient(val instance: CLightningInstanceLocal, binary: File)(
|
|||
extends CLightningUnixSocketHandler
|
||||
with NativeProcessFactory
|
||||
with StartStopAsync[CLightningRpcClient]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
// documentation: https://lightning.readthedocs.io/index.html
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package com.bitcoins.clightning.rpc.config
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.commons.ConfigFactory
|
||||
import org.bitcoins.core.config._
|
||||
import org.bitcoins.rpc.config.BitcoindAuthCredentials.PasswordBased
|
||||
|
@ -24,7 +24,7 @@ import scala.util.Properties
|
|||
case class CLightningConfig(
|
||||
private[bitcoins] val lines: Seq[String],
|
||||
datadir: File)
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
|
||||
//create datadir and config if it DNE on disk
|
||||
if (!datadir.exists()) {
|
||||
|
@ -142,7 +142,9 @@ case class CLightningConfig(
|
|||
)
|
||||
}
|
||||
|
||||
object CLightningConfig extends ConfigFactory[CLightningConfig] with Logging {
|
||||
object CLightningConfig
|
||||
extends ConfigFactory[CLightningConfig]
|
||||
with BitcoinSLogger {
|
||||
|
||||
/** The empty `lightning` config */
|
||||
override lazy val empty: CLightningConfig =
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.db
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import slick.dbio.{DBIOAction, NoStream}
|
||||
import slick.lifted.AbstractTable
|
||||
|
||||
|
@ -134,7 +134,7 @@ abstract class CRUD[T, PrimaryKeyType](implicit
|
|||
}
|
||||
|
||||
case class SafeDatabase(jdbcProfile: JdbcProfileComponent[DbAppConfig])
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
|
||||
import jdbcProfile.database
|
||||
import jdbcProfile.profile.api.{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.db
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.util.FutureUtil
|
||||
import org.bitcoins.db.DatabaseDriver._
|
||||
import org.flywaydb.core.Flyway
|
||||
|
@ -9,7 +9,7 @@ import org.flywaydb.core.api.{FlywayException, MigrationInfoService}
|
|||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
trait DbManagement extends Logging {
|
||||
trait DbManagement extends BitcoinSLogger {
|
||||
_: JdbcProfileComponent[DbAppConfig] =>
|
||||
import profile.api._
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@ package org.bitcoins.db
|
|||
|
||||
import com.codahale.metrics.{Histogram, MetricRegistry}
|
||||
import com.zaxxer.hikari.{HikariDataSource, HikariPoolMXBean}
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.util._
|
||||
import slick.jdbc.JdbcDataSource
|
||||
import slick.jdbc.hikaricp.HikariCPJdbcDataSource
|
||||
|
@ -17,7 +17,7 @@ case class HikariLogging(
|
|||
hikariDataSource: HikariDataSource,
|
||||
moduleName: String,
|
||||
interval: Duration
|
||||
) extends Logging
|
||||
) extends BitcoinSLogger
|
||||
with StartStop[HikariLogging] {
|
||||
|
||||
/** Logs thread activity */
|
||||
|
@ -163,8 +163,8 @@ case class HikariLogging(
|
|||
queueSize = slickMxBean.getQueueSize
|
||||
)
|
||||
|
||||
logger.info(poolUsageUpdate)
|
||||
logger.info(activityUpdate)
|
||||
logger.info(poolUsageUpdate.toString)
|
||||
logger.info(activityUpdate.toString)
|
||||
}
|
||||
|
||||
private[this] var started: Boolean = false
|
||||
|
@ -208,7 +208,7 @@ case class HikariLogging(
|
|||
}
|
||||
}
|
||||
|
||||
object HikariLogging extends Logging {
|
||||
object HikariLogging extends BitcoinSLogger {
|
||||
private[db] val scheduler = Executors.newScheduledThreadPool(1)
|
||||
|
||||
/** Returns a started hikari logger if configuration is correct, else None
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.bitcoins.db
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import slick.basic.DatabaseConfig
|
||||
import slick.jdbc.{JdbcBackend, JdbcProfile}
|
||||
|
||||
import scala.concurrent.duration.Duration
|
||||
|
||||
trait JdbcProfileComponent[+ConfigType <: DbAppConfig] extends Logging {
|
||||
trait JdbcProfileComponent[+ConfigType <: DbAppConfig] extends BitcoinSLogger {
|
||||
|
||||
def appConfig: ConfigType
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.bitcoins.db
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import java.io.IOException
|
||||
import java.nio.file.{Files, LinkOption, Path}
|
||||
import scala.util.matching.Regex
|
||||
|
||||
object SQLiteUtil extends Logging {
|
||||
object SQLiteUtil extends BitcoinSLogger {
|
||||
|
||||
Class.forName("org.sqlite.JDBC")
|
||||
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
package org.bitcoins.dlc.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.{Actor, ActorLogging, ActorRef, Props, Terminated}
|
||||
import org.apache.pekko.event.LoggingReceive
|
||||
import org.apache.pekko.io.Tcp
|
||||
import org.apache.pekko.util.ByteString
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.wallet.DLCWalletApi
|
||||
import org.bitcoins.core.protocol.BigSizeUInt
|
||||
import org.bitcoins.core.protocol.tlv._
|
||||
|
@ -132,7 +132,7 @@ class DLCConnectionHandler(
|
|||
}
|
||||
}
|
||||
|
||||
object DLCConnectionHandler extends Logging {
|
||||
object DLCConnectionHandler extends BitcoinSLogger {
|
||||
|
||||
case object CloseConnection
|
||||
case class WriteFailed(cause: Option[Throwable])
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.dlc.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.{ActorRef, ActorSystem}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.node.DLCNodeApi
|
||||
import org.bitcoins.core.api.dlc.wallet.DLCWalletApi
|
||||
import org.bitcoins.core.api.node.Peer
|
||||
|
@ -20,7 +20,7 @@ case class DLCNode(wallet: DLCWalletApi)(implicit
|
|||
system: ActorSystem,
|
||||
val config: DLCNodeAppConfig)
|
||||
extends DLCNodeApi
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
implicit val ec: ExecutionContextExecutor = system.dispatcher
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.dlc.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.callback.{CallbackFactory, ModuleCallbacks}
|
||||
import org.bitcoins.core.api.{Callback, CallbackHandler}
|
||||
import org.bitcoins.crypto.Sha256Digest
|
||||
|
@ -9,7 +9,9 @@ import java.net.InetSocketAddress
|
|||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
/** Callbacks for responding to events in the DLC node. */
|
||||
trait DLCNodeCallbacks extends ModuleCallbacks[DLCNodeCallbacks] with Logging {
|
||||
trait DLCNodeCallbacks
|
||||
extends ModuleCallbacks[DLCNodeCallbacks]
|
||||
with BitcoinSLogger {
|
||||
|
||||
def onPeerConnectionInitiated: CallbackHandler[
|
||||
InetSocketAddress,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.dlc.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.{
|
||||
Actor,
|
||||
ActorLogging,
|
||||
|
@ -10,6 +9,7 @@ import org.apache.pekko.actor.{
|
|||
}
|
||||
import org.apache.pekko.event.LoggingReceive
|
||||
import org.apache.pekko.io.{IO, Tcp}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.wallet.DLCWalletApi
|
||||
import org.bitcoins.core.protocol.BigSizeUInt
|
||||
import org.bitcoins.tor._
|
||||
|
@ -78,7 +78,7 @@ class DLCServer(
|
|||
|
||||
}
|
||||
|
||||
object DLCServer extends Logging {
|
||||
object DLCServer extends BitcoinSLogger {
|
||||
|
||||
case object Disconnect
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.dlc.oracle
|
||||
|
||||
import com.typesafe.config.Config
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlcoracle._
|
||||
import org.bitcoins.core.api.dlcoracle.db._
|
||||
import org.bitcoins.core.config.{BitcoinNetwork, MainNet}
|
||||
|
@ -36,7 +36,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
|
||||
case class DLCOracle()(implicit val conf: DLCOracleAppConfig)
|
||||
extends DLCOracleApi
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
implicit private val ec: ExecutionContext = conf.ec
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.dlc.wallet.callback
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.Done
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.stream.OverflowStrategy
|
||||
|
@ -10,6 +9,7 @@ import org.apache.pekko.stream.scaladsl.{
|
|||
Source,
|
||||
SourceQueueWithComplete
|
||||
}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.CallbackHandler
|
||||
import org.bitcoins.core.api.dlc.wallet.db.IncomingDLCOfferDb
|
||||
import org.bitcoins.core.protocol.dlc.models.DLCStatus
|
||||
|
@ -25,7 +25,7 @@ case class DLCWalletCallbackStreamManager(
|
|||
maxBufferSize: Int = 16)(implicit system: ActorSystem)
|
||||
extends DLCWalletCallbacks
|
||||
with StartStopAsync[Unit]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
import system.dispatcher
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.dlc.wallet.callback
|
||||
|
||||
import grizzled.slf4j.{Logging}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.callback.{CallbackFactory, ModuleCallbacks}
|
||||
import org.bitcoins.core.api.dlc.wallet.db.IncomingDLCOfferDb
|
||||
import org.bitcoins.core.api.{Callback, CallbackHandler}
|
||||
|
@ -11,7 +11,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
|
||||
trait DLCWalletCallbacks
|
||||
extends ModuleCallbacks[DLCWalletCallbacks]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
def onStateChange: CallbackHandler[DLCStatus, OnDLCStateChange]
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.dlc.wallet.internal
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.wallet.db.DLCDb
|
||||
import org.bitcoins.core.api.wallet.db.TransactionDb
|
||||
import org.bitcoins.core.hd._
|
||||
|
@ -12,7 +12,7 @@ import org.bitcoins.core.protocol.dlc.sign.DLCTxSigner
|
|||
import org.bitcoins.core.protocol.dlc.verify.DLCSignatureVerifier
|
||||
import org.bitcoins.core.protocol.script._
|
||||
import org.bitcoins.core.protocol.tlv._
|
||||
import org.bitcoins.core.util.sorted.{OrderedAnnouncements}
|
||||
import org.bitcoins.core.util.sorted.OrderedAnnouncements
|
||||
import org.bitcoins.core.wallet.utxo._
|
||||
import org.bitcoins.crypto.Sha256Digest
|
||||
import org.bitcoins.db.SafeDatabase
|
||||
|
@ -30,7 +30,7 @@ import scala.util.Try
|
|||
/** Handles fetching and constructing different DLC datastructures from the database */
|
||||
case class DLCDataManagement(dlcWalletDAOs: DLCWalletDAOs)(implicit
|
||||
ec: ExecutionContext)
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
val dlcDAO = dlcWalletDAOs.dlcDAO
|
||||
private val dlcAnnouncementDAO = dlcWalletDAOs.dlcAnnouncementDAO
|
||||
private val dlcInputsDAO = dlcWalletDAOs.dlcInputsDAO
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.dlc.wallet.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.wallet.db.DLCDb
|
||||
import org.bitcoins.core.api.wallet.db.AccountDb
|
||||
import org.bitcoins.core.config.NetworkParameters
|
||||
|
@ -32,7 +32,7 @@ import scodec.bits.ByteVector
|
|||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
object DLCAcceptUtil extends Logging {
|
||||
object DLCAcceptUtil extends BitcoinSLogger {
|
||||
|
||||
/** Builds an [[DLCAcceptWithoutSigs]] message from relevant data inside of the [[DLCWallet]] */
|
||||
def buildAcceptWithoutSigs(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.feeprovider
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.feeprovider.FeeRateApi
|
||||
import org.bitcoins.core.api.tor.Socks5ProxyParams
|
||||
import org.bitcoins.core.config.BitcoinNetwork
|
||||
|
@ -20,7 +20,7 @@ trait FeeProviderFactory[T <: FeeRateApi] {
|
|||
implicit system: ActorSystem): T
|
||||
}
|
||||
|
||||
object FeeProviderFactory extends Logging {
|
||||
object FeeProviderFactory extends BitcoinSLogger {
|
||||
|
||||
/** Gets a Fee Provider from the given wallet app config
|
||||
* Returns default if there is no config set
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.keymanager
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
/** Exposes access to the key manager logger */
|
||||
private[bitcoins] trait KeyManagerLogger extends Logging
|
||||
private[bitcoins] trait KeyManagerLogger extends BitcoinSLogger
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.keymanager.bip39
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.keymanager.{
|
||||
BIP39KeyManagerApi,
|
||||
BIP39KeyManagerCreateApi,
|
||||
|
@ -70,7 +70,7 @@ class BIP39KeyManager(
|
|||
|
||||
object BIP39KeyManager
|
||||
extends BIP39KeyManagerCreateApi[BIP39KeyManager]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
def fromMnemonic(
|
||||
mnemonic: MnemonicCode,
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package org.bitcoins.keymanager.bip39
|
||||
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.wallet.keymanagement.{
|
||||
KeyManagerParams,
|
||||
KeyManagerUnlockError
|
||||
|
@ -10,10 +11,9 @@ import org.bitcoins.keymanager.ReadMnemonicError.{
|
|||
JsonParsingError
|
||||
}
|
||||
import org.bitcoins.keymanager._
|
||||
import grizzled.slf4j.Logging
|
||||
|
||||
/** Represents a */
|
||||
object BIP39LockedKeyManager extends Logging {
|
||||
object BIP39LockedKeyManager extends BitcoinSLogger {
|
||||
|
||||
/** Unlock the wallet by decrypting the [[EncryptedMnemonic]] seed
|
||||
* @param passphrase the password to decrypt the wallet
|
||||
|
|
|
@ -5,7 +5,6 @@ import org.apache.pekko.actor.ActorSystem
|
|||
import org.apache.pekko.stream.scaladsl.{Sink, Source}
|
||||
import chainrpc._
|
||||
import com.google.protobuf.ByteString
|
||||
import grizzled.slf4j.Logging
|
||||
import invoicesrpc.LookupInvoiceMsg.InvoiceRef
|
||||
import invoicesrpc._
|
||||
import io.grpc.{CallCredentials, Metadata}
|
||||
|
@ -14,7 +13,7 @@ import lnrpc.CloseStatusUpdate.Update.{ChanClose, ClosePending}
|
|||
import lnrpc._
|
||||
import org.apache.pekko.grpc.{GrpcClientSettings, SSLContextUtils}
|
||||
import org.bitcoins.commons.jsonmodels.lnd._
|
||||
import org.bitcoins.commons.util.NativeProcessFactory
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, NativeProcessFactory}
|
||||
import org.bitcoins.core.currency._
|
||||
import org.bitcoins.core.number._
|
||||
import org.bitcoins.core.protocol._
|
||||
|
@ -68,7 +67,7 @@ class LndRpcClient(val instance: LndInstance, binaryOpt: Option[File] = None)(
|
|||
with LndUtils
|
||||
with LndRouterClient
|
||||
with StartStopAsync[LndRpcClient]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
instance match {
|
||||
case _: LndInstanceLocal =>
|
||||
require(binaryOpt.isDefined,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.lnd.rpc.config
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.commons.ConfigFactory
|
||||
import org.bitcoins.core.config._
|
||||
import scodec.bits.ByteVector
|
||||
|
@ -22,7 +22,7 @@ import scala.util.Properties
|
|||
* requests.
|
||||
*/
|
||||
case class LndConfig(private[bitcoins] val lines: Seq[String], datadir: File)
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
|
||||
//create datadir and config if it DNE on disk
|
||||
if (!datadir.exists()) {
|
||||
|
@ -170,7 +170,7 @@ case class LndConfig(private[bitcoins] val lines: Seq[String], datadir: File)
|
|||
}
|
||||
}
|
||||
|
||||
object LndConfig extends ConfigFactory[LndConfig] with Logging {
|
||||
object LndConfig extends ConfigFactory[LndConfig] with BitcoinSLogger {
|
||||
|
||||
/** The empty `lnd` config */
|
||||
override lazy val empty: LndConfig = LndConfig("", DEFAULT_DATADIR)
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.bitcoins.lnurl
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.http.scaladsl.Http
|
||||
import org.apache.pekko.http.scaladsl.client.RequestBuilding.Get
|
||||
import org.apache.pekko.http.scaladsl.model.{HttpRequest, MediaTypes}
|
||||
import org.apache.pekko.http.scaladsl.model.headers.Accept
|
||||
import org.apache.pekko.util.ByteString
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.tor.Socks5ProxyParams
|
||||
import org.bitcoins.core.currency._
|
||||
import org.bitcoins.core.protocol.ln.LnInvoice
|
||||
|
@ -21,7 +21,7 @@ import scala.concurrent._
|
|||
|
||||
class LnURLClient(proxyParams: Option[Socks5ProxyParams])(implicit
|
||||
system: ActorSystem)
|
||||
extends Logging {
|
||||
extends BitcoinSLogger {
|
||||
implicit protected val ec: ExecutionContext = system.dispatcher
|
||||
|
||||
private val http = Http(system)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.callback.{CallbackFactory, ModuleCallbacks}
|
||||
import org.bitcoins.core.api.{Callback, Callback2, CallbackHandler}
|
||||
import org.bitcoins.core.gcs.GolombFilter
|
||||
|
@ -16,7 +16,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
* The appropriate callback is executed whenever the node receives
|
||||
* a `getdata` message matching it.
|
||||
*/
|
||||
trait NodeCallbacks extends ModuleCallbacks[NodeCallbacks] with Logging {
|
||||
trait NodeCallbacks extends ModuleCallbacks[NodeCallbacks] with BitcoinSLogger {
|
||||
|
||||
def onCompactFiltersReceived: CallbackHandler[
|
||||
Vector[(DoubleSha256DigestBE, GolombFilter)],
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
/** Exposes access to the P2P submodule logger */
|
||||
private[bitcoins] trait P2PLogger extends Logging
|
||||
private[bitcoins] trait P2PLogger extends BitcoinSLogger
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.bitcoins.node
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.Done
|
||||
import org.apache.pekko.stream.scaladsl.{Sink, SourceQueue}
|
||||
import org.bitcoins.asyncutil.AsyncUtil
|
||||
import org.bitcoins.chain.blockchain.ChainHandler
|
||||
import org.bitcoins.chain.config.ChainAppConfig
|
||||
import org.bitcoins.chain.models.BlockHeaderDAO
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.chain.ChainApi
|
||||
import org.bitcoins.core.api.chain.db.{
|
||||
BlockHeaderDb,
|
||||
|
@ -1084,7 +1084,7 @@ case class PeerManager(
|
|||
|
||||
case class ResponseTimeout(payload: NetworkPayload)
|
||||
|
||||
object PeerManager extends Logging {
|
||||
object PeerManager extends BitcoinSLogger {
|
||||
|
||||
/** Sends first getcfheader message.
|
||||
* Returns None if are our filter headers are in sync with our block headers or
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.node.callback
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.Done
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.stream.OverflowStrategy
|
||||
|
@ -10,6 +9,7 @@ import org.apache.pekko.stream.scaladsl.{
|
|||
Source,
|
||||
SourceQueueWithComplete
|
||||
}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.CallbackHandler
|
||||
import org.bitcoins.core.gcs.GolombFilter
|
||||
import org.bitcoins.core.protocol.blockchain.{Block, BlockHeader, MerkleBlock}
|
||||
|
@ -28,7 +28,7 @@ case class NodeCallbackStreamManager(
|
|||
maxBufferSize: Int = 16)(implicit system: ActorSystem)
|
||||
extends NodeCallbacks
|
||||
with StartStopAsync[Unit]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
import system.dispatcher
|
||||
|
||||
private val filterQueueSource: Source[
|
||||
|
|
|
@ -14,7 +14,6 @@ object Deps {
|
|||
val logkitV = "20020529"
|
||||
val avalonLoggingV = "20020627"
|
||||
|
||||
val grizzledSlf4j = "1.3.4"
|
||||
val scalacheck = "1.17.0"
|
||||
val scalaTest = "3.2.18" //https://www.scalatest.org/
|
||||
|
||||
|
@ -178,9 +177,6 @@ object Deps {
|
|||
val avalonLogging =
|
||||
"avalon-framework" % "avalon-framework" % V.avalonLoggingV //https://github.com/apache/commons-logging/blob/0d4f2604ada038fd95e714d504d2278f1bd5814a/pom.xml#L498
|
||||
|
||||
val grizzledSlf4j =
|
||||
"org.clapper" %% "grizzled-slf4j" % V.grizzledSlf4j withSources () withJavadoc ()
|
||||
|
||||
val codehaus = "org.codehaus.janino" % "janino" % V.codehausV
|
||||
|
||||
//for loading secp256k1 natively
|
||||
|
@ -261,7 +257,6 @@ object Deps {
|
|||
val junitInterface =
|
||||
"com.github.sbt" % "junit-interface" % V.junitV % "test" withSources () withJavadoc ()
|
||||
val logback = Compile.logback % "test"
|
||||
val grizzledSlf4j = Compile.grizzledSlf4j % "test"
|
||||
|
||||
val scalacheck = Def.setting(
|
||||
"org.scalacheck" %%% "scalacheck" % V.scalacheck % "test" withSources () withJavadoc ())
|
||||
|
@ -310,7 +305,6 @@ object Deps {
|
|||
Compile.newMicroPickle.value,
|
||||
Compile.playJson,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j,
|
||||
Compile.typesafeConfig
|
||||
)
|
||||
}
|
||||
|
@ -337,14 +331,12 @@ object Deps {
|
|||
|
||||
val dlcWallet =
|
||||
List(
|
||||
Compile.newMicroJson,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.newMicroJson
|
||||
)
|
||||
|
||||
val dlcNode =
|
||||
List(
|
||||
Compile.newMicroJson,
|
||||
Compile.grizzledSlf4j,
|
||||
Compile.akkaActor
|
||||
)
|
||||
|
||||
|
@ -399,7 +391,6 @@ object Deps {
|
|||
List(
|
||||
Compile.zeromq,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j,
|
||||
Test.logback,
|
||||
Test.scalacheck.value,
|
||||
Test.scalaTest.value
|
||||
|
@ -410,8 +401,7 @@ object Deps {
|
|||
Compile.akkaHttp,
|
||||
Compile.akkaStream,
|
||||
Compile.typesafeConfig,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.slf4j
|
||||
)
|
||||
|
||||
def bitcoindRpcTest = Def.setting {
|
||||
|
@ -441,7 +431,6 @@ object Deps {
|
|||
Compile.postgres,
|
||||
Compile.slickHikari,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j,
|
||||
Test.scalaTest.value,
|
||||
Test.pgEmbedded
|
||||
)
|
||||
|
@ -511,14 +500,12 @@ object Deps {
|
|||
Compile.akkaHttp,
|
||||
Compile.akkaStream,
|
||||
Compile.playJson,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.slf4j
|
||||
)
|
||||
|
||||
val clightningRpc = List(
|
||||
Compile.jUnixSocket,
|
||||
Compile.playJson,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.playJson
|
||||
)
|
||||
|
||||
val clightningRpcTest = Def.setting {
|
||||
|
@ -533,8 +520,7 @@ object Deps {
|
|||
List(
|
||||
Compile.akkaStream,
|
||||
Compile.akkaHttp,
|
||||
Compile.scodec.value,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.scodec.value
|
||||
)
|
||||
}
|
||||
|
||||
|
@ -546,8 +532,7 @@ object Deps {
|
|||
Compile.akkaDiscovery,
|
||||
Compile.pekkoGrpc,
|
||||
Compile.playJson,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.slf4j
|
||||
)
|
||||
|
||||
def eclairRpcTest = Def.setting {
|
||||
|
@ -596,8 +581,7 @@ object Deps {
|
|||
Compile.slick,
|
||||
Compile.slickHikari,
|
||||
Compile.sqlite,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.slf4j
|
||||
)
|
||||
|
||||
val nodeTest = Def.setting {
|
||||
|
@ -625,7 +609,6 @@ object Deps {
|
|||
Compile.scalaTestPlus.value,
|
||||
Compile.pgEmbedded,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j,
|
||||
Compile.akkaTestkit
|
||||
)
|
||||
}
|
||||
|
@ -645,7 +628,6 @@ object Deps {
|
|||
Compile.newMicroJson,
|
||||
Compile.logback,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j,
|
||||
Compile.akkaActor,
|
||||
Compile.akkaStream
|
||||
)
|
||||
|
@ -673,8 +655,7 @@ object Deps {
|
|||
List(
|
||||
Compile.newMicroJson,
|
||||
Compile.logback,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.slf4j
|
||||
)
|
||||
|
||||
val dlcOracleTest =
|
||||
|
@ -688,7 +669,6 @@ object Deps {
|
|||
Compile.akkaActor,
|
||||
Compile.akkaSlf4j,
|
||||
Compile.akkaStream,
|
||||
Compile.slf4j,
|
||||
Compile.grizzledSlf4j
|
||||
Compile.slf4j
|
||||
)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.testkit.chain
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.bitcoins.chain.blockchain.ChainHandler
|
||||
import org.bitcoins.chain.blockchain.sync.{
|
||||
|
@ -10,6 +9,7 @@ import org.bitcoins.chain.blockchain.sync.{
|
|||
}
|
||||
import org.bitcoins.chain.config.ChainAppConfig
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.GetBlockFilterResult
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.node
|
||||
import org.bitcoins.core.api.node.{NodeApi, NodeChainQueryApi}
|
||||
import org.bitcoins.core.api.wallet.WalletApi
|
||||
|
@ -32,7 +32,7 @@ import org.bitcoins.wallet.sync.WalletSync
|
|||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
/** Useful utilities to use in the chain project for syncing things against bitcoind */
|
||||
abstract class SyncUtil extends Logging {
|
||||
abstract class SyncUtil extends BitcoinSLogger {
|
||||
|
||||
/** Creates a function that will retrun bitcoin's best block hash when called */
|
||||
def getBestBlockHashFunc(
|
||||
|
|
|
@ -3,8 +3,8 @@ package org.bitcoins.testkit.clightning
|
|||
import org.apache.pekko.actor.ActorSystem
|
||||
import com.bitcoins.clightning.rpc.CLightningRpcClient
|
||||
import com.bitcoins.clightning.rpc.config.CLightningInstanceLocal
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.jsonmodels.clightning.CLightningJsonModels.FundChannelResult
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.currency._
|
||||
import org.bitcoins.core.protocol.ln.node.NodeId
|
||||
import org.bitcoins.core.wallet.fee.SatoshisPerVirtualByte
|
||||
|
@ -22,7 +22,7 @@ import scala.concurrent.duration.DurationInt
|
|||
import scala.concurrent.{ExecutionContext, Future}
|
||||
import scala.util.Properties
|
||||
|
||||
trait CLightningRpcTestUtil extends Logging {
|
||||
trait CLightningRpcTestUtil extends BitcoinSLogger {
|
||||
|
||||
val sbtBinaryDirectory: Path =
|
||||
TestkitBinaries.baseBinaryDirectory.resolve("clightning")
|
||||
|
|
|
@ -2,13 +2,13 @@ package org.bitcoins.testkit.eclair.rpc
|
|||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import com.typesafe.config.{Config, ConfigFactory}
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.jsonmodels.eclair.{
|
||||
IncomingPaymentStatus,
|
||||
OutgoingPayment,
|
||||
OutgoingPaymentStatus,
|
||||
PaymentId
|
||||
}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.compat.JavaConverters._
|
||||
import org.bitcoins.core.currency.{CurrencyUnit, Satoshis}
|
||||
import org.bitcoins.core.protocol.ln.channel.{
|
||||
|
@ -51,7 +51,7 @@ import scala.util.{Failure, Success}
|
|||
* Each double sided arrow represents a P2P connection as well as a funded
|
||||
* channel
|
||||
*/
|
||||
trait EclairRpcTestUtil extends Logging {
|
||||
trait EclairRpcTestUtil extends BitcoinSLogger {
|
||||
|
||||
def randomEclairDatadir(): File =
|
||||
new File(s"/tmp/eclair-test/${FileUtil.randomDirName}/.eclair/")
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
package org.bitcoins.testkit.lnd
|
||||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.asyncutil.AsyncUtil
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.currency.{Bitcoins, CurrencyUnit, Satoshis}
|
||||
import org.bitcoins.core.number.UInt32
|
||||
import org.bitcoins.core.protocol.ln.node.NodeId
|
||||
|
@ -29,7 +29,7 @@ import scala.concurrent.duration.DurationInt
|
|||
import scala.concurrent.{ExecutionContext, Future}
|
||||
import scala.util.Properties
|
||||
|
||||
trait LndRpcTestUtil extends Logging {
|
||||
trait LndRpcTestUtil extends BitcoinSLogger {
|
||||
|
||||
val sbtBinaryDirectory: Path =
|
||||
TestkitBinaries.baseBinaryDirectory.resolve("lnd")
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package org.bitcoins.testkit.rpc
|
||||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.asyncutil.AsyncUtil
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.RpcOpts.AddNodeArgument
|
||||
import org.bitcoins.commons.jsonmodels.bitcoind.{
|
||||
|
@ -10,6 +9,7 @@ import org.bitcoins.commons.jsonmodels.bitcoind.{
|
|||
RpcOpts,
|
||||
SignRawTransactionResult
|
||||
}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.compat.JavaConverters._
|
||||
import org.bitcoins.core.config.RegTest
|
||||
import org.bitcoins.core.currency.Bitcoins
|
||||
|
@ -48,7 +48,7 @@ import scala.concurrent.duration.{DurationInt, FiniteDuration}
|
|||
import scala.util._
|
||||
|
||||
//noinspection AccessorLikeMethodIsEmptyParen
|
||||
trait BitcoindRpcTestUtil extends Logging {
|
||||
trait BitcoindRpcTestUtil extends BitcoinSLogger {
|
||||
|
||||
lazy val network: RegTest.type = RegTest
|
||||
|
||||
|
|
|
@ -2,8 +2,8 @@ package org.bitcoins.testkit.util
|
|||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.util.Timeout
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.testkit.TestKit
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.config.NetworkParameters
|
||||
import org.bitcoins.testkit.rpc.BitcoindRpcTestUtil
|
||||
import org.bitcoins.testkitcore.util.BaseAsyncTest
|
||||
|
@ -15,7 +15,7 @@ import scala.concurrent.ExecutionContext
|
|||
/** A bitcoin-s async test trait, that uses akka's actor system
|
||||
* execution context to run the scalatest test suites
|
||||
*/
|
||||
trait BitcoinSPekkoAsyncTest extends BaseAsyncTest with Logging {
|
||||
trait BitcoinSPekkoAsyncTest extends BaseAsyncTest with BitcoinSLogger {
|
||||
this: AsyncTestSuite =>
|
||||
implicit lazy val akkaTimeout: Timeout = Timeout(duration)
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.testkit.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import java.nio.file.Files
|
||||
import org.bitcoins.rpc.client.common.BitcoindRpcClient
|
||||
|
@ -9,7 +9,8 @@ import org.bitcoins.testkit.rpc.BitcoindRpcTestUtil
|
|||
import scala.collection.mutable
|
||||
import scala.concurrent.{Await, Future}
|
||||
|
||||
trait BitcoindRpcBaseTest extends Logging { this: BitcoinSPekkoAsyncTest =>
|
||||
trait BitcoindRpcBaseTest extends BitcoinSLogger {
|
||||
this: BitcoinSPekkoAsyncTest =>
|
||||
|
||||
private val dirExists =
|
||||
Files.exists(BitcoindRpcTestClient.sbtBinaryDirectory)
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package org.bitcoins.testkit.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.{Files, Path, Paths}
|
||||
import scala.annotation.tailrec
|
||||
import scala.util.{Properties, Random}
|
||||
|
||||
object FileUtil extends Logging {
|
||||
object FileUtil extends BitcoinSLogger {
|
||||
|
||||
/** Returns a `BufferedSource` for any file on the classpath */
|
||||
def getFileAsSource(fileName: String): scala.io.BufferedSource = {
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
package org.bitcoins.testkit.util
|
||||
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.config.RegTest
|
||||
import org.bitcoins.core.util.StartStopAsync
|
||||
import grizzled.slf4j.Logging
|
||||
|
||||
import java.nio.file.Path
|
||||
|
||||
/** A utility trait for handling binaries like bitcoind/eclair.
|
||||
* All common utility methods should go in this trait
|
||||
*/
|
||||
trait RpcBinaryUtil[T] extends StartStopAsync[T] with Logging {
|
||||
trait RpcBinaryUtil[T] extends StartStopAsync[T] with BitcoinSLogger {
|
||||
|
||||
/** The path to the binary, an example is
|
||||
* '/home/suredbits/.bitcoin-s/binaries/bitcoind/bitcoin-0.20.1/bin/bitcoind'
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
package org.bitcoins.testkit.util
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.util.NetworkUtil.portIsBound
|
||||
import org.bitcoins.tor.TorParams
|
||||
|
||||
import java.net.{InetAddress, InetSocketAddress}
|
||||
import scala.util.Properties
|
||||
|
||||
object TorUtil extends Logging {
|
||||
object TorUtil extends BitcoinSLogger {
|
||||
|
||||
val torEnabled: Boolean = Properties
|
||||
.envOrNone("TOR")
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.testkit.wallet
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.dlc.wallet.db.DLCDb
|
||||
import org.bitcoins.core.crypto.WitnessTxSigComponent
|
||||
import org.bitcoins.core.currency._
|
||||
|
@ -35,7 +35,7 @@ import scodec.bits.ByteVector
|
|||
import java.time.Instant
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
object DLCWalletUtil extends Logging {
|
||||
object DLCWalletUtil extends BitcoinSLogger {
|
||||
lazy val oraclePrivKey: ECPrivateKey = ECPrivateKey.freshPrivateKey
|
||||
|
||||
lazy val kValues: Vector[ECPrivateKey] = {
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package org.bitcoins.testkit.wallet
|
||||
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.chain.ChainQueryApi
|
||||
import org.bitcoins.core.api.node.NodeApi
|
||||
import org.bitcoins.core.api.wallet.HDWalletApi
|
||||
|
@ -27,7 +27,7 @@ import org.bitcoins.wallet.config.WalletAppConfig
|
|||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
trait FundWalletUtil extends Logging {
|
||||
trait FundWalletUtil extends BitcoinSLogger {
|
||||
|
||||
/** Funds the given wallet with money from the given bitcoind */
|
||||
def fundWalletWithBitcoind[T <: WalletWithBitcoind[_ <: BitcoindRpcClient]](
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.tor
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.NotUsed
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.http.scaladsl.ClientTransport.TCP
|
||||
|
@ -18,6 +17,7 @@ import org.apache.pekko.stream.stage.{
|
|||
StageLogging
|
||||
}
|
||||
import org.apache.pekko.util.ByteString
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.tor.Socks5ProxyParams
|
||||
import org.bitcoins.core.util.NetworkUtil
|
||||
|
||||
|
@ -121,7 +121,7 @@ class Socks5ProxyGraphStage(
|
|||
proxyParams: Socks5ProxyParams)
|
||||
extends GraphStage[
|
||||
BidiShape[ByteString, ByteString, ByteString, ByteString]]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
val bytesIn: Inlet[ByteString] = Inlet("OutgoingTCP.in")
|
||||
val bytesOut: Outlet[ByteString] = Outlet("OutgoingTCP.out")
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
package org.bitcoins.tor
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.NotUsed
|
||||
import org.apache.pekko.actor.{Actor, ActorLogging, ActorRef, Props, Terminated}
|
||||
import org.apache.pekko.io.Tcp
|
||||
import org.apache.pekko.stream.Materializer
|
||||
import org.apache.pekko.stream.scaladsl.{Flow, Keep, Sink, Source}
|
||||
import org.apache.pekko.util.ByteString
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.tor.Credentials
|
||||
import org.bitcoins.tor.Socks5Connection.Socks5Connect
|
||||
|
||||
|
@ -27,7 +27,7 @@ class Socks5Connection(
|
|||
target: Socks5Connect)
|
||||
extends Actor
|
||||
with ActorLogging
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
import Socks5Connection._
|
||||
|
||||
|
@ -108,7 +108,7 @@ class Socks5Connection(
|
|||
|
||||
}
|
||||
|
||||
object Socks5Connection extends Logging {
|
||||
object Socks5Connection extends BitcoinSLogger {
|
||||
|
||||
def props(
|
||||
tcpConnection: ActorRef,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.tor
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.callback.{CallbackFactory, ModuleCallbacks}
|
||||
import org.bitcoins.core.api.{Callback, CallbackHandler}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
|
||||
trait OnTorStarted extends Callback[Unit]
|
||||
|
||||
trait TorCallbacks extends ModuleCallbacks[TorCallbacks] with Logging {
|
||||
trait TorCallbacks extends ModuleCallbacks[TorCallbacks] with BitcoinSLogger {
|
||||
def onTorStarted: CallbackHandler[Unit, OnTorStarted]
|
||||
|
||||
def executeOnTorStarted()(implicit ec: ExecutionContext): Future[Unit] = {
|
||||
|
|
|
@ -2,7 +2,6 @@ package org.bitcoins.tor
|
|||
|
||||
import org.apache.pekko.Done
|
||||
import org.apache.pekko.util.ByteString
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.actor.{
|
||||
Actor,
|
||||
ActorLogging,
|
||||
|
@ -13,6 +12,7 @@ import org.apache.pekko.actor.{
|
|||
Terminated
|
||||
}
|
||||
import org.apache.pekko.io.{IO, Tcp}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.tor.TorProtocolHandler.Authentication
|
||||
|
||||
import java.io.IOException
|
||||
|
@ -85,7 +85,7 @@ class TorController(
|
|||
|
||||
}
|
||||
|
||||
object TorController extends Logging {
|
||||
object TorController extends BitcoinSLogger {
|
||||
|
||||
def props(
|
||||
address: InetSocketAddress,
|
||||
|
|
|
@ -1,12 +1,11 @@
|
|||
package org.bitcoins.tor.client
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.NativeProcessFactory
|
||||
import org.bitcoins.commons.util.{BitcoinSLogger, NativeProcessFactory}
|
||||
import org.bitcoins.core.api.tor.Socks5ProxyParams
|
||||
import org.bitcoins.core.util.EnvUtil
|
||||
import org.bitcoins.tor.TorProtocolHandler._
|
||||
import org.bitcoins.tor.config.TorAppConfig
|
||||
import org.bitcoins.tor.{TorParams}
|
||||
import org.bitcoins.tor.TorParams
|
||||
|
||||
import java.io.{File, FileNotFoundException}
|
||||
import java.net.{InetAddress, InetSocketAddress}
|
||||
|
@ -19,7 +18,7 @@ class TorClient()(implicit
|
|||
val executionContext: ExecutionContext,
|
||||
conf: TorAppConfig)
|
||||
extends NativeProcessFactory
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
lazy val socks5ProxyParams: Socks5ProxyParams = conf.socks5ProxyParams match {
|
||||
case Some(params) => params
|
||||
|
@ -75,7 +74,7 @@ class TorClient()(implicit
|
|||
|
||||
}
|
||||
|
||||
object TorClient extends Logging {
|
||||
object TorClient extends BitcoinSLogger {
|
||||
|
||||
// made by doing ./tor --version
|
||||
val TOR_VERSION = "Tor 0.4.7.10 (git-f732a91a73be3ca6)"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.wallet
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.wallet.CoinSelectionAlgo
|
||||
import org.bitcoins.core.api.wallet.db.SpendingInfoDb
|
||||
import org.bitcoins.core.currency.{Bitcoins, Satoshis}
|
||||
|
@ -25,7 +25,7 @@ import scala.concurrent.Future
|
|||
|
||||
class UTXOLifeCycleTest
|
||||
extends BitcoinSWalletTestCachedBitcoindNewest
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
behavior of "Wallet Txo States"
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.wallet
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.chain.ChainQueryApi
|
||||
import org.bitcoins.core.api.dlc.wallet.DLCNeutrinoHDWalletApi
|
||||
import org.bitcoins.core.api.dlc.wallet.db.{
|
||||
|
@ -55,7 +55,7 @@ class WalletNotInitialized extends Exception("The wallet is not initialized")
|
|||
class WalletHolder(initWalletOpt: Option[DLCNeutrinoHDWalletApi])(implicit
|
||||
ec: ExecutionContext)
|
||||
extends DLCNeutrinoHDWalletApi
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
|
||||
@volatile private var walletOpt: Option[DLCNeutrinoHDWalletApi] =
|
||||
initWalletOpt
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.wallet
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
/** Exposes access to the wallet logger */
|
||||
private[bitcoins] trait WalletLogger extends Logging
|
||||
private[bitcoins] trait WalletLogger extends BitcoinSLogger
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package org.bitcoins.wallet.callback
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.apache.pekko.Done
|
||||
import org.apache.pekko.actor.ActorSystem
|
||||
import org.apache.pekko.stream.OverflowStrategy
|
||||
|
@ -10,6 +9,7 @@ import org.apache.pekko.stream.scaladsl.{
|
|||
Source,
|
||||
SourceQueueWithComplete
|
||||
}
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.CallbackHandler
|
||||
import org.bitcoins.core.api.wallet.db.SpendingInfoDb
|
||||
import org.bitcoins.core.protocol.BitcoinAddress
|
||||
|
@ -28,7 +28,7 @@ case class WalletCallbackStreamManager(
|
|||
)(implicit system: ActorSystem)
|
||||
extends WalletCallbacks
|
||||
with StartStopAsync[Unit]
|
||||
with Logging {
|
||||
with BitcoinSLogger {
|
||||
import system.dispatcher
|
||||
|
||||
private val txProcessedQueueSource: Source[
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.wallet.callback
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.CallbackHandler
|
||||
import org.bitcoins.core.api.callback.{CallbackFactory, ModuleCallbacks}
|
||||
import org.bitcoins.core.api.wallet.db.SpendingInfoDb
|
||||
|
@ -15,7 +15,9 @@ import scala.concurrent.{ExecutionContext, Future}
|
|||
* The appropriate callback is executed whenever the wallet finishes,
|
||||
* the corresponding function.
|
||||
*/
|
||||
trait WalletCallbacks extends ModuleCallbacks[WalletCallbacks] with Logging {
|
||||
trait WalletCallbacks
|
||||
extends ModuleCallbacks[WalletCallbacks]
|
||||
with BitcoinSLogger {
|
||||
|
||||
def onTransactionProcessed: CallbackHandler[
|
||||
Transaction,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.wallet.sync
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.api.wallet.WalletApi
|
||||
import org.bitcoins.core.protocol.blockchain.{Block, BlockHeader}
|
||||
import org.bitcoins.core.util.FutureUtil
|
||||
|
@ -8,7 +8,7 @@ import org.bitcoins.crypto.DoubleSha256DigestBE
|
|||
|
||||
import scala.concurrent.{ExecutionContext, Future}
|
||||
|
||||
trait WalletSync extends Logging {
|
||||
trait WalletSync extends BitcoinSLogger {
|
||||
|
||||
/** Synchronizes the bitcoin-s' wallet by retrieving each block and then calling
|
||||
* [[Wallet.processBlock()]] on the block retrieved
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.bitcoins.zmq
|
||||
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
import org.bitcoins.core.protocol.blockchain.Block
|
||||
import org.bitcoins.core.protocol.transaction.Transaction
|
||||
import org.bitcoins.core.util.StartStop
|
||||
|
@ -27,7 +27,7 @@ class ZMQSubscriber(
|
|||
hashBlockListener: Option[DoubleSha256DigestBE => Unit],
|
||||
rawTxListener: Option[Transaction => Unit],
|
||||
rawBlockListener: Option[Block => Unit])
|
||||
extends Logging
|
||||
extends BitcoinSLogger
|
||||
with StartStop[Unit] {
|
||||
|
||||
private var isConnected = false
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package org.bitcoins.zmq
|
||||
|
||||
import java.net.InetSocketAddress
|
||||
import org.bitcoins.commons.util.BitcoinSLogger
|
||||
|
||||
import java.net.InetSocketAddress
|
||||
import org.bitcoins.core.config.MainNet
|
||||
import org.bitcoins.core.protocol.blockchain.Block
|
||||
import org.bitcoins.core.protocol.transaction.Transaction
|
||||
import grizzled.slf4j.Logging
|
||||
import org.bitcoins.crypto.DoubleSha256DigestBE
|
||||
import org.scalatest.flatspec.AsyncFlatSpec
|
||||
import org.zeromq.{SocketType, ZFrame, ZMQ, ZMsg}
|
||||
|
||||
import scala.concurrent.Promise
|
||||
|
||||
class ZMQSubscriberTest extends AsyncFlatSpec with Logging {
|
||||
class ZMQSubscriberTest extends AsyncFlatSpec with BitcoinSLogger {
|
||||
|
||||
behavior of "ZMQSubscriber"
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue