[receipt]: add sender & receiver to RichReceipts (#11179)

* [receipts]: add `to` & `from` to `RichReceipts`

* [rpc]: add test for `pending_receipt`

* docs(common_types/receipt): add note Option field
This commit is contained in:
Niklas Adolfsson
2019-10-18 18:12:02 +02:00
committed by GitHub
parent 2d2513b35a
commit c8b4373e13
5 changed files with 50 additions and 7 deletions

View File

@@ -1236,6 +1236,11 @@ impl miner::MinerService for Miner {
let prev_gas = if index == 0 { Default::default() } else { receipts[index - 1].gas_used };
let receipt = &receipts[index];
RichReceipt {
from: tx.sender(),
to: match tx.action {
Action::Create => None,
Action::Call(ref address) => Some(*address),
},
transaction_hash: tx.hash(),
transaction_index: index,
cumulative_gas_used: receipt.gas_used,