# Path: lib/chainparams.py
# def get_active_chain():
# def set_active_chain(chaincode):
# def is_known_chain(code):
# def get_params(code):
# def get_chainparam(code, property):
# def get_chain_index(code):
# def get_code_from_index(index):
# def get_server_trust(code):
# def get_chain_instance(code):


import shutil
import tempfile
import sys
import unittest
from StringIO import StringIO
from lib.bitcoin import bip32_root, bip32_private_derivation, bip32_public_derivation, xpub_from_xprv, deserialize_xkey, hash_160, hash_160_to_bc_address
from lib.wallet import WalletStorage, Wallet_2of2
from lib import chainparams
from lib.transaction import Transaction



class FakeConfig(object):
    """A stub config file to be used in tests"""
    def __init__(self, path):
        self.path = path
        self.store = {}

    def set_active_chain_code(self, value, save=True):
        value = value.upper()
        if not chainparams.is_known_chain(value):
            return False
        self.store['active_chain_code'] = value
        if self.store.get(value,None) is None:
            self.store[value] = {}

# Path: lib/chainparams.py
# def get_active_chain():
# def set_active_chain(chaincode):
# def is_known_chain(code):
# def get_params(code):
# def get_chainparam(code, property):
# def get_chain_index(code):
# def get_code_from_index(index):
# def get_server_trust(code):
# def get_chain_instance(code):


# Path: lib/tests/test_multisig.py
import shutil
import tempfile
import sys
import unittest
from StringIO import StringIO
from lib.bitcoin import bip32_root, bip32_private_derivation, bip32_public_derivation, xpub_from_xprv, deserialize_xkey, hash_160, hash_160_to_bc_address
from lib.wallet import WalletStorage, Wallet_2of2
from lib import chainparams
from lib.transaction import Transaction




class FakeConfig(object):
    """A stub config file to be used in tests"""
    def __init__(self, path):
        self.path = path
        self.store = {}

    def set_active_chain_code(self, value, save=True):
        value = value.upper()
        if not chainparams.is_known_chain(value):
            return False
        self.store['active_chain_code'] = value
        if self.store.get(value,None) is None:
            self.store[value] = {}

        chainparams.set_active_chain(value)