Struct marlowe_lang::semantics::ContractInstance
source · pub struct ContractInstance {
pub state: State,
pub contract: Contract,
pub payments: Vec<Payment>,
pub logs: Vec<String>,
pub warnings: Vec<TransactionWarning>,
pub applied: Vec<AppliedInput>,
pub role_payout_validator_hash: Option<String>,
pub resolved_merkleized_continuations: HashMap<String, Contract>,
pub hard_coded_time: Option<u64>,
pub time_interval_end: Option<u64>,
}
Fields§
§state: State
§contract: Contract
§payments: Vec<Payment>
§logs: Vec<String>
§warnings: Vec<TransactionWarning>
§applied: Vec<AppliedInput>
§role_payout_validator_hash: Option<String>
§resolved_merkleized_continuations: HashMap<String, Contract>
§hard_coded_time: Option<u64>
§time_interval_end: Option<u64>
Implementations§
source§impl<'a> ContractInstance
impl<'a> ContractInstance
pub fn is_closed(&self) -> bool
pub fn locked_amounts(&'a self) -> Vec<(&'a Party, &'a Token, u128)>
pub fn from_datum_cborhex(datum_cbor_hex: &str) -> Result<Self, String>
pub fn with_current_time(self, posix_time: u64) -> Self
pub fn with_time_interval_end(self, posix_time: u64) -> Self
pub fn truncate_upward_to_nearest_second(posix_time_ms: u64) -> u64
pub fn get_current_time() -> u64
pub fn add_continuation(&mut self, merkle_hash: &str, contract: &Contract)
pub fn from_datum(datum: &MarloweDatum) -> Self
pub fn new( contract: &Contract, role_payout_validator_hash: Option<String> ) -> Self
pub fn has_timed_out(&self) -> bool
pub fn as_datum(&self) -> MarloweDatum
Trait Implementations§
source§impl Clone for ContractInstance
impl Clone for ContractInstance
source§fn clone(&self) -> ContractInstance
fn clone(&self) -> ContractInstance
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl ContractSemantics<ContractInstance> for ContractInstance
impl ContractSemantics<ContractInstance> for ContractInstance
source§fn with_accounts(&self, accounts: &HashMap<(Party, Token), u128>) -> Self
fn with_accounts(&self, accounts: &HashMap<(Party, Token), u128>) -> Self
Creates a new instance with the accounts replaced. Any account with less than 1 token will be dropped from the state.
source§fn with_account(&self, party: &Party, asset: &Token, quantity: u128) -> Self
fn with_account(&self, party: &Party, asset: &Token, quantity: u128) -> Self
Creates a new instance with the account of a specific party replaced (or added if it does not already exist). Setting quantity to 0 will drop the account from the state.
source§fn with_account_addr(
&self,
bech32_addr: &str,
asset: &Token,
quantity: u128
) -> Result<Self, String>
fn with_account_addr( &self, bech32_addr: &str, asset: &Token, quantity: u128 ) -> Result<Self, String>
Creates a new instance with the account of a specific address replaced (or added if it does not already exist)
source§fn with_account_role(&self, role: &str, asset: &Token, quantity: u128) -> Self
fn with_account_role(&self, role: &str, asset: &Token, quantity: u128) -> Self
Creates a new instance with the account of a specific role replaced (or added if it does not already exist)
fn eval_num_value( &self, val: &Value ) -> Result<(i128, Vec<TransactionWarning>), String>
fn assert_observation( &self, obs: &Observation ) -> Result<(bool, Vec<TransactionWarning>), String>
fn apply_input_action( &self, action: InputAction ) -> Result<ContractInstance, ActionApplicationError>
fn apply_input_choice( &self, applied_choice_name: &str, applied_choice_owner: Party, applied_chosen_value: i128 ) -> Result<ContractInstance, ApplyInputChoiceError>
fn apply_input_deposit( &self, from: Party, asset: Token, quantity: i128, to: AccountId ) -> Result<ContractInstance, ApplyInputDepositError>
fn process(&self) -> Result<(ContractInstance, MachineState), ProcessError>
fn step( &self, force_observe: bool ) -> Result<(ContractInstance, MachineState), String>
fn with_min_time(&self, val: &u64) -> ContractInstance
source§impl Debug for ContractInstance
impl Debug for ContractInstance
source§impl<'de> Deserialize<'de> for ContractInstance
impl<'de> Deserialize<'de> for ContractInstance
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ContractInstance
impl RefUnwindSafe for ContractInstance
impl Send for ContractInstance
impl Sync for ContractInstance
impl Unpin for ContractInstance
impl UnwindSafe for ContractInstance
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more