diff --git a/ethcore/src/blockchain.rs b/ethcore/src/blockchain.rs index f7c45d94e..764b76588 100644 --- a/ethcore/src/blockchain.rs +++ b/ethcore/src/blockchain.rs @@ -38,7 +38,7 @@ pub enum TransactionId { Hash(H256), /// Block id and transaction index within this block. /// Querying by block position is always faster. - BlockPosition(BlockId, usize) + Location(BlockId, usize) } /// Represents a tree route between `from` block and `to` block: @@ -132,11 +132,11 @@ pub trait BlockProvider { fn transaction(&self, id: TransactionId) -> Option { match id { TransactionId::Hash(ref hash) => self.transaction_address(hash), - TransactionId::BlockPosition(BlockId::Hash(hash), index) => Some(TransactionAddress { + TransactionId::Location(BlockId::Hash(hash), index) => Some(TransactionAddress { block_hash: hash, index: index }), - TransactionId::BlockPosition(BlockId::Number(number), index) => self.block_hash(number).map(|hash| TransactionAddress { + TransactionId::Location(BlockId::Number(number), index) => self.block_hash(number).map(|hash| TransactionAddress { block_hash: hash, index: index }) diff --git a/rpc/src/v1/impls/eth.rs b/rpc/src/v1/impls/eth.rs index 32c1919bf..5d60b40a6 100644 --- a/rpc/src/v1/impls/eth.rs +++ b/rpc/src/v1/impls/eth.rs @@ -166,7 +166,7 @@ impl Eth for EthClient { fn transaction_by_block_hash_and_index(&self, params: Params) -> Result { from_params::<(H256, Index)>(params) - .and_then(|(hash, index)| match self.client.transaction(TransactionId::BlockPosition(BlockId::Hash(hash), index.value())) { + .and_then(|(hash, index)| match self.client.transaction(TransactionId::Location(BlockId::Hash(hash), index.value())) { Some(t) => to_value(&Transaction::from(t)), None => Ok(Value::Null) })