This repository has been archived by the owner on Oct 6, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
4 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
use oasis_types::Address; | ||
|
||
pub trait Gateway { | ||
type Error; | ||
|
||
/// Deploys a new service with the provided initcode. | ||
/// `initcode` is expected to be the Wasm bytecode concatenated with the the constructor stdin. | ||
/// Upon success, returns the address of the new service. | ||
fn deploy(&self, initcode: &[u8]) -> Result<Address, Self::Error>; | ||
fn deploy(&self, initcode: &[u8]) -> Result<Address, Box<dyn std::error::Error>>; | ||
|
||
/// Returns the output of calling the service at `address` with `data` as stdin. | ||
fn rpc(&self, address: Address, data: &[u8]) -> Result<Vec<u8>, Self::Error>; | ||
fn rpc(&self, address: Address, data: &[u8]) -> Result<Vec<u8>, Box<dyn std::error::Error>>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters