Skip to content

Commit

Permalink
add a delay
Browse files Browse the repository at this point in the history
  • Loading branch information
JssDWt committed Nov 22, 2023
1 parent 7237542 commit 8985c4b
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 0 deletions.
4 changes: 4 additions & 0 deletions itest/lsps0_protocol_version_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package itest
import (
"encoding/hex"
"encoding/json"
"time"

"github.com/breez/lntest"
"github.com/breez/lspd/lsps0"
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions itest/lsps2_buy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions itest/lsps2_cltv_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions itest/lsps2_get_info_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 4 additions & 0 deletions itest/lsps2_get_versions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/hex"
"encoding/json"
"log"
"time"

"github.com/breez/lntest"
"github.com/breez/lspd/lsps0"
Expand All @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions itest/lsps2_happy_flow_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions itest/lsps2_no_balance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 3 additions & 0 deletions itest/lsps2_zero_conf_utxo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8985c4b

Please sign in to comment.