How to use the gear.utils.types.normalize_block_identifier function in gear

To help you get started, we’ve selected a few gear examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github vechain / web3-gear / gear / rpc.py View on Github external
async def eth_getStorageAt(address, position, block_identifier="best"):
    if position.startswith("0x"):
        position = position[2:]
    position = "0x{}".format(position.zfill(64))
    return await thor.get_storage_at(
        address, position, normalize_block_identifier(block_identifier))
github vechain / web3-gear / gear / rpc.py View on Github external
async def eth_call(transaction, block_identifier="best"):
    formatted_transaction = input_transaction_formatter(transaction)
    return await thor.call(formatted_transaction, normalize_block_identifier(block_identifier))
github vechain / web3-gear / gear / rpc.py View on Github external
async def eth_getBalance(address, block_identifier="best"):
    return await thor.get_balance(address, normalize_block_identifier(block_identifier))
github vechain / web3-gear / gear / rpc.py View on Github external
async def get_block(block_identifier, full_tx):
    blk = await thor.get_block(normalize_block_identifier(block_identifier))
    if blk and full_tx:
        blk["transactions"] = [await eth_getTransactionByHash(
            tx) for tx in blk["transactions"]]
    return blk
github vechain / web3-gear / gear / rpc.py View on Github external
async def eth_getCode(address, block_identifier="best"):
    return await thor.get_code(address, normalize_block_identifier(block_identifier))