Пример #1
0
def hex2a(datastr):

    datastr = remove_0x_prefix(datastr)

    str = unhexlify(datastr)

    str = str.decode('utf8')

    str_dict = dict(json.loads(str))

    return str_dict
Пример #2
0
UNLOCKABLE_ACCOUNT = '0x12efdc31b1a8fa1a1e756dfd8a1601055c971e13'
UNLOCKABLE_ACCOUNT_PW = KEYFILE_PW

GENESIS_DATA = {
    "nonce": "0xdeadbeefdeadbeef",
    "timestamp": "0x0",
    "parentHash":
    "0x0000000000000000000000000000000000000000000000000000000000000000",  # noqa: E501
    "extraData": "0x7765623370792d746573742d636861696e",
    "gasLimit": "0x47d5cc",
    "difficulty": "0x01",
    "mixhash":
    "0x0000000000000000000000000000000000000000000000000000000000000000",  # noqa: E501
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
        remove_0x_prefix(COINBASE): {
            'balance': str(to_wei(1000000000, 'ether')),
        },
        remove_0x_prefix(RAW_TXN_ACCOUNT): {
            'balance': str(to_wei(10, 'ether')),
        },
        remove_0x_prefix(UNLOCKABLE_ACCOUNT): {
            'balance': str(to_wei(10, 'ether')),
        },
    },
    "config": {
        "chainId": 131277322940537,  # the string 'web3py' as an integer
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },
UNLOCKABLE_PRIVATE_KEY = '0x392f63a79b1ff8774845f3fa69de4a13800a59e7083f5187f1558f0797ad0f01'
UNLOCKABLE_ACCOUNT = '0x12efdc31b1a8fa1a1e756dfd8a1601055c971e13'
UNLOCKABLE_ACCOUNT_PW = KEYFILE_PW


GENESIS_DATA = {
    "nonce": "0xdeadbeefdeadbeef",
    "timestamp": "0x0",
    "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",  # noqa: E501
    "extraData": "0x7765623370792d746573742d636861696e",
    "gasLimit": "0x47d5cc",
    "difficulty": "0x01",
    "mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",  # noqa: E501
    "coinbase": "0x3333333333333333333333333333333333333333",
    "alloc": {
        remove_0x_prefix(COINBASE): {
            'balance': str(to_wei(1000000000, 'ether')),
        },
        remove_0x_prefix(RAW_TXN_ACCOUNT): {
            'balance': str(to_wei(10, 'ether')),
        },
        remove_0x_prefix(UNLOCKABLE_ACCOUNT): {
            'balance': str(to_wei(10, 'ether')),
        },
    },
    "config": {
        "chainId": 131277322940537,  # the string 'web3py' as an integer
        "homesteadBlock": 0,
        "eip155Block": 0,
        "eip158Block": 0
    },