Moving pallet-asset-tx-payment from cumulus to substrate (#10127)

* Moving `pallet-asset-tx-payment` from cumulus

* move pallet-asset-tx-payment into transaction payment directory

* cargo +nightly fmt

* Adding `pallet-asset-tx-payment` to node runtime
I had to change the Balance type to u128.
Also harmonised that pallet's version

* Updating cargo.lock after merge

* forgot this

* Adding tx-payment signature

* Missed one more

* `transaction-payment` replaced in`SignedExtension`
by `asset-tx-payment` and not added

* Fixing benches

* add test to verify that we don't charge on post-dispatch if we didn't on pre-dispatch

* add (failing) test for asset tx payment of unsigned extrinsics

* fix test by removing debug_assert

* cargo +nightly fmt

* typo in `Cargo.lock`

* Object defined twice in lock file

* cargo update

* remove todo

* Apply formatting suggestions from code review

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Refactoring `post_dispatch` of `asset-tx-payment`
to reuse `post_dispatch` of `transaction-payment` if the fee asset is
native
Removing unneeded imports.

* Removing redundant `TODO`

* Reverting an accidental bump of `impl-serde`
 from `0.3.1` to `0.3.2`

* Revert unneeded changes to `cargo.lock`

* Update frame/transaction-payment/asset-tx-payment/src/payment.rs

Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>

* Fixing cargo fmt

Reverting changes which broke cargo fmt

Co-authored-by: Alexander Popiak <alexander.popiak@parity.io>
Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>
Co-authored-by: Kian Paimani <5588131+kianenigma@users.noreply.github.com>
This commit is contained in:
Georges
2021-11-19 09:29:12 +00:00
committed by GitHub
parent 69478639b3
commit 439af98e55
16 changed files with 1346 additions and 11 deletions
@@ -11,6 +11,7 @@ test-runner = { path = "../../../test-utils/test-runner" }
frame-system = { path = "../../../frame/system" }
frame-benchmarking = { path = "../../../frame/benchmarking" }
pallet-transaction-payment = { path = "../../../frame/transaction-payment" }
pallet-asset-tx-payment = { path = "../../../frame/transaction-payment/asset-tx-payment/" }
node-runtime = { path = "../runtime" }
node-primitives = { path = "../primitives" }