Struct pallet_plasma::Module [−][src]
pub struct Module<T: Config>(_);
Implementations
pub fn bare_exit_claim(
plapps_id: &T::AccountId,
state_update: &StateUpdateOf<T>,
checkpoint: &Option<StateUpdateOf<T>>,
witness: &Option<InclusionProofOf<T>>
) -> DispatchResult
pub fn bare_exit_claim(
plapps_id: &T::AccountId,
state_update: &StateUpdateOf<T>,
checkpoint: &Option<StateUpdateOf<T>>,
witness: &Option<InclusionProofOf<T>>
) -> DispatchResult
Claim Exit at StateUpdate There’re two kind of exit claims. ExitStateUpdate and ExitCheckpoint. The former needs inclusion proof of stateUpdate. The latter don’t need witness but check if checkpoint for the stateUpdate is finalized yet. inputs: [encode(stateUpdate), checkpoint] witness: [encode(inclusionProof)]
pub fn bare_exit_challenge(
plapps_id: &T::AccountId,
state_update: &StateUpdateOf<T>,
challenge_inputs: &Vec<Vec<u8>>,
witness: &InclusionProofOf<T>
) -> DispatchResult
pub fn bare_exit_challenge(
plapps_id: &T::AccountId,
state_update: &StateUpdateOf<T>,
challenge_inputs: &Vec<Vec<u8>>,
witness: &InclusionProofOf<T>
) -> DispatchResult
challenge prove the exiting coin has been spent. First element of challengeInputs must be either of bytes(“EXIT_SPENT_CHALLENGE”) or bytes(“EXIT_CHECKPOINT_CHALLENGE”) SPENT_CHALLENGE input: [SU] challengeInput: [label, transaction] witness: [signature] CHECKPOINT input: [SU] challengeInput: [label, checkpointSU] witness: []
pub fn bare_exit_remove_challenge(
_plapps_id: &T::AccountId,
_inputs: Vec<Vec<u8>>,
_challenge_inputs: Vec<Vec<u8>>,
_witness: Vec<Vec<u8>>
) -> DispatchResult
pub fn bare_exit_settle(
plapps_id: &T::AccountId,
state_update: &StateUpdateOf<T>
) -> DispatchResult
pub fn bare_exit_settle(
plapps_id: &T::AccountId,
state_update: &StateUpdateOf<T>
) -> DispatchResult
prove exit is coin which hasn’t been spent. check checkpoint
pub fn get_claim_decision(
predicate_address: T::AccountId,
su: &StateUpdateOf<T>
) -> DispatchResultT<Decision>
If the exit can be withdrawable, isCompletable returns true.
pub fn create_property(
predicate_address: T::AccountId,
su_bytes: &Vec<u8>,
kind: &'static [u8]
) -> PropertyOf<T>
pub fn validate_checkpoint_challenge(
plapps_id: &T::AccountId,
state_update: StateUpdateOf<T>,
challenge_state_update: StateUpdateOf<T>,
inclusion_proof: InclusionProofOf<T>
) -> DispatchResultT<(StateUpdateOf<T>, StateUpdateOf<T>, InclusionProofOf<T>)>
pub fn validate_checkpoint_challenge(
plapps_id: &T::AccountId,
state_update: StateUpdateOf<T>,
challenge_state_update: StateUpdateOf<T>,
inclusion_proof: InclusionProofOf<T>
) -> DispatchResultT<(StateUpdateOf<T>, StateUpdateOf<T>, InclusionProofOf<T>)>
challenge checkpiont _inputs: [encode(stateUpdate)] challenged state update _challengeInputs: [encode(stateUpdate)] challenging state update _witness: [encode(inclusionProof)] inclusionProof of challenging state update
Single aggregator address: AggregatorId
Current block number of commitment chain: BlockNumber
pub fn blocks<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> T::Hash where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::BlockNumber>,
mapping from Plapps address to Exit predicate address.
mapping from Plapps address to ExitDeposit predicate address.
TotalDeposited is the most right coin id which has been deposited.
pub fn deposited_ranges<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> RangeOf<T> where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<BalanceOf<T>>,
pub fn checkpoints<KArg1, KArg2>(k1: KArg1, k2: KArg2) -> bool where
KArg1: EncodeLike<T::AccountId>,
KArg2: EncodeLike<T::Hash>,
predicate address => payout address
Public callable Plasma commitment module methods.
pub fn verify_inclusion(
plapps_id: &T::AccountId,
leaf: &T::Hash,
token_address: &T::AccountId,
range: &RangeOf<T>,
inclusion_proof: &InclusionProofOf<T>,
block_number: &T::BlockNumber
) -> DispatchResultT<bool>
pub fn verify_inclusion(
plapps_id: &T::AccountId,
leaf: &T::Hash,
token_address: &T::AccountId,
range: &RangeOf<T>,
inclusion_proof: &InclusionProofOf<T>,
block_number: &T::BlockNumber
) -> DispatchResultT<bool>
verifyInclusion method verifies inclusion of message in Double Layer Tree. The message has range and token address and these also must be verified. Please see https://docs.plasma.group/projects/spec/en/latest/src/01-core/double-layer-tree.html for further details.
- @param leaf a message to verify its inclusion
- @param token_address token address of the message
- @param range range of the message
- @param inclusion_proof The proof data to verify inclusion
- @param block_number block number where the Merkle root is stored
pub fn verify_inclusion_with_root(
leaf: &T::Hash,
token_address: &T::AccountId,
range: &RangeOf<T>,
inclusion_proof: &InclusionProofOf<T>,
root: &T::Hash
) -> DispatchResultT<bool>
Public callable Plasma deposit module methods.
pub fn bare_remove_deposited_range(
plapps_id: &T::AccountId,
range: &RangeOf<T>,
deposited_range_id: &BalanceOf<T>
) -> DispatchResult
pub fn bare_finalize_exit(
plapps_id: &T::AccountId,
exit_property: &PropertyOf<T>,
deposited_range_id: &BalanceOf<T>
) -> DispatchResultT<StateUpdateOf<T>>
pub fn bare_finalize_exit(
plapps_id: &T::AccountId,
exit_property: &PropertyOf<T>,
deposited_range_id: &BalanceOf<T>
) -> DispatchResultT<StateUpdateOf<T>>
bare_finalize_exit called by this module.
- @param _exitProperty A property which is instance of exit predicate and its inputs are range and StateUpdate that exiting account wants to withdraw. _exitProperty can be a property of ether ExitPredicate or ExitDepositPredicate.
- @param _depositedRangeId Id of deposited range
- @return return StateUpdate of exit property which is finalized.
- @dev The steps of finalizeExit.
- Serialize exit property
- check the property is decided by Adjudication Contract.
- Transfer asset to payout contract corresponding to StateObject.
Please alse see https://docs.plasma.group/projects/spec/en/latest/src/02-contracts/deposit-contract.html#finalizeexit
pub fn verify_exit_property(
plapps_id: &T::AccountId,
exit_property: &PropertyOf<T>
) -> DispatchResultT<StateUpdateOf<T>>
pub fn verify_exit_property(
plapps_id: &T::AccountId,
exit_property: &PropertyOf<T>
) -> DispatchResultT<StateUpdateOf<T>>
@dev verify StateUpdate in Exit property. _exitProperty must be instance of ether ExitPredicate or ExitDepositPredicate. if _exitProperty is instance of ExitDepositPredicate, check _exitProperty.su is subrange of _exitProperty.checkpoint.
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,