Skip to content

Commit 41e99a2

Browse files
Seulgi Kimsgkim126
authored andcommitted
Rename hash to tracker
1 parent 1212949 commit 41e99a2

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

core/src/client/client.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -589,8 +589,8 @@ impl TransactionInfo for Client {
589589
self.transaction_address(id).map(|addr| addr.block_hash)
590590
}
591591

592-
fn transaction_header(&self, hash: &H256) -> Option<::encoded::Header> {
593-
self.transaction_addresses(hash)
592+
fn transaction_header(&self, tracker: &H256) -> Option<::encoded::Header> {
593+
self.transaction_addresses(tracker)
594594
.and_then(|addr| {
595595
addr.into_iter()
596596
.find(|addr| {
@@ -848,12 +848,12 @@ impl ChainTimeInfo for Client {
848848
self.chain_info().best_block_timestamp
849849
}
850850

851-
fn transaction_block_age(&self, hash: &H256) -> Option<u64> {
852-
self.transaction_block_number(hash).map(|block_number| self.chain_info().best_block_number - block_number)
851+
fn transaction_block_age(&self, tracker: &H256) -> Option<u64> {
852+
self.transaction_block_number(tracker).map(|block_number| self.chain_info().best_block_number - block_number)
853853
}
854854

855-
fn transaction_time_age(&self, hash: &H256) -> Option<u64> {
856-
self.transaction_block_timestamp(hash)
855+
fn transaction_time_age(&self, tracker: &H256) -> Option<u64> {
856+
self.transaction_block_timestamp(tracker)
857857
.map(|block_timestamp| self.chain_info().best_block_timestamp - block_timestamp)
858858
}
859859
}

core/src/client/mod.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,14 +84,14 @@ pub trait TransactionInfo {
8484
/// Get the hash of block that contains the transaction, if any.
8585
fn transaction_block(&self, id: &TransactionId) -> Option<H256>;
8686

87-
fn transaction_header(&self, hash: &H256) -> Option<::encoded::Header>;
87+
fn transaction_header(&self, tracker: &H256) -> Option<::encoded::Header>;
8888

89-
fn transaction_block_number(&self, hash: &H256) -> Option<BlockNumber> {
90-
self.transaction_header(hash).map(|header| header.number())
89+
fn transaction_block_number(&self, tracker: &H256) -> Option<BlockNumber> {
90+
self.transaction_header(tracker).map(|header| header.number())
9191
}
9292

93-
fn transaction_block_timestamp(&self, hash: &H256) -> Option<u64> {
94-
self.transaction_header(hash).map(|header| header.timestamp())
93+
fn transaction_block_timestamp(&self, tracker: &H256) -> Option<u64> {
94+
self.transaction_header(tracker).map(|header| header.timestamp())
9595
}
9696
}
9797

core/src/client/test_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl TransactionInfo for TestBlockChainClient {
423423
None // Simple default.
424424
}
425425

426-
fn transaction_header(&self, _hash: &H256) -> Option<::encoded::Header> {
426+
fn transaction_header(&self, _tracker: &H256) -> Option<::encoded::Header> {
427427
None
428428
}
429429
}

vm/src/executor.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -370,10 +370,10 @@ pub trait ChainTimeInfo {
370370
fn best_block_timestamp(&self) -> u64;
371371

372372
/// Get the block height of the transaction.
373-
fn transaction_block_age(&self, hash: &H256) -> Option<u64>;
373+
fn transaction_block_age(&self, tracker: &H256) -> Option<u64>;
374374

375375
/// Get the how many seconds elapsed since transaction is confirmed, according to block timestamp.
376-
fn transaction_time_age(&self, hash: &H256) -> Option<u64>;
376+
fn transaction_time_age(&self, tracker: &H256) -> Option<u64>;
377377
}
378378

379379
#[cfg(test)]

0 commit comments

Comments
 (0)