Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ object Transactions {
abstract val anchorAmount: Satoshi

object AnchorOutputs : CommitmentFormat() {
override val fundingInputWeight: Int = 384
// See https://github.com/lightning/bolts/blob/master/03-transactions.md#appendix-a-expected-weights
// funding input weight = 4 * funding_input_size + witness_size = 4 * 41 + 222 = 386
override val fundingInputWeight: Int = 386
override val commitWeight: Int = 1124
override val htlcOutputWeight: Int = 172
override val htlcTimeoutWeight: Int = 666
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,11 +439,11 @@ class InteractiveTxTestsCommon : LightningTestSuite() {

assertEquals(sharedTxA.sharedTx.totalAmountIn, 315_000.sat)
assertNotNull(sharedTxA.sharedTx.sharedInput)
assertEquals(sharedTxA.sharedTx.localFees, 953_000.msat)
assertEquals(sharedTxA.sharedTx.localFees, 955_000.msat)
assertEquals(sharedTxA.sharedTx.remoteFees, 357_000.msat)
assertNotNull(sharedTxB.sharedTx.sharedInput)
assertEquals(sharedTxB.sharedTx.localFees, 357_000.msat)
assertEquals(sharedTxB.sharedTx.remoteFees, 953_000.msat)
assertEquals(sharedTxB.sharedTx.remoteFees, 955_000.msat)

// Bob sends signatures first as he contributed less than Alice.
val signedTxB = sharedTxB.sharedTx.sign(bob5, f.keyManagerB, f.fundingParamsB, f.nodeIdA).right
Expand Down Expand Up @@ -670,11 +670,11 @@ class InteractiveTxTestsCommon : LightningTestSuite() {

assertEquals(sharedTxA.sharedTx.totalAmountIn, 375_000.sat)
assertNotNull(sharedTxA.sharedTx.sharedInput)
assertEquals(sharedTxA.sharedTx.localFees, 1_077_000.msat)
assertEquals(sharedTxA.sharedTx.localFees, 1_079_000.msat)
assertEquals(sharedTxA.sharedTx.remoteFees, 481_000.msat)
assertNotNull(sharedTxB.sharedTx.sharedInput)
assertEquals(sharedTxB.sharedTx.localFees, 481_000.msat)
assertEquals(sharedTxB.sharedTx.remoteFees, 1_077_000.msat)
assertEquals(sharedTxB.sharedTx.remoteFees, 1_079_000.msat)

// Bob sends signatures first as he did not contribute.
val signedTxB = sharedTxB.sharedTx.sign(bob6, f.keyManagerB, f.fundingParamsB, f.nodeIdA).right
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ class TransactionsTestsCommon : LightningTestSuite() {
when (commitmentFormat) {
Transactions.CommitmentFormat.AnchorOutputs -> {
// ECDSA signatures are der-encoded, which creates some variability in signature size compared to the baseline.
assertTrue(actual <= expected + 2, "actual=$actual, expected=$expected")
assertTrue(actual >= expected - 2, "actual=$actual, expected=$expected")
assertTrue(actual <= expected + 4, "actual=$actual, expected=$expected")
assertTrue(actual >= expected - 4, "actual=$actual, expected=$expected")
}
Transactions.CommitmentFormat.SimpleTaprootChannels -> assertEquals(expected, actual)
}
Expand Down