Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 480
[Custom Transactions] Add TxBuilder trait, support fixed additional outputs #3775
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
Uh oh!
There was an error while loading. Please reload this page.
Changes from all commits
098b98eebf6b135688658aacaf77f399c9185cc09e07b794039cb0a3File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Uh oh!
There was an error while loading. Please reload this page.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -544,9 +544,11 @@ fn do_test_claim_value_force_close(anchors: bool, prev_commitment_tx: bool) { | ||
| let commitment_tx_fee = chan_feerate as u64 * | ||
| (chan_utils::commitment_tx_base_weight(&channel_type_features) + 2 * chan_utils::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000; | ||
| let anchor_outputs_value = if anchors { 2 * channel::ANCHOR_OUTPUT_VALUE_SATOSHI } else { 0 }; | ||
| let amount_satoshis = 1_000_000 - 3_000 - 4_000 - 1_000 - 3 - commitment_tx_fee - anchor_outputs_value - 1; /* msat amount that is burned to fees */ | ||
| assert_eq!(sorted_vec(vec![Balance::ClaimableOnChannelClose { | ||
| amount_satoshis: 1_000_000 - 3_000 - 4_000 - 1_000 - 3 - commitment_tx_fee - anchor_outputs_value - 1 /* msat amount that is burned to fees */, | ||
| transaction_fee_satoshis: commitment_tx_fee, | ||
| amount_satoshis, | ||
| // In addition to `commitment_tx_fee`, this also includes the dust HTLC, and the total msat amount rounded down from non-dust HTLCs | ||
| transaction_fee_satoshis: 1_000_000 - 4_000 - 3_000 - 1_000 - amount_satoshis - anchor_outputs_value, | ||
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. Probably want to update docs. | ||
| outbound_payment_htlc_rounded_msat: 3300, | ||
| outbound_forwarded_htlc_rounded_msat: 0, | ||
| inbound_claiming_htlc_rounded_msat: 0, | ||
| @@ -598,16 +600,18 @@ fn do_test_claim_value_force_close(anchors: bool, prev_commitment_tx: bool) { | ||
| let commitment_tx_fee = chan_feerate as u64 * | ||
| (chan_utils::commitment_tx_base_weight(&channel_type_features) + | ||
| if prev_commitment_tx { 1 } else { 2 } * chan_utils::COMMITMENT_TX_WEIGHT_PER_HTLC) / 1000; | ||
| let mut a_expected_balances = vec![Balance::ClaimableOnChannelClose { | ||
| amount_satoshis: 1_000_000 - // Channel funding value in satoshis | ||
| let amount_satoshis = 1_000_000 - // Channel funding value in satoshis | ||
| 4_000 - // The to-be-failed HTLC value in satoshis | ||
| 3_000 - // The claimed HTLC value in satoshis | ||
| 1_000 - // The push_msat value in satoshis | ||
| 3 - // The dust HTLC value in satoshis | ||
| commitment_tx_fee - // The commitment transaction fee with two HTLC outputs | ||
| anchor_outputs_value - // The anchor outputs value in satoshis | ||
| 1, // The rounded up msat part of the one HTLC | ||
| transaction_fee_satoshis: commitment_tx_fee, | ||
| 1; // The rounded up msat part of the one HTLC | ||
| let mut a_expected_balances = vec![Balance::ClaimableOnChannelClose { | ||
| amount_satoshis, // Channel funding value in satoshis | ||
| // In addition to `commitment_tx_fee`, this also includes the dust HTLC, and the total msat amount rounded down from non-dust HTLCs | ||
| transaction_fee_satoshis: 1_000_000 - 4_000 - 3_000 - 1_000 - amount_satoshis - anchor_outputs_value, | ||
| outbound_payment_htlc_rounded_msat: 3000 + if prev_commitment_tx { | ||
| 200 /* 1 to-be-failed HTLC */ } else { 300 /* 2 HTLCs */ }, | ||
| outbound_forwarded_htlc_rounded_msat: 0, | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: why cant we use
sum? Maybe mappingto_satin the firstmap?