htlcswitch: recreate hlcswitch from scratch

This commit gives the start for making the htlc manager and htlc switch
testable. The testability of htlc switch have been achieved by mocking
all external subsystems. The concrete list of updates:

1. create standalone package for htlc switch.
2. add "ChannelLink" interface, which represent the previous htlc link.
3. add "Peer" interface, which represent the remote node inside our
subsystem.
4. add htlc switch config to htlc switch susbystem, which stores the
handlers which are not elongs to any of the above interfaces.

With this commit we are able test htlc switch even without having
the concrete implementation of Peer, ChannelLink structures, they will
be added later.
This commit is contained in:
Andrey Samokhvalov
2017-05-01 19:58:08 +03:00
committed by Olaoluwa Osuntokun
parent 84f94bdf4f
commit b86409cdb3
9 changed files with 1814 additions and 9 deletions

View File

@@ -40,6 +40,10 @@ const (
// IncorrectValue indicates that the HTLC ultimately extended to the
// destination did not match the value that was expected.
IncorrectValue FailCode = 5
// UnknownError indicates the error which should be returned, but
// not exist in specification yet.
UnknownError FailCode = 6
)
// String returns a human-readable version of the FailCode type.