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

Bug transacting with capacity should not require tokens to cover transaction cost #1851

Conversation

mattheworris
Copy link
Collaborator

@mattheworris mattheworris commented Jan 23, 2024

Goal

The goal of this PR is to fix a frequency-tx-payment bug to allow capacity holders to transact when their free balance is less than the minimum balance, or Existential Deposit (ED).

Closes #1850

Discussion

  • withdraw_fee check updated to use total_balance instead of balance, which ensures that if an account has capacity (frozen > 0) but has no available balance (free == frozen) transactions are still successful
  • Ensures that additional provider keys that have no ED cannot transact successfully.
  • Add e2e-test that successfully claims a handle with 0 available balance

How to Test

  • Ensure that e2e-tests complete successfully

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

Matthew Orris added 2 commits January 23, 2024 10:53
…1850-bug-transacting-with-capacity-should-not-require-tokens-to-cover-transaction-cost
Copy link

codecov bot commented Jan 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (8679b88) 82.95% compared to head (dbb29df) 82.95%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1851   +/-   ##
=======================================
  Coverage   82.95%   82.95%           
=======================================
  Files          56       56           
  Lines        4552     4552           
=======================================
  Hits         3776     3776           
  Misses        776      776           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mattheworris mattheworris self-assigned this Jan 23, 2024
@mattheworris mattheworris marked this pull request as ready for review January 23, 2024 23:32
@mattheworris mattheworris requested a review from a team January 23, 2024 23:34
@mattheworris mattheworris added bug Something isn't working Capacity Capacity Transactions labels Jan 23, 2024
@mattheworris mattheworris changed the title WIP: 1850 bug transacting with capacity should not require tokens to cover transaction cost Bug transacting with capacity should not require tokens to cover transaction cost Jan 23, 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! 👍

Matthew Orris and others added 2 commits January 24, 2024 08:54
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 good to me!

@aramikm
Copy link
Collaborator

aramikm commented Jan 24, 2024

Only need to increase spec version

@github-actions github-actions bot added the metadata-changed Metadata has changed since the latest full release label Jan 24, 2024
@mattheworris mattheworris merged commit 9bc974e into main Jan 24, 2024
30 checks passed
@mattheworris mattheworris deleted the 1850-bug-transacting-with-capacity-should-not-require-tokens-to-cover-transaction-cost branch January 24, 2024 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Capacity Capacity Transactions metadata-changed Metadata has changed since the latest full release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: Transacting with Capacity Should Not Require Tokens to Cover Transaction Cost
4 participants