Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
added from and to to Receipt
Browse files Browse the repository at this point in the history
  • Loading branch information
ab320012 committed May 31, 2018
1 parent 00b209a commit b0a4873
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
2 changes: 2 additions & 0 deletions rpc/src/v1/impls/light/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,8 @@ impl<T: LightChainClient + 'static> Eth for EthClient<T> {
receipt.transaction_index = Some(index.into());
receipt.block_hash = Some(block_hash);
receipt.block_number = tx.block_number;
receipt.to = tx.to;
receipt.from = Some(tx.from);
receipt
})
.map(Some);
Expand Down
17 changes: 14 additions & 3 deletions rpc/src/v1/types/receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ pub struct Receipt {
/// Block hash
#[serde(rename="blockHash")]
pub block_hash: Option<H256>,
/// Block number
/// Sender
pub from: Option<H160>,
/// Recipient
pub to: Option<H160>,
/// Block number
#[serde(rename="blockNumber")]
pub block_number: Option<U256>,
/// Cumulative gas used
Expand Down Expand Up @@ -73,7 +77,9 @@ impl Receipt {
impl From<LocalizedReceipt> for Receipt {
fn from(r: LocalizedReceipt) -> Self {
Receipt {
transaction_hash: Some(r.transaction_hash.into()),
from: None,
to: None,
transaction_hash: Some(r.transaction_hash.into()),
transaction_index: Some(r.transaction_index.into()),
block_hash: Some(r.block_hash.into()),
block_number: Some(r.block_number.into()),
Expand All @@ -91,6 +97,9 @@ impl From<LocalizedReceipt> for Receipt {
impl From<RichReceipt> for Receipt {
fn from(r: RichReceipt) -> Self {
Receipt {

from: None,
to: None,
transaction_hash: Some(r.transaction_hash.into()),
transaction_index: Some(r.transaction_index.into()),
block_hash: None,
Expand All @@ -109,7 +118,9 @@ impl From<RichReceipt> for Receipt {
impl From<EthReceipt> for Receipt {
fn from(r: EthReceipt) -> Self {
Receipt {
transaction_hash: None,
from: None,
to: None,
transaction_hash: None,
transaction_index: None,
block_hash: None,
block_number: None,
Expand Down

0 comments on commit b0a4873

Please sign in to comment.