-
Notifications
You must be signed in to change notification settings - Fork 54
feat(platform-wallet): e2e test spec and harness extensions #3563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 11 commits
b574ccf
085734a
5dbbb8d
66ca7ee
e7b885c
471e399
4e3a4b1
491f65c
7546a1e
4a04786
895fa93
5015e65
511d28c
2dea99c
000d645
29598fd
361d771
a2371a7
ee895d0
696ae3d
d18fd4d
140a028
18cebcc
96c5177
b112616
d5fdc70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -582,6 +582,27 @@ pub struct PlatformAddressChangeSet { | |
| /// Last block height with recent address changes (compaction marker). | ||
| /// `None` means "no change". | ||
| pub last_known_recent_block: Option<u64>, | ||
| /// Fee paid by the transfer that produced this changeset, in | ||
| /// credits. `0` for changesets not produced by `transfer()` | ||
| /// (e.g. sync-only changesets). See [`Self::fee_paid`]. | ||
| pub fee: Credits, | ||
| } | ||
|
|
||
| impl PlatformAddressChangeSet { | ||
| /// Fee paid by the transfer that produced this changeset, in | ||
| /// credits. | ||
| /// | ||
| /// Returns `0` for changesets that didn't originate from a | ||
| /// `transfer()` call — e.g. sync-only changesets, or changesets | ||
| /// constructed via `Default::default()`. The value is computed by | ||
| /// `transfer()` from the transition's input/output counts via | ||
| /// `AddressFundsTransferTransition::estimate_min_fee`, then | ||
| /// adjusted by the configured `fee_strategy` so the returned | ||
| /// number reflects the portion of the fee charged to the | ||
| /// fee-bearing input's remaining balance. | ||
|
lklimek marked this conversation as resolved.
Outdated
|
||
| pub fn fee_paid(&self) -> Credits { | ||
| self.fee | ||
| } | ||
| } | ||
|
lklimek marked this conversation as resolved.
lklimek marked this conversation as resolved.
|
||
|
|
||
| impl Merge for PlatformAddressChangeSet { | ||
|
|
@@ -606,13 +627,19 @@ impl Merge for PlatformAddressChangeSet { | |
| .map_or(r, |existing| existing.max(r)), | ||
| ); | ||
| } | ||
| // Fee: last-non-zero-wins. Sync-only merges (which carry | ||
| // `fee == 0`) preserve a transfer's recorded fee; merging | ||
| // two transfer changesets sums the fees, matching the | ||
| // "total fee paid across operations in this batch" intent. | ||
|
lklimek marked this conversation as resolved.
Outdated
|
||
| self.fee = self.fee.saturating_add(other.fee); | ||
|
lklimek marked this conversation as resolved.
Outdated
lklimek marked this conversation as resolved.
Outdated
Comment on lines
585
to
+644
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Suggestion: Three layers disagree on what this number means:
A caller reading only the field name reasonably writes a balance-delta assertion against Fix one of:
source: ['claude-rust-quality', 'codex-general'] 🤖 Fix this with AI agents |
||
| } | ||
|
|
||
| fn is_empty(&self) -> bool { | ||
| self.addresses.is_empty() | ||
| && self.sync_height.is_none() | ||
| && self.sync_timestamp.is_none() | ||
| && self.last_known_recent_block.is_none() | ||
| && self.fee == 0 | ||
| } | ||
| } | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.