New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Send to route #952
Send to route #952
Changes from 26 commits
59b8803
9f3e6b0
e723066
07dab5e
6383690
ef75c66
d7a85af
84ad29f
ec18724
39bc8d5
e7f5423
4cdd736
be56cba
9b94099
584cf7f
39a64d5
3452c81
5db5b93
f3c270d
38f3e35
aae2171
5557989
8b0e022
3584079
52e4938
44acb29
2cd06c3
3aa79f7
468ec83
9bf8f2e
1d819a0
00aa6d7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -130,10 +130,10 @@ class RouterSpec extends BaseRouterSpec { | |
test("handle bad signature for NodeAnnouncement") { fixture => | ||
import fixture._ | ||
val sender = TestProbe() | ||
val buggy_ann_a = ann_a.copy(signature = ann_b.signature, timestamp = ann_a.timestamp + 1) | ||
sender.send(router, PeerRoutingMessage(null, remoteNodeId, buggy_ann_a)) | ||
sender.expectMsg(TransportHandler.ReadAck(buggy_ann_a)) | ||
sender.expectMsg(InvalidSignature(buggy_ann_a)) | ||
val buggy_ann_b = ann_b.copy(signature = ann_c.signature, timestamp = ann_b.timestamp + 1) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did you need to change that? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch that was some leftover from development, in 3aa79f7 i reverted the changes to RouterSpec and BaseRouterSpec (along with updating the copyright header). |
||
sender.send(router, PeerRoutingMessage(null, remoteNodeId, buggy_ann_b)) | ||
sender.expectMsg(TransportHandler.ReadAck(buggy_ann_b)) | ||
sender.expectMsg(InvalidSignature(buggy_ann_b)) | ||
} | ||
|
||
test("handle bad signature for ChannelUpdate") { fixture => | ||
|
@@ -237,6 +237,20 @@ class RouterSpec extends BaseRouterSpec { | |
assert(state.updates.size == 8) | ||
} | ||
|
||
test("given a pre-computed route add the proper channel updates") { fixture => | ||
import fixture._ | ||
|
||
val sender = TestProbe() | ||
val preComputedRoute = Seq(a, b, c, d) | ||
sender.send(router, FinalizeRoute(preComputedRoute)) | ||
|
||
val response = sender.expectMsgType[RouteResponse] | ||
// the route hasn't changed (nodes are the same) | ||
assert(response.hops.map(_.nodeId).toList == preComputedRoute.dropRight(1).toList) | ||
assert(response.hops.last.nextNodeId == preComputedRoute.last) | ||
assert(response.hops.map(_.lastUpdate).toList == List(channelUpdate_ab, channelUpdate_bc, channelUpdate_cd)) | ||
} | ||
|
||
test("ask for channels that we marked as stale for which we receive a new update") { fixture => | ||
import fixture._ | ||
val blockHeight = Globals.blockCount.get().toInt - 2020 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does that parse URL-encoded json?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no URL-encoding here, this only parses the form data parameter (as json array of strings) into a list of public keys.