AstarNetwork / astar-frame

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

Remove chain-extension-trait package #109

Closed akru closed 1 year ago

akru commented 1 year ago

Pull Request Summary

The purpose of this PR is

The problem is when we trying to development new CE usually we doing following steps:

  1. fork development branch;
  2. add dependency with new package pointed into development branch.

But, linking all CE to same Trait package makes requirement for all CE use it, and use it with same source, that means touch one CE requires repoint all CEs to development branch. It looks inconvenient in terms of independent development for may CEs. The purpose of this PR is making CE development more independent.

Dapps Staking CE 1.1

This PR aslo includes some code optimizations for dapps-staking CE. Contract type was removed and used runtime-level converters from [u8; 32] to SmartContract types. It looks much more safe rather than hacks with codec, runtime level converter is trivial and looks much more like trait-driven programming.

So, instead of byte manipulations hacks we just make requirement to have From<[u8; 32]> trait impl somewhere (usually where SmartContract type defined).

Check list

github-actions[bot] commented 1 year ago

Code Coverage

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

Minimum allowed line rate is 50%