Skip to content

Commit

Permalink
fix: tx-valid-since rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
jjyr committed Apr 11, 2019
1 parent d5fd988 commit ef16437
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 10 deletions.
1 change: 0 additions & 1 deletion chain/src/chain.rs
Expand Up @@ -7,7 +7,6 @@ use ckb_core::extras::BlockExt;
use ckb_core::service::{Request, DEFAULT_CHANNEL_SIZE, SIGNAL_CHANNEL_SIZE};
use ckb_core::transaction::ProposalShortId;
use ckb_core::{header::Header, BlockNumber};
use ckb_db::batch::Batch;
use ckb_notify::NotifyController;
use ckb_shared::cell_set::CellSetDiff;
use ckb_shared::chain_state::ChainState;
Expand Down
4 changes: 3 additions & 1 deletion shared/src/chain_state.rs
Expand Up @@ -43,7 +43,9 @@ impl<CI: ChainIndex> ChainState<CI> {
match store.get_tip_header() {
Some(h) => h,
None => {
store.init(&genesis);
store
.init(&genesis)
.expect("init genesis block should be ok");
genesis.header().clone()
}
}
Expand Down
3 changes: 1 addition & 2 deletions shared/src/shared.rs
@@ -1,4 +1,3 @@
use crate::cell_set::CellSet;
use crate::chain_state::ChainState;
use crate::error::SharedError;
use crate::index::ChainIndex;
Expand All @@ -12,7 +11,7 @@ use ckb_core::header::{BlockNumber, Header};
use ckb_core::transaction::{Capacity, ProposalShortId, Transaction};
use ckb_core::uncle::UncleBlock;
use ckb_db::{CacheDB, DBConfig, KeyValueDB, MemoryKeyValueDB, RocksDB};
use ckb_traits::{BlockMedianTimeContext, ChainProvider};
use ckb_traits::ChainProvider;
use ckb_util::Mutex;
use failure::Error;
use numext_fixed_hash::H256;
Expand Down
5 changes: 1 addition & 4 deletions shared/src/tests/shared.rs
Expand Up @@ -32,12 +32,9 @@ where
let mut batch = store.new_batch().unwrap();
for b in blocks {
batch.insert_block(&b).unwrap();
batch
.insert_block_hash(b.header().number(), &b.header().hash())
.unwrap();
batch.attach_block(&b).unwrap();
}
batch.commit().unwrap();
hashes
}

#[test]
Expand Down
4 changes: 2 additions & 2 deletions sync/src/relayer/compact_block_process.rs
Expand Up @@ -112,7 +112,7 @@ struct CompactBlockMedianTimeView<'a, CI> {

impl<'a, CI> ::std::clone::Clone for CompactBlockMedianTimeView<'a, CI>
where
CI: ChainIndex + 'static,
CI: ChainIndex,
{
fn clone(&self) -> Self {
CompactBlockMedianTimeView {
Expand All @@ -125,7 +125,7 @@ where

impl<'a, CI> CompactBlockMedianTimeView<'a, CI>
where
CI: ChainIndex + 'static,
CI: ChainIndex,
{
fn get_header(&self, hash: &H256) -> Option<Header> {
self.pending_compact_blocks
Expand Down

0 comments on commit ef16437

Please sign in to comment.