docs(rs-platform-wallet/e2e): token TK-NNN spec entries + Wave G harness roadmap#3580
Closed
lklimek wants to merge 11 commits intofeat/rs-platform-wallet-e2efrom
Closed
docs(rs-platform-wallet/e2e): token TK-NNN spec entries + Wave G harness roadmap#3580lklimek wants to merge 11 commits intofeat/rs-platform-wallet-e2efrom
lklimek wants to merge 11 commits intofeat/rs-platform-wallet-e2efrom
Conversation
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
… G harness roadmap Source: token-feature investigation by Diziet (UX) covering 14 new TK-NNN cases (TK-005..TK-016 plus TK-001c, TK-003b suffix variants). All entries land as Status: BLOCKED until Wave A (Signer<IdentityPublicKey> harness, on PR #3578) and Wave G (token-contract bootstrap) ship. Reframing of existing TK-001..TK-004: - TK-003 SUPERSEDED by TK-007 (in-test deployment + supply assertions + unauthorised-mint negative as sub-case). - TK-004 SUPERSEDED by TK-008 (in-test deployment + supply round-trip + unauthorised-burn sub-case). - TK-001 / TK-001b reframed off operator-pre-funded contract onto in-test deploy (TK-005 helper + in-test mint via TK-007). - TK-002 demoted to nightly-only "live perpetual distribution"; the synchronous tier covers the same surface via TK-015's pre-programmed-distribution variant. New TK-005..TK-016 cover: register contract, transfer-with-fee-accounting, mint+supply, burn+supply, freeze, unfreeze, destroy frozen funds, pause/resume, set-price + direct purchase, update config, claim from pre-programmed distribution, and the group-action gateway happy path. Harness work documented as Wave G in §4 with 13 helpers (setup_with_token_*, mint_to, token_*_of accessors, wait_for_token_balance, JSON template, register_extra_identity) plus 6 wallet-API gaps (Gap-T1..T6) for follow-up. Wave D is marked SUPERSEDED by Wave G — operator-pre-funded contracts dropped because the wallet already accepts tokens_schema_json on create_data_contract_with_signer (wallet/identity/network/contract.rs:124). Quick index updated with 14 new TK rows + 2 SUPERSEDED placeholders; counts line recomputed (P0: 8 -> 10, P1: 17 -> 24, P2: 53 -> 56, total 79 -> 93 with 2 superseded). No test code, no framework code, no wallet API changes. Spec-only edit for review before implementation begins. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
… TK-NNN User confirmed renumbering is safe — token tests haven't started implementation yet, no external references to disturb. - Remove TK-003 and TK-004 (superseded by TK-007 / TK-008 per Diziet's investigation). - Renumber TK-005..TK-016 → TK-003..TK-014 contiguously. - Renumber TK-003b → TK-005b (it is a P2 variant of the mint case which is now TK-005, not of the deleted old TK-003). - Update Quick index, counts, cross-references, and §5 / §6 wording that referred to the old TK-003/TK-004 / Wave D model. TK-001 / TK-001b / TK-001c retain their numbers (they cover the operator-pre-funded → in-test-contract reframing, not superseded). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7a313a4 to
bcc5f64
Compare
…elpers Gap-T1..T6 were tracked as wallet-API surface gaps blocking token test implementation. User decision: write framework-level helpers that wrap SDK calls directly instead. The wallet's public API doesn't need new methods to support tests. - Each Gap-T* becomes a Wave G helper that calls SDK directly. - TK-NNN BLOCKED reasons updated to drop Gap-T* references. - Wave G helper count grows accordingly (13 + 6 = ~19 helpers). - §4 / §5 / §6 cross-references cleaned up. Test implementation can now proceed without waiting for any new wallet API surface. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds packages/rs-platform-wallet/tests/e2e/framework/tokens.rs with the
19-helper Wave G inventory documented in TEST_SPEC.md:
- 5 SDK-wrapper accessors (token_balance_of, token_supply_of,
token_is_paused_of, token_pricing_of, token_frozen_balance_of)
plus 5 raw-id variants.
- 4 bootstrap helpers (setup_with_token_contract,
setup_with_token_and_{two,three}_identities,
setup_with_token_pre_programmed_distribution).
- 4 utility helpers (register_token_contract_via_sdk, mint_to,
wait_for_token_balance, permissive_owner_token_contract_json,
register_extra_identity).
Module wired via framework/mod.rs. cargo check / clippy / fmt clean.
Test cases consuming these helpers come in Wave 2.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ip cases [Wave 2-β] TK-003 exercises Wave G's `register_token_contract_via_sdk` end to end and asserts the chain-derived contract id, ownerId, and the default token slot are all observable via `DataContract::fetch` immediately after the broadcast resolves. The Wave 1 MASTER-vs-CRITICAL signing trigger is wired as a sharp `panic!` so Wave 4 (Marvin) sees the exact `InvalidSignatureError` rollup in CI logs without spelunking. TK-004 drives an A→B→A token round-trip through `setup_with_token_ and_two_identities` + Wave G's `mint_to` + an inlined `Sdk::token_transfer` call. Asserts owner balance is conserved across the round-trip (token transfers carry no token-side fee), peer sees the intermediate balance, peer ends at zero, and total supply stays flat across pure transfers (only mint moves it). Both cases gated behind `#[ignore]` per harness convention; `cargo check --tests --all-features --test e2e` and `cargo clippy --tests --all-features -- -D warnings` are clean, and `cargo fmt --check` passes. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… [Wave 2-γ] Implements three TK-NNN cases on top of Wave G's framework helpers: - TK-005: owner mints to self (two consecutive mints), pinning that total supply and owner balance both equal MINT_AMOUNT_A + MINT_AMOUNT_B and that pre-mint supply equals DEFAULT_BASE_SUPPLY (= 0). - TK-005b: owner mints to a separate identity via setup_with_token_and_two_identities; pins that the recipient gains the balance, the owner balance stays 0, and supply equals the mint amount — exercising the cross-identity destination branch (mintingAllowChoosingDestination = true). - TK-006: seeds a 1_000-token mint, then burns 100 via the SDK TokenBurnTransitionBuilder (the framework has no burn shortcut yet). Pins post-burn supply and owner balance both equal MINT_AMOUNT - BURN_AMOUNT (900) and asserts BurnResult resolves to HistoricalDocument because the permissive contract sets keepsBurningHistory = true. All three carry #[ignore] (live testnet + bank-mnemonic gated) and share the tracing-subscriber init pattern from id_001 / transfer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… [Wave 2-δ] Adds three #[ignore]'d e2e cases for the freeze admin chain: TK-007 freeze + reject-while-frozen, TK-008 freeze→unfreeze round-trip, TK-009 destroy-frozen-funds. Each test is self-contained and stages its own freeze precondition via setup_with_token_and_two_identities + mint + transfer; the spec's BLOCKED-on-TK-007 chain is editorial only. Drives the wallet-level token_(un)freeze/destroy_frozen_funds_with_signer helpers and asserts frozen-balance / supply / fee-debited invariants. FreezeResult/UnfreezeResult/DestroyFrozenFundsResult do not expose actual_fee, so the fee>0 assertion is observed against IdentityBalance pre/post. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… cases [Wave 2-ε] Wire up three Wave 2 epsilon TK-NNN test cases against the Wave G token-harness helpers in `tests/e2e/framework/tokens.rs`: - TK-010: pause/resume round-trip — owner mints, pauses, asserts `token_is_paused_of` flips, attempts a transfer (must fail with a "token is paused" typed error), resumes, retries successfully. - TK-011: set price + direct purchase — owner mints + sets a `SinglePrice(1_000)` schedule via `token_set_price_for_direct_purchase`, buyer purchases 10 tokens at total_agreed_price=10_000. Pins buyer/owner token deltas and credit-balance deltas (the bare SDK result enums don't surface `actual_fee`, so we read fees from credit-balance deltas). - TK-012: single-ChangeItem update — owner mutates `MaxSupply` from the default `1e15` to `2e15` and re-fetches the contract to confirm the new value plus a contract-version bump. All three cases are `#[ignore]`d behind PLATFORM_WALLET_E2E_BANK_MNEMONIC + live testnet, mirroring the existing transfer case. Each TODO-tags the actual_fee assertion drift so Wave 4 can fold it back in once the SDK result types expose fee fields. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…laim cases [Wave 2-α] TK-001: full happy-path transfer between two identities; pins exact sender/peer token balance deltas and a non-zero credit fee. TK-001b: pins the zero-amount **(a) Reject** contract — calls `token_transfer_with_signer(amount=0)` and asserts the typed `InvalidTokenAmount` validator rejects pre-broadcast with both balances unchanged. TK-001c: depends on ID-004 (key add/disable) helper — body covers setup + mint, then panics with a TODO at the rotation step pending a `derive_identity_key`-driven signer-cache injection. TK-002: live perpetual distribution — the spec requires `setup_with_token_contract` to be extended with a `distribution_rules` override which is not on the Wave 1 baseline. Sub-team α is constrained from editing `framework/tokens.rs`, so the test sets up the baseline fixture and panics with a TODO citing the missing helper. All four ignored by default; verified by `cargo check`, `cargo clippy --tests --all-features -- -D warnings`, and `cargo fmt --check`. Wave 4 runs them against live testnet. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ases [Wave 2-ζ] Pin TK-013 (token claim from a past-timestamp pre-programmed distribution) and TK-014 (group-action gateway: queue mint, list pending, co-sign) end-to-end against a live testnet bank wallet. TK-013 registers the owner first (so the recipient identifier is known before the schedule is baked) then deploys a fresh contract whose preProgrammedDistribution lands one hour in the past — the claim is immediately eligible, dodging the live-time wait that gates TK-002 (perpetual). Asserts owner balance == pre + payout. TK-014 deploys a custom V1 contract with a 2-of-3 group at position 0 and `manualMintingRules` routed to it. Owner proposes a mint to peer A (`GroupStateTransitionInfoProposer`), the test asserts the pending list surfaces the proposal at `ActionActive` with the recipient/amount untouched, peer A co-signs (`GroupStateTransitionInfoOtherSigner`), then the test asserts balance + supply advance, the action moves to `ActionClosed`, and the active list no longer carries it. Both cases drive `Sdk::token_*` builders directly — the wallet's `token_claim_with_signer` / `token_mint_with_signer` are thin forwards to the SDK, and the framework's `mint_to` already takes this shape. TK-014 also ships an inline V1-envelope assembler with a `groups` field, since `register_token_contract_via_sdk` (Wave 1) doesn't surface a groups injection point yet. Both gated behind `#[ignore]` for operator env (mnemonic + DAPI access). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
… Wave 2 Wave 2 implementation landed all 17 test cases (TK-001..TK-014 + variants). Tests are #[ignore]-tagged and runnable on demand against testnet. Some entries flag known limitations (panic-with-todo) for follow-up work: - TK-001c: needs ID-004 signer-cache injection helper. - TK-002: needs perpetual-distribution helper override in tokens.rs. - TK-003: may need CRITICAL signing key class upgrade for DataContractCreate. These do not block test execution — they document Wave 4's expected discovery surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Merged into feature branch test/platform-wallet-e2e |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue being fixed or feature implemented
Stacks on top of #3549.
This is a SPEC-ONLY PR for review. No test code, no framework code, no wallet API changes. The actual token-test implementation will be a follow-up PR after this spec is approved.
Source: token-feature investigation by the UX team (catalog of operations, mapping to wallet API surfaces, identification of API gaps).
What was done?
TEST_SPEC.md changes
Status: BLOCKEDuntil two prerequisites land: (1) Wave ASigner<IdentityPublicKey>(already on PR feat(rs-platform-wallet/e2e): identity-credit sweep + ID-001/002/003/005 tests #3578), (2) a token-contract bootstrap helper (Wave G).What's NOT in this PR
How Has This Been Tested?
cargo check --tests --all-featuresandcargo fmt --checkboth green; spec-only edit doesn't affect compilation.Breaking Changes
None.
Checklist:
🤖 Co-authored by Claudius the Magnificent AI Agent