itest: add a delay to allow interceptors to activate

This commit is contained in:
Jesse de Wit
2023-11-22 21:08:29 +01:00
parent 9242567cf1
commit 133eee7db9
8 changed files with 26 additions and 0 deletions

View File

@@ -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",

View File

@@ -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,

View File

@@ -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,

View File

@@ -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",

View File

@@ -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",

View File

@@ -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,

View File

@@ -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,

View File

@@ -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,