Initial (non-functional) code.

- Kill Externalities Error type requirement.
This commit is contained in:
Gav
2018-01-23 17:27:43 +01:00
parent 68bdf72de7
commit 8ca5c09961
10 changed files with 72 additions and 30 deletions
+3 -5
View File
@@ -19,7 +19,7 @@
use std::{error, fmt};
use backend::Backend;
use {Externalities, OverlayedChanges};
use {Externalities, ExternalitiesError, OverlayedChanges};
/// Errors that can occur when interacting with the externalities.
#[derive(Debug, Copy, Clone)]
@@ -61,12 +61,10 @@ pub struct Ext<'a, B: 'a> {
impl<'a, B: 'a> Externalities for Ext<'a, B>
where B: Backend
{
type Error = B::Error;
fn storage(&self, key: &[u8]) -> Result<&[u8], Self::Error> {
fn storage(&self, key: &[u8]) -> Result<&[u8], ExternalitiesError> {
match self.overlay.storage(key) {
Some(x) => Ok(x),
None => self.backend.storage(key)
None => self.backend.storage(key).map_err(|_| ExternalitiesError),
}
}