Htlcswitch: rename Deobfuscator and Obfuscator interfaces

This commit renames the Deobfuscator interface to ErrorDecrypter and
the Obfuscator interface to ErrorEncrypter. With this rename, the
purpose of these two interfaces are a bit clearer.

Additionally, DecryptError (which was formerly Deobfuscate) now
directly returns an ForwardingError type instead of the
lnwire.FailureMessage.
This commit is contained in:
Olaoluwa Osuntokun
2017-10-10 19:36:52 -07:00
parent 30a46291f8
commit 12ae63101d
9 changed files with 109 additions and 93 deletions

View File

@@ -556,7 +556,7 @@ func newThreeHopNetwork(t *testing.T, aliceToBob,
Peer: bobServer,
Switch: aliceServer.htlcSwitch,
DecodeHopIterator: decoder.DecodeHopIterator,
DecodeOnionObfuscator: func(io.Reader) (Obfuscator,
DecodeOnionObfuscator: func(io.Reader) (ErrorEncrypter,
lnwire.FailCode) {
return obfuscator, lnwire.CodeNone
},
@@ -577,7 +577,7 @@ func newThreeHopNetwork(t *testing.T, aliceToBob,
Peer: aliceServer,
Switch: bobServer.htlcSwitch,
DecodeHopIterator: decoder.DecodeHopIterator,
DecodeOnionObfuscator: func(io.Reader) (Obfuscator,
DecodeOnionObfuscator: func(io.Reader) (ErrorEncrypter,
lnwire.FailCode) {
return obfuscator, lnwire.CodeNone
},
@@ -598,7 +598,7 @@ func newThreeHopNetwork(t *testing.T, aliceToBob,
Peer: carolServer,
Switch: bobServer.htlcSwitch,
DecodeHopIterator: decoder.DecodeHopIterator,
DecodeOnionObfuscator: func(io.Reader) (Obfuscator,
DecodeOnionObfuscator: func(io.Reader) (ErrorEncrypter,
lnwire.FailCode) {
return obfuscator, lnwire.CodeNone
},
@@ -619,7 +619,7 @@ func newThreeHopNetwork(t *testing.T, aliceToBob,
Peer: bobServer,
Switch: carolServer.htlcSwitch,
DecodeHopIterator: decoder.DecodeHopIterator,
DecodeOnionObfuscator: func(io.Reader) (Obfuscator,
DecodeOnionObfuscator: func(io.Reader) (ErrorEncrypter,
lnwire.FailCode) {
return obfuscator, lnwire.CodeNone
},