-
-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Labels
T-featureType: New functionality requestType: New functionality request
Description
A WebAssembly contract-key will implement the following functions:
trait ContractKey {
/// Determine whether this value is valid for this contract
fn validate_value(value : &Vec<u8>) -> bool;
/// Determine whether this value is a valid update for this contract. If it is, modify
/// the value and return true, else return false.
fn update_value(value: &mut Vec<u8>, value_update: &Vec<u8>) -> bool;
/// Obtain any other related contracts for this value update. Typicall used to ensure
/// update has been fully propagated.
fn related_contracts(value_update : &Vec<u8>) -> Vec<ContractKey>;
/// Extract some data from the value and return it.
///
/// eg. `extractor` might contain a byte range, which will be extracted
/// from the value and returned.
fn extract(extractor : &Vec<u8>, value : &Vec<u8>) -> Vec<u8>;
}Metadata
Metadata
Assignees
Labels
T-featureType: New functionality requestType: New functionality request