Core — Account Test Cases
A. Document controlA. Kiểm soát tài liệu
| Doc ID | CPG-TC-CORE-ACC |
|---|---|
| VersionPhiên bản | 1.0 |
| StatusTrạng thái | Draft |
| Owner | CPG BA / Architecture |
| AudienceĐối tượng | QA, Product, Backend, Frontend |
| ClassificationPhân loại | Internal |
| Effective dateNgày hiệu lực | 01/12/2026 |
| Related docs | Account RTM · Account BR anchors · Account UC anchors |
B. Version historyB. Lịch sử phiên bản
| Version | Date | Author | ChangesThay đổi |
|---|---|---|---|
| 1.0 | 01/12/2026 | Khoa Trinh | Version 1.0 |
C. Table of contentsC. Mục lục
D. ContentD. Nội dung
Index
| Test ID | Test name | BR | UC | Category |
|---|---|---|---|---|
| TC-CORE-ACC-001 | Sequential derivation index per chain+merchant+purpose | ACC-01 | UC-ADR-01 | DataIntegrity |
| TC-CORE-ACC-002 | UNIQUE (chain, address) aborts issue on collision | ACC-01 | UC-ADR-01 | DataIntegrity |
| TC-CORE-ACC-003 | Issuance never uses UUID hash/mod | ACC-01 | UC-ADR-01 | DataIntegrity |
| TC-CORE-ACC-004 | Index counters are not global across merchants | ACC-01 | UC-ADR-01 | DataIntegrity |
| TC-CORE-ACC-005 | TRON VA returns Base58 address | ACC-02 | UC-VA-01 | Function |
| TC-CORE-ACC-006 | TRON VA response has no xpub/seed/key | ACC-10 | UC-VA-01 | Security |
| TC-CORE-ACC-007 | No key material in DB or logs after TRON VA | ACC-10 | UC-VA-01 | Security |
| TC-CORE-ACC-008 | TRON VA requires hot_wallet_id | ACC-02 | UC-VA-01 | Validation |
| TC-CORE-ACC-009 | TRON VA rejects inactive Hot Wallet | ACC-02 | UC-VA-01 | Validation |
| TC-CORE-ACC-010 | TRON VA rejects network-mismatch Hot Wallet | ACC-02 | UC-VA-01 | Validation |
| TC-CORE-ACC-011 | Custody timeout does not expose address | ACC-02 | UC-VA-01 | Infra |
| TC-CORE-ACC-012 | EVM VA CREATE2 predict then register (Phase 2) | ACC-03 | UC-VA-02 | Function |
| TC-CORE-ACC-013 | EVM VA UNIQUE across chains (Phase 2) | ACC-03 | UC-VA-02 | DataIntegrity |
| TC-CORE-ACC-014 | EVM Forwarder predicted equals deployed | ACC-04 | UC-HW-01 | Function |
| TC-CORE-ACC-015 | Forwarder salt is keccak256(merchant:service:name) | ACC-04 | UC-HW-01 | Function |
| TC-CORE-ACC-016 | Invalid EVM beneficiary on HW create | ACC-04 | UC-HW-01 | Validation |
| TC-CORE-ACC-017 | SERVICE_NOT_CONFIGURED maps to 400 | ACC-04 | UC-HW-01 | Infra |
| TC-CORE-ACC-018 | CHAIN_NOT_CONFIGURED maps to 400 | ACC-04 | UC-HW-01 | Infra |
| TC-CORE-ACC-019 | RPC_UNAVAILABLE maps to 503 | ACC-04 | UC-HW-01 | Infra |
| TC-CORE-ACC-020 | DEPLOY_FAILED maps to 500 | ACC-04 | UC-HW-01 | Infra |
| TC-CORE-ACC-021 | PREDICT_DEPLOY_MISMATCH maps to 409 | ACC-04 | UC-HW-01 | Infra |
| TC-CORE-ACC-022 | TRON dedicated Hot Wallet success | ACC-05 | UC-HW-02 | Function |
| TC-CORE-ACC-023 | TRON HW binds treasury:hot ledger path | ACC-11 | UC-HW-02 | Function |
| TC-CORE-ACC-024 | New HW not on Sync map by default | ACC-07 | UC-MAP-01 | Function |
| TC-CORE-ACC-025 | EVM beneficiary bind pending_governance | ACC-06 | UC-BEN-01 | Function |
| TC-CORE-ACC-026 | TRON beneficiary bind active off-chain | ACC-06 | UC-BEN-01 | Function |
| TC-CORE-ACC-027 | Invalid beneficiary format rejected | ACC-06 | UC-BEN-01 | Validation |
| TC-CORE-ACC-028 | Cross-chain beneficiary address rejected | ACC-06 | UC-BEN-01 | Validation |
| TC-CORE-ACC-029 | Watched map returns active=true VAs only | ACC-07 | UC-MAP-01 | Function |
| TC-CORE-ACC-030 | Watched map cursor pagination | ACC-07 | UC-MAP-01 | Infra |
| TC-CORE-ACC-031 | Watched map unauthorized without internal secret | ACC-07 | UC-MAP-01 | Security |
| TC-CORE-ACC-032 | Watched map contains no keys | ACC-10 | UC-MAP-01 | Security |
| TC-CORE-ACC-033 | Deactivate drops VA from watched map | ACC-08 | UC-ACT-01 | Function |
| TC-CORE-ACC-034 | Deactivate never reuses address or index | ACC-08 | UC-ACT-01 | DataIntegrity |
| TC-CORE-ACC-035 | Re-activate same va_id restores same address | ACC-08 | UC-ACT-02 | Function |
| TC-CORE-ACC-036 | Re-activate wrong va_id fails | ACC-08 | UC-ACT-02 | Validation |
| TC-CORE-ACC-037 | Idempotency-Key replay returns same VA | ACC-09 | UC-IDM-01 | Function |
| TC-CORE-ACC-038 | Parallel create with same Idempotency-Key | ACC-09 | UC-IDM-01 | DataIntegrity |
| TC-CORE-ACC-039 | Natural key returns existing active VA when key omitted | ACC-09 | UC-IDM-01 | Function |
| TC-CORE-ACC-040 | Second active VA for same customer+chain is CONFLICT | ACC-09 | UC-IDM-01 | DataIntegrity |
| TC-CORE-ACC-041 | VA ledger bind treasury:virtual | ACC-11 | UC-VA-01 | Function |
| TC-CORE-ACC-042 | Crash after registry before ledger bind does not expose address | ACC-11 | UC-ADR-01 | DataIntegrity |
| TC-CORE-ACC-043 | Warm/Cold have no transfer APIs | ACC-12 | UC-HW-01 | Function |
| TC-CORE-ACC-044 | Issuance pause returns ISSUANCE_PAUSED 503 | ACC-02 | UC-PAUSE-01 | Infra |
| TC-CORE-ACC-045 | Issuance pause requires internal secret | ACC-02 | UC-PAUSE-01 | Security |
| TC-CORE-ACC-046 | Public create requires merchant JWT | ACC-02 | UC-VA-01 | Security |
| TC-CORE-ACC-047 | Merchant A cannot read Merchant B VA | ACC-02 | UC-VA-01 | Security |
| TC-CORE-ACC-048 | Error envelope includes code and request_id | ACC-02 | UC-VA-01 | Validation |
| TC-CORE-ACC-049 | NFR 1M synthetic uniqueness zero collisions | ACC-01 | UC-ADR-01 | NFR |
| TC-CORE-ACC-050 | NFR watched map paginates 100k addresses | ACC-07 | UC-MAP-01 | NFR |
| TC-CORE-ACC-051 | HW create Idempotency-Key replay | ACC-09 | UC-IDM-01 | Function |
| TC-CORE-ACC-052 | Deactivate already-inactive VA | ACC-08 | UC-ACT-01 | Validation |
| TC-CORE-ACC-053 | VA create while HW watch default false still publishes VA | ACC-07 | UC-MAP-01 | Function |
| TC-CORE-ACC-054 | PUT issuance-pause chain omitted is global | ACC-02 | UC-PAUSE-01 | Function |
| TC-CORE-ACC-055 | Missing JWT on public API is 401 | ACC-02 | UC-VA-01 | Security |
| TC-CORE-ACC-056 | TRON HW custody/ledger failure does not expose address | ACC-05 | UC-HW-02 | Infra |
Test cases
TC-CORE-ACC-001
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-001 |
| Business Requirement ID | ACC-01 |
| Category | DataIntegrity |
| Use Case ID | UC-ADR-01 |
| Test name | Sequential derivation index per chain+merchant+purpose |
| Preconditions | Merchant A has no TRON VA rows. HW-TRON-A active. |
| Data | Two consecutive POST VA for customers C1, C2; chain=tron; purpose=VA |
| Steps | 1. Create VA for C1. 2. Create VA for C2. 3. Read derivation_index from registry. |
| Expected result | Indexes are sequential (n, n+1) for (tron, m_A, purpose=VA). Not UUID-derived. |
TC-CORE-ACC-002
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-002 |
| Business Requirement ID | ACC-01 |
| Category | DataIntegrity |
| Use Case ID | UC-ADR-01 |
| Test name | UNIQUE (chain, address) aborts issue on collision |
| Preconditions | Inject a registry row with address that the next derive would produce. |
| Data | Forced collision on (tron, address) |
| Steps | 1. POST create VA. |
| Expected result | Issue aborted. No client exposure of colliding address. No second registry row. Error envelope present. |
TC-CORE-ACC-003
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-003 |
| Business Requirement ID | ACC-01 |
| Category | DataIntegrity |
| Use Case ID | UC-ADR-01 |
| Test name | Issuance never uses UUID hash/mod |
| Preconditions | Code/config review plus 100 sequential issues. |
| Data | — |
| Steps | 1. Inspect issuance algorithm. 2. Issue 100 VAs. 3. Plot indexes. |
| Expected result | Counter-based sequential index only. No hash/mod of UUID or customer_id. Gaps only on aborted collisions. |
TC-CORE-ACC-004
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-004 |
| Business Requirement ID | ACC-01 |
| Category | DataIntegrity |
| Use Case ID | UC-ADR-01 |
| Test name | Index counters are not global across merchants |
| Preconditions | Merchant A and B both issue first TRON VA. |
| Data | — |
| Steps | 1. Create VA for A. 2. Create VA for B. |
| Expected result | Each merchant has its own (chain, merchant_id, purpose) counter. B is not forced to A’s next index. Addresses still globally unique per chain. |
TC-CORE-ACC-005
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-005 |
| Business Requirement ID | ACC-02 |
| Category | Function |
| Use Case ID | UC-VA-01 |
| Test name | TRON VA returns Base58 address |
| Preconditions | Phase 1 TRON configured. HW-TRON-A active. |
| Data | POST /api/v1/accounts/crypto/virtual-accounts with hot_wallet_id=hw_tron_A, blockchain=tron, customer_id=CUST1 |
| Steps | 1. POST create. 2. Inspect address. |
| Expected result | 201. Address is TRON Base58 (not 0x). active=true. Watched map includes the VA. |
TC-CORE-ACC-006
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-006 |
| Business Requirement ID | ACC-10 |
| Category | Security |
| Use Case ID | UC-VA-01 |
| Test name | TRON VA response has no xpub/seed/key |
| Preconditions | Successful TC-CORE-ACC-005. |
| Data | Response JSON |
| Steps | 1. Inspect create and GET VA payloads. |
| Expected result | No xpub, xprv, seed, mnemonic, private key, or MPC share fields. Address + path alias only. |
TC-CORE-ACC-007
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-007 |
| Business Requirement ID | ACC-10 |
| Category | Security |
| Use Case ID | UC-VA-01 |
| Test name | No key material in DB or logs after TRON VA |
| Preconditions | Log capture and DB dump of registry/account tables. |
| Data | — |
| Steps | 1. Create VA. 2. Search logs and DB for seed/xpub/xprv patterns. |
| Expected result | Zero matches. HD master remains in HSM/MPC. |
TC-CORE-ACC-008
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-008 |
| Business Requirement ID | ACC-02 |
| Category | Validation |
| Use Case ID | UC-VA-01 |
| Test name | TRON VA requires hot_wallet_id |
| Preconditions | Valid JWT. TRON configured. |
| Data | Body without hot_wallet_id |
| Steps | 1. POST create VA. |
| Expected result | 400 VALIDATION_ERROR. details.field=hot_wallet_id, reason required. No registry insert. |
TC-CORE-ACC-009
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-009 |
| Business Requirement ID | ACC-02 |
| Category | Validation |
| Use Case ID | UC-VA-01 |
| Test name | TRON VA rejects inactive Hot Wallet |
| Preconditions | HW-TRON-A active=false. |
| Data | hot_wallet_id=hw_tron_A |
| Steps | 1. POST create VA. |
| Expected result | 400 VALIDATION_ERROR. reason inactive. |
TC-CORE-ACC-010
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-010 |
| Business Requirement ID | ACC-02 |
| Category | Validation |
| Use Case ID | UC-VA-01 |
| Test name | TRON VA rejects network-mismatch Hot Wallet |
| Preconditions | Body blockchain=tron; HW is BSC. |
| Data | hot_wallet_id=hw_bsc_A |
| Steps | 1. POST create VA. |
| Expected result | 400 VALIDATION_ERROR. reason network_mismatch. |
TC-CORE-ACC-011
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-011 |
| Business Requirement ID | ACC-02 |
| Category | Infra |
| Use Case ID | UC-VA-01 |
| Test name | Custody timeout does not expose address |
| Preconditions | Custody adapter hangs/times out after derive. |
| Data | — |
| Steps | 1. POST create VA. 2. Inspect response and registry. |
| Expected result | Error returned (timeout/503 as specified). Address not returned to client. Incomplete row not published to Sync. |
TC-CORE-ACC-012
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-012 |
| Business Requirement ID | ACC-03 |
| Category | Function |
| Use Case ID | UC-VA-02 |
| Test name | EVM VA CREATE2 predict then register (Phase 2) |
| Preconditions | Phase 2 EVM VA enabled. Matching active EVM HW. |
| Data | POST VA blockchain=bsc |
| Steps | 1. Capture predicted CREATE2 address. 2. Confirm registry insert before client response. 3. Return VA. |
| Expected result | Predicted address registered first. Client sees address only after UNIQUE success. Phase 2 gate: skip in Phase 1 CI. |
TC-CORE-ACC-013
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-013 |
| Business Requirement ID | ACC-03 |
| Category | DataIntegrity |
| Use Case ID | UC-VA-02 |
| Test name | EVM VA UNIQUE across chains (Phase 2) |
| Preconditions | Same 20-byte payload possible on bsc vs eth. |
| Data | — |
| Steps | 1. Issue VA on bsc. 2. Issue VA on eth for another customer. |
| Expected result | UNIQUE is (chain, address). Same bytes on different chains allowed. Same chain collision aborts. Phase 2. |
TC-CORE-ACC-014
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-014 |
| Business Requirement ID | ACC-04 |
| Category | Function |
| Use Case ID | UC-HW-01 |
| Test name | EVM Forwarder predicted equals deployed |
| Preconditions | EVM chain configured. Valid BEN-EVM. Merchant JWT. |
| Data | POST /api/v1/accounts/crypto/hot-wallets |
| Steps | 1. Create HW. 2. Compare predicted vs on-chain deployed address. |
| Expected result | Predicted == deployed. Registry row tier=hot. Address returned. |
TC-CORE-ACC-015
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-015 |
| Business Requirement ID | ACC-04 |
| Category | Function |
| Use Case ID | UC-HW-01 |
| Test name | Forwarder salt is keccak256(merchant:service:name) |
| Preconditions | Known merchant_id, service_id, wallet_name. |
| Data | — |
| Steps | 1. Create HW. 2. Read salt used for CREATE2. |
| Expected result | Salt = keccak256(merchant_id:service_id:wallet_name). Deterministic. |
TC-CORE-ACC-016
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-016 |
| Business Requirement ID | ACC-04 |
| Category | Validation |
| Use Case ID | UC-HW-01 |
| Test name | Invalid EVM beneficiary on HW create |
| Preconditions | EVM HW create. |
| Data | beneficiary=TXYZ... or 0x123 |
| Steps | 1. POST create HW. |
| Expected result | 400 VALIDATION_ERROR. No deploy. |
TC-CORE-ACC-017
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-017 |
| Business Requirement ID | ACC-04 |
| Category | Infra |
| Use Case ID | UC-HW-01 |
| Test name | SERVICE_NOT_CONFIGURED maps to 400 |
| Preconditions | Merchant fee/wallet service config missing. |
| Data | — |
| Steps | 1. POST create EVM HW. |
| Expected result | HTTP 400. error.code=SERVICE_NOT_CONFIGURED. error.request_id present. |
TC-CORE-ACC-018
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-018 |
| Business Requirement ID | ACC-04 |
| Category | Infra |
| Use Case ID | UC-HW-01 |
| Test name | CHAIN_NOT_CONFIGURED maps to 400 |
| Preconditions | Requested chain not in account-service config. |
| Data | blockchain=polygon when not configured |
| Steps | 1. POST create. |
| Expected result | HTTP 400. error.code=CHAIN_NOT_CONFIGURED. |
TC-CORE-ACC-019
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-019 |
| Business Requirement ID | ACC-04 |
| Category | Infra |
| Use Case ID | UC-HW-01 |
| Test name | RPC_UNAVAILABLE maps to 503 |
| Preconditions | Chain RPC down. |
| Data | — |
| Steps | 1. POST create EVM HW (deploy path). |
| Expected result | HTTP 503. error.code=RPC_UNAVAILABLE. |
TC-CORE-ACC-020
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-020 |
| Business Requirement ID | ACC-04 |
| Category | Infra |
| Use Case ID | UC-HW-01 |
| Test name | DEPLOY_FAILED maps to 500 |
| Preconditions | Clone deploy reverts/fails after predict. |
| Data | — |
| Steps | 1. POST create EVM HW. |
| Expected result | HTTP 500. error.code=DEPLOY_FAILED. Address not treated as live. |
TC-CORE-ACC-021
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-021 |
| Business Requirement ID | ACC-04 |
| Category | Infra |
| Use Case ID | UC-HW-01 |
| Test name | PREDICT_DEPLOY_MISMATCH maps to 409 |
| Preconditions | Deployed address ≠ predicted. |
| Data | — |
| Steps | 1. POST create EVM HW. |
| Expected result | HTTP 409. error.code=PREDICT_DEPLOY_MISMATCH. |
TC-CORE-ACC-022
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-022 |
| Business Requirement ID | ACC-05 |
| Category | Function |
| Use Case ID | UC-HW-02 |
| Test name | TRON dedicated Hot Wallet success |
| Preconditions | TRON configured. Valid BEN-TRON. |
| Data | POST hot-wallets blockchain=tron |
| Steps | 1. Create HW. 2. Read registry. |
| Expected result | Dedicated address from custody adapter purpose=HW. UNIQUE (chain, address) and UNIQUE (chain, merchant_id, purpose, derivation_index). No xpub stored. |
TC-CORE-ACC-023
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-023 |
| Business Requirement ID | ACC-11 |
| Category | Function |
| Use Case ID | UC-HW-02 |
| Test name | TRON HW binds treasury:hot ledger path |
| Preconditions | ledger-service available. |
| Data | Created HW id hw_01 |
| Steps | 1. Create TRON HW. 2. GET ledger metadata. |
| Expected result | Path treasury:hot:tron:{hot_id} bound. Create response includes ledger_account when v2 enabled. |
TC-CORE-ACC-024
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-024 |
| Business Requirement ID | ACC-07 |
| Category | Function |
| Use Case ID | UC-MAP-01 |
| Test name | New HW not on Sync map by default |
| Preconditions | Fresh TRON HW created. |
| Data | GET /internal/v1/watched-addresses?chain=tron&active=true |
| Steps | 1. Create HW. 2. Fetch watched map. |
| Expected result | HW watch default false. HW address absent from active map. VA addresses still published with active=true. |
TC-CORE-ACC-025
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-025 |
| Business Requirement ID | ACC-06 |
| Category | Function |
| Use Case ID | UC-BEN-01 |
| Test name | EVM beneficiary bind pending_governance |
| Preconditions | EVM HW exists. Valid BEN-EVM. |
| Data | PUT /api/v1/accounts/crypto/hot-wallets/{hot_id}/beneficiary |
| Steps | 1. PUT new beneficiary. |
| Expected result | Intent stored. Status pending_governance. On-chain SET_BENEFICIARY is not executed by this API (deferred to governance/ops). |
TC-CORE-ACC-026
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-026 |
| Business Requirement ID | ACC-06 |
| Category | Function |
| Use Case ID | UC-BEN-01 |
| Test name | TRON beneficiary bind active off-chain |
| Preconditions | TRON HW exists. Valid BEN-TRON. |
| Data | PUT beneficiary |
| Steps | 1. PUT. |
| Expected result | Binding stored Active for off-chain settlement. No on-chain tx required. |
TC-CORE-ACC-027
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-027 |
| Business Requirement ID | ACC-06 |
| Category | Validation |
| Use Case ID | UC-BEN-01 |
| Test name | Invalid beneficiary format rejected |
| Preconditions | HW exists. |
| Data | Address 0x123 |
| Steps | 1. PUT beneficiary. |
| Expected result | 400 VALIDATION_ERROR. Binding unchanged. |
TC-CORE-ACC-028
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-028 |
| Business Requirement ID | ACC-06 |
| Category | Validation |
| Use Case ID | UC-BEN-01 |
| Test name | Cross-chain beneficiary address rejected |
| Preconditions | TRON HW. |
| Data | EVM 0x address |
| Steps | 1. PUT beneficiary. |
| Expected result | Rejected. Format must match HW chain. |
TC-CORE-ACC-029
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-029 |
| Business Requirement ID | ACC-07 |
| Category | Function |
| Use Case ID | UC-MAP-01 |
| Test name | Watched map returns active=true VAs only |
| Preconditions | One active VA, one deactivated VA. Internal secret. |
| Data | GET /internal/v1/watched-addresses?chain=tron&active=true |
| Steps | 1. GET map. |
| Expected result | Active VA present with chain, address, va_id, merchant_id, active=true. Inactive VA omitted. Default filter active=true. |
TC-CORE-ACC-030
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-030 |
| Business Requirement ID | ACC-07 |
| Category | Infra |
| Use Case ID | UC-MAP-01 |
| Test name | Watched map cursor pagination |
| Preconditions | >1000 active VAs on tron. |
| Data | limit=1000 then next cursor |
| Steps | 1. Page 1. 2. Follow cursor until empty. |
| Expected result | Default/max limit 1000. No unbounded dump. All active addresses returned exactly once. |
TC-CORE-ACC-031
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-031 |
| Business Requirement ID | ACC-07 |
| Category | Security |
| Use Case ID | UC-MAP-01 |
| Test name | Watched map unauthorized without internal secret |
| Preconditions | No internal token. Merchant JWT only. |
| Data | GET /internal/v1/watched-addresses |
| Steps | 1. Call without internal secret. 2. Call with merchant JWT. |
| Expected result | 401/403. Map not publicly exposed. |
TC-CORE-ACC-032
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-032 |
| Business Requirement ID | ACC-10 |
| Category | Security |
| Use Case ID | UC-MAP-01 |
| Test name | Watched map contains no keys |
| Preconditions | Successful map GET. |
| Data | Page JSON |
| Steps | 1. Inspect fields. |
| Expected result | Only chain, address, va_id, merchant_id, active (and cursor). No keys/xpub. |
TC-CORE-ACC-033
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-033 |
| Business Requirement ID | ACC-08 |
| Category | Function |
| Use Case ID | UC-ACT-01 |
| Test name | Deactivate drops VA from watched map |
| Preconditions | Active VA. Merchant JWT. |
| Data | POST /api/v1/accounts/crypto/virtual-accounts/{va_id}/deactivate |
| Steps | 1. Deactivate. 2. GET watched map. |
| Expected result | VA active=false. Address gone from active map. Historical registry row retained. |
TC-CORE-ACC-034
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-034 |
| Business Requirement ID | ACC-08 |
| Category | DataIntegrity |
| Use Case ID | UC-ACT-01 |
| Test name | Deactivate never reuses address or index |
| Preconditions | VA deactivated; address T_OLD, index k. |
| Data | New VA for same or other customer |
| Steps | 1. Deactivate. 2. Create new VA. |
| Expected result | New VA gets new address and next index. T_OLD and k never reassigned. |
TC-CORE-ACC-035
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-035 |
| Business Requirement ID | ACC-08 |
| Category | Function |
| Use Case ID | UC-ACT-02 |
| Test name | Re-activate same va_id restores same address |
| Preconditions | VA inactive. |
| Data | POST /api/v1/accounts/crypto/virtual-accounts/{va_id}/activate |
| Steps | 1. Activate original va_id. 2. GET VA and watched map. |
| Expected result | Same address and derivation_index. active=true. Published to map. Portal PATCH status=active maps to this endpoint. |
TC-CORE-ACC-036
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-036 |
| Business Requirement ID | ACC-08 |
| Category | Validation |
| Use Case ID | UC-ACT-02 |
| Test name | Re-activate wrong va_id fails |
| Preconditions | VA-1 inactive. |
| Data | POST activate on a different/non-existent id |
| Steps | 1. POST activate unknown id. 2. Attempt to “reactivate” by creating a new VA expecting old address. |
| Expected result | 404 NOT_FOUND for unknown id. New create cannot claim old address. |
TC-CORE-ACC-037
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-037 |
| Business Requirement ID | ACC-09 |
| Category | Function |
| Use Case ID | UC-IDM-01 |
| Test name | Idempotency-Key replay returns same VA |
| Preconditions | First POST succeeded with key K1. |
| Data | Same body + Idempotency-Key: K1 |
| Steps | 1. Replay POST. |
| Expected result | Same va_id and address. No second index allocated. Idempotency-Key is authoritative. |
TC-CORE-ACC-038
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-038 |
| Business Requirement ID | ACC-09 |
| Category | DataIntegrity |
| Use Case ID | UC-IDM-01 |
| Test name | Parallel create with same Idempotency-Key |
| Preconditions | No existing VA. |
| Data | Two concurrent POSTs, same key K2 |
| Steps | 1. Fire both requests. |
| Expected result | One issuance. Both callers receive the same resource (or one waits then replays). Single index. |
TC-CORE-ACC-039
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-039 |
| Business Requirement ID | ACC-09 |
| Category | Function |
| Use Case ID | UC-IDM-01 |
| Test name | Natural key returns existing active VA when key omitted |
| Preconditions | Active VA for (m_A, CUST1, tron, testnet). |
| Data | POST same natural key, no Idempotency-Key |
| Steps | 1. POST create. |
| Expected result | Existing active VA returned. No new address. |
TC-CORE-ACC-040
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-040 |
| Business Requirement ID | ACC-09 |
| Category | DataIntegrity |
| Use Case ID | UC-IDM-01 |
| Test name | Second active VA for same customer+chain is CONFLICT |
| Preconditions | Active VA exists. Caller sends a new Idempotency-Key. |
| Data | Same merchant, customer_id, blockchain, network_type |
| Steps | 1. POST create with new key. |
| Expected result | 409 CONFLICT. No second active VA. |
TC-CORE-ACC-041
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-041 |
| Business Requirement ID | ACC-11 |
| Category | Function |
| Use Case ID | UC-VA-01 |
| Test name | VA ledger bind treasury:virtual |
| Preconditions | ledger-service up. |
| Data | Created va_id |
| Steps | 1. Create TRON VA. 2. Inspect ledger_account. |
| Expected result | treasury:virtual:tron:{va_id} bound before client success. |
TC-CORE-ACC-042
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-042 |
| Business Requirement ID | ACC-11 |
| Category | DataIntegrity |
| Use Case ID | UC-ADR-01 |
| Test name | Crash after registry before ledger bind does not expose address |
| Preconditions | Inject crash/timeout between UNIQUE insert and ledger bind. |
| Data | — |
| Steps | 1. POST create VA. 2. Inspect client response, Sync map, incomplete row. |
| Expected result | Address not returned to client. Not published to Sync as active. Repair/retry must not leak a half-bound address. |
TC-CORE-ACC-043
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-043 |
| Business Requirement ID | ACC-12 |
| Category | Function |
| Use Case ID | UC-HW-01 |
| Test name | Warm/Cold have no transfer APIs |
| Preconditions | Account-service OpenAPI / route table. |
| Data | — |
| Steps | 1. Search for warm/cold transfer, sweep, or move endpoints. 2. Confirm metadata-only refs if present. |
| Expected result | No public transfer APIs for Warm/Cold. Out of API scope this phase. Config/metadata only. |
TC-CORE-ACC-044
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-044 |
| Business Requirement ID | ACC-02 |
| Category | Infra |
| Use Case ID | UC-PAUSE-01 |
| Test name | Issuance pause returns ISSUANCE_PAUSED 503 |
| Preconditions | Ops sets pause for tron (or global). |
| Data | PUT /internal/v1/issuance-pause then POST create VA/HW |
| Steps | 1. Pause. 2. Create VA. 3. Create HW. 4. GET watched map. |
| Expected result | Creates return HTTP 503 ISSUANCE_PAUSED. Existing registry and map unchanged. |
TC-CORE-ACC-045
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-045 |
| Business Requirement ID | ACC-02 |
| Category | Security |
| Use Case ID | UC-PAUSE-01 |
| Test name | Issuance pause requires internal secret |
| Preconditions | Merchant JWT only. |
| Data | PUT /internal/v1/issuance-pause |
| Steps | 1. Call with merchant JWT. 2. Call unauthenticated. |
| Expected result | 401/403. Pause flag unchanged. |
TC-CORE-ACC-046
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-046 |
| Business Requirement ID | ACC-02 |
| Category | Security |
| Use Case ID | UC-VA-01 |
| Test name | Public create requires merchant JWT |
| Preconditions | No Authorization header. |
| Data | POST virtual-accounts |
| Steps | 1. POST. |
| Expected result | 401 UNAUTHORIZED. |
TC-CORE-ACC-047
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-047 |
| Business Requirement ID | ACC-02 |
| Category | Security |
| Use Case ID | UC-VA-01 |
| Test name | Merchant A cannot read Merchant B VA |
| Preconditions | VA belongs to Merchant B. |
| Data | Merchant A JWT; B’s va_id |
| Steps | 1. GET /api/v1/accounts/crypto/virtual-accounts/{va_id}. 2. List VAs. |
| Expected result | 404 NOT_FOUND or empty list. No cross-tenant data. |
TC-CORE-ACC-048
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-048 |
| Business Requirement ID | ACC-02 |
| Category | Validation |
| Use Case ID | UC-VA-01 |
| Test name | Error envelope includes code and request_id |
| Preconditions | Any non-2xx path (validation, unauthorized, pause). |
| Data | — |
| Steps | 1. Trigger 400, 401, 409, 503. |
| Expected result | Body matches canonical envelope. error.code stable. error.request_id present. No stack traces, SQL, or secrets. |
TC-CORE-ACC-049
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-049 |
| Business Requirement ID | ACC-01 |
| Category | NFR |
| Use Case ID | UC-ADR-01 |
| Test name | NFR 1M synthetic uniqueness zero collisions |
| Preconditions | CI/load job with isolated registry. |
| Data | 1,000,000 synthetic issue attempts across configured chains |
| Steps | 1. Run uniqueness job. 2. Count UNIQUE violations and duplicate addresses. |
| Expected result | 0 address collisions. Job is the ACC-01 NFR gate. |
TC-CORE-ACC-050
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-050 |
| Business Requirement ID | ACC-07 |
| Category | NFR |
| Use Case ID | UC-MAP-01 |
| Test name | NFR watched map paginates 100k addresses |
| Preconditions | Registry populated to ~100,000 active VAs (or representative subset + projection). |
| Data | limit=1000 |
| Steps | 1. Page through full map. 2. Measure completeness. |
| Expected result | Pagination mandatory. Full dump endpoint must not exist. All active addresses delivered via cursors. |
TC-CORE-ACC-051
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-051 |
| Business Requirement ID | ACC-09 |
| Category | Function |
| Use Case ID | UC-IDM-01 |
| Test name | HW create Idempotency-Key replay |
| Preconditions | First POST HW with key HK1 succeeded. |
| Data | Replay same key and body |
| Steps | 1. Replay POST hot-wallets. |
| Expected result | Same hot_id and address. No second deploy/index. |
TC-CORE-ACC-052
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-052 |
| Business Requirement ID | ACC-08 |
| Category | Validation |
| Use Case ID | UC-ACT-01 |
| Test name | Deactivate already-inactive VA |
| Preconditions | VA already inactive. |
| Data | POST deactivate |
| Steps | 1. Deactivate again. |
| Expected result | Idempotent success or stable conflict as specified; no address reuse; map unchanged. |
TC-CORE-ACC-053
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-053 |
| Business Requirement ID | ACC-07 |
| Category | Function |
| Use Case ID | UC-MAP-01 |
| Test name | VA create while HW watch default false still publishes VA |
| Preconditions | HW watch=false. |
| Data | New VA |
| Steps | 1. Create VA bound to that HW. 2. GET map. |
| Expected result | VA appears with active=true. HW still absent unless watch enabled. |
TC-CORE-ACC-054
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-054 |
| Business Requirement ID | ACC-02 |
| Category | Function |
| Use Case ID | UC-PAUSE-01 |
| Test name | PUT issuance-pause chain omitted is global |
| Preconditions | Internal secret. TRON and BSC both configured. |
| Data | Body { "paused": true } without chain |
| Steps | 1. Global pause. 2. Create TRON VA and BSC HW. |
| Expected result | Both creates 503 ISSUANCE_PAUSED. Chain-scoped pause only affects that chain. |
TC-CORE-ACC-055
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-055 |
| Business Requirement ID | ACC-02 |
| Category | Security |
| Use Case ID | UC-VA-01 |
| Test name | Missing JWT on public API is 401 |
| Preconditions | No token. |
| Data | POST hot-wallets; POST deactivate |
| Steps | 1. Call public crypto account APIs without JWT. |
| Expected result | 401 UNAUTHORIZED with envelope. Internal routes still require internal secret, not merchant JWT. |
TC-CORE-ACC-056
| Field | Value |
|---|---|
| Test ID | TC-CORE-ACC-056 |
| Business Requirement ID | ACC-05 |
| Category | Infra |
| Use Case ID | UC-HW-02 |
| Test name | TRON HW custody/ledger failure does not expose address |
| Preconditions | Custody adapter or ledger-service fails during TRON HW create. |
| Data | POST /api/v1/accounts/crypto/hot-wallets blockchain=tron |
| Steps | 1. Force custody timeout or ledger bind failure. 2. Inspect client response, registry, watched map. |
| Expected result | Error envelope (timeout/503/500 as mapped). Address not returned as a live Hot Wallet. Incomplete row not published to Sync. No xpub in error body. |