mirror of
https://github.com/bitcoin-s/bitcoin-s.git
synced 2025-03-13 11:35:40 +01:00
Change Factory to an abstract class (#330)
This commit is contained in:
parent
b44c7af53d
commit
50aa66404c
2 changed files with 3 additions and 3 deletions
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue