Files
work-board/vitest.config.ts
zeekayandHanzo Dev e17ce018c7 read the bounty struct the contract answers with
`bounties(uint256)` returns eighteen components. This board declared thirteen,
in an order that predates the reward asset being split from the stake asset.
Every component is a static type, so the short list did not revert: it read
thirteen words off the front of the answer and named them by the wrong list.
Position 1 is `rewardKind`, an enum in 0..3, which came back as
`token: 0x00…03`, and every address after it moved up one slot — funder read as
approver, approver as arbiter, worker as a deadline. The board rendered, and
credited the wrong people.

The events were stale in the same way. `BountyProposed` carries ten parameters,
not seven: `rewardKind`, `rewardTokenId` and `stakeToken` joined it when the
assets were split, and with a seven-parameter fragment `issueRef` — the only
dynamic member, so the one whose offset moves — decoded to noise.
`BountyFunded` and `BountyCancelled` name their third parameter `reward`.
`DisputeResolved`, `StakeSlashed` and `RewardRecovered` were not declared at
all; `ActivityKind` already had names for two of them, so the activity log had
been promising steps it could not read. All twelve lifecycle events are now
read.

The single `token` field is gone. A reward is `rewardKind` / `rewardToken` /
`rewardTokenId` / `reward` and a stake is `stakeToken` / `stake`, because a
reward may be an NFT while the worker's stake stays fungible. Both are read
through one `Asset`, so the board can show a stake beside a reward without a
second formatter. `parseReward` inferred the reward kind from whether the token
address was zero; the kind is recorded now, so the inference is deleted rather
than kept as a fallback, and `RewardType` takes the contract's name for it,
`AssetKind`. `Task` stops carrying a derived copy of the reward: the render site
reads it off the struct.

`src/abi.test.ts` pins the eighteen names and types, then encodes a bounty whose
every field differs and decodes it back through the fragment, so the order is
measured by what it does and not only by what it says. Swapping funder and
approver, dropping a component, or restoring the seven-parameter
`BountyProposed` each fail it.

Fixture rebuilt to the eighteen-field shape — in the old order it would have
enshrined the decode it was written under. Its Pars address and the README's
address tables were the superseded V1 set, which answers a different struct;
both now name the deployment in lp-0020.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-04 00:52:49 -07:00

10 lines
217 B
TypeScript

import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
include: ['src/**/*.test.ts'],
// A run that finds nothing is a failure, not a pass.
passWithNoTests: false,
},
});