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.

贡献指南

打开贡献指南

调研方向

The issue identifies three test suites that need a guardian leg added: earn-deposit.spec.ts, earn-withdraw.spec.ts, mint-and-balance.spec.ts, and multi-account.spec.ts. Start by examining the existing guardian test pattern in guardian-multi-claim to understand how to integrate guardianAxis. You'll need to add a guardian container to the pr-e2e-earn.yml configuration. Run the existing tests to understand the current flow before adding the new guardian path.

由索引模型根据 Issue 内容生成。

评估

技术栈
typescript
领域
testing-qa
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
活跃
描述清晰度
描述清楚
新手友好度
65/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。