watchtower: make use of the new AddressIterator
This commit upgrades the wtclient package to make use of the new `AddressIterator`. It does so by first creating new `Tower` and `ClientSession` types. The new `Tower` type has an `AddressIterator` instead of a list of addresses. The `ClientSession` type contains a `Tower`.
This commit is contained in:
13 files changed
+274
-184
No files matched your search
@@ -343,8 +343,11 @@ func testCreateTower(h *clientDBHarness) {
|
||||
h.loadTowerByID(20, wtdb.ErrTowerNotFound)
|
||||
|
||||
tower := h.newTower()
|
||||
require.Len(h.t, tower.LNAddrs(), 1)
|
||||
towerAddr := tower.LNAddrs()[0]
|
||||
require.Len(h.t, tower.Addresses, 1)
|
||||
towerAddr := &lnwire.NetAddress{
|
||||
IdentityKey: tower.IdentityKey,
|
||||
Address: tower.Addresses[0],
|
||||
}
|
||||
|
||||
// Load the tower from the database and assert that it matches the tower
|
||||
// we created.
|
||||
|
||||
Reference in new issue
Block a user