fix: emit null transaction fields (#1654)

This commit is contained in:
Matthias Seitz 2022-09-04 19:55:29 +02:00 committed by GitHub
parent 6e7149b2a1
commit 5aac82a3d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 6 deletions

View File

@ -21,18 +21,15 @@ pub struct Transaction {
pub nonce: U256, pub nonce: U256,
/// Block hash. None when pending. /// Block hash. None when pending.
#[serde(rename = "blockHash")] #[serde(default, rename = "blockHash")]
#[serde(skip_serializing_if = "Option::is_none")]
pub block_hash: Option<H256>, pub block_hash: Option<H256>,
/// Block number. None when pending. /// Block number. None when pending.
#[serde(rename = "blockNumber")] #[serde(default, rename = "blockNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
pub block_number: Option<U64>, pub block_number: Option<U64>,
/// Transaction Index. None when pending. /// Transaction Index. None when pending.
#[serde(rename = "transactionIndex")] #[serde(default, rename = "transactionIndex")]
#[serde(skip_serializing_if = "Option::is_none")]
pub transaction_index: Option<U64>, pub transaction_index: Option<U64>,
/// Sender /// Sender