Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Statemint runtimes to accept sufficient assets as xcm fee payment#1278

Merged
paritytech-processbot[bot] merged 62 commits intoparitytech:masterfrom
girazoki:girazoki-statemint-runtimes-to-accept-sufficient-assets
Aug 3, 2022
Merged

Statemint runtimes to accept sufficient assets as xcm fee payment#1278
paritytech-processbot[bot] merged 62 commits intoparitytech:masterfrom
girazoki:girazoki-statemint-runtimes-to-accept-sufficient-assets

Conversation

@girazoki
Copy link
Copy Markdown
Contributor

@girazoki girazoki commented May 20, 2022

Solves #1247

It adds a new trader TakeFirstAssetTrader, which takes the first asset and tries to charge xcm execution on such asset. If such asset in a sufficient asset in pallet-assets, then the fee (corresponding to how much it would cost in the native token) is converted to an asset_fee(corresponding to how much it would cost in the specified asset) based on the difference on the existential deposits.

Charged fee is for now given to the block author. I am open to suggestions on this

Missing tests, I am unsure where to add these tests. Open to suggestions on this too

@girazoki girazoki changed the title Girazoki statemint runtimes to accept sufficient assets Girazoki statemint runtimes to accept sufficient assets as xcm fee payment May 20, 2022
@girazoki girazoki changed the title Girazoki statemint runtimes to accept sufficient assets as xcm fee payment Statemint runtimes to accept sufficient assets as xcm fee payment May 20, 2022
@girazoki girazoki marked this pull request as ready for review May 20, 2022 10:28
@paritytech-ci paritytech-ci requested review from a team May 20, 2022 10:29
@girazoki girazoki marked this pull request as draft May 20, 2022 10:29
@joepetrowski
Copy link
Copy Markdown
Contributor

Missing tests, I am unsure where to add these tests. Open to suggestions on this too.

We are working on a dir restructure that will include a folder for all asset parachain runtimes. I think we could probably add a tests.rs file to that to test behavior that should be common for all Statemint variants.

@hbulgarini hbulgarini added the T7-system_parachains This PR/Issue is related to System Parachains. label May 20, 2022
@hbulgarini
Copy link
Copy Markdown
Contributor

Thanks for the PR @girazoki ! could you please fix the conflicting files? as Joe mentioned the dir restructure might originates the conflicts described.

@girazoki
Copy link
Copy Markdown
Contributor Author

sure!

ExtBuilder { balances: vec![], collators: vec![] }
}
}
use frame_support::traits::GenesisBuild;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't these builders be reused?

Copy link
Copy Markdown
Contributor Author

@girazoki girazoki Aug 1, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can put the builder in common so that all runtimes can access it yes

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved the builders to asset-test-utils package, now they are shared across all statemine runtimes

@paritytech-ci paritytech-ci requested a review from a team July 26, 2022 15:54
@girazoki girazoki closed this Aug 3, 2022
@girazoki girazoki reopened this Aug 3, 2022
@joepetrowski
Copy link
Copy Markdown
Contributor

bot merge

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

T7-system_parachains This PR/Issue is related to System Parachains.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants