hiero-ledger / hiero-ledger/hiero-consensus-node

Verify approval/allowance test case

Open
#2,992 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
406
Forks
226
Avg merge
3d 4h
Merged PRs (30d)
210

Description

### Problem

Please see the below scenario.

1. Alice has given Bob an approval for 20 hbars. At that time, Bob had a balance of 100 hbars.
2. Technically, Bob can spend 120 hbars now (100 of his own , and 20 from Alice’s account).
3. Bob then transfers his 100 hbars to Carol.
4. Now Bob has a balance of 0 and approval for 20.
5. And Bob’s account comes up for auto-renewal.
6. I am expecting that the auto-renewal for Bob will fail because he doesn’t have sufficient balance. Our auto-renewal logic will not automatically transfer the amount required for renewal (say 0.01 hbar) from Alice’s account to Bob’s account and then use that for auto-renewal.

### Solution

Please verify or add test case for this scenario.

### Alternatives

_No response_

Contributor guide

Open the contributing guide

Research direction

Review the existing approval/allowance and account auto-renewal tests for issue #2992, then trace how the scenario is covered. Add or update a test for Bob transferring away his balance while retaining Alice’s approval; done means the test verifies that auto-renewal fails without automatically transferring funds from Alice.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
blockchain
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.