* Move snapshot to own crate Sort out imports * WIP cargo toml * Make snapshotting generic over the client Sort out tests * Sort out types from blockchain and client * Sort out sync * Sort out imports and generics * Sort out main binary * Fix sync test-helpers * Sort out import for secret-store * Sort out more imports * Fix easy todos * cleanup * Move SnapshotClient and SnapshotWriter to their proper places Sort out the circular dependency between snapshot and ethcore by moving all snapshot tests to own crate, snapshot-tests * cleanup * Cleanup * fix merge issues * Update ethcore/snapshot/snapshot-tests/Cargo.toml Co-Authored-By: Andronik Ordian <write@reusable.software> * Sort out botched merge * Ensure snapshot-tests run * Docs * Fix grumbles
46 lines
1.3 KiB
Rust
46 lines
1.3 KiB
Rust
// Copyright 2015-2019 Parity Technologies (UK) Ltd.
|
|
// This file is part of Parity Ethereum.
|
|
|
|
// Parity Ethereum is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU General Public License as published by
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
// (at your option) any later version.
|
|
|
|
// Parity Ethereum is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU General Public License for more details.
|
|
|
|
// You should have received a copy of the GNU General Public License
|
|
// along with Parity Ethereum. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
//! Snapshot tests.
|
|
|
|
#![cfg(test)]
|
|
|
|
mod abridged_block;
|
|
mod account;
|
|
mod io;
|
|
mod proof_of_work;
|
|
mod proof_of_authority;
|
|
mod state;
|
|
mod service;
|
|
mod watcher;
|
|
|
|
mod helpers;
|
|
|
|
#[test]
|
|
fn manifest_rlp() {
|
|
use common_types::snapshot::ManifestData;
|
|
let manifest = ManifestData {
|
|
version: 2,
|
|
block_hashes: Vec::new(),
|
|
state_hashes: Vec::new(),
|
|
block_number: 1234567,
|
|
state_root: Default::default(),
|
|
block_hash: Default::default(),
|
|
};
|
|
let raw = manifest.clone().into_rlp();
|
|
assert_eq!(ManifestData::from_rlp(&raw).unwrap(), manifest);
|
|
}
|