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,
/// Block hash. None when pending.
#[serde(rename = "blockHash")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, rename = "blockHash")]
pub block_hash: Option<H256>,
/// Block number. None when pending.
#[serde(rename = "blockNumber")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, rename = "blockNumber")]
pub block_number: Option<U64>,
/// Transaction Index. None when pending.
#[serde(rename = "transactionIndex")]
#[serde(skip_serializing_if = "Option::is_none")]
#[serde(default, rename = "transactionIndex")]
pub transaction_index: Option<U64>,
/// Sender