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

#2029: Passkey withdraw token fees for tx #2040

Merged
merged 47 commits into from
Jul 2, 2024
Merged

Conversation

saraswatpuneet
Copy link
Collaborator

@saraswatpuneet saraswatpuneet commented Jun 24, 2024

Goal

The goal of this PR is to enable pallet_transaction_pallet to withdraw tx fee, this is needed as our extrinsic is unsigned, thereby does not gets charged by default

Closes #2029
Creates #2051

Details

  • Refactor some common types from frequency-tx-payment to common-primitives
  • Add a withdraw fee function to be called from Validate Unsigned to charge for tx fee
  • Add unit test

Discussion

Checklist

  • Chain spec updated
  • Custom RPC OR Runtime API added/changed? Updated js/api-augment.
  • Design doc(s) updated
  • Tests added
  • Benchmarks added
  • Weights updated

Copy link

codecov bot commented Jun 24, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Files Coverage Δ
pallets/frequency-tx-payment/src/lib.rs 82.87% <100.00%> (ø)
pallets/passkey/src/lib.rs 95.00% <100.00%> (+9.63%) ⬆️

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jun 24, 2024
@wilwade wilwade changed the title [WIP] #2029: Passke withdraw token fees for tx [WIP] #2029: Passkey withdraw token fees for tx Jun 25, 2024
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Jun 25, 2024
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Jun 26, 2024
@github-actions github-actions bot added metadata-changed Metadata has changed since the latest full release and removed metadata-changed Metadata has changed since the latest full release labels Jun 26, 2024
@saraswatpuneet saraswatpuneet changed the title [WIP] #2029: Passkey withdraw token fees for tx #2029: Passkey withdraw token fees for tx Jun 26, 2024
@saraswatpuneet
Copy link
Collaborator Author

@aramikm added some tests you suggested here 42fcca4

@enddynayn
Copy link
Collaborator

enddynayn commented Jul 1, 2024

Looking good! 💯

Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

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

Added some comments

pallets/passkey/src/lib.rs Outdated Show resolved Hide resolved
pallets/passkey/src/lib.rs Show resolved Hide resolved
pallets/passkey/src/tests.rs Outdated Show resolved Hide resolved
);
let tx_payment_validity = tx_charge.validate()?;
let valid_tx = valid_tx
.combine_with(signature_validity)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice!

Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

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

Looks Great!

Copy link
Collaborator

@shannonwells shannonwells left a comment

Choose a reason for hiding this comment

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

One non-blocking comment.

pallets/passkey/src/tests.rs Outdated Show resolved Hide resolved
@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jul 2, 2024
@github-actions github-actions bot removed the metadata-changed Metadata has changed since the latest full release label Jul 2, 2024
Copy link
Collaborator

@enddynayn enddynayn left a comment

Choose a reason for hiding this comment

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

👍 superb! 💯

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jul 2, 2024
@saraswatpuneet saraswatpuneet merged commit dc4057c into main Jul 2, 2024
28 checks passed
@saraswatpuneet saraswatpuneet deleted the passkey_tx_charge branch July 2, 2024 17:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
metadata-changed Metadata has changed since the latest full release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature]: Passkey - Implement tx payment fee charge
4 participants