Optimizing layout
Pull request

[wallet 2/3]: refactor funding logic to use allocation code

Refactors the wallet's funding code to use the pre-existing allocation logic to distribute coins from grouped assets.

Part of the group key support saga:

see less
File matrix
19 files19 files
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
itest/itest/
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
tapchannel/tapchannel/
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r2
r3
r4
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
tapfreighter/tapfreighter/
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
tappsbt/tappsbt/
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
tapsend/tapsend/
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r2
r3
r4
r9
r10
r2
r3
r4
r9
r10
~77 +133 -21
+81
+30
~22 -12
~14 +11
~41 +11 -9
adjust what's shown in the file matrix here.
Participants
waiting on
participant
status
role
contributor
last active
drafts
discussions
Diffs
  Reviewing the latest revision (r10) against its ⊥ base revision.

Show diffs to review (file selection:

)

Show other diffs: All changes

Preferences
Top level discussions
Review discussion
2 weeks ago
New comments
coverallsCoveralls

Pull Request Test Coverage Report for Build 13661304934

Details

  • 247 of 516 (47.87%) changed or added relevant lines in 10 files are covered.
  • 6312 unchanged lines in 93 files lost coverage.
  • Overall coverage decreased (-6.8%) to 47.726%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tapsend/allocation_sort.go 0 1 0.0%
itest/assertions.go 17 22 77.27%
tapfreighter/fund.go 57 82 69.51%
tapchannel/aux_funding_controller.go 0 26 0.0%
tapsend/allocation.go 163 197 82.74%
tapchannel/aux_sweeper.go 0 36 0.0%
tapchannel/aux_closer.go 0 44 0.0%
tapchannel/commitment.go 0 98 0.0%
Files with Coverage Reduction New Missed Lines %
fn/errors.go 2 48.39%
tapfreighter/fund.go 3 70.38%
universe/interface.go 3 70.13%
commitment/encoding.go 4 68.75%
tapgarden/batch.go 4 74.23%
fn/recv.go 5 60.47%
rfqmsg/messages.go 5 85.52%
proof/courier.go 6 79.04%
tapdb/test_sqlite.go 6 0.0%
asset/records.go 7 86.67%
Totals Coverage Status
Change from base Build 13579304854: -6.8%
Covered Lines: 42671
Relevant Lines: 89408

💛 - Coveralls
1 week ago
ffranr

🎆

1 week ago
RoasbeefOlaoluwa Osuntokun

LGTM 🐎

In progress
2 weeks ago
New comments
RoasbeefOlaoluwa Osuntokun

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

Still getting through the PR, but is the idea here that we'll start to use DistributeCoins more widely in the codebase? As otherwise right now, it's always used in an interactive setting.

1 week ago
guggeroOliver Gugger

Yeah, exactly. We'll want to use the allocation code for the wallet's funding logic, which we'll use for the channel funding and in the future for the grouped asset on-chain send.

In progress
2 weeks ago
New comment
RoasbeefOlaoluwa Osuntokun

(Reviewable was unable to map this GitHub inline comment thread to the right spot — sorry!)

👍

r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
+81
Revision mapping:
Compact 10 revisions Click and hold to arm, release to activate.
r2
r3
r4
r8
r9
r10
+30
r2
r3
r4
r8
r9
r10
~22 -12
r2
r3
r4
r8
r9
r10
~14 +11
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
~41 +11 -9
r2
r3
r4
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
r2
r3
r4
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
File renamed from tapchannel/allocation.go   to tapsend/allocation.go   in this diff.
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
File renamed from tapchannel/allocation_sort.go   to tapsend/allocation_sort.go   in this diff.
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
File renamed from tapchannel/allocation_sort_test.go   to tapsend/allocation_sort_test.go   in this diff.
r1
r2
r3
r4
r5
r6
r7
r8
r9
r10
File renamed from tapchannel/allocation_test.go   to tapsend/allocation_test.go   in this diff.
r2
r3
r4
r9
r10
r2
r3
r4
r9
r10
Use of Reviewable is subject to the terms of useprivacy policy.