Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Merged
Prev Previous commit
Next Next commit
More docs.
  • Loading branch information
pepyakin committed Sep 6, 2019
commit d70268cefcebf3c39cb501f87f6226b8718bf0f6
15 changes: 12 additions & 3 deletions node/primitives/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,22 @@ pub type BlockId = generic::BlockId<Block>;
/// Opaque, encoded, unchecked extrinsic.
pub type UncheckedExtrinsic = OpaqueExtrinsic;

// TODO: docs
// TODO: Reuse Result?
/// A result of execution of a contract.
#[derive(Eq, PartialEq, Encode, Decode)]
#[cfg_attr(feature = "std", derive(Debug, Serialize, Deserialize))]
pub enum ContractExecResult {
/// The contract returned successfully.
///
/// There is a status code and, optionally, some data returned by the contract.
Success {
/// Status code returned by the contract.
status: u8,
/// Output data returned by the contract.
///
/// Can be empty.
data: Vec<u8>,
},
/// The contract execution either trapped or returned an error.
Error,
}

Expand All @@ -91,9 +98,11 @@ client::decl_runtime_apis! {
fn account_nonce(account: AccountId) -> Index;
}

/// The API to perform a call to a contract without using executive.
/// The API to interact with contracts without using executive.
pub trait ContractsApi {
/// Perform a call from a specified account to a given contract.
///
/// See the contracts' `call` dispatchable function for more details.
fn call(
origin: AccountId,
dest: AccountId,
Expand Down