Beispiel #1
0
    def get_account(self, address):
        validate_address(address)
        account = self._get_account(address)

        # print('_get_const_validator : ', self.get_validator(address).to_dict())
        # print('get_const_validator_list : ', self.get_const_validator_list())
        return account
Beispiel #2
0
 def __init__(self, index, tx_base, to, value, fee, nonce, type):
     self.index = index
     self._limited = fee
     self.value = value
     validate_address(tx_base)
     self._tx_base = tx_base
     self._fee = 0
     self._nonce = nonce
     self.to = to
     self._type = type
Beispiel #3
0
 def get_balance(self, address):
     validate_address(address)
     account = self._get_account(address)
     return account.balance
Beispiel #4
0
 def set_balance(self, address, balance):
     validate_address(address)
     account = self._get_account(address)
     self._set_account(address, account.copy(balance=balance))
Beispiel #5
0
 def compute_stake_balance(self, address, stake):
     validate_address(address)
     account = self._get_account(address)
     new_balance = account.delegated_stake_balance + stake
     self._set_account(address,
                       account.copy(delegated_stake_balance=new_balance))
Beispiel #6
0
 def compute_balance(self, address, consume):
     validate_address(address)
     self.set_balance(address, self.get_balance(address) + consume)
Beispiel #7
0
 def increase_nonce(self, address):
     validate_address(address)
     account = self._get_account(address)
     self._set_account(address, account.copy(nonce=account.nonce + 1))
Beispiel #8
0
 def get_delegated_balance(self, address):
     validate_address(address)
     account = self._get_account(address)
     return account.delegated_stake_balance