Skip to content

Commit

Permalink
removed old migrations (openethereum#7974)
Browse files Browse the repository at this point in the history
* removed old migrations

* improve SimpleMigration

* fixed migration tests

* fixed redundant whitespace

* add ToV13 migration which removes bloom groups

* bump CURRENT_VERSION of db
  • Loading branch information
debris authored Feb 22, 2018
1 parent d90ab40 commit ee93be8
Show file tree
Hide file tree
Showing 15 changed files with 68 additions and 871 deletions.
12 changes: 0 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions ethcore/migrations/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,4 @@ version = "0.1.0"
authors = ["Parity Technologies <[email protected]>"]

[dependencies]
ethcore-bytes = { path = "../../util/bytes" }
ethereum-types = "0.2"
keccak-hash = { path = "../../util/hash" }
kvdb = { path = "../../util/kvdb" }
kvdb-rocksdb = { path = "../../util/kvdb-rocksdb" }
log = "0.3"
macros = { path = "../../util/macros" }
migration = { path = "../../util/migration" }
rlp = { path = "../../util/rlp" }
patricia-trie = { path = "../../util/patricia_trie" }
journaldb = { path = "../../util/journaldb" }
ethcore-bloom-journal = { path = "../../util/bloom" }
ethcore = { path = ".." }
21 changes: 0 additions & 21 deletions ethcore/migrations/src/blocks/mod.rs

This file was deleted.

37 changes: 0 additions & 37 deletions ethcore/migrations/src/blocks/v8.rs

This file was deleted.

21 changes: 0 additions & 21 deletions ethcore/migrations/src/extras/mod.rs

This file was deleted.

102 changes: 0 additions & 102 deletions ethcore/migrations/src/extras/v6.rs

This file was deleted.

56 changes: 29 additions & 27 deletions ethcore/migrations/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,34 +16,9 @@

//! Database migrations.
#[macro_use]
extern crate log;
#[macro_use]
extern crate macros;
extern crate migration;
extern crate rlp;
extern crate ethereum_types;
extern crate ethcore_bytes as bytes;
extern crate kvdb;
extern crate kvdb_rocksdb;
extern crate keccak_hash as hash;
extern crate journaldb;
extern crate ethcore_bloom_journal as bloom_journal;
extern crate ethcore;
extern crate patricia_trie as trie;

use migration::ChangeColumns;

pub mod state;
pub mod blocks;
pub mod extras;

mod v9;
pub use self::v9::ToV9;
pub use self::v9::Extract;

mod v10;
pub use self::v10::ToV10;

use migration::{ChangeColumns, SimpleMigration};

/// The migration from v10 to v11.
/// Adds a column for node info.
Expand All @@ -60,3 +35,30 @@ pub const TO_V12: ChangeColumns = ChangeColumns {
post_columns: Some(8),
version: 12,
};

#[derive(Default)]
pub struct ToV13;

impl SimpleMigration for ToV13 {
fn columns(&self) -> Option<u32> {
Some(8)
}

fn version(&self) -> u32 {
13
}

fn migrated_column_index(&self) -> Option<u32> {
// extras!
Some(3)
}

fn simple_migrate(&mut self, key: Vec<u8>, value: Vec<u8>) -> Option<(Vec<u8>, Vec<u8>)> {
// remove all bloom groups
if key[0] == 3 {
None
} else {
Some((key, value))
}
}
}
21 changes: 0 additions & 21 deletions ethcore/migrations/src/state/mod.rs

This file was deleted.

Loading

0 comments on commit ee93be8

Please sign in to comment.