Commit Graph

11 Commits

Author SHA1 Message Date
Rusty Russell de7fb4a83f test_protocol: restart support.
We keep a "database" for each side's persistent state.  Upon restart,
each side tells the other where it was up to, in terms of the number
of commit and revocation messages it receives.

Because only one update can be in flight at a time, we can tell w

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:45 +09:30
Rusty Russell ba50776c47 test_protocol: fix up expected test output.
Our implementation now displays things differently, so output changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:44 +09:30
Rusty Russell d54a59f010 test_protocol: remove support for multiple commits in flight.
Laolu pointed out that we can't have multiple in flight, since we can't
sign without knowing the next revocation preimage.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-08-18 14:23:44 +09:30
Rusty Russell 889db659c5 test: test commands during commit phase.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-26 15:25:25 +09:30
Rusty Russell a2ced6c16c test/test_protocol: add actual crossover case.
Not just add-htlc crossing over, but all the commit stages.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-18 06:55:28 +09:30
Rusty Russell e46a2ed49a test/test_protocol: rename internally to match updated 02-wire-protocol.md
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-17 15:06:12 +09:30
Rusty Russell 126c91e1b1 test/test_protocol: don't allow multiple commits in flight by default.
Add "nocommitwait" for the two cases we test that, otherwise add
assertions that we never end up dealing with anything other than
the previous commit.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-17 15:01:10 +09:30
Rusty Russell 4c1b50baab test/test_protocol: don't bother keeping acked (outgoing) queue.
We can simply set a boolean to indicate there are changes.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-17 13:56:08 +09:30
Rusty Russell 388dfc355e test/test_protocol: add fee support.
We simply record how many fee changes there are, rather than supporting
a particular level.

Fees are tricky: it's a noop to apply them when incoming, but we apply them
when they've been acked.  Unlike HTLC modifications, which are symmetric,
fee updates only apply when returning to the originating node.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-17 13:49:32 +09:30
Rusty Russell 056c219bc1 test/test_protocol: add checksync command to assert nodes are in sync.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-17 13:48:11 +09:30
Rusty Russell 7f90d183da test/test_protocol: simulator for the updated wire-protocol BOLT.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2016-05-17 13:47:44 +09:30