Skip to content
This repository has been archived by the owner on Aug 14, 2023. It is now read-only.

Commit

Permalink
deploy-template & spawn-app receipts (#97)
Browse files Browse the repository at this point in the history
  • Loading branch information
YaronWittenstein committed Mar 17, 2020
1 parent 35b4c95 commit 4135d47
Show file tree
Hide file tree
Showing 44 changed files with 1,387 additions and 664 deletions.
1 change: 1 addition & 0 deletions crates/svm-app/src/error/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::fmt;
#[derive(Debug, PartialEq, Clone)]
pub enum StoreError {
OsFailure(String),

DataCorruption(String),
}

Expand Down
22 changes: 0 additions & 22 deletions crates/svm-app/src/traits/env.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
4 changes: 2 additions & 2 deletions crates/svm-runtime-c-api/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Loading

0 comments on commit 4135d47

Please sign in to comment.