コード例 #1
0
ファイル: commands.py プロジェクト: martexcoin/encompass
 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())
コード例 #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())
コード例 #3
0
ファイル: simple_config.py プロジェクト: ELM4Ever/encompass
 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
コード例 #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
コード例 #5
0
ファイル: simple_config.py プロジェクト: ELM4Ever/encompass
 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)
コード例 #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)