sendProposalFixture function
SendProposal
sendProposalFixture({})
A neutral SendProposal for tests — override only what a case cares about.
Defaults to a single shielded (Orchard) recipient (no de-shield disclosure).
Implementation
SendProposal sendProposalFixture({
int proposalId = 1,
int totalZat = 100500,
int feeZat = 500,
int changeZat = 0,
bool hasTransparentRecipient = false,
bool isShield = false,
// A ZIP-320 TEX two-step (the partial-terminal "in motion" outcome keys off this).
// Default `false` (an ordinary single-step send) so existing tests are unaffected.
bool isTwoStepTex = false,
List<ProposalStep>? steps,
// Money-safety signals (#226). Default to an ORDINARY send (no large-amount
// confirm, not a self-send) so the existing send tests are unaffected; a case
// that exercises the large-send dialog / self-send note sets these explicitly.
LargeSendReason? largeSend,
bool selfSend = false,
// FR-46: the one recipient's total as signed. Defaults to the default step's
// lone recipient amount; a case pins its own (or `null` for two recipients).
int? singleRecipientZat = 100000,
// FR-17 (#396): required on the real DTO; deterministic bytes by default so
// a test that pins the seam's pass-through sets its own distinct fill.
Uint8List? binding,
}) {
return SendProposal(
proposalId: proposalId,
totalZat: totalZat,
feeZat: feeZat,
changeZat: changeZat,
steps:
steps ??
const [
ProposalStep(
recipients: [
ProposalRecipient(pool: OutputPool.orchard, amountZat: 100000),
],
),
],
targetHeight: 2_000_000,
hasTransparentRecipient: hasTransparentRecipient,
isShield: isShield,
isTwoStepTex: isTwoStepTex,
largeSend: largeSend,
selfSend: selfSend,
singleRecipientZat: singleRecipientZat,
binding: binding ?? defaultSendProposalBinding,
);
}