Commit Graph

17 Commits

Author SHA1 Message Date
Conner Fromknecht
b35a5b8892
watchtower/wtclient: integrate ClientChannelSummaries
In this commit, we utilize the more generic ClientChanSummary instead of
exposing methods that only allow us to set and fetch sweep pkscripts.
2019-05-23 20:48:50 -07:00
Conner Fromknecht
440ae7818a
watchtower/wtmock/client_db: adjust mock clientdb behavior
In advance of the upcoming wtdb.ClientDB, we'll modify the behavior
of the mockdb to be more like the final bbolt backed one, and assert
that all or our tests are still passing.
2019-05-23 20:48:23 -07:00
Conner Fromknecht
1db9bf2fd4
watchtower/wtdb: create embedded ClientSessionBody
This commit splits out the portions of the ClientSession into an
embedded ClientSessionBody, since these fields will be serialized
together on-disk.
2019-05-23 20:47:49 -07:00
Conner Fromknecht
5ad9530502
watchtower/wtdb: return sorted ClientSession.CommittedUpdates
This commit replaces the map-based CommittedUpdates field with a slice.
When reading from disk, these will already be sorted by bbolt, so the
client restore the updates as presented without needing to sort them
first.

Since the key in the map variant was the sequence number, we refactor
the CommittedUpdate struct to have a sequence number and an embedded
CommittedUpdateBody (which is equivalent to the old CommittedUpdate).
The database is then expected to populate the sequence number from the
key on disk.

Since the sequence number is now directly integrated in the
CommittedUpdate struct, this allow allows us to remove the now redundant
seqNum argument from CommitUpdate.
2019-05-23 20:47:36 -07:00
Conner Fromknecht
3509c0c991
watchtower/multi: use proper TowerID type
This allows serialization methods to be added with TowerID method
receivers.
2019-05-23 20:47:22 -07:00
Conner Fromknecht
2ce6228021
watchtower/wtmock/tower_db: move mock tower db to wtmock pkg 2019-04-26 17:19:58 -07:00
Conner Fromknecht
ec6e2010d6
watchtower/wtmock: validate key index reservation 2019-04-23 20:06:20 -07:00
Conner Fromknecht
bebe6461a9
watchtower/wtclient: use HD session key derivation 2019-04-23 20:04:55 -07:00
Conner Fromknecht
0404aedede
watchtower/wtclient/interface+wtmock: add session key reservation 2019-04-23 20:04:40 -07:00
Conner Fromknecht
df390df966
watchtower/wtmock/client_db: clone bytes w/ nil 2019-04-23 20:04:23 -07:00
Conner Fromknecht
c6f95c5667
watchtower/wtdb/client_session: replace keydesc w/ KeyIndex 2019-04-23 20:04:06 -07:00
Conner Fromknecht
3af6eafc8e
watchtower/wtclient/interface: add SecretKeyRing iface 2019-04-23 20:03:15 -07:00
Conner Fromknecht
7d99005dde
watchtower/wtclient/interface: add LoadTower and mock impl 2019-04-23 19:17:21 -07:00
Conner Fromknecht
05e3a7f6c0
watchtower/wtmock/peer: set local pubkey 2019-03-15 02:34:00 -07:00
Conner Fromknecht
81497eceaf
watchtower/wtmock/peer: create mock net.Conn using bidi MockPeer 2019-03-15 02:32:53 -07:00
Conner Fromknecht
87e8700c5d
watchtower/wtmock/client_db: add mock client db 2019-03-15 02:32:40 -07:00
Conner Fromknecht
43120fd08c
watchtower/multi: move MockSigner+MockPeer to wtmock 2019-01-31 18:16:02 -08:00