apply_formatter_if(is_not_null, to_hexbytes(32)), 'sha3Uncles': apply_formatter_if(is_not_null, to_hexbytes(32)), 'uncles': apply_formatter_to_array(to_hexbytes(32)), 'difficulty': to_integer_if_hex, 'receiptsRoot': to_hexbytes(32), 'stateRoot': to_hexbytes(32), 'totalDifficulty': to_integer_if_hex, 'transactions': apply_one_of_formatters(( (apply_formatter_to_array(transaction_formatter), is_array_of_dicts), (apply_formatter_to_array(to_hexbytes(32)), is_array_of_strings), )), 'transactionsRoot': to_hexbytes(32), } block_formatter = apply_formatters_to_dict(BLOCK_FORMATTERS) SYNCING_FORMATTERS = { 'startingBlock': to_integer_if_hex, 'currentBlock': to_integer_if_hex, 'highestBlock': to_integer_if_hex, 'knownStates': to_integer_if_hex, 'pulledStates': to_integer_if_hex, }
'timestamp': to_integer_if_hex, 'hash': apply_formatter_if(is_not_null, to_hexbytes(32)), 'logsBloom': apply_formatter_if(is_not_null, to_hexbytes(256)), 'miner': apply_formatter_if(is_not_null, to_checksum_address), 'mixHash': to_hexbytes(32), 'nonce': apply_formatter_if(is_not_null, to_hexbytes(8, variable_length=True)), 'number': apply_formatter_if(is_not_null, to_integer_if_hex), 'parentHash': apply_formatter_if(is_not_null, to_hexbytes(32)), 'sha3Uncles': apply_formatter_if(is_not_null, to_hexbytes(32)), 'uncles': apply_formatter_to_array(to_hexbytes(32)), 'difficulty': to_integer_if_hex, 'receiptsRoot': to_hexbytes(32), 'stateRoot': to_hexbytes(32), 'totalDifficulty': to_integer_if_hex, 'transactions': apply_one_of_formatters(( (apply_formatter_to_array(transaction_formatter), is_array_of_dicts), (apply_formatter_to_array(to_hexbytes(32)), is_array_of_strings), )), 'transactionsRoot': to_hexbytes(32), } block_formatter = apply_formatters_to_dict(BLOCK_FORMATTERS) STORAGE_PROOF_FORMATTERS = { 'key': HexBytes, 'value': HexBytes, 'proof': apply_formatter_to_array(HexBytes), } ACCOUNT_PROOF_FORMATTERS = {
'timestamp': to_integer_if_hex, 'hash': apply_formatter_if(is_not_null, to_hexbytes(32)), 'logsBloom': to_hexbytes(256), 'miner': apply_formatter_if(is_not_null, to_checksum_address), 'mixHash': to_hexbytes(32), 'nonce': apply_formatter_if(is_not_null, to_hexbytes(8, variable_length=True)), 'number': apply_formatter_if(is_not_null, to_integer_if_hex), 'parentHash': apply_formatter_if(is_not_null, to_hexbytes(32)), 'sha3Uncles': apply_formatter_if(is_not_null, to_hexbytes(32)), 'uncles': apply_formatter_to_array(to_hexbytes(32)), 'difficulty': to_integer_if_hex, 'receiptsRoot': to_hexbytes(32), 'stateRoot': to_hexbytes(32), 'totalDifficulty': to_integer_if_hex, 'transactions': apply_one_of_formatters(( (apply_formatter_to_array(transaction_formatter), is_array_of_dicts), (apply_formatter_to_array(to_hexbytes(32)), is_array_of_strings), )), 'transactionsRoot': to_hexbytes(32), } block_formatter = apply_formatters_to_dict(BLOCK_FORMATTERS) SYNCING_FORMATTERS = { 'startingBlock': to_integer_if_hex, 'currentBlock': to_integer_if_hex, 'highestBlock': to_integer_if_hex, 'knownStates': to_integer_if_hex, 'pulledStates': to_integer_if_hex, }