test(cluster-tool): carry uwreqs.target_amount in the swap-scenario fixture (companion to wire-sysio#550) - #58
Merged
Conversation
…ixture wire-sysio#550 adds one additive field to the `uw_request_t` row — `target_amount: uint64`, the caller's original destination amount, retained as the fixed reference the race-time slippage check anchors on. `uwreqRow()` returns the full `SysioUwritUwRequestTType` rather than a `Partial`, so once the regenerated `sdk-core` types carry `target_amount` as a required property the fixture stops compiling and takes `pnpm build` (and the e2e gate behind it) with it. This adds the field. That fixture is the whole surface: every other `SysioUwritUwRequestTType` reference in the repo is a READ position — `Promise<…>` returns in five flow scenarios, a predicate parameter, a type alias, an array field — none of which constructs a row and none of which an additive field can break. The live flow reads are unaffected either way. They go through `.tables.uwreqs.query()` → `get_table_rows`, where nodeop serializes against the on-chain ABI and returns JSON; an extra field is simply ignored by name-based reads. BLOCKED until the `sysio.uwrit` regen lands in `wire-libraries-ts`. Against today's `sdk-core` this errors: SwapScenarioContext.test.ts(65,5): error TS2353: Object literal may only specify known properties, and 'target_amount' does not exist in type 'SysioUwritUwRequestTType'. Merge order: wire-sysio#549 → regenerate `SysioContractTypes` once → the `wire-libraries-ts` PR → this. This must land in the same window as the regen, not after it, or the gate is red in the gap. Change-Id: I5c640c1fdc7a9170a4544a9d6fe00a4d18f37bf8
jglanz
approved these changes
Aug 10, 2026
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.
Companion to wire-sysio#550, opened now so it is reviewed ahead of the regen rather than racing it.
What and why
#550 adds one additive field to the
uw_request_trow —target_amount: uint64, the caller's original destination amount, retained as the fixed reference the race-time slippage check anchors on:"name": "dst_amount", "type": "uint64" }, + { + "name": "target_amount", + "type": "uint64" + },uwreqRow()inSwapScenarioContext.test.tsreturns the fullSysioUwritUwRequestTTyperather than aPartial, so the moment the regenerated types carrytarget_amountas required, the fixture stops compiling — which failspnpm build(tsconfig.cjs.jest.jsonis a project reference) and the e2e gate behind it. One line fixes it.That fixture is the entire surface
I checked every
SysioUwritUwRequestTTypereference in the repo. All the others are read positions —Promise<…>returns in five flow scenarios (flow-swap-private-reserves,flow-swap-to-wire,flow-reserve-lifecycle,flow-underwriter-slashing,SwapScenarioContext), a predicate parameter, a type alias inflow-swap-non-native-tokens, an array field in this same test. None constructs a row; an additive field cannot break any of them.Live flow reads are unaffected regardless of merge order. They go through
.tables.uwreqs.query()→get_table_rows, wherenodeopserializes against the on-chain ABI and returns JSON, so the extra field simply arrives and is ignored by name-based reads. There is no host-side binary decoder to misalign either — the underwriter plugin reachesuwreqsover the same JSON-RPC path, not a hand-rolled struct. So the mid-struct insertion, which would matter for a raw binary decode, does not bite.Sequencing
Verified against today's
sdk-core, this errors:sdk-coreis currently ahead ofwire-sysiomaster and already carries #549'ssysio.chalgtypes, so regenerating today would delete them. Order:SysioContractTypesoncewire-libraries-tsregen PRThis is the same shape as the
challenge_idfixture update riding #56 for the #549 regen — one cycle later, for #550.