Fix Scala 2.11 complaints

This commit is contained in:
Torkel Rogstad 2019-06-25 10:42:27 +02:00
parent 89e3f7dc38
commit 505d3cbaa1
2 changed files with 26 additions and 17 deletions

View file

@ -43,22 +43,29 @@ import scala.concurrent.ExecutionContext
class TrezorAddressTest extends BitcoinSWalletTest with EmptyFixture { class TrezorAddressTest extends BitcoinSWalletTest with EmptyFixture {
val mnemonic = MnemonicCode.fromWords( val mnemonic = MnemonicCode.fromWords(
Vector("stage", Vector(
"boring", "stage",
"net", "boring",
"gather", "net",
"radar", "gather",
"radio", "radar",
"arrest", "radio",
"eye", "arrest",
"ask", "eye",
"risk", "ask",
"girl", "risk",
"country")) "girl",
"country"
)
)
lazy val json: JsValue = { lazy val json: JsValue = {
val stream = {
val classLoader = getClass().getClassLoader()
classLoader.getResourceAsStream("trezor-addresses.json")
}
val rawText = Source val rawText = Source
.fromResource("trezor-addresses.json") .fromInputStream(stream)
.getLines .getLines
.drop(1) // first line is a comment .drop(1) // first line is a comment
.mkString .mkString
@ -279,7 +286,7 @@ class TrezorAddressTest extends BitcoinSWalletTest with EmptyFixture {
nestedAssertions.flatten nestedAssertions.flatten
} }
assert(assertions.forall(_.isInstanceOf[succeed.type])) assert(assertions.forall(_.isCompleted))
} }
} }

View file

@ -37,7 +37,7 @@ object GetAddresses extends App {
val accountPath = BIP32Path( val accountPath = BIP32Path(
BIP32Node(constant.constant, hardened = true), BIP32Node(constant.constant, hardened = true),
BIP32Node(coin.toInt, hardened = true), BIP32Node(coin.toInt, hardened = true),
BIP32Node(accountIndex, hardened = true), BIP32Node(accountIndex, hardened = true)
) )
val pathType = val pathType =
@ -83,7 +83,8 @@ object GetAddresses extends App {
"chain" -> chainType.toString, "chain" -> chainType.toString,
"addressIndex" -> addressIndex, "addressIndex" -> addressIndex,
"address" -> address "address" -> address
)) )
)
json json
} }
@ -94,7 +95,8 @@ object GetAddresses extends App {
"account" -> accountIndex, "account" -> accountIndex,
"xpub" -> xpub, "xpub" -> xpub,
"addresses" -> addresses "addresses" -> addresses
)) )
)
json json
} }