Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: adding payFees.. #6702

Open
wants to merge 1 commit into
base: papi_chopsticks_docs
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,7 @@ test("Initiate Teleport XCM v5", async () => {
})

test("Initiate Teleport with remote fees", async () => {

const msg = Enum('V5', [
XcmV4Instruction.WithdrawAsset([
{
Expand All @@ -345,12 +346,17 @@ test("Initiate Teleport with remote fees", async () => {
interior: XcmV3Junctions.Here(),
},
// optional field. an example of usage:
// do not use wild all
remote_fees: Enum('Teleport', {
type: 'Wild',
value: {
type: 'All',
value: undefined,
},
type: 'Definite',
value: [{
id: {
parents: 1,
interior: XcmV3Junctions.Here(),
},
// here need to put the cost/weight of remote xcm message.
fun: XcmV3MultiassetFungibility.Fungible(weight_to_asset_fee.value),
}],
}),
preserve_origin: false,
assets: [Enum('Teleport', {
Expand All @@ -377,6 +383,17 @@ test("Initiate Teleport with remote fees", async () => {
],
}),
]);

// const xcm_origin_weight = await AHApi.apis.XcmPaymentApi.query_xcm_weight(msg);
// const weight_to_asset_fee = await AHApi.apis.XcmPaymentApi.query_weight_to_asset_fee(
// { ref_time: xcm_origin_weight.value.ref_time, proof_size: xcm_origin_weight.value.proof_size },
// Enum('V5', {
// parents: 1,
// interior: XcmV3Junctions.Here(),
// }),
// );
// expect(weight_to_asset_fee.value).toBe('123');

const weight = await AHApi.apis.XcmPaymentApi.query_xcm_weight(msg);

const ahToWnd = AHApi.tx.PolkadotXcm.execute({
Expand Down
Loading