Пример #1
0
 def test_get_set_stored_network(self):
     """
     Checks default stored network and set method.
     """
     # checks default
     assert Settings.get_stored_network() == ChainID.MAINNET
     # checks set
     Settings.set_stored_network(ChainID.ROPSTEN)
     assert Settings.get_stored_network() == ChainID.ROPSTEN
Пример #2
0
 def pyetheroll(self):
     """
     Gets or creates the Etheroll object.
     Also recreates the object if the chain_id changed.
     """
     chain_id = Settings.get_stored_network()
     print(f'chain_id: {chain_id}')
     if self._pyetheroll is None or self._pyetheroll.chain_id != chain_id:
         self._pyetheroll = Etheroll(API_KEY_PATH, chain_id)
     return self._pyetheroll