mirror of
https://github.com/aljazceru/lspd.git
synced 2026-02-14 18:54:31 +01:00
itest: add a delay to allow interceptors to activate
This commit is contained in:
@@ -3,6 +3,7 @@ package itest
|
||||
import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"time"
|
||||
|
||||
"github.com/breez/lntest"
|
||||
"github.com/breez/lspd/lsps0"
|
||||
@@ -12,6 +13,9 @@ import (
|
||||
func testLsps0GetProtocolVersions(p *testParams) {
|
||||
p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
rawMsg := `{
|
||||
"method": "lsps0.list_protocols",
|
||||
"jsonrpc": "2.0",
|
||||
|
||||
@@ -22,6 +22,9 @@ func testLsps2Buy(p *testParams) {
|
||||
})
|
||||
p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
p.BreezClient().Node().SendCustomMessage(&lntest.CustomMsgRequest{
|
||||
PeerId: hex.EncodeToString(p.Lsp().NodeId()),
|
||||
Type: lsps0.Lsps0MessageType,
|
||||
|
||||
@@ -24,6 +24,9 @@ func testLsps2Cltv(p *testParams) {
|
||||
log.Print("Connecting bob to lspd")
|
||||
p.BreezClient().Node().ConnectPeer(p.lsp.LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
log.Printf("Calling lsps2.get_info")
|
||||
info := Lsps2GetInfo(p.BreezClient(), p.Lsp(), lsps2.GetInfoRequest{
|
||||
Token: &WorkingToken,
|
||||
|
||||
@@ -26,6 +26,9 @@ func testLsps2GetInfo(p *testParams) {
|
||||
})
|
||||
p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
rawMsg := `{
|
||||
"method": "lsps2.get_info",
|
||||
"jsonrpc": "2.0",
|
||||
|
||||
@@ -4,6 +4,7 @@ import (
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/breez/lntest"
|
||||
"github.com/breez/lspd/lsps0"
|
||||
@@ -13,6 +14,9 @@ import (
|
||||
func testLsps2GetVersions(p *testParams) {
|
||||
p.BreezClient().Node().ConnectPeer(p.Lsp().LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
rawMsg := `{
|
||||
"method": "lsps2.get_versions",
|
||||
"jsonrpc": "2.0",
|
||||
|
||||
@@ -24,6 +24,9 @@ func testLsps2HappyFlow(p *testParams) {
|
||||
log.Print("Connecting bob to lspd")
|
||||
p.BreezClient().Node().ConnectPeer(p.lsp.LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
log.Printf("Calling lsps2.get_info")
|
||||
info := Lsps2GetInfo(p.BreezClient(), p.Lsp(), lsps2.GetInfoRequest{
|
||||
Token: &WorkingToken,
|
||||
|
||||
@@ -23,6 +23,9 @@ func testLsps2NoBalance(p *testParams) {
|
||||
log.Print("Connecting bob to lspd")
|
||||
p.BreezClient().Node().ConnectPeer(p.lsp.LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
log.Printf("Calling lsps2.get_info")
|
||||
info := Lsps2GetInfo(p.BreezClient(), p.Lsp(), lsps2.GetInfoRequest{
|
||||
Token: &WorkingToken,
|
||||
|
||||
@@ -37,6 +37,9 @@ func testLsps2ZeroConfUtxo(p *testParams) {
|
||||
log.Print("Connecting bob to lspd")
|
||||
p.BreezClient().Node().ConnectPeer(lsp.LightningNode())
|
||||
|
||||
// Make sure everything is activated.
|
||||
<-time.After(htlcInterceptorDelay)
|
||||
|
||||
log.Printf("Calling lsps2.get_info")
|
||||
info := Lsps2GetInfo(p.BreezClient(), lsp, lsps2.GetInfoRequest{
|
||||
Token: &WorkingToken,
|
||||
|
||||
Reference in New Issue
Block a user