AstarNetwork / astar-frame

Core frame modules for Astar & Shiden network.
Other
58 stars 38 forks source link

Add workaround to reserve transfer native assets #108

Closed 0x7CFE closed 1 year ago

0x7CFE commented 1 year ago

Currently we identify assets being transferred by specifying an H160 style address (XC20), so this prevents us from sending native token since there's no representation for it.

This PR adds a workaround to interpret address 0x0 as native token to be sent (parents: 0, interior: Here), it can be used to pay for transaction.

Dinonard commented 1 year ago

At this point, it might be worth doing the UT improvement item for XCM precompiles.

It would be good to check that in case msg.value > 0 we get a modified asset list in the dispatched XCM.

0x7CFE commented 1 year ago

It would be good to check that in case msg.value > 0 we get a modified asset list in the dispatched XCM.

Agree. Current solution looks ad-hoc and fragile.

0x7CFE commented 1 year ago

Documented recent changes in API in https://github.com/AstarNetwork/astar-docs/pull/130

github-actions[bot] commented 1 year ago

Code Coverage

Package Line Rate Branch Rate Health
chain-extensions/dapps-staking/src 0% 0%
chain-extensions/types/rmrk/src 0% 0%
chain-extensions/xvm/src 0% 0%
precompiles/dapps-staking/src 93% 0%
precompiles/utils/src/data 72% 0%
chain-extensions/types/xvm/src 0% 0%
frame/pallet-xcm/src 65% 0%
frame/custom-signatures/src 57% 0%
frame/pallet-xvm/src 11% 0%
precompiles/sr25519/src 79% 0%
frame/dapps-staking/src/pallet 90% 0%
frame/block-reward/src 85% 0%
frame/xc-asset-config/src 70% 0%
frame/dapps-staking/src 83% 0%
frame/collator-selection/src 80% 0%
frame/pallet-xvm/src/pallet 34% 0%
chain-extensions/rmrk/src 0% 0%
precompiles/assets-erc20/src 73% 0%
precompiles/substrate-ecdsa/src 78% 0%
precompiles/utils/macro/src 0% 0%
precompiles/utils/macro/tests 0% 0%
precompiles/xcm/src 84% 0%
precompiles/xvm/src 94% 0%
primitives/xcm/src 68% 0%
precompiles/utils/src 72% 0%
chain-extensions/types/dapps-staking/src 0% 0%
Summary 60% (2581 / 4332) 0% (0 / 0)

Minimum allowed line rate is 50%