0xMiden / 0xMiden/wallet

E2E: earn, mint-and-balance and multi-account only test a non-guardian account shape production cannot create

未關閉
#769 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
TypeScript
星號
5
分支
28
平均合併
9 小時 50 分鐘
30 天內合併 PR
123

描述

## What

Several value-moving E2E suites create wallets with `createNewWallet()`, which routes to `createWalletViaBypass({ walletType: 'offchain' })`. The harness documents that shape as unreachable in production:

> Note this is NOT a configuration production can reach: `ChooseGuardian` always emits an operator endpoint. It is kept as a leg because the offchain path is still the cheaper signal and runs without a guardian container.
>
> — `playwright/e2e/helpers/money-path.ts`, `offChainAxis`

`allowNoGuardian` defaults to `false` and is described in `effective-endpoints.ts` as "dev-only: expose a 'No guardian' card in onboarding", so every account a real user has is a guardian account.

## Why it matters

For a guardian account, `send`, `consume`, `swap`, `bridged-send` and `earn-deposit` are all in `OFFSCREEN_ROUTABLE_GUARDIAN_TYPES`, and `generateTransaction` routes any `isGuardianAccount` row through `generateGuardianTransaction`. The offchain leg therefore exercises a completely different pipeline from the one every real transaction takes — different proving path, different failure modes, no co-signing round trip.

The earn workflow states the assumption explicitly, and it is wrong:

```yaml
# (Guardian co-signer is still omitted — earn needs no co-signing.)
```

A production earn deposit **is** co-signed.

## Scope

Most suites already pair the cheap offchain leg with a guardian twin — `multi-claim` / `guardian-multi-claim`, `send-private` / `guardian-send-private`, `swap-guardian`, `bridge-out-epoch-guardian`. The ones with no guardian leg at all:

- `tests/earn/earn-deposit.spec.ts`, `tests/earn/earn-withdraw.spec.ts`
- `tests/mint-and-balance.spec.ts`
- `tests/multi-account.spec.ts`

## Suggested fix

Add a guardian leg to each, following the `guardian-multi-claim` pattern (`guardianAxis(getEnvironmentConfig().guardianUrl)` where the journey helper applies). Earn needs a guardian container added to `pr-e2e-earn.yml` and its "earn needs no co-signing" comment removed.

Keeping the offchain leg is fine — it is the cheaper signal — as long as it is not the only one.

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。