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 #1850

Closed
wilwade opened this issue Jan 23, 2024 · 0 comments · Fixed by #1851
Closed

Bug: Transacting with Capacity Should Not Require Tokens to Cover Transaction Cost #1850

wilwade opened this issue Jan 23, 2024 · 0 comments · Fixed by #1851
Assignees
Labels
bug Something isn't working

Comments

@wilwade
Copy link
Collaborator

wilwade commented Jan 23, 2024

Scenario:

  1. Use Account X to create Provider X
  2. Account X has balance of 200 UNITs
  3. Account X Stakes to Provider X 199 UNITs (The max allowed as the system forces you to retain at least 1 UNIT when staking the max amount)
  4. Account X then does some things that remove most/all of the 1 UNIT that is unfrozen.
  5. Account X has minimal unfrozen tokens
  6. Account X then tries to do a Capacity Transaction on Provider X that without Capacity would take MORE than the minimal unfrozen token balance
  • Expected: Transaction should be successful as there is enough Capacity to cover the transaction
  • Actual: The transaction is rejected with 1010 Invalid Transaction - Inability to pay some fees (e.g. account balance too low)
@wilwade wilwade added the bug Something isn't working label Jan 23, 2024
@mattheworris mattheworris self-assigned this Jan 23, 2024
mattheworris added a commit that referenced this issue Jan 24, 2024
…saction cost (#1851)

# 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

- [x] `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
- [x] Ensures that additional provider keys that have no ED cannot
transact successfully.
- [x] Add e2e-test that successfully claims a handle with 0 available
balance

# How to Test
- Ensure that e2e-tests complete successfully

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

---------

Co-authored-by: Matthew Orris <--help>
Co-authored-by: Joe Caputo <joseph.caputo@unfinished.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants