Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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))
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))
async def eth_getBalance(address, block_identifier="best"):
return await thor.get_balance(address, normalize_block_identifier(block_identifier))
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
async def eth_getCode(address, block_identifier="best"):
return await thor.get_code(address, normalize_block_identifier(block_identifier))