-
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 all 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,36 @@ pub struct PlatformAddressChangeSet { | |
| /// Last block height with recent address changes (compaction marker). | ||
| /// `None` means "no change". | ||
| pub last_known_recent_block: Option<u64>, | ||
| /// Lower-bound static fee estimate for the transfer that produced | ||
| /// this changeset, in credits. `0` for changesets not produced by | ||
| /// `transfer()` (e.g. sync-only changesets). See | ||
| /// [`Self::estimated_min_fee`]. | ||
| pub fee: Credits, | ||
| } | ||
|
|
||
| impl PlatformAddressChangeSet { | ||
| /// Lower-bound static fee estimate for 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 the raw | ||
| /// `AddressFundsTransferTransition::estimate_min_fee(input_count, | ||
| /// output_count, version)` result captured at submit time — it is | ||
| /// **NOT** the actual on-chain fee and is **NOT** adjusted by the | ||
| /// `fee_strategy`. | ||
| /// | ||
| /// `estimate_min_fee` only models the static | ||
| /// `state_transition_min_fees` floor; chain-time fees include | ||
| /// storage + processing costs that scale with the operation set | ||
| /// (~6.5M static vs ~14.94M observed real for 1in/1out at the time | ||
| /// of writing). Tests asserting on the actual chain-time debit | ||
| /// must read the post-broadcast balance delta directly, not this | ||
| /// value. See platform issue #3040 for the open ticket on | ||
| /// upgrading `estimate_min_fee` to a chain-time-accurate estimate. | ||
| pub fn estimated_min_fee(&self) -> Credits { | ||
| self.fee | ||
| } | ||
| } | ||
|
lklimek marked this conversation as resolved.
|
||
|
|
||
| impl Merge for PlatformAddressChangeSet { | ||
|
|
@@ -606,13 +636,20 @@ impl Merge for PlatformAddressChangeSet { | |
| .map_or(r, |existing| existing.max(r)), | ||
| ); | ||
| } | ||
| // Fee: append-sum via `saturating_add`. Sync-only merges | ||
| // (`fee == 0`) are a no-op so a transfer's recorded fee | ||
| // survives untouched; merging two transfer changesets sums | ||
| // the per-operation fees so the merged total reflects the | ||
| // "total fee paid across operations in this batch" intent. | ||
| self.fee = self.fee.saturating_add(other.fee); | ||
|
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.