Trait xcm_runtime_apis::dry_run::DryRunApi
source · pub trait DryRunApi<Block: BlockT, Call, Event, OriginCaller>: Core<Block>where
Call: Encode,
Event: Decode,
OriginCaller: Encode,{
// Provided methods
fn dry_run_call(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: OriginCaller,
call: Call,
) -> Result<Result<CallDryRunEffects<Event>, Error>, ApiError> { ... }
fn dry_run_xcm(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin_location: VersionedLocation,
xcm: VersionedXcm<Call>,
) -> Result<Result<XcmDryRunEffects<Event>, Error>, ApiError> { ... }
}
Expand description
API for dry-running extrinsics and XCM programs to get the programs that need to be passed to the fees API.
All calls return a vector of tuples (location, xcm) where each “xcm” is executed in “location”. If there’s local execution, the location will be “Here”. This vector can be used to calculate both execution and delivery fees.
Calls or XCMs might fail when executed, this doesn’t mean the result of these calls will be an Err
.
In those cases, there might still be a valid result, with the execution error inside it.
The only reasons why these calls might return an error are listed in the Error
enum.
Provided Methods§
sourcefn dry_run_call(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin: OriginCaller,
call: Call,
) -> Result<Result<CallDryRunEffects<Event>, Error>, ApiError>
fn dry_run_call( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin: OriginCaller, call: Call, ) -> Result<Result<CallDryRunEffects<Event>, Error>, ApiError>
Dry run call.
sourcefn dry_run_xcm(
&self,
__runtime_api_at_param__: <Block as BlockT>::Hash,
origin_location: VersionedLocation,
xcm: VersionedXcm<Call>,
) -> Result<Result<XcmDryRunEffects<Event>, Error>, ApiError>
fn dry_run_xcm( &self, __runtime_api_at_param__: <Block as BlockT>::Hash, origin_location: VersionedLocation, xcm: VersionedXcm<Call>, ) -> Result<Result<XcmDryRunEffects<Event>, Error>, ApiError>
Dry run XCM program