1
0
Fork 0
mirror of https://github.com/ACINQ/eclair.git synced 2025-02-22 22:25:26 +01:00

Improve integration tests (#710)

* added more logs and improved integration test

* make travis cache maven data
This commit is contained in:
Pierre-Marie Padiou 2018-09-18 17:03:49 +02:00 committed by GitHub
parent 2c1811d18f
commit db96c17fd2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 2 deletions

View file

@ -9,6 +9,10 @@ env:
- export LD_LIBRARY_PATH=/usr/local/lib
script:
- mvn install
cache:
directories:
- .autoconf
- $HOME/.m2
jdk:
- oraclejdk8
notifications:

View file

@ -810,7 +810,7 @@ class Channel(val nodeParams: NodeParams, wallet: EclairWallet, remoteNodeId: Pu
case Event(TickRefreshChannelUpdate, d: DATA_NORMAL) =>
// periodic refresh is used as a keep alive
log.debug(s"sending channel_update announcement (refresh)")
log.info(s"sending channel_update announcement (refresh)")
val channelUpdate = Announcements.makeChannelUpdate(nodeParams.chainHash, nodeParams.privateKey, remoteNodeId, d.shortChannelId, d.channelUpdate.cltvExpiryDelta, d.channelUpdate.htlcMinimumMsat, d.channelUpdate.feeBaseMsat, d.channelUpdate.feeProportionalMillionths, enable = true)
// we use GOTO instead of stay because we want to fire transitions
goto(NORMAL) using store(d.copy(channelUpdate = channelUpdate))

View file

@ -261,10 +261,16 @@ class IntegrationSpec extends TestKit(ActorSystem("test")) with BitcoindService
assert(sender.expectMsgType[Map[ChannelDesc, ChannelUpdate]].apply(ChannelDesc(channelUpdateBC.shortChannelId, nodes("B").nodeParams.nodeId, nodes("C").nodeParams.nodeId)) === channelUpdateBC)
// we then put everything back like before by asking B to refresh its channel update (this will override the one we created)
sender.send(nodes("B").register, ForwardShortId(shortIdBC, TickRefreshChannelUpdate))
sender.send(nodes("B").register, ForwardShortId(shortIdBC, CMD_GETINFO))
val channelUpdateBC_new = sender.expectMsgType[RES_GETINFO].data.asInstanceOf[DATA_NORMAL].channelUpdate
logger.info(s"channelUpdateBC=$channelUpdateBC")
logger.info(s"channelUpdateBC_new=$channelUpdateBC_new")
assert(channelUpdateBC_new.timestamp > channelUpdateBC.timestamp)
assert(channelUpdateBC_new.cltvExpiryDelta == nodes("B").nodeParams.expiryDeltaBlocks)
awaitCond({
sender.send(nodes("A").router, 'updatesMap)
val u = sender.expectMsgType[Map[ChannelDesc, ChannelUpdate]].apply(ChannelDesc(channelUpdateBC.shortChannelId, nodes("B").nodeParams.nodeId, nodes("C").nodeParams.nodeId))
u.cltvExpiryDelta == 144
u.cltvExpiryDelta == nodes("B").nodeParams.expiryDeltaBlocks
}, max = 30 seconds, interval = 1 second)
}