Context
create_request in src/request.rs stores amount, memo, and expires_in without validating their values. A caller can create a request with amount == 0, expires_in == 0, or an arbitrarily long memo.
Acceptance criteria
create_request aborts with a descriptive panic when amount <= 0.
create_request aborts when expires_in == 0.
memo longer than 128 bytes is rejected.
- Each case has a unit test in the
#[cfg(test)] module of src/request.rs.
Technical notes
- Check
amount with amount <= 0 before writing storage.
- Cap
memo with memo.len() (byte length for String).
- Soroban panics become transaction failures, so keep messages specific.
Testing
- Add
create_request_rejects_zero_amount, create_request_rejects_zero_expiry, create_request_rejects_long_memo.
make test must pass and make lint must stay clean.
Context
create_requestinsrc/request.rsstoresamount,memo, andexpires_inwithout validating their values. A caller can create a request withamount == 0,expires_in == 0, or an arbitrarily longmemo.Acceptance criteria
create_requestaborts with a descriptive panic whenamount <= 0.create_requestaborts whenexpires_in == 0.memolonger than 128 bytes is rejected.#[cfg(test)]module ofsrc/request.rs.Technical notes
amountwithamount <= 0before writing storage.memowithmemo.len()(byte length forString).Testing
create_request_rejects_zero_amount,create_request_rejects_zero_expiry,create_request_rejects_long_memo.make testmust pass andmake lintmust stay clean.