Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💸 USDT transaction payments #403

Merged
merged 1 commit into from
Oct 10, 2024
Merged

Conversation

JuaniRios
Copy link
Contributor

@JuaniRios JuaniRios commented Sep 27, 2024

What?

Allow extrinsic fee payment with AssetHub assets that have a price in the oracle

Why?

Needed for OTM flow

How?

  • Add the pallet_asset_tx_payment which is tightly coupled to pallet_transaction_payment.
  • It gets the PLMC fee required for an extrinsic, and converts it to the asset from pallet_assets with our own custom logic.

Testing?

In the next PR

Anything Else?

  • There already were some existing generic structs that implemented this logic, but they assumed the tip and fee to go to the same place. Since we want the fee to go to the Blockchain Operation Treasury, and the tip to go to the block author, we had to reimplement most logic.

  • The original struct was FungiblesAdapter<CON, HC>.
    where CON was the converter and HC the crediting of the fee.
    Our solution copies that, but also implements a third generic, such that the second pays the fee-tip, and the third the fee. For more info check pallet_asset_tx_payment::payment::FungiblesAdapter

@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from f49c7d8 to 290b404 Compare September 27, 2024 11:38
@JuaniRios JuaniRios changed the title USDT transaction payment 💸 USDT transaction payment Sep 27, 2024
@JuaniRios JuaniRios changed the title 💸 USDT transaction payment 💸 USDT transaction payments Sep 27, 2024
@JuaniRios JuaniRios self-assigned this Sep 27, 2024
@JuaniRios JuaniRios marked this pull request as ready for review September 27, 2024 11:43
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch 2 times, most recently from 1c5ab2b to 64e8904 Compare September 27, 2024 11:45
runtimes/shared-configuration/src/fee.rs Outdated Show resolved Hide resolved
runtimes/polimec/src/lib.rs Show resolved Hide resolved
runtimes/polimec/src/lib.rs Show resolved Hide resolved
runtimes/polimec/src/lib.rs Show resolved Hide resolved
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 9050fc9 to 9f8292f Compare September 30, 2024 12:51
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from 64e8904 to b17ad86 Compare September 30, 2024 12:52
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 9f8292f to 228d298 Compare September 30, 2024 12:58
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from b17ad86 to 881ae63 Compare September 30, 2024 12:58
@JuaniRios JuaniRios mentioned this pull request Sep 30, 2024
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 228d298 to ac29096 Compare September 30, 2024 13:00
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from 881ae63 to a0d191f Compare September 30, 2024 13:00
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from ac29096 to 94ee09b Compare September 30, 2024 13:05
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from a0d191f to d1269bb Compare September 30, 2024 13:05
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 94ee09b to 5115a7b Compare September 30, 2024 13:12
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from d1269bb to 0d68b35 Compare September 30, 2024 13:12
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 5115a7b to 990eb8b Compare September 30, 2024 13:14
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch 2 times, most recently from dd2d227 to a6346c6 Compare October 1, 2024 09:20
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from cbdb1d7 to 33630ab Compare October 4, 2024 12:17
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from d660244 to b1f0a8d Compare October 4, 2024 12:17
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 33630ab to 9c24271 Compare October 7, 2024 13:02
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from b1f0a8d to 05af248 Compare October 7, 2024 13:02
@lrazovic lrazovic force-pushed the 09-24-usdt_transaction_payment branch from 05af248 to 0711b4f Compare October 8, 2024 13:27
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 9c24271 to 8eb1453 Compare October 9, 2024 09:59
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from 0711b4f to cc0ed0d Compare October 9, 2024 09:59
@lrazovic lrazovic force-pushed the 09-19-otm_funding_tests branch from 8eb1453 to cd0edbf Compare October 10, 2024 11:57
@lrazovic lrazovic force-pushed the 09-24-usdt_transaction_payment branch from cc0ed0d to 55f4136 Compare October 10, 2024 11:58
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from cd0edbf to 8eb1453 Compare October 10, 2024 11:59
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from 55f4136 to cc0ed0d Compare October 10, 2024 11:59
@lrazovic lrazovic force-pushed the 09-19-otm_funding_tests branch from 8eb1453 to cd0edbf Compare October 10, 2024 12:20
@lrazovic lrazovic force-pushed the 09-24-usdt_transaction_payment branch from cc0ed0d to 55f4136 Compare October 10, 2024 12:20
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from cd0edbf to 8eb1453 Compare October 10, 2024 12:22
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from 55f4136 to cc0ed0d Compare October 10, 2024 12:22
@JuaniRios JuaniRios force-pushed the 09-19-otm_funding_tests branch from 8eb1453 to c14f528 Compare October 10, 2024 13:46
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from cc0ed0d to 26e32e8 Compare October 10, 2024 13:46
Copy link
Contributor Author

JuaniRios commented Oct 10, 2024

Merge activity

  • Oct 10, 10:08 AM EDT: A user started a stack merge that includes this pull request via Graphite.
  • Oct 10, 10:16 AM EDT: Graphite rebased this pull request as part of a merge.
  • Oct 10, 10:17 AM EDT: A user merged this pull request with Graphite.

@JuaniRios JuaniRios changed the base branch from 09-19-otm_funding_tests to graphite-base/403 October 10, 2024 14:12
@JuaniRios JuaniRios changed the base branch from graphite-base/403 to main October 10, 2024 14:14
@JuaniRios JuaniRios force-pushed the 09-24-usdt_transaction_payment branch from 26e32e8 to 9e3183f Compare October 10, 2024 14:15
@JuaniRios JuaniRios merged commit 9d81e47 into main Oct 10, 2024
1 check passed
@JuaniRios JuaniRios deleted the 09-24-usdt_transaction_payment branch October 10, 2024 14:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants