()
| 87 | |
| 88 | |
| 89 | async def test_intstr_mapping(): |
| 90 | client = make_client() |
| 91 | total_time = 0 |
| 92 | for _ in range(NUM_BENCHMARK_RUNS): |
| 93 | start_time = time.time() |
| 94 | |
| 95 | res = await client.collect_arrow( |
| 96 | QUERY, |
| 97 | hypersync.StreamConfig( |
| 98 | hex_output=HexOutput.PREFIXED, |
| 99 | column_mapping=hypersync.ColumnMapping( |
| 100 | trace={ |
| 101 | TraceField.TRANSACTION_POSITION: DataType.INT32, |
| 102 | }, |
| 103 | transaction={ |
| 104 | TransactionField.BLOCK_NUMBER: DataType.INT64, |
| 105 | TransactionField.VALUE: DataType.FLOAT32, |
| 106 | }, |
| 107 | decoded_log={ |
| 108 | "value": DataType.INTSTR, |
| 109 | }, |
| 110 | ), |
| 111 | event_signature="Transfer(address indexed from, address indexed to, uint256 value)", |
| 112 | ), |
| 113 | ) |
| 114 | |
| 115 | # print(res.data.decoded_logs.column("value")) |
| 116 | |
| 117 | execution_time = (time.time() - start_time) * 1000 |
| 118 | total_time += execution_time |
| 119 | print(f"intstr_mapping time: {format(execution_time, '.9f')}ms") |
| 120 | |
| 121 | |
| 122 | async def test_create_parquet_folder(): |
no test coverage detected