Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding new parameter in the config inside the plugin module #39

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions glightning/lightning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import (
"bufio"
"errors"
"fmt"
"github.com/niftynei/glightning/glightning"
"github.com/stretchr/testify/assert"
"github.com/niftynei/glightning/glightning"
"io"
"io/ioutil"
"net"
Expand Down Expand Up @@ -262,7 +262,7 @@ func TestListPeers(t *testing.T) {
OutPaymentsFulfilled: 123,
OutMilliSatoshiFulfilled: 123,
OutgoingFulfilledMsat: "123msat",
Htlcs: htlcs,
Htlcs: htlcs,
},
},
},
Expand Down Expand Up @@ -367,10 +367,10 @@ func TestListPays(t *testing.T) {
}
assert.Equal(t, []glightning.PaymentFields{
glightning.PaymentFields{
Bolt11: "lnbcrt100n1pw5mktvpp53a20un076gq93swhnemdmyday8c88kj9yh7d3k66c49narluy0dsdq0vehhygrzd3hk7eqxqyjw5qcqp2zwqux7t9zyelgcuwc535ugs5sylwdh0fu03xrzugu2zzljwvtg3q4xy22u3mhvxx3ag09jyjpx5lxl7lwux5l2mge8r85havpspm09gpnfxxsw",
PaymentPreImage: "c907587348984baf0ae031b286bf1c9427abfa492b254aca67b6809fd9b58d7c",
Status: "complete",
Label: "optional",
Bolt11: "lnbcrt100n1pw5mktvpp53a20un076gq93swhnemdmyday8c88kj9yh7d3k66c49narluy0dsdq0vehhygrzd3hk7eqxqyjw5qcqp2zwqux7t9zyelgcuwc535ugs5sylwdh0fu03xrzugu2zzljwvtg3q4xy22u3mhvxx3ag09jyjpx5lxl7lwux5l2mge8r85havpspm09gpnfxxsw",
PaymentPreImage: "c907587348984baf0ae031b286bf1c9427abfa492b254aca67b6809fd9b58d7c",
Status: "complete",
Label: "optional",
AmountSentMilliSatoshi: "10000msat",
},
}, forwards)
Expand Down
9 changes: 9 additions & 0 deletions glightning/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1059,12 +1059,21 @@ func (gm GetManifestMethod) Call() (jrpc2.Result, error) {
return m, nil
}

type ProxyConf struct {
Type string `json:"type"`
Address string `json:"address"`
Port uint64 `json:"port"`
}

type Config struct {
LightningDir string `json:"lightning-dir"`
RpcFile string `json:"rpc-file"`
Startup bool `json:"startup,omitempty"`
Network string `json:"network,omitempty"`
Features *FeatureBits `json:"feature_set,omitempty"`
Proxy *ProxyConf `json:"proxy,omitempty"`
TorV3Enabled bool `json:"torv3-enabled,omitempty"`
AlwaysProxy bool `json:"always_use_proxy,omitempty"`
}

type InitMethod struct {
Expand Down
2 changes: 1 addition & 1 deletion glightning/plugin_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package glightning_test
import (
"bufio"
"fmt"
"github.com/stretchr/testify/assert"
"github.com/niftynei/glightning/glightning"
"github.com/niftynei/glightning/jrpc2"
"github.com/stretchr/testify/assert"
"io"
"log"
"os"
Expand Down
2 changes: 1 addition & 1 deletion glightning/tests/interop_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import (
"bufio"
"errors"
"fmt"
"github.com/stretchr/testify/assert"
"github.com/niftynei/glightning/gbitcoin"
"github.com/niftynei/glightning/glightning"
"github.com/stretchr/testify/assert"
"io"
"io/ioutil"
"log"
Expand Down
1 change: 1 addition & 0 deletions jrpc2/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"io"
"log"
"math"
"net"
"os"
"sync"
Expand Down