Exemple #1
0
def accounts():
    _accounts = []
    for i in range(1, 11):
        pk = PrivateKey(i.to_bytes(32, byteorder='big'))
        _accounts.append(
            EthereumAccount(pk.public_key.to_checksum_address(), pk))
    return _accounts
def ethtester():
    tester.chain = tester.Chain()
    tester.accounts = []
    for i in range(10):
        address = getattr(tester, 'a{0}'.format(i))
        key = getattr(tester, 'k{0}'.format(i))
        tester.accounts.append(EthereumAccount(address_to_hex(address), key))
    return tester
Exemple #3
0
def get_accounts(ethtester):
    """Converts ethereum.tools.tester accounts into a list.

    Args:
        ethtester (ethereum.tools.tester): Ethereum tester instance.

    Returns:
        EthereumAccount[]: A list of EthereumAccounts.
    """

    accounts = []
    for i in range(10):
        address = getattr(ethtester, 'a{0}'.format(i))
        key = getattr(ethtester, 'k{0}'.format(i))
        accounts.append(EthereumAccount(address_to_hex(address), key))
    return accounts