Skip to content
Permalink
Browse files
deploy-template & spawn-app receipts (#97)
  • Loading branch information
YaronWittenstein committed Mar 17, 2020
1 parent 35b4c95 commit 4135d4746452ba232ea770d1c73747ac70ff6ca3
Showing 44 changed files with 1,387 additions and 664 deletions.
@@ -4,6 +4,7 @@ use std::fmt;
#[derive(Debug, PartialEq, Clone)]
pub enum StoreError {
OsFailure(String),

DataCorruption(String),
}

@@ -179,28 +179,6 @@ pub trait Env {
store.load(&addr)
}

/// Validates an `AppTemplate`
fn validate_template(&self, _template: &AppTemplate) -> Result<(), String> {
todo!();
}

/// Validates an `App`
fn validate_app(&self, _app: &App) -> Result<(), String> {
todo!();
}

/// Validates an `AppTransaction`
fn validate_app_tx(&self, tx: &AppTransaction) -> Result<(), String> {
let app = self.load_app(&tx.app);

if app.is_some() {
Ok(())
} else {
let err = format!("App `{:?}` doesn't exist", tx.app.inner());
Err(err)
}
}

#[inline]
fn template_exists(&self, addr: &TemplateAddr) -> bool {
self.load_template(addr).is_some()
@@ -11,8 +11,8 @@ use svm_common::Address;
///
/// let bytes: svm_byte_array = Address:of("@someone").into();
///
/// let addr: Result<Address, String> = bytes.into();
/// assert_eq!(Address::of("@someone"), addr.unwrap());
/// let res: Result<Address, String> = Address::try_from(bytes);
/// assert_eq!(Address::of("@someone"), res.unwrap());
/// ```
///
impl_from_svm_byte_array!(Address);

0 comments on commit 4135d47

Please sign in to comment.