Skip to content
This repository has been archived by the owner on Sep 28, 2023. It is now read-only.

update precompile-xcm #161

Open
wants to merge 33 commits into
base: polkadot-v0.9.39
Choose a base branch
from

Conversation

gitofdeepanshu
Copy link

@gitofdeepanshu gitofdeepanshu commented Jun 2, 2023

Pull Request Summary

Changes

  1. Add SetAppendix instruction in remote_transact() in xcm-precompile after which user can have extra fees deposited to it’s sovereign account instead of asset trap.
  2. Add new function send_xcm() which allows to send any xcm-message to the destination chain.
  3. Add new Struct Multilocation to precompile
struct Multilocation {
    uint8 parents;
    bytes[] interior;
}

This addition helps in getting rid of function overloading for different Account types (AccountId32 and AccountKey20) supported by xcm.

Check list

  • added unit tests
  • updated documentation

@gitofdeepanshu gitofdeepanshu marked this pull request as ready for review June 14, 2023 08:35
@gitofdeepanshu gitofdeepanshu changed the title add SetAppendix in remote_transact update precompile-xcm Jun 14, 2023
precompiles/utils/src/xcm.rs Outdated Show resolved Hide resolved
precompiles/xcm/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

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

PR summary/message should be updated.

precompiles/utils/src/bytes.rs Show resolved Hide resolved
precompiles/utils/src/bytes.rs Outdated Show resolved Hide resolved
precompiles/utils/src/data.rs Outdated Show resolved Hide resolved
precompiles/utils/src/bytes.rs Show resolved Hide resolved
precompiles/utils/src/xcm.rs Show resolved Hide resolved
precompiles/utils/src/xcm.rs Show resolved Hide resolved
precompiles/xcm/XCM.sol Outdated Show resolved Hide resolved
precompiles/xcm/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Member

@Dinonard Dinonard left a comment

Choose a reason for hiding this comment

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

I'd suggest to discuss the XTokens inclusion and its impact on the interface with the team.

precompiles/xcm/XCM_v2.sol Show resolved Hide resolved
precompiles/utils/src/tests.rs Show resolved Hide resolved
}

/**
* @dev Withdraw assets using PalletXCM call.
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn't put implementation details into interface definition.

I see the old file also has this, but it's wrong.

@github-actions
Copy link

Code Coverage

Package Line Rate Branch Rate Health
chain-extensions/pallet-assets/src 0% 0%
frame/custom-signatures/src 52% 0%
precompiles/utils/macro/src 0% 0%
precompiles/dapps-staking/src 93% 0%
precompiles/utils/macro/tests 0% 0%
frame/dapps-staking/src 82% 0%
precompiles/xcm/src 81% 0%
chain-extensions/types/dapps-staking/src 0% 0%
frame/pallet-xvm/src/pallet 8% 0%
frame/xc-asset-config/src 50% 0%
chain-extensions/xvm/src 0% 0%
frame/collator-selection/src 76% 0%
frame/contracts-migration/src 0% 0%
frame/pallet-xcm/src 53% 0%
precompiles/assets-erc20/src 76% 0%
frame/pallet-xvm/src 5% 0%
precompiles/sr25519/src 79% 0%
chain-extensions/types/xvm/src 0% 0%
precompiles/substrate-ecdsa/src 78% 0%
chain-extensions/types/assets/src 0% 0%
precompiles/utils/src 66% 0%
primitives/xcm/src 62% 0%
frame/dapps-staking/src/pallet 87% 0%
frame/block-reward/src 80% 0%
precompiles/xvm/src 61% 0%
chain-extensions/dapps-staking/src 0% 0%
Summary 58% (3081 / 5324) 0% (0 / 0)

Minimum allowed line rate is 50%

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants