Example #1
0
 def test_get_set_stored_gas_price(self):
     """
     Checks default stored gas price and set method.
     """
     # checks default
     assert Settings.get_stored_gas_price() == 4
     # checks set
     Settings.set_stored_gas_price(42)
     assert Settings.get_stored_gas_price() == 42
 def load_settings(self):
     """
     Load json store settings to UI properties.
     """
     self.is_stored_mainnet = Settings.is_stored_mainnet()
     self.is_stored_testnet = Settings.is_stored_testnet()
     self.stored_gas_price = Settings.get_stored_gas_price()
     is_persistent_keystore = (
         Settings.is_persistent_keystore() and check_write_permission())
     self.set_persist_keystore_switch_state(is_persistent_keystore)
Example #3
0
 def roll(self):
     """
     Retrieves bet parameters from user input and sends it as a signed
     transaction to the smart contract.
     """
     roll_screen = self.roll_screen
     roll_input = roll_screen.get_roll_input()
     bet_size = roll_input['bet_size']
     chances = roll_input['chances']
     gas_price = Settings.get_stored_gas_price()
     account = self.current_account
     if account is None:
         self.on_account_none()
         return
     wallet_path = account.path
     password = self.get_account_password(account)
     if password is not None:
         self.player_roll_dice(bet_size, chances, wallet_path, password,
                               gas_price)
         # restarts roll polling service to reset the roll activity period
         self.start_services()