(
config: &DVFConfig,
transaction_hash: &str,
)
| 370 | } |
| 371 | |
| 372 | pub fn get_block_number_for_tx( |
| 373 | config: &DVFConfig, |
| 374 | transaction_hash: &str, |
| 375 | ) -> Result<u64, ValidationError> { |
| 376 | let request_body = json!({ |
| 377 | "jsonrpc": "2.0", |
| 378 | "method": "eth_getTransactionByHash", |
| 379 | "params": [transaction_hash], |
| 380 | "id": 1 |
| 381 | }); |
| 382 | let result = send_blocking_web3_post(config, &request_body)?; |
| 383 | |
| 384 | if let Some(block_number) = result.get("blockNumber") { |
| 385 | let block_number = |
| 386 | u64::from_str_radix(block_number.as_str().unwrap().trim_start_matches("0x"), 16)?; |
| 387 | return Ok(block_number); |
| 388 | } |
| 389 | Err(ValidationError::Error( |
| 390 | "Invalid response from eth_getTransactionByHash".to_string(), |
| 391 | )) |
| 392 | } |
| 393 | |
| 394 | fn get_deployment_tx_from_graphql( |
| 395 | config: &DVFConfig, |
no test coverage detected