 
 typealias CoreCurrency = BRCrypto.Currency
 typealias AppCurrency = breadwallet.Currency
+
+private let networks = Network.installBuiltins()
 
 struct TestCurrencies {
     private static let btcMetaData = Data("""

    static var bch: AppCurrency {
        let bch = CoreCurrency(uids: Currencies.bch.uid.rawValue, name: "Bitcoin Cash", code: Currencies.bch.code, type: "native", issuer: nil)
        let metaData = try! JSONDecoder().decode(CurrencyMetaData.self, from: bchMetaData)
        let BCH_SATOSHI = BRCrypto.Unit (currency: bch, uids: "BCH-SAT",  name: "Satoshi", symbol: "SAT")
        let BCH_BCH = BRCrypto.Unit (currency: bch, uids: "BCH-BTC",  name: "Bitcoin Cash", symbol: "BCH", base: BCH_SATOSHI, decimals: 8)
        let associations = Network.Association (baseUnit: BCH_SATOSHI,
                                                defaultUnit: BCH_BCH,
                                                units: Set (arrayLiteral: BCH_SATOSHI, BCH_BCH))
        let fee = NetworkFee (timeIntervalInMilliseconds: 30 * 1000,
                              pricePerCostFactor: BRCrypto.Amount.create(integer: 1000, unit: BCH_SATOSHI))
        let network = Network (uids: "bitcoin-cash-mainnet",
                               name: "bitcoin-cash-name",
                               isMainnet: true,
                               currency: bch,
                               height: 100000,
                               associations: [bch:associations],
                               fees: [fee],
                               confirmationsUntilFinal: 6)
        return AppCurrency(core: bch,
                           network: network,
                           metaData: metaData,

    static var btc: AppCurrency {
        let btc = CoreCurrency(uids: Currencies.btc.uid.rawValue, name: "Bitcoin", code: Currencies.btc.code, type: "native", issuer: nil)
        let metaData = try! JSONDecoder().decode(CurrencyMetaData.self, from: btcMetaData)
        let network = networks.first(where: { $0.uids == "bitcoin-mainnet" })!
        let BTC_SATOSHI = BRCrypto.Unit(currency: btc, code: "BTC-SAT", name: "Satoshi", symbol: "SAT")
        let BTC_BTC = BRCrypto.Unit (currency: btc, code: "BTC-BTC",  name: "Bitcoin", symbol: "B", base: BTC_SATOSHI, decimals: 8)
        return AppCurrency(core: btc,
                           network: network,
                           metaData: metaData,
