Struct ethcore_rpc::v1::tests::helpers::TestSnapshotService
[−]
[src]
pub struct TestSnapshotService { /* fields omitted */ }
Mocked snapshot service (used for sync info extensions).
Methods
impl TestSnapshotService
[src]
fn new() -> Self
Create a test snapshot service. Only the status
function matters -- it'll
return Inactive
by default.
fn set_status(&self, status: RestorationStatus)
Set the restoration status.
Trait Implementations
impl SnapshotService for TestSnapshotService
[src]
fn manifest(&self) -> Option<ManifestData>
Query the most recent manifest data.
fn chunk(&self, _hash: H256) -> Option<Bytes>
Get raw chunk for a given hash.
fn status(&self) -> RestorationStatus
Ask the snapshot service for the restoration status.
fn begin_restore(&self, _manifest: ManifestData)
Begin snapshot restoration. If restoration in-progress, this will reset it. From this point on, any previous snapshot may become unavailable. Read more
fn abort_restore(&self)
Abort an in-progress restoration if there is one.
fn restore_state_chunk(&self, _hash: H256, _chunk: Bytes)
Feed a raw state chunk to the service to be processed asynchronously. no-op if not currently restoring. Read more
fn restore_block_chunk(&self, _hash: H256, _chunk: Bytes)
Feed a raw block chunk to the service to be processed asynchronously. no-op if currently restoring. Read more
fn provide_canon_hashes(&self, _hashes: &[(u64, H256)])
Give the restoration in-progress some canonical block hashes for extra verification (performed at the end) Read more