예제 #1
0
 def pyetheroll(self):
     """
     Gets or creates the Etheroll object.
     Also recreates the object if the chain_id changed.
     """
     from pyetheroll.etheroll import Etheroll
     chain_id = SettingsScreen.get_stored_network()
     if self._pyetheroll is None or self._pyetheroll.chain_id != chain_id:
         self._pyetheroll = Etheroll(chain_id)
     return self._pyetheroll
예제 #2
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 = SettingsScreen.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)