`invoice_count()` returns the next invoice id, not the number of invoices
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 2/5
- Tempo stimato
- 1-3 ore
- Idoneità per principianti
- 55/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- rust
- Ambito
- blockchain, payments
Direzione di ricerca
Start in contracts/invoice/src/lib.rs at invoice_count, which returns the stored NextId, and at the test invoice_count_returns_next_id in contracts/invoice/src/test.rs, which currently asserts that behaviour. Confirm the intended semantics with a maintainer first, since the issue asks for either NextId - 1 or a rename to a next-id function. Done means the count matches the chosen semantics, the doc comment and contracts/invoice/README.md agree, and cargo test, cargo fmt --check and clippy pass.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Difficulty: Beginner
Problem
invoice_count returns the stored NextId, which is 1 when no invoice exists. The unit test invoice_count_returns_next_id codifies this, and the doc comment says "total number of invoices ever created (the next invoice id)", which contradicts itself. A client that loops 1..=count would be off by one.
Why it matters
The function exists to replace the id-by-id scan. An off-by-one in a newly merged public function is cheapest to fix before the contract is redeployed (the live testnet contract does not have it yet).
Scope of work
Make the function return the real count (NextId - 1, saturating) or rename it to match its behaviour, update its doc comment, test and the contract README, and state the choice in the PR.
Acceptance criteria
- No invoices gives
0; after N creations it givesN(or the function is renamed and documented as "next id"). - Test and README updated.
-
cargo fmt --check, clippy and tests pass.
Relevant files
contracts/invoice/src/lib.rscontracts/invoice/src/test.rscontracts/invoice/README.md
Dependencies
Related to #27, #28 and #29, which also touch lib.rs; coordinate to avoid conflicts.
Maintainer discussion needed?
Yes, briefly: confirm the intended semantics. The function is not deployed yet, so there is no compatibility concern.
- Lingua principale
- TypeScript
- Stelle
- 0
- Fork
- 4
- Merge medio
- 54m
- PR unite (30g)
- 6
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
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 Yormee-103/PayLoop
-
Add a CHANGELOG and release-notes conventionForse già presa @Sharon-dev-create l’ha presa oggi. Apertadifficulty: beginner documentation dx help wanted Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
Yormee-103/PayLoop#169 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Glossary of Stellar and PayLoop terms, linked from the Help pageForse già presa @Yemmy88 l’ha presa oggi. Apertadifficulty: beginner documentation good first issue help wanted Stellar Wave
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
Yormee-103/PayLoop#168 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
difficulty: beginner dx good first issue help wanted web
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Yormee-103/PayLoop#158 ·
I maintainer di solito rispondono entro 1 giorno
-
difficulty: beginner documentation good first issue help wanted security
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
Yormee-103/PayLoop#145 ·
I maintainer di solito rispondono entro 1 giorno
-
a11y difficulty: beginner good first issue help wanted web
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
Yormee-103/PayLoop#144 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Yormee-103/PayLoop
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
I maintainer di solito rispondono entro 1 giorno
-
agent-canvas bug oh-gpt-fleet priority:medium ready-for-dev UI/UX
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
I maintainer di solito rispondono entro 1 giorno
-
good first issue javascript test
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
writerslogic/scrivener-mcp#272 ·
I maintainer di solito rispondono entro 1 giorno
-
bug triaged tui ux wontfix
Difficoltà 2/5 Mezza giornata Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno