Balance of receiver gets overwritten instead of increased
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 48/100
Direzione di ricerca
Inizia individuando la logica di trasferimento di denaro che utilizza self.receiver_balance, quindi esamina come viene letto e scritto il saldo del destinatario. Verifica la correzione con un saldo del destinatario di 300 e un trasferimento di 50; il saldo finale memorizzato dovrebbe essere 350 anziché 50.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Hi, I found an issue in the money transfer logic.
When transferring money, the receiver’s balance doesn’t get incremented.
Instead, it gets replaced by the transfer amount.
The problem comes from this variable:
self.receiver_balance
It’s initialized to 0 and never updated from the database, so the code ends up doing:
balance = transfer_amount
This means the receiver’s old balance is lost.
Example:
If the receiver originally has 300 and I transfer 50 → the final balance becomes 50, not 350.
Expected:
The balance should increase by the transfer amount.
Suggestion:
Update the DB directly using something like:
UPDATE card SET balance = balance + ? WHERE number = ?
This way the balance is always based on the value stored in the database.
- Lingua principale
- Python
- Stelle
- 583
- Fork
- 441
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Shahrayar123/Python-Projects
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Shahrayar123/Python-Projects#297 · 7 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Shahrayar123/Python-Projects#112 · 8 commenti ·
-
Add AI & Agentic AI Projects ApertaAgentic AI enhancement good first issue
Shahrayar123/Python-Projects#332 · 3 commenti · 1 assegnatario ·
-
documentation good first issue help wanted
Difficoltà 3/5 1-2 giorni Idoneità per principianti 70/100
Shahrayar123/Python-Projects#331 · 2 commenti ·
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 48/100
Shahrayar123/Python-Projects#320 · 3 commenti ·
Tutte le issue di Shahrayar123/Python-Projects
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·