Skip to content

Commit f7e4463

Browse files
authored
chore(bounty): refresh codegen, drop ownerAddress casts (#682)
Regenerate the API schema against the current backend (ownerAddress is now optional on select-winners / cancel per boundless-nestjs#392, plus escrowOwnerAddress is exposed). Drop the temporary casts in useBountyPayout / useBountyCancel now that the generated types are correct.
1 parent d7a4aab commit f7e4463

3 files changed

Lines changed: 927 additions & 30 deletions

File tree

hooks/use-bounty-cancel.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ export const useBountyCancel = ({
8686
return;
8787
}
8888

89-
// ownerAddress is optional on the backend (boundless-nestjs#392); until
90-
// codegen picks that up the generated type marks it required, so cast.
91-
const body = {
89+
// ownerAddress is optional; the backend resolves and signs with the
90+
// on-chain event manager. Send it only as a hint when we have it.
91+
const body: CancelBountyEscrowRequest = {
9292
fundingMode,
9393
...(ownerAddress ? { ownerAddress } : {}),
94-
} as CancelBountyEscrowRequest;
94+
};
9595

9696
finalizedRef.current = false;
9797
toast.info('Submitting cancellation…');

hooks/use-bounty-payout.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,13 @@ export const useBountyPayout = ({
8181
return;
8282
}
8383

84-
// ownerAddress is optional on the backend (it resolves the manager); until
85-
// codegen picks that up (boundless-nestjs#392) the generated type still
86-
// marks it required, so cast.
87-
const body = {
84+
// ownerAddress is optional; the backend resolves and signs with the
85+
// on-chain event manager. Send it only as a hint when we have it.
86+
const body: SelectBountyWinnersRequest = {
8887
selections,
8988
fundingMode,
9089
...(ownerAddress ? { ownerAddress } : {}),
91-
} as SelectBountyWinnersRequest;
90+
};
9291

9392
finalizedRef.current = false;
9493
toast.info('Submitting winner selection…');

0 commit comments

Comments
 (0)