Esempio n. 1
0
 def setchain(self, chaincode):
     """Set the chain that your wallet is currently using."""
     if not chainparams.is_known_chain(chaincode):
         return 'Invalid chain: "{}"'.format(chaincode)
     if self.config.get_active_chain_code() == chaincode:
         return 'Active chain is already {}'.format(chaincode)
     self.config.set_active_chain_code(chaincode)
     self.network.switch_to_active_chain()
     return 'Active chain is now {}'.format(self.config.get_active_chain_code())
Esempio n. 2
0
 def setchain(self, chaincode):
     """Set the chain that your wallet is currently using."""
     if not chainparams.is_known_chain(chaincode):
         return 'Invalid chain: "{}"'.format(chaincode)
     if self.config.get_active_chain_code() == chaincode:
         return 'Active chain is already {}'.format(chaincode)
     self.config.set_active_chain_code(chaincode)
     self.network.switch_to_active_chain()
     return 'Active chain is now {}'.format(
         self.config.get_active_chain_code())
Esempio n. 3
0
 def set_active_chain_code(self, value, save = True):
     """Easy way to account for the config being divided by chain indices"""
     value = value.upper()
     if not chainparams.is_known_chain(value):
         return False
     with self.lock:
         self.user_config['active_chain_code'] = value
         chainparams.set_active_chain(value)
         # Make an empty dict if nothing is there
         if self.user_config.get(value, None) is None:
             self.user_config[value] = {}
         if save:
             self.save_user_config()
     return True
Esempio n. 4
0
 def set_active_chain_code(self, value, save=True):
     """Easy way to account for the config being divided by chain indices"""
     value = value.upper()
     if not chainparams.is_known_chain(value):
         return False
     with self.lock:
         self.user_config['active_chain_code'] = value
         chainparams.set_active_chain(value)
         # Make an empty dict if nothing is there
         if self.user_config.get(value, None) is None:
             self.user_config[value] = {}
         if save:
             self.save_user_config()
     return True
Esempio n. 5
0
 def set_chain_config(self, chaincode, value):
     '''Convenience method for setting a chain's config dict'''
     if not chainparams.is_known_chain(chaincode):
         return False
     return self.set_key_above_chain(chaincode, value)
Esempio n. 6
0
 def set_chain_config(self, chaincode, value):
     '''Convenience method for setting a chain's config dict'''
     if not chainparams.is_known_chain(chaincode):
         return False
     return self.set_key_above_chain(chaincode, value)