Change Factory to an abstract class (#330)

This commit is contained in:
Chris Stewart 2019-02-07 19:58:39 -06:00 committed by GitHub
parent b44c7af53d
commit 50aa66404c
2 changed files with 3 additions and 3 deletions

View file

@ -6,7 +6,7 @@ import org.bitcoins.core.script.ScriptOperationFactory
import org.bitcoins.core.util.{BitcoinSUtil, BitcoinScriptUtil, Factory}
import scodec.bits.ByteVector
import scala.util.{Failure, Success, Try}
import scala.util.{Failure, Try}
/**
* Created by chris on 1/6/16.

View file

@ -7,7 +7,7 @@ import scodec.bits.ByteVector
* Created by chris on 2/26/16.
* Trait to implement ubiquitous factory functions across our codebase
*/
trait Factory[T] {
abstract class Factory[+T] {
/** Creates a T out of a hex string. */
def fromHex(hex: String): T = fromBytes(BitcoinSUtil.decodeHex(hex))
@ -21,7 +21,7 @@ trait Factory[T] {
/** Creates a T from a hex string. */
def apply(hex: String): T = fromHex(hex)
def logger: Logger = BitcoinSLogger.logger
lazy val logger: Logger = BitcoinSLogger.logger
/** Allows a `def foo[C: Factory]()` construction. */
implicit def self: Factory[T] = this