Ledger Acceptance Tests
HCP Ledger Test Suite
10 acceptance tests covering double-spend, replay, signatures, state roots, receipts, and smart contracts.
Asset Transfer — Happy Path
Create Wallet A and Wallet B. Register Asset X owned by Wallet A. Transfer to Wallet B. Verify ownership change, state root, and receipt.
Double Spend — NOT_CURRENT_OWNER
expects: NOT_CURRENT_OWNERAfter Test 1, try to transfer Asset X again from Wallet A. Expect NOT_CURRENT_OWNER rejection.
Replay Attack — REPLAYED_NONCE
expects: REPLAYED_NONCESubmit same transaction with same nonce twice from same wallet. Expect REPLAYED_NONCE on second attempt.
Once-Only Redemption — ALREADY_REDEEMED
expects: ALREADY_REDEEMEDCreate redeemable Asset Y. Redeem once (success). Try again. Expect ALREADY_REDEEMED.
Invalid Signature Rejection
expects: INVALID_SIGNATURESubmit transaction with empty signature. Verify rejected before finality with INVALID_SIGNATURE.
Rate Limit / Quota Enforcement
expects: INSUFFICIENT_CREDITSSimulate exhausted usage credits. Verify transaction rejected with insufficient quota error.
State Root Generation
Finalize a transaction batch. Generate and store state root with Merkle root, batch height, and validator signature bundle.
Validator Signature Threshold
Verify finality receipt shows 4/4 validator signatures and confirms threshold is met.
External Anchor Reference
Create anchor checkpoint record for a finalized state root. Verify anchor status and reference URL stored.
Smart Contract One-Time Redemption
expects: ALREADY_REDEEMEDSimulate contract-call ticket redemption. First call succeeds. Second call fails with ALREADY_REDEEMED.