Skip to content

Commit

Permalink
Plugins e2e (#53)
Browse files Browse the repository at this point in the history
* chore: debugging

* chore: debug++

* chore: ...

* chore: debug++

* chore: ...

* chore: ...

* chore: ...

* chore: debug++

* feat: after success or failure trigger reporting of node data

* test: fix nodedata tests

* chore: remote omitempty [skip ci]
  • Loading branch information
fiksn authored Mar 16, 2023
1 parent b224ee3 commit 618e9a9
Show file tree
Hide file tree
Showing 15 changed files with 220 additions and 50 deletions.
23 changes: 20 additions & 3 deletions cmd/bolt-agent/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,14 @@ func shouldCrash(status int, body string) {
}

func nodeDataCallback(ctx context.Context, report *agent_entities.NodeDataReport) bool {
if report == nil {
return true
}
if report.NodeDetails != nil {
// a bit cumbersome but we don't want to put GitRevision into the checker
report.NodeDetails.AgentVersion = fmt.Sprintf("bolt-agent/%s", GitRevision)
}

rep, err := json.Marshal(report)
if err != nil {
glog.Warningf("Error marshalling report: %v", err)
Expand All @@ -430,7 +438,7 @@ func nodeDataCallback(ctx context.Context, report *agent_entities.NodeDataReport
return false
}

req.Header.Set("User-Agent", fmt.Sprintf("boltobserver-agent/%s", GitRevision))
req.Header.Set("User-Agent", fmt.Sprintf("bolt-agent/%s", GitRevision))
req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", apiKey))
req.Header.Set("Content-Type", "application/json")

Expand Down Expand Up @@ -582,8 +590,10 @@ func runAgent(cmdCtx *cli.Context) error {

g, gctx := errgroup.WithContext(ct)

var nodeDataChecker *nodedata.NodeData

if periodicSend {
nodeDataChecker := nodedata.NewDefaultNodeData(ct, cmdCtx.Duration("keepalive"), cmdCtx.Bool("smooth"), cmdCtx.Bool("checkgraph"), nodedata.NewNopNodeDataMonitoring("nodedata checker"))
nodeDataChecker = nodedata.NewDefaultNodeData(ct, cmdCtx.Duration("keepalive"), cmdCtx.Bool("smooth"), cmdCtx.Bool("checkgraph"), nodedata.NewNopNodeDataMonitoring("nodedata checker"))
settings := agent_entities.ReportingSettings{PollInterval: interval, AllowedEntropy: cmdCtx.Int("allowedentropy"), AllowPrivateChannels: private, Filter: f}

if settings.PollInterval == agent_entities.ManualRequest {
Expand Down Expand Up @@ -619,7 +629,14 @@ func runAgent(cmdCtx *cli.Context) error {
if cmdCtx.Bool("actions") {
fn := mkGetLndAPI(cmdCtx)
if !cmdCtx.Bool("noplugins") {
plugins.InitPlugins(fn, f, cmdCtx)
// Need this due to https://stackoverflow.com/questions/43059653/golang-interfacenil-is-nil-or-not
var invalidatable agent_entities.Invalidatable
if nodeDataChecker == nil {
invalidatable = nil
} else {
invalidatable = agent_entities.Invalidatable(nodeDataChecker)
}
plugins.InitPlugins(fn, f, cmdCtx, invalidatable)
}
g.Go(func() error {
ac := &actions.Connector{
Expand Down
15 changes: 15 additions & 0 deletions cmd/bolt-agent/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"testing"
"time"

"github.com/bolt-observer/agent/entities"
"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -34,3 +35,17 @@ func TestConvertTimeSetting(t *testing.T) {
assert.Equal(t, false, s.useLatestTimeFromServer)
assert.Equal(t, now, s.time)
}

func TestNilInterface(t *testing.T) {
//var nodeDataChecker *nodedata.NodeData
//x := entities.Invalidatable(nodeDataChecker)
var y entities.Invalidatable
if y == nil {
t.Logf("NIL\n")
return
}

t.Logf("NOT NIL %v\n", y)

t.Fail()
}
5 changes: 5 additions & 0 deletions entities/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,8 @@ func (r *ReentrancyBlock) Release(id string) {

sem.Release(1)
}

// Invalidatable interface.
type Invalidatable interface {
Invalidate() error
}
8 changes: 5 additions & 3 deletions entities/nodedetails.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import (

// NodeDetails struct
type NodeDetails struct {
NodeVersion string `json:"node_version"`
IsSyncedToChain bool `json:"is_synced_to_chain"`
IsSyncedToGraph bool `json:"is_synced_to_graph"`
NodeVersion string `json:"node_version"`
IsSyncedToChain bool `json:"is_synced_to_chain"`
IsSyncedToGraph bool `json:"is_synced_to_graph"`
AgentVersion string `json:"agent_version"` // will be filled before sending
TotalOnChainBalance uint64 `json:"total_onchain_balance"`

api.NodeInfoAPIExtended
}
27 changes: 24 additions & 3 deletions nodedata/nodedata.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,20 @@ func NewNodeData(ctx context.Context, cache ChannelCache, keepAlive time.Duratio
}
}

// Invalidate when data was last reported
func (c *NodeData) Invalidate() error {
c.perNodeSettings.mutex.Lock()
defer c.perNodeSettings.mutex.Unlock()

for _, one := range c.perNodeSettings.data {
one.lastCheck = time.Time{}
one.lastReport = time.Time{}
one.lastNodeReport = time.Time{}
}

return nil
}

// IsSubscribed - check if we are subscribed for a certain public key
func (c *NodeData) IsSubscribed(pubKey, uniqueID string) bool {
return utils.Contains(c.perNodeSettings.GetKeys(), pubKey+uniqueID)
Expand Down Expand Up @@ -540,6 +554,12 @@ func (c *NodeData) checkOne(
return nil, 0, fmt.Errorf("pubkey and reported pubkey are not the same")
}

funds, err := api.GetOnChainFunds(c.ctx)
if err != nil {
c.monitoring.MetricsReport("checkone", "failure", map[string]string{"pubkey": pubkey})
return nil, 0, fmt.Errorf("failed to get info: %v", err)
}

identifier.Identifier = info.IdentityPubkey

channelList, set, err := c.getChannelList(api, info, settings.AllowedEntropy, settings.AllowPrivateChannels, settings.Filter)
Expand Down Expand Up @@ -578,9 +598,10 @@ func (c *NodeData) checkOne(
}

nodeInfoFull := &entities.NodeDetails{
NodeVersion: info.Version,
IsSyncedToChain: info.IsSyncedToChain,
IsSyncedToGraph: info.IsSyncedToGraph,
NodeVersion: info.Version,
IsSyncedToChain: info.IsSyncedToChain,
IsSyncedToGraph: info.IsSyncedToGraph,
TotalOnChainBalance: uint64(funds.TotalBalance),
}

nodeInfoFull.NodeInfoAPIExtended = *nodeInfo
Expand Down
34 changes: 34 additions & 0 deletions nodedata/nodedata_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ func getNodeInfoJSON(pubKey string) string {
`, pubKey)
}

func getBalanceJSON() string {
return `{"total_balance":"89476363","confirmed_balance":"89476363","reserved_balance_anchor_chan":"50000","account_balance":{"default":{"confirmed_balance":89476363}}}`
}

func getChanInfo(url string) string {
s := strings.ReplaceAll(url, "/v1/graph/edge/", "")
id, err := strconv.Atoi(s)
Expand Down Expand Up @@ -208,6 +212,8 @@ func TestBasicFlow(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -270,6 +276,8 @@ func TestContextCanBeNil(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -329,6 +337,8 @@ func TestGetState(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -379,6 +389,8 @@ func TestGetStateCallback(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -533,6 +545,8 @@ func TestPrivateChannelsExcluded(t *testing.T) {
contents = getChannelJSON(1337, true, true)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -602,6 +616,8 @@ func TestInactiveFlow(t *testing.T) {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/graph/edge") {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -691,6 +707,8 @@ func TestChange(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -821,6 +839,8 @@ func TestKeepAliveIsSent(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -907,6 +927,8 @@ func TestKeepAliveIsNotSentWhenError(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -987,6 +1009,8 @@ func TestChangeIsCachedWhenCallbackFails(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -1077,6 +1101,8 @@ func TestGraphIsRequested(t *testing.T) {
{"nodes":[{"last_update":1659296984,"pub_key":"020003b9499a97c8dfbbab6b196319db37ba9c37bccb60477f3c867175f417988e","alias":"BJCR_BTCPayServer","addresses":[{"network":"tcp","addr":"95.217.192.209:9735"}],"color":"#3399ff","features":{"0":{"name":"data-loss-protect","is_required":true,"is_known":true},"12":{"name":"static-remote-key","is_required":true,"is_known":true},"14":{"name":"payment-addr","is_required":true,"is_known":true},"17":{"name":"multi-path-payments","is_known":true},"2023":{"name":"script-enforced-lease","is_known":true},"23":{"name":"anchors-zero-fee-htlc-tx","is_known":true},"31":{"name":"amp","is_known":true},"45":{"name":"explicit-commitment-type","is_known":true},"5":{"name":"upfront-shutdown-script","is_known":true},"7":{"name":"gossip-queries","is_known":true},"9":{"name":"tlv-onion","is_known":true}}},{"last_update":1657199384,"pub_key":"0200072fd301cb4a680f26d87c28b705ccd6a1d5b00f1b5efd7fe5f998f1bbb1f1","alias":"OutaSpace 🚀","addresses":[{"network":"tcp","addr":"176.28.11.68:9760"},{"network":"tcp","addr":"nzslu33ecbokyn32teza2peiiiuye43ftom7jvnuhsxdbg3vhw7w3aqd.onion:9760"}],"color":"#123456","features":{"1":{"name":"data-loss-protect","is_known":true},"11":{"name":"unknown"},"13":{"name":"static-remote-key","is_known":true},"14":{"name":"payment-addr","is_required":true,"is_known":true},"17":{"name":"multi-path-payments","is_known":true},"27":{"name":"unknown"},"5":{"name":"upfront-shutdown-script","is_known":true},"55":{"name":"unknown"},"7":{"name":"gossip-queries","is_known":true},"8":{"name":"tlv-onion","is_required":true,"is_known":true}}},{"last_update":1618162974,"pub_key":"0200081eaa41b5661d3b512f5aae9d6abfb11ba1497a354e9217d9a18fbaa1e76b","alias":"0200081eaa41b5661d3b","addresses":[{"network":"tcp","addr":"lm63zodngkzqbol6lgadijh5p5xm6ltbekfxlbofvmnbkvi5cnzrzdid.onion:9735"}],"color":"#3399ff","features":{"0":{"name":"data-loss-protect","is_required":true,"is_known":true},"12":{"name":"static-remote-key","is_required":true,"is_known":true},"14":{"name":"payment-addr","is_required":true,"is_known":true},"17":{"name":"multi-path-payments","is_known":true},"5":{"name":"upfront-shutdown-script","is_known":true},"7":{"name":"gossip-queries","is_known":true},"9":{"name":"tlv-onion","is_known":true}}},{"last_update":1660845145,"pub_key":"020016201d389a44840f1f33be29288952f67c8ef6b3f98726fda180b4185ca6e2","alias":"AlasPoorYorick","addresses":[{"network":"tcp","addr":"7vuykfnmgkarlk4xjew4ea6lj7qwbbggbox4b72abupu7sn24geajzyd.onion:9735"}],"color":"#604bee","features":{"0":{"name":"data-loss-protect","is_required":true,"is_known":true},"12":{"name":"static-remote-key","is_required":true,"is_known":true},"14":{"name":"payment-addr","is_required":true,"is_known":true},"17":{"name":"multi-path-payments","is_known":true},"2023":{"name":"script-enforced-lease","is_known":true},"23":{"name":"anchors-zero-fee-htlc-tx","is_known":true},"31":{"name":"amp","is_known":true},"45":{"name":"explicit-commitment-type","is_known":true},"5":{"name":"upfront-shutdown-script","is_known":true},"7":{"name":"gossip-queries","is_known":true},"9":{"name":"tlv-onion","is_known":true}}},{"last_update":1660753871,"pub_key":"02001828ca7eb8e44d4d78b5c1ea609cd3744be823c22cd69d895eff2f9345892d","alias":"nodl-lnd-s010-042","addresses":[{"network":"tcp","addr":"185.150.160.210:4042"}],"color":"#000000","features":{"0":{"name":"data-loss-protect","is_required":true,"is_known":true},"12":{"name":"static-remote-key","is_required":true,"is_known":true},"14":{"name":"payment-addr","is_required":true,"is_known":true},"17":{"name":"multi-path-payments","is_known":true},"2023":{"name":"script-enforced-lease","is_known":true},"23":{"name":"anchors-zero-fee-htlc-tx","is_known":true},"31":{"name":"amp","is_known":true},"45":{"name":"explicit-commitment-type","is_known":true},"5":{"name":"upfront-shutdown-script","is_known":true},"7":{"name":"gossip-queries","is_known":true},"9":{"name":"tlv-onion","is_known":true}}}],"edges":[{"channel_id":"553951550347608065","capacity":"37200","chan_point":"ede04f9cfc1bb5373fd07d8af9c9b8b5a85cfe5e323b7796eb0a4d0dce5d5058:1","node1_pub":"03bd3466efd4a7306b539e2314e69efc6b1eaee29734fcedd78cf81b1dde9fedf8","node2_pub":"03c3d14714b78f03fd6ea4997c2b540a4139258249ea1d625c03b68bb82f85d0ea"},{"channel_id":"554317687705305088","capacity":"1000000","chan_point":"cfd0ae79fc150c2c3c4068ceca74bc26652bb2691624379aba9e28b197a78d6a:0","node1_pub":"02eccebd9ed98f6d267080a58194dbe554a2b33d976eb95bb7c116d00fd64c4a13","node2_pub":"02ee4469f2b686d5d02422917ac199602ce4c366a7bfaac1099e3ade377677064d"},{"channel_id":"554460624201252865","capacity":"1000000","chan_point":"c0a8d3428f562c232d86be399eb4497934e7e0390fa79e6860bcb65e7b0dd4fe:1","node1_pub":"02eccebd9ed98f6d267080a58194dbe554a2b33d976eb95bb7c116d00fd64c4a13","node2_pub":"02ee4469f2b686d5d02422917ac199602ce4c366a7bfaac1099e3ade377677064d"},{"channel_id":"554494709160148993","capacity":"200000","chan_point":"06bbac25ed610feb1d07316d1be8b8ba6850ee1dd96cc1d5439159bfe992be5a:1","node1_pub":"03bd3466efd4a7306b539e2314e69efc6b1eaee29734fcedd78cf81b1dde9fedf8","node2_pub":"03cbf298b068300be33f06c947b9d3f00a0f0e8089da3233f5db37e81d3a596fe1"},{"channel_id":"554495808645955584","capacity":"2000000","chan_point":"2392c45431c064269e4eaeccb0476ac32e56485d84e104064636aea896d1e439:0","node1_pub":"022e74ed3ddd3f590fd6492e60b20dcad7303f17e1ffd882fb33bb3f6c88f64398","node2_pub":"02ee4469f2b686d5d02422917ac199602ce4c366a7bfaac1099e3ade377677064d"}]}
`
success = true
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -1143,6 +1169,8 @@ func TestBasicFlowRedis(t *testing.T) {
contents = getChannelJSON(1337, false, true)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -1212,6 +1240,8 @@ func TestBaseFeePolicyChange(t *testing.T) {
} else if step == 1 {
contents = getChanInfoWithPolicyBaseFee(req.URL.Path, 1100)
}
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -1289,6 +1319,8 @@ func TestBasicFlowFilterOne(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down Expand Up @@ -1356,6 +1388,8 @@ func TestBasicFlowFilterTwo(t *testing.T) {
contents = getChanInfo(req.URL.Path)
} else if strings.Contains(req.URL.Path, "v1/graph/node") {
contents = getNodeInfoJSON("02b67e55fb850d7f7d77eb71038362bc0ed0abd5b7ee72cc4f90b16786c69b9256")
} else if strings.Contains(req.URL.Path, "v1/balance/blockchain") {
contents = getBalanceJSON()
}

r := io.NopCloser(bytes.NewReader([]byte(contents)))
Expand Down
2 changes: 1 addition & 1 deletion plugins/boltz/connection_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func TestEnsureConnected(t *testing.T) {
f, err := filter.NewAllowAllFilter()
require.NoError(t, err)

b, err := NewPlugin(getAPI(t, "fixture.secret", api.LndRest), f, getMockCliCtx("", "", "regtest"))
b, err := NewPlugin(getAPI(t, "fixture.secret", api.LndRest), f, getMockCliCtx("", "", "regtest"), nil)
if b == nil || b.LnAPI == nil {
if FailNoCredsBoltz {
t.Fail()
Expand Down
24 changes: 24 additions & 0 deletions plugins/boltz/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"os"
"testing"

"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
)

Expand All @@ -16,6 +17,11 @@ type Dummy struct {
Name string
}

type ExtendedJobData struct {
Burek string
JobData
}

func TestBoltzDB(t *testing.T) {
os.Remove(dbpath)
db := &BoltzDB{}
Expand Down Expand Up @@ -46,4 +52,22 @@ func TestBoltzDB(t *testing.T) {
err := db.Get("notfound", &d)
require.EqualError(t, err, "No data found for this key")
})
t.Run("Extended entities", func(t *testing.T) {
jd := &JobData{ID: 1337}
err = db.Insert(1337, jd)
assert.NoError(t, err)

var jd2 JobData
err = db.Get(1337, &jd2)
assert.NoError(t, err)

assert.Equal(t, int32(1337), jd.ID)

ejd := &ExtendedJobData{Burek: "mesni", JobData: *jd}
err = db.Insert(1337, ejd)
assert.NoError(t, err)

//err = db.Get(1337, &jd2)
//assert.NoError(t, err)
})
}
4 changes: 2 additions & 2 deletions plugins/boltz/liquidity_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func TestGetNodeLiquidity(t *testing.T) {
f, err := filter.NewAllowAllFilter()
assert.NoError(t, err)

b, err := NewPlugin(getAPI(t, "fixture.secret", api.LndGrpc), f, getMockCliCtx("", "", "regtest"))
b, err := NewPlugin(getAPI(t, "fixture.secret", api.LndGrpc), f, getMockCliCtx("", "", "regtest"), nil)
if b == nil || b.LnAPI == nil {
if FailNoCredsBoltz {
t.Fail()
Expand All @@ -33,7 +33,7 @@ func TestGetByDescendingOutboundLiqudity(t *testing.T) {
f, err := filter.NewAllowAllFilter()
assert.NoError(t, err)

b, err := NewPlugin(getAPI(t, "fixture.secret", api.LndGrpc), f, getMockCliCtx("", "", "regtest"))
b, err := NewPlugin(getAPI(t, "fixture.secret", api.LndGrpc), f, getMockCliCtx("", "", "regtest"), nil)
if b == nil || b.LnAPI == nil {
if FailNoCredsBoltz {
t.Fail()
Expand Down
Loading

0 comments on commit 618e9a9

Please sign in to comment.