Merged
Conversation
ea920e9 to
9951075
Compare
1212c51 to
1a3ca40
Compare
pgherveou
approved these changes
May 28, 2025
Comment on lines
+450
to
+452
| ext.execute_with(|| { | ||
| assert_ok!(Pallet::<Test>::map_account(RuntimeOrigin::signed(checking_account))); | ||
| }); |
Contributor
There was a problem hiding this comment.
sure I mean since you use the genesis config for the balance you can also use pallet_revive geneis config to set the mapping
pgherveou
reviewed
May 28, 2025
cumulus/parachains/runtimes/assets/asset-hub-westend/tests/contracts/dummy.polkavm
Show resolved
Hide resolved
pgherveou
reviewed
May 28, 2025
cumulus/parachains/runtimes/assets/asset-hub-westend/tests/contracts/erc20.polkavm
Show resolved
Hide resolved
|
All GitHub workflows were cancelled due to failure one of the required jobs. |
pgherveou
pushed a commit
that referenced
this pull request
Jun 11, 2025
Partially addresses #7523. In order to interact with ERC20 tokens via XCM (with `DepositAsset`, `WithdrawAsset` instructions), we need an Asset Transactor that can match them and call their contracts. I originally implemented the `fungibles::*` family of traits for `pallet-revive` in order to reuse the `FungiblesAdapter`. This was not suitable for the final solution since the adapter doesn't let you return fees to do anything with them. For getting the fees to work, I had to implement `TransactAsset` manually. I left the `fungibles::*` implementation for useful inspecting and minting in tests. A standard ERC20 transfer costs a specific amount of gas. We use this as the gas limit for every `WithdrawAsset` or `DepositAsset` in the executor. We call this `GasLimit`. I implemented a new method in `TransactAsset` that returns the surplus, `GasLimit - gas_consumed`. I managed to make it non-breaking by making this new function have a default implementation that calls the normal function and adds `Weight::zero()` to the return value. --------- Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
alvicsam
pushed a commit
that referenced
this pull request
Oct 17, 2025
Partially addresses #7523. In order to interact with ERC20 tokens via XCM (with `DepositAsset`, `WithdrawAsset` instructions), we need an Asset Transactor that can match them and call their contracts. I originally implemented the `fungibles::*` family of traits for `pallet-revive` in order to reuse the `FungiblesAdapter`. This was not suitable for the final solution since the adapter doesn't let you return fees to do anything with them. For getting the fees to work, I had to implement `TransactAsset` manually. I left the `fungibles::*` implementation for useful inspecting and minting in tests. A standard ERC20 transfer costs a specific amount of gas. We use this as the gas limit for every `WithdrawAsset` or `DepositAsset` in the executor. We call this `GasLimit`. I implemented a new method in `TransactAsset` that returns the surplus, `GasLimit - gas_consumed`. I managed to make it non-breaking by making this new function have a default implementation that calls the normal function and adds `Weight::zero()` to the return value. --------- Co-authored-by: Adrian Catangiu <adrian@parity.io> Co-authored-by: Alexander Theißen <alex.theissen@me.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially addresses #7523.
In order to interact with ERC20 tokens via XCM (with
DepositAsset,WithdrawAssetinstructions), we need an Asset Transactor that can match them and call their contracts.I originally implemented the
fungibles::*family of traits forpallet-revivein order to reuse theFungiblesAdapter.This was not suitable for the final solution since the adapter doesn't let you return fees to do anything with them.
For getting the fees to work, I had to implement
TransactAssetmanually. I left thefungibles::*implementation for useful inspecting and minting in tests.A standard ERC20 transfer costs a specific amount of gas. We use this as the gas limit for every
WithdrawAssetorDepositAssetin the executor. We call thisGasLimit.I implemented a new method in
TransactAssetthat returns the surplus,GasLimit - gas_consumed.I managed to make it non-breaking by making this new function have a default implementation that calls the normal function and adds
Weight::zero()to the return value.