Struct pallet_ovm::Module [−][src]
pub struct Module<T: Config>(_);
Implementations
Current cost schedule for contracts.
A mapping from an original code hash to the original code, untouched by instrumentation.
A mapping between an original code hash and instrumented ovm(predicate) code, ready for execution.
pub fn predicates<K: EncodeLike<T::AccountId>>(
key: K
) -> Option<PredicateContract<<T as Config>::Hash>>
pub fn predicates<K: EncodeLike<T::AccountId>>(
key: K
) -> Option<PredicateContract<<T as Config>::Hash>>
Mapping the predicate address to Predicate. Predicate is handled similar to contracts.
pub fn games<K: EncodeLike<T::Hash>>(
key: K
) -> Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
pub fn games<K: EncodeLike<T::Hash>>(
key: K
) -> Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
Mapping the game id to Challenge Game.
Can also be called using Call
.
Stores the given binary Wasm code into the chain’s storage and returns its codehash
.
You can instantiate contracts only with stored code.
NOTE: Calling this function will bypass origin filters.
pub fn instantiate(
origin: T::Origin,
predicate_hash: <T as Config>::Hash,
inputs: Vec<u8>
) -> DispatchResult
pub fn instantiate(
origin: T::Origin,
predicate_hash: <T as Config>::Hash,
inputs: Vec<u8>
) -> DispatchResult
Deploy predicate and made predicate address as AccountId. TODO: weight
NOTE: Calling this function will bypass origin filters.
Claims property and create new game. Id of game is hash of claimed property TODO: weight
NOTE: Calling this function will bypass origin filters.
pub fn challenge(
origin: T::Origin,
property: PropertyOf<T>,
challenge_property: PropertyOf<T>
) -> DispatchResult
pub fn challenge(
origin: T::Origin,
property: PropertyOf<T>,
challenge_property: PropertyOf<T>
) -> DispatchResult
Challenge to an existing game instance by a property.
challenge will be added to challenges
field of challenged game instance.
if property does not exist, revert.
if challenge with same property was made before, revert.
TODO: weight
NOTE: Calling this function will bypass origin filters.
remove challenge set challenging game decision to false and remove it from challenges field of challenged game if property does not exist, revert. if challenge property does not exist, revert.
TODO: weight
NOTE: Calling this function will bypass origin filters.
pub fn set_game_result(
origin: T::Origin,
property: PropertyOf<T>,
result: bool
) -> DispatchResult
pub fn set_game_result(
origin: T::Origin,
property: PropertyOf<T>,
result: bool
) -> DispatchResult
set game result to given result value. only called from dispute contract
TODO: weight
NOTE: Calling this function will bypass origin filters.
settle game settle started game whose dispute period has passed. if no challenge for the property exists, decide to true. if any of its challenges decided to true, decide game to false. if undecided challenge remains, revert.
TODO: weight
NOTE: Calling this function will bypass origin filters.
Perform a call to a specified contract.
This function is similar to Self::call
, but doesn’t perform any address lookups and better
suitable for calling directly from Rust.
pub fn bare_challenge(
origin: T::AccountId,
property: PropertyOf<T>,
challenge_property: PropertyOf<T>
) -> DispatchResult
Get of true/false the decision of property.
Get of true/false the decision of game id.
pub fn get_game(
claim_id: &T::Hash
) -> Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
pub fn get_game(
claim_id: &T::Hash
) -> Option<ChallengeGame<<T as Config>::Hash, <T as Config>::BlockNumber>>
Get of the instatiated challenge game from claim_id.
Get of the property id from the propaty itself.
Trait Implementations
Returns the current version of the pallet.
Returns the version of the pallet that is stored in storage. Read more
Run integrity test. Read more
This function is being called after every block import (when fully synced). Read more
The block is being finalized. Implement to have something happen. Read more
Something that should happen at genesis.
The block is being initialized. Implement to have something happen. Read more
Perform a module upgrade. Read more
Auto Trait Implementations
impl<T> RefUnwindSafe for Module<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for Module<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
The counterpart to unchecked_from
.
Consume self to return an equivalent value of T
.
pub fn vzip(self) -> V
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeDebug for T where
T: Debug,
impl<T> MaybeRefUnwindSafe for T where
T: RefUnwindSafe,