Merge pull request #7659 from guggero/lncli-json-hex-replacement
lncli: replace deprecated fork for serializing protobuf as JSON with new one
This commit is contained in:
30 files changed
+225
-200
No files matched your search
@@ -98,6 +98,13 @@ linters-settings:
|
||||
- 'math.*'
|
||||
- 'strconv.ParseInt'
|
||||
- 'errors.Wrap'
|
||||
|
||||
gomoddirectives:
|
||||
replace-allow-list:
|
||||
# See go.mod for the explanation why these are needed.
|
||||
- github.com/ulikunitz/xz
|
||||
- github.com/gogo/protobuf
|
||||
- google.golang.org/protobuf
|
||||
|
||||
|
||||
linters:
|
||||
|
||||
@@ -10,11 +10,11 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
"github.com/urfave/cli"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
@@ -385,7 +385,7 @@ func printMacaroon(ctx *cli.Context) error {
|
||||
return fmt.Errorf("unable to decode macaroon version: %v", err)
|
||||
}
|
||||
|
||||
// Prepare everything to be printed in a more human readable format.
|
||||
// Prepare everything to be printed in a more human-readable format.
|
||||
content := &macaroonContent{
|
||||
Version: uint16(mac.Version()),
|
||||
Location: mac.Location(),
|
||||
|
||||
@@ -17,7 +17,6 @@ import (
|
||||
"github.com/btcsuite/btcd/btcutil"
|
||||
"github.com/jedib0t/go-pretty/v6/table"
|
||||
"github.com/jedib0t/go-pretty/v6/text"
|
||||
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
|
||||
"github.com/lightningnetwork/lnd/chainreg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/routerrpc"
|
||||
@@ -952,7 +951,7 @@ func sendToRoute(ctx *cli.Context) error {
|
||||
// format.
|
||||
var route *lnrpc.Route
|
||||
routes := &lnrpc.QueryRoutesResponse{}
|
||||
err = jsonpb.UnmarshalString(jsonRoutes, routes)
|
||||
err = lnrpc.ProtoJSONUnmarshalOpts.Unmarshal([]byte(jsonRoutes), routes)
|
||||
if err == nil {
|
||||
if len(routes.Routes) == 0 {
|
||||
return fmt.Errorf("no routes provided")
|
||||
@@ -966,7 +965,9 @@ func sendToRoute(ctx *cli.Context) error {
|
||||
route = routes.Routes[0]
|
||||
} else {
|
||||
routes := &routerrpc.BuildRouteResponse{}
|
||||
err = jsonpb.UnmarshalString(jsonRoutes, routes)
|
||||
err = lnrpc.ProtoJSONUnmarshalOpts.Unmarshal(
|
||||
[]byte(jsonRoutes), routes,
|
||||
)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unable to unmarshal json string "+
|
||||
"from incoming array of routes: %v", err)
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/walletrpc"
|
||||
@@ -720,7 +719,7 @@ func createWatchOnly(ctx *cli.Context) error {
|
||||
}
|
||||
|
||||
jsonAccts := &walletrpc.ListAccountsResponse{}
|
||||
err = jsonpb.Unmarshal(bytes.NewReader(jsonBytes), jsonAccts)
|
||||
err = lnrpc.ProtoJSONUnmarshalOpts.Unmarshal(jsonBytes, jsonAccts)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error parsing JSON: %v", err)
|
||||
}
|
||||
|
||||
+4
-11
@@ -5,6 +5,7 @@ import (
|
||||
"bytes"
|
||||
"context"
|
||||
"encoding/hex"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"io"
|
||||
@@ -17,9 +18,6 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/btcsuite/btcd/wire"
|
||||
"github.com/lightninglabs/protobuf-hex-display/json"
|
||||
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
|
||||
"github.com/lightninglabs/protobuf-hex-display/proto"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/routing"
|
||||
"github.com/lightningnetwork/lnd/routing/route"
|
||||
@@ -27,6 +25,7 @@ import (
|
||||
"github.com/urfave/cli"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
// TODO(roasbeef): cli logic for supporting both positional and unix style
|
||||
@@ -71,19 +70,13 @@ func printJSON(resp interface{}) {
|
||||
}
|
||||
|
||||
func printRespJSON(resp proto.Message) {
|
||||
jsonMarshaler := &jsonpb.Marshaler{
|
||||
EmitDefaults: true,
|
||||
OrigName: true,
|
||||
Indent: " ",
|
||||
}
|
||||
|
||||
jsonStr, err := jsonMarshaler.MarshalToString(resp)
|
||||
jsonBytes, err := lnrpc.ProtoJSONMarshalOpts.Marshal(resp)
|
||||
if err != nil {
|
||||
fmt.Println("unable to decode response: ", err)
|
||||
return
|
||||
}
|
||||
|
||||
fmt.Println(jsonStr)
|
||||
fmt.Printf("%s\n", jsonBytes)
|
||||
}
|
||||
|
||||
// actionDecorator is used to add additional information and error handling
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
|
||||
"github.com/lightninglabs/protobuf-hex-display/jsonpb"
|
||||
"github.com/lightningnetwork/lnd/lncfg"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/devrpc"
|
||||
@@ -43,14 +41,14 @@ func importGraph(ctx *cli.Context) error {
|
||||
defer cleanUp()
|
||||
|
||||
jsonFile := lncfg.CleanAndExpandPath(ctx.Args().First())
|
||||
jsonBytes, err := ioutil.ReadFile(jsonFile)
|
||||
jsonBytes, err := os.ReadFile(jsonFile)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error reading JSON from file %v: %v",
|
||||
jsonFile, err)
|
||||
}
|
||||
|
||||
jsonGraph := &lnrpc.ChannelGraph{}
|
||||
err = jsonpb.Unmarshal(bytes.NewReader(jsonBytes), jsonGraph)
|
||||
err = lnrpc.ProtoJSONUnmarshalOpts.Unmarshal(jsonBytes, jsonGraph)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error parsing JSON: %v", err)
|
||||
}
|
||||
|
||||
@@ -44,6 +44,13 @@ unlock or create.
|
||||
* [Restore support](https://github.com/lightningnetwork/lnd/pull/7678) for
|
||||
`PKCS8`-encoded cert private keys.
|
||||
|
||||
## Code Health
|
||||
|
||||
* Updated [our fork for serializing protobuf as JSON to be based on the
|
||||
latest version of `google.golang.org/protobuf` instead of the deprecated
|
||||
`github.com/golang/protobuf/jsonpb`
|
||||
module](https://github.com/lightningnetwork/lnd/pull/7659).
|
||||
|
||||
# Contributors (Alphabetical Order)
|
||||
|
||||
* Carla Kirk-Cohen
|
||||
@@ -52,4 +59,5 @@ unlock or create.
|
||||
* Erik Arvstedt
|
||||
* hieblmi
|
||||
* Jordi Montes
|
||||
* Oliver Gugger
|
||||
* ziggie1984
|
||||
@@ -18,7 +18,6 @@ require (
|
||||
github.com/davecgh/go-spew v1.1.1
|
||||
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1
|
||||
github.com/go-errors/errors v1.0.1
|
||||
github.com/golang/protobuf v1.5.2
|
||||
github.com/gorilla/websocket v1.4.2
|
||||
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0
|
||||
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0
|
||||
@@ -32,7 +31,6 @@ require (
|
||||
github.com/kkdai/bstream v1.0.0
|
||||
github.com/lightninglabs/neutrino v0.15.0
|
||||
github.com/lightninglabs/neutrino/cache v1.1.1
|
||||
github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display
|
||||
github.com/lightningnetwork/lightning-onion v1.2.1-0.20221202012345-ca23184850a1
|
||||
github.com/lightningnetwork/lnd/cert v1.2.1
|
||||
github.com/lightningnetwork/lnd/clock v1.1.0
|
||||
@@ -58,7 +56,7 @@ require (
|
||||
golang.org/x/term v0.6.0
|
||||
golang.org/x/time v0.0.0-20210220033141-f8bda1e9f3ba
|
||||
google.golang.org/grpc v1.41.0
|
||||
google.golang.org/protobuf v1.27.1
|
||||
google.golang.org/protobuf v1.30.0
|
||||
gopkg.in/macaroon-bakery.v2 v2.0.1
|
||||
gopkg.in/macaroon.v2 v2.0.0
|
||||
)
|
||||
@@ -85,6 +83,7 @@ require (
|
||||
github.com/fergusstrange/embedded-postgres v1.10.0 // indirect
|
||||
github.com/gogo/protobuf v1.3.2 // indirect
|
||||
github.com/golang-jwt/jwt/v4 v4.4.2 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.4 // indirect
|
||||
github.com/google/btree v1.0.1 // indirect
|
||||
github.com/google/uuid v1.3.0 // indirect
|
||||
@@ -129,7 +128,7 @@ require (
|
||||
github.com/stretchr/objx v0.5.0 // indirect
|
||||
github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // indirect
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 // indirect
|
||||
github.com/ulikunitz/xz v0.5.10 // indirect
|
||||
github.com/ulikunitz/xz v0.5.11 // indirect
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 // indirect
|
||||
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2 // indirect
|
||||
gitlab.com/yawning/bsaes.git v0.0.0-20190805113838-0a714cd429ec // indirect
|
||||
@@ -172,16 +171,17 @@ require (
|
||||
sigs.k8s.io/yaml v1.2.0 // indirect
|
||||
)
|
||||
|
||||
// This replace is for https://github.com/advisories/GHSA-w73w-5m7g-f7qc
|
||||
replace github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt v3.2.1+incompatible
|
||||
|
||||
// This replace is for https://github.com/advisories/GHSA-25xm-hr59-7c27
|
||||
replace github.com/ulikunitz/xz => github.com/ulikunitz/xz v0.5.8
|
||||
replace github.com/ulikunitz/xz => github.com/ulikunitz/xz v0.5.11
|
||||
|
||||
// This replace is for
|
||||
// https://deps.dev/advisory/OSV/GO-2021-0053?from=%2Fgo%2Fgithub.com%252Fgogo%252Fprotobuf%2Fv1.3.1
|
||||
replace github.com/gogo/protobuf => github.com/gogo/protobuf v1.3.2
|
||||
|
||||
// We want to format raw bytes as hex instead of base64. The forked version
|
||||
// allows us to specify that as an option.
|
||||
replace google.golang.org/protobuf => github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display
|
||||
|
||||
// If you change this please also update .github/pull_request_template.md and
|
||||
// docs/INSTALL.md.
|
||||
go 1.19
|
||||
|
||||
@@ -215,10 +215,6 @@ github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5y
|
||||
github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
|
||||
github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk=
|
||||
github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
|
||||
github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
|
||||
github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
|
||||
github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
|
||||
github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
|
||||
github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8=
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
@@ -395,8 +391,8 @@ github.com/lightninglabs/neutrino v0.15.0 h1:yr3uz36fLAq8hyM0TRUVlef1TRNoWAqpmmN
|
||||
github.com/lightninglabs/neutrino v0.15.0/go.mod h1:pmjwElN/091TErtSE9Vd5W4hpxoG2/+xlb+HoPm9Gug=
|
||||
github.com/lightninglabs/neutrino/cache v1.1.1 h1:TllWOSlkABhpgbWJfzsrdUaDH2fBy/54VSIB4vVqV8M=
|
||||
github.com/lightninglabs/neutrino/cache v1.1.1/go.mod h1:XJNcgdOw1LQnanGjw8Vj44CvguYA25IMKjWFZczwZuo=
|
||||
github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display h1:RZJ8H4ueU/aQ9pFtx5wqsuD3B/DezrewJeVwDKKYY8E=
|
||||
github.com/lightninglabs/protobuf-hex-display v1.4.3-hex-display/go.mod h1:2oKOBU042GKFHrdbgGiKax4xVrFiZu51lhacUZQ9MnE=
|
||||
github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display h1:pRdza2wleRN1L2fJXd6ZoQ9ZegVFTAb2bOQfruJPKcY=
|
||||
github.com/lightninglabs/protobuf-go-hex-display v1.30.0-hex-display/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
github.com/lightningnetwork/lightning-onion v1.2.1-0.20221202012345-ca23184850a1 h1:Wm0g70gkcAu2pGpNZwfWPSVOY21j8IyYsNewwK4OkT4=
|
||||
github.com/lightningnetwork/lightning-onion v1.2.1-0.20221202012345-ca23184850a1/go.mod h1:7dDx73ApjEZA0kcknI799m2O5kkpfg4/gr7N092ojNo=
|
||||
github.com/lightningnetwork/lnd/cert v1.2.1 h1:CTrTcU0L66J73oqdRLVfNylZyp1Fh97ZezX6IuzkrqE=
|
||||
@@ -544,8 +540,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802 h1:uruHq4
|
||||
github.com/tmc/grpc-websocket-proxy v0.0.0-20201229170055-e5319fda7802/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U=
|
||||
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02 h1:tcJ6OjwOMvExLlzrAVZute09ocAGa7KqOON60++Gz4E=
|
||||
github.com/tv42/zbase32 v0.0.0-20160707012821-501572607d02/go.mod h1:tHlrkM198S068ZqfrO6S8HsoJq2bF3ETfTL+kt4tInY=
|
||||
github.com/ulikunitz/xz v0.5.8 h1:ERv8V6GKqVi23rgu5cj9pVfVzJbOqAY2Ntl88O6c2nQ=
|
||||
github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/ulikunitz/xz v0.5.11 h1:kpFauv27b6ynzBNT/Xy+1k+fK4WswhN/6PN5WhFAGw8=
|
||||
github.com/ulikunitz/xz v0.5.11/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14=
|
||||
github.com/urfave/cli v1.22.9 h1:cv3/KhXGBGjEXLC4bH0sLuJ9BewaAbpk5oyMOveu4pw=
|
||||
github.com/urfave/cli v1.22.9/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0=
|
||||
github.com/xi2/xz v0.0.0-20171230120015-48954b6210f8 h1:nIPpBwaJSVYIxUFsDv3M8ofmx9yWTog9BfvIu0q41lo=
|
||||
@@ -935,20 +931,6 @@ google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQ
|
||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||
google.golang.org/grpc v1.41.0 h1:f+PlOh7QV4iIJkPrx5NQ7qaNGFQ3OTse67yaDHfju4E=
|
||||
google.golang.org/grpc v1.41.0/go.mod h1:U3l9uK9J0sini8mHphKoXyaqDA/8VyGnDee1zzIUK6k=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
|
||||
google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
|
||||
google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20160105164936-4f90aeace3a2/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@@ -9,13 +9,13 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
"github.com/lightningnetwork/lnd/lntest/node"
|
||||
"github.com/lightningnetwork/lnd/macaroons"
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
|
||||
|
||||
+30
-28
@@ -7,15 +7,12 @@ import (
|
||||
"encoding/hex"
|
||||
"fmt"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"net/http"
|
||||
"regexp"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/golang/protobuf/jsonpb"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/gorilla/websocket"
|
||||
"github.com/lightningnetwork/lnd/lnrpc"
|
||||
"github.com/lightningnetwork/lnd/lnrpc/autopilotrpc"
|
||||
@@ -26,6 +23,7 @@ import (
|
||||
"github.com/lightningnetwork/lnd/lntest"
|
||||
"github.com/lightningnetwork/lnd/lntest/node"
|
||||
"github.com/stretchr/testify/require"
|
||||
"google.golang.org/protobuf/proto"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -35,11 +33,6 @@ var (
|
||||
restClient = &http.Client{
|
||||
Transport: insecureTransport,
|
||||
}
|
||||
jsonMarshaler = &jsonpb.Marshaler{
|
||||
EmitDefaults: true,
|
||||
OrigName: true,
|
||||
Indent: " ",
|
||||
}
|
||||
urlEnc = base64.URLEncoding
|
||||
webSocketDialer = &websocket.Dialer{
|
||||
HandshakeTimeout: time.Second,
|
||||
@@ -288,7 +281,9 @@ func wsTestCaseSubscription(ht *lntest.HarnessTest) {
|
||||
// Make sure we can parse the unwrapped message into the
|
||||
// expected proto message.
|
||||
protoMsg := &chainrpc.BlockEpoch{}
|
||||
err = jsonpb.UnmarshalString(msgStr, protoMsg)
|
||||
err = lnrpc.RESTJsonUnmarshalOpts.Unmarshal(
|
||||
[]byte(msgStr), protoMsg,
|
||||
)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
@@ -378,7 +373,9 @@ func wsTestCaseSubscriptionMacaroon(ht *lntest.HarnessTest) {
|
||||
// Make sure we can parse the unwrapped message into the
|
||||
// expected proto message.
|
||||
protoMsg := &chainrpc.BlockEpoch{}
|
||||
err = jsonpb.UnmarshalString(msgStr, protoMsg)
|
||||
err = lnrpc.RESTJsonUnmarshalOpts.Unmarshal(
|
||||
[]byte(msgStr), protoMsg,
|
||||
)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
@@ -474,7 +471,9 @@ func wsTestCaseBiDirectionalSubscription(ht *lntest.HarnessTest) {
|
||||
// Make sure we can parse the unwrapped message into the
|
||||
// expected proto message.
|
||||
protoMsg := &lnrpc.ChannelAcceptRequest{}
|
||||
err = jsonpb.UnmarshalString(msgStr, protoMsg)
|
||||
err = lnrpc.RESTJsonUnmarshalOpts.Unmarshal(
|
||||
[]byte(msgStr), protoMsg,
|
||||
)
|
||||
if err != nil {
|
||||
select {
|
||||
case errChan <- err:
|
||||
@@ -488,7 +487,8 @@ func wsTestCaseBiDirectionalSubscription(ht *lntest.HarnessTest) {
|
||||
Accept: true,
|
||||
PendingChanId: protoMsg.PendingChanId,
|
||||
}
|
||||
resMsg, err := jsonMarshaler.MarshalToString(res)
|
||||
|
||||
resMsg, err := lnrpc.RESTJsonMarshalOpts.Marshal(res)
|
||||
if err != nil {
|
||||
select {
|
||||
case errChan <- err:
|
||||
@@ -496,9 +496,7 @@ func wsTestCaseBiDirectionalSubscription(ht *lntest.HarnessTest) {
|
||||
}
|
||||
return
|
||||
}
|
||||
err = conn.WriteMessage(
|
||||
websocket.TextMessage, []byte(resMsg),
|
||||
)
|
||||
err = conn.WriteMessage(websocket.TextMessage, resMsg)
|
||||
if err != nil {
|
||||
select {
|
||||
case errChan <- err:
|
||||
@@ -613,7 +611,9 @@ func wsTestPingPongTimeout(ht *lntest.HarnessTest) {
|
||||
// Make sure we can parse the unwrapped message into the
|
||||
// expected proto message.
|
||||
protoMsg := &lnrpc.Invoice{}
|
||||
err = jsonpb.UnmarshalString(msgStr, protoMsg)
|
||||
err = lnrpc.RESTJsonUnmarshalOpts.Unmarshal(
|
||||
[]byte(msgStr), protoMsg,
|
||||
)
|
||||
if err != nil {
|
||||
select {
|
||||
case errChan <- err:
|
||||
@@ -684,7 +684,7 @@ func invokeGET(node *node.HarnessNode, url string, resp proto.Message) error {
|
||||
return err
|
||||
}
|
||||
|
||||
return jsonpb.Unmarshal(bytes.NewReader(rawResp), resp)
|
||||
return lnrpc.RESTJsonUnmarshalOpts.Unmarshal(rawResp, resp)
|
||||
}
|
||||
|
||||
// invokePOST calls the given URL with the POST method, request body and
|
||||
@@ -693,19 +693,21 @@ func invokeGET(node *node.HarnessNode, url string, resp proto.Message) error {
|
||||
func invokePOST(node *node.HarnessNode, url string, req,
|
||||
resp proto.Message) error {
|
||||
|
||||
// Marshal the request to JSON using the jsonpb marshaler to get correct
|
||||
// Marshal the request to JSON using the REST marshaler to get correct
|
||||
// field names.
|
||||
var buf bytes.Buffer
|
||||
if err := jsonMarshaler.Marshal(&buf, req); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, rawResp, err := makeRequest(node, url, "POST", &buf, nil)
|
||||
reqBytes, err := lnrpc.RESTJsonMarshalOpts.Marshal(req)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return jsonpb.Unmarshal(bytes.NewReader(rawResp), resp)
|
||||
_, rawResp, err := makeRequest(
|
||||
node, url, "POST", bytes.NewReader(reqBytes), nil,
|
||||
)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return lnrpc.RESTJsonUnmarshalOpts.Unmarshal(rawResp, resp)
|
||||
}
|
||||
|
||||
// makeRequest calls the given URL with the given method, request body and
|
||||
@@ -737,7 +739,7 @@ func makeRequest(node *node.HarnessNode, url, method string,
|
||||
}
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
data, err := ioutil.ReadAll(resp.Body)
|
||||
data, err := io.ReadAll(resp.Body)
|
||||
return resp.Header, data, err
|
||||
}
|
||||
|
||||
@@ -766,11 +768,11 @@ func openWebSocket(node *node.HarnessNode, url, method string,
|
||||
defer func() { _ = resp.Body.Close() }()
|
||||
|
||||
// Send the given request message as the first message on the socket.
|
||||
reqMsg, err := jsonMarshaler.MarshalToString(req)
|
||||
reqMsg, err := lnrpc.RESTJsonMarshalOpts.Marshal(req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
err = conn.WriteMessage(websocket.TextMessage, []byte(reqMsg))
|
||||
err = conn.WriteMessage(websocket.TextMessage, reqMsg)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -37,7 +37,6 @@ import (
|
||||
"github.com/lightningnetwork/lnd/watchtower"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
"gopkg.in/macaroon-bakery.v2/bakery"
|
||||
"gopkg.in/macaroon.v2"
|
||||
)
|
||||
@@ -857,10 +856,8 @@ func startRestProxy(cfg *Config, rpcServer *rpcServer, restDialOpts []grpc.DialO
|
||||
// that the marshaler prints all values, even if they are falsey.
|
||||
customMarshalerOption := proxy.WithMarshalerOption(
|
||||
proxy.MIMEWildcard, &proxy.JSONPb{
|
||||
MarshalOptions: protojson.MarshalOptions{
|
||||
UseProtoNames: true,
|
||||
EmitUnpopulated: true,
|
||||
},
|
||||
MarshalOptions: *lnrpc.RESTJsonMarshalOpts,
|
||||
UnmarshalOptions: *lnrpc.RESTJsonUnmarshalOpts,
|
||||
},
|
||||
)
|
||||
mux := proxy.NewServeMux(
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: autopilotrpc/autopilot.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: chainrpc/chainkit.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: chainrpc/chainnotifier.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: devrpc/dev.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: invoicesrpc/invoices.proto
|
||||
|
||||
|
||||
+71
-71
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: lightning.proto
|
||||
|
||||
@@ -1826,7 +1826,7 @@ type Transaction struct {
|
||||
// Addresses that received funds for this transaction. Deprecated as it is
|
||||
// now incorporated in the output_details field.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
DestAddresses []string `protobuf:"bytes,8,rep,name=dest_addresses,json=destAddresses,proto3" json:"dest_addresses,omitempty"`
|
||||
// Outputs that received funds for this transaction
|
||||
OutputDetails []*OutputDetail `protobuf:"bytes,11,rep,name=output_details,json=outputDetails,proto3" json:"output_details,omitempty"`
|
||||
@@ -1919,7 +1919,7 @@ func (x *Transaction) GetTotalFees() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Transaction) GetDestAddresses() []string {
|
||||
if x != nil {
|
||||
return x.DestAddresses
|
||||
@@ -2187,7 +2187,7 @@ type SendRequest struct {
|
||||
// The hex-encoded identity pubkey of the payment recipient. Deprecated now
|
||||
// that the REST gateway supports base64 encoding of bytes fields.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
DestString string `protobuf:"bytes,2,opt,name=dest_string,json=destString,proto3" json:"dest_string,omitempty"`
|
||||
// The amount to send expressed in satoshis.
|
||||
//
|
||||
@@ -2203,7 +2203,7 @@ type SendRequest struct {
|
||||
// The hex-encoded hash to use within the payment's HTLC. Deprecated now
|
||||
// that the REST gateway supports base64 encoding of bytes fields.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
PaymentHashString string `protobuf:"bytes,5,opt,name=payment_hash_string,json=paymentHashString,proto3" json:"payment_hash_string,omitempty"`
|
||||
// A bare-bones invoice for a payment within the Lightning Network. With the
|
||||
// details of the invoice, the sender has all the data necessary to send a
|
||||
@@ -2284,7 +2284,7 @@ func (x *SendRequest) GetDest() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *SendRequest) GetDestString() string {
|
||||
if x != nil {
|
||||
return x.DestString
|
||||
@@ -2313,7 +2313,7 @@ func (x *SendRequest) GetPaymentHash() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *SendRequest) GetPaymentHashString() string {
|
||||
if x != nil {
|
||||
return x.PaymentHashString
|
||||
@@ -2473,7 +2473,7 @@ type SendToRouteRequest struct {
|
||||
// An optional hex-encoded payment hash to be used for the HTLC. Deprecated now
|
||||
// that the REST gateway supports base64 encoding of bytes fields.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
PaymentHashString string `protobuf:"bytes,2,opt,name=payment_hash_string,json=paymentHashString,proto3" json:"payment_hash_string,omitempty"`
|
||||
// Route that should be used to attempt to complete the payment.
|
||||
Route *Route `protobuf:"bytes,4,opt,name=route,proto3" json:"route,omitempty"`
|
||||
@@ -2518,7 +2518,7 @@ func (x *SendToRouteRequest) GetPaymentHash() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *SendToRouteRequest) GetPaymentHashString() string {
|
||||
if x != nil {
|
||||
return x.PaymentHashString
|
||||
@@ -3239,7 +3239,7 @@ type EstimateFeeResponse struct {
|
||||
// Deprecated, use sat_per_vbyte.
|
||||
// The fee rate in satoshi/vbyte.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
FeerateSatPerByte int64 `protobuf:"varint,2,opt,name=feerate_sat_per_byte,json=feerateSatPerByte,proto3" json:"feerate_sat_per_byte,omitempty"`
|
||||
// The fee rate in satoshi/vbyte.
|
||||
SatPerVbyte uint64 `protobuf:"varint,3,opt,name=sat_per_vbyte,json=satPerVbyte,proto3" json:"sat_per_vbyte,omitempty"`
|
||||
@@ -3284,7 +3284,7 @@ func (x *EstimateFeeResponse) GetFeeSat() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *EstimateFeeResponse) GetFeerateSatPerByte() int64 {
|
||||
if x != nil {
|
||||
return x.FeerateSatPerByte
|
||||
@@ -3316,7 +3316,7 @@ type SendManyRequest struct {
|
||||
// A manual fee rate set in sat/vbyte that should be used when crafting the
|
||||
// transaction.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
SatPerByte int64 `protobuf:"varint,5,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
|
||||
// An optional label for the transaction, limited to 500 characters.
|
||||
Label string `protobuf:"bytes,6,opt,name=label,proto3" json:"label,omitempty"`
|
||||
@@ -3380,7 +3380,7 @@ func (x *SendManyRequest) GetSatPerVbyte() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *SendManyRequest) GetSatPerByte() int64 {
|
||||
if x != nil {
|
||||
return x.SatPerByte
|
||||
@@ -3476,7 +3476,7 @@ type SendCoinsRequest struct {
|
||||
// A manual fee rate set in sat/vbyte that should be used when crafting the
|
||||
// transaction.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
SatPerByte int64 `protobuf:"varint,5,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
|
||||
// If set, then the amount field will be ignored, and lnd will attempt to
|
||||
// send all the coins under control of the internal wallet to the specified
|
||||
@@ -3551,7 +3551,7 @@ func (x *SendCoinsRequest) GetSatPerVbyte() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *SendCoinsRequest) GetSatPerByte() int64 {
|
||||
if x != nil {
|
||||
return x.SatPerByte
|
||||
@@ -4516,7 +4516,7 @@ type Channel struct {
|
||||
// force closed, we will need to wait for this many blocks before we can regain
|
||||
// our funds.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
CsvDelay uint32 `protobuf:"varint,16,opt,name=csv_delay,json=csvDelay,proto3" json:"csv_delay,omitempty"`
|
||||
// Whether this channel is advertised to the network or not.
|
||||
Private bool `protobuf:"varint,17,opt,name=private,proto3" json:"private,omitempty"`
|
||||
@@ -4527,16 +4527,16 @@ type Channel struct {
|
||||
// Deprecated. The minimum satoshis this node is required to reserve in its
|
||||
// balance.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
LocalChanReserveSat int64 `protobuf:"varint,20,opt,name=local_chan_reserve_sat,json=localChanReserveSat,proto3" json:"local_chan_reserve_sat,omitempty"`
|
||||
// Deprecated. The minimum satoshis the other node is required to reserve in
|
||||
// its balance.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
RemoteChanReserveSat int64 `protobuf:"varint,21,opt,name=remote_chan_reserve_sat,json=remoteChanReserveSat,proto3" json:"remote_chan_reserve_sat,omitempty"`
|
||||
// Deprecated. Use commitment_type.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
StaticRemoteKey bool `protobuf:"varint,22,opt,name=static_remote_key,json=staticRemoteKey,proto3" json:"static_remote_key,omitempty"`
|
||||
// The commitment type used by this channel.
|
||||
CommitmentType CommitmentType `protobuf:"varint,26,opt,name=commitment_type,json=commitmentType,proto3,enum=lnrpc.CommitmentType" json:"commitment_type,omitempty"`
|
||||
@@ -4722,7 +4722,7 @@ func (x *Channel) GetPendingHtlcs() []*HTLC {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Channel) GetCsvDelay() uint32 {
|
||||
if x != nil {
|
||||
return x.CsvDelay
|
||||
@@ -4751,7 +4751,7 @@ func (x *Channel) GetChanStatusFlags() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Channel) GetLocalChanReserveSat() int64 {
|
||||
if x != nil {
|
||||
return x.LocalChanReserveSat
|
||||
@@ -4759,7 +4759,7 @@ func (x *Channel) GetLocalChanReserveSat() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Channel) GetRemoteChanReserveSat() int64 {
|
||||
if x != nil {
|
||||
return x.RemoteChanReserveSat
|
||||
@@ -4767,7 +4767,7 @@ func (x *Channel) GetRemoteChanReserveSat() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Channel) GetStaticRemoteKey() bool {
|
||||
if x != nil {
|
||||
return x.StaticRemoteKey
|
||||
@@ -6044,7 +6044,7 @@ type GetInfoResponse struct {
|
||||
// Whether the current node is connected to testnet. This field is
|
||||
// deprecated and the network field should be used instead
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Testnet bool `protobuf:"varint,10,opt,name=testnet,proto3" json:"testnet,omitempty"`
|
||||
// A list of active chains the node is connected to
|
||||
Chains []*Chain `protobuf:"bytes,16,rep,name=chains,proto3" json:"chains,omitempty"`
|
||||
@@ -6189,7 +6189,7 @@ func (x *GetInfoResponse) GetSyncedToGraph() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *GetInfoResponse) GetTestnet() bool {
|
||||
if x != nil {
|
||||
return x.Testnet
|
||||
@@ -6577,7 +6577,7 @@ type CloseChannelRequest struct {
|
||||
// A manual fee rate set in sat/vbyte that should be used when crafting the
|
||||
// closure transaction.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
SatPerByte int64 `protobuf:"varint,4,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
|
||||
// An optional address to send funds to in the case of a cooperative close.
|
||||
// If the channel was opened with an upfront shutdown script and this field
|
||||
@@ -6646,7 +6646,7 @@ func (x *CloseChannelRequest) GetTargetConf() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *CloseChannelRequest) GetSatPerByte() int64 {
|
||||
if x != nil {
|
||||
return x.SatPerByte
|
||||
@@ -7175,7 +7175,7 @@ type OpenChannelRequest struct {
|
||||
// The hex encoded pubkey of the node to open a channel with. Deprecated now
|
||||
// that the REST gateway supports base64 encoding of bytes fields.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
NodePubkeyString string `protobuf:"bytes,3,opt,name=node_pubkey_string,json=nodePubkeyString,proto3" json:"node_pubkey_string,omitempty"`
|
||||
// The number of satoshis the wallet should commit to the channel
|
||||
LocalFundingAmount int64 `protobuf:"varint,4,opt,name=local_funding_amount,json=localFundingAmount,proto3" json:"local_funding_amount,omitempty"`
|
||||
@@ -7189,7 +7189,7 @@ type OpenChannelRequest struct {
|
||||
// A manual fee rate set in sat/vbyte that should be used when crafting the
|
||||
// funding transaction.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
SatPerByte int64 `protobuf:"varint,7,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
|
||||
// Whether this channel should be private, not announced to the greater
|
||||
// network.
|
||||
@@ -7309,7 +7309,7 @@ func (x *OpenChannelRequest) GetNodePubkey() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *OpenChannelRequest) GetNodePubkeyString() string {
|
||||
if x != nil {
|
||||
return x.NodePubkeyString
|
||||
@@ -7338,7 +7338,7 @@ func (x *OpenChannelRequest) GetTargetConf() int32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *OpenChannelRequest) GetSatPerByte() int64 {
|
||||
if x != nil {
|
||||
return x.SatPerByte
|
||||
@@ -8463,7 +8463,7 @@ type PendingChannelsResponse struct {
|
||||
// closed channels with a single confirmation. These channels are now
|
||||
// considered closed from the time we see them on chain.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
PendingClosingChannels []*PendingChannelsResponse_ClosedChannel `protobuf:"bytes,3,rep,name=pending_closing_channels,json=pendingClosingChannels,proto3" json:"pending_closing_channels,omitempty"`
|
||||
// Channels pending force closing
|
||||
PendingForceClosingChannels []*PendingChannelsResponse_ForceClosedChannel `protobuf:"bytes,4,rep,name=pending_force_closing_channels,json=pendingForceClosingChannels,proto3" json:"pending_force_closing_channels,omitempty"`
|
||||
@@ -8517,7 +8517,7 @@ func (x *PendingChannelsResponse) GetPendingOpenChannels() []*PendingChannelsRes
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *PendingChannelsResponse) GetPendingClosingChannels() []*PendingChannelsResponse_ClosedChannel {
|
||||
if x != nil {
|
||||
return x.PendingClosingChannels
|
||||
@@ -9013,11 +9013,11 @@ type ChannelBalanceResponse struct {
|
||||
|
||||
// Deprecated. Sum of channels balances denominated in satoshis
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Balance int64 `protobuf:"varint,1,opt,name=balance,proto3" json:"balance,omitempty"`
|
||||
// Deprecated. Sum of channels pending balances denominated in satoshis
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
PendingOpenBalance int64 `protobuf:"varint,2,opt,name=pending_open_balance,json=pendingOpenBalance,proto3" json:"pending_open_balance,omitempty"`
|
||||
// Sum of channels local balances.
|
||||
LocalBalance *Amount `protobuf:"bytes,3,opt,name=local_balance,json=localBalance,proto3" json:"local_balance,omitempty"`
|
||||
@@ -9065,7 +9065,7 @@ func (*ChannelBalanceResponse) Descriptor() ([]byte, []int) {
|
||||
return file_lightning_proto_rawDescGZIP(), []int{94}
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *ChannelBalanceResponse) GetBalance() int64 {
|
||||
if x != nil {
|
||||
return x.Balance
|
||||
@@ -9073,7 +9073,7 @@ func (x *ChannelBalanceResponse) GetBalance() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *ChannelBalanceResponse) GetPendingOpenBalance() int64 {
|
||||
if x != nil {
|
||||
return x.PendingOpenBalance
|
||||
@@ -9155,7 +9155,7 @@ type QueryRoutesRequest struct {
|
||||
IgnoredNodes [][]byte `protobuf:"bytes,6,rep,name=ignored_nodes,json=ignoredNodes,proto3" json:"ignored_nodes,omitempty"`
|
||||
// Deprecated. A list of edges to ignore during path finding.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
IgnoredEdges []*EdgeLocator `protobuf:"bytes,7,rep,name=ignored_edges,json=ignoredEdges,proto3" json:"ignored_edges,omitempty"`
|
||||
// The source node where the request route should originated from. If empty,
|
||||
// self is assumed.
|
||||
@@ -9268,7 +9268,7 @@ func (x *QueryRoutesRequest) GetIgnoredNodes() [][]byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *QueryRoutesRequest) GetIgnoredEdges() []*EdgeLocator {
|
||||
if x != nil {
|
||||
return x.IgnoredEdges
|
||||
@@ -9533,11 +9533,11 @@ type Hop struct {
|
||||
// height, the next 3 the index within the block, and the last 2 bytes are the
|
||||
// output index for the channel.
|
||||
ChanId uint64 `protobuf:"varint,1,opt,name=chan_id,json=chanId,proto3" json:"chan_id,omitempty"`
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
ChanCapacity int64 `protobuf:"varint,2,opt,name=chan_capacity,json=chanCapacity,proto3" json:"chan_capacity,omitempty"`
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
AmtToForward int64 `protobuf:"varint,3,opt,name=amt_to_forward,json=amtToForward,proto3" json:"amt_to_forward,omitempty"`
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Fee int64 `protobuf:"varint,4,opt,name=fee,proto3" json:"fee,omitempty"`
|
||||
Expiry uint32 `protobuf:"varint,5,opt,name=expiry,proto3" json:"expiry,omitempty"`
|
||||
AmtToForwardMsat int64 `protobuf:"varint,6,opt,name=amt_to_forward_msat,json=amtToForwardMsat,proto3" json:"amt_to_forward_msat,omitempty"`
|
||||
@@ -9549,7 +9549,7 @@ type Hop struct {
|
||||
// TLV format. Note that if any custom tlv_records below are specified, then
|
||||
// this field MUST be set to true for them to be encoded properly.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
TlvPayload bool `protobuf:"varint,9,opt,name=tlv_payload,json=tlvPayload,proto3" json:"tlv_payload,omitempty"`
|
||||
// An optional TLV record that signals the use of an MPP payment. If present,
|
||||
// the receiver will enforce that the same mpp_record is included in the final
|
||||
@@ -9610,7 +9610,7 @@ func (x *Hop) GetChanId() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Hop) GetChanCapacity() int64 {
|
||||
if x != nil {
|
||||
return x.ChanCapacity
|
||||
@@ -9618,7 +9618,7 @@ func (x *Hop) GetChanCapacity() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Hop) GetAmtToForward() int64 {
|
||||
if x != nil {
|
||||
return x.AmtToForward
|
||||
@@ -9626,7 +9626,7 @@ func (x *Hop) GetAmtToForward() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Hop) GetFee() int64 {
|
||||
if x != nil {
|
||||
return x.Fee
|
||||
@@ -9662,7 +9662,7 @@ func (x *Hop) GetPubKey() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Hop) GetTlvPayload() bool {
|
||||
if x != nil {
|
||||
return x.TlvPayload
|
||||
@@ -9843,7 +9843,7 @@ type Route struct {
|
||||
// of a one-hop payment, this value will be zero as we don't need to pay a fee
|
||||
// to ourselves.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
TotalFees int64 `protobuf:"varint,2,opt,name=total_fees,json=totalFees,proto3" json:"total_fees,omitempty"`
|
||||
// The total amount of funds required to complete a payment over this route.
|
||||
// This value includes the cumulative fees at each hop. As a result, the HTLC
|
||||
@@ -9851,7 +9851,7 @@ type Route struct {
|
||||
// satoshis, otherwise the route will fail at an intermediate node due to an
|
||||
// insufficient amount of fees.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
TotalAmt int64 `protobuf:"varint,3,opt,name=total_amt,json=totalAmt,proto3" json:"total_amt,omitempty"`
|
||||
// Contains details concerning the specific forwarding details at each hop.
|
||||
Hops []*Hop `protobuf:"bytes,4,rep,name=hops,proto3" json:"hops,omitempty"`
|
||||
@@ -9900,7 +9900,7 @@ func (x *Route) GetTotalTimeLock() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Route) GetTotalFees() int64 {
|
||||
if x != nil {
|
||||
return x.TotalFees
|
||||
@@ -9908,7 +9908,7 @@ func (x *Route) GetTotalFees() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Route) GetTotalAmt() int64 {
|
||||
if x != nil {
|
||||
return x.TotalAmt
|
||||
@@ -10346,7 +10346,7 @@ type ChannelEdge struct {
|
||||
// output index for the channel.
|
||||
ChannelId uint64 `protobuf:"varint,1,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"`
|
||||
ChanPoint string `protobuf:"bytes,2,opt,name=chan_point,json=chanPoint,proto3" json:"chan_point,omitempty"`
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
LastUpdate uint32 `protobuf:"varint,3,opt,name=last_update,json=lastUpdate,proto3" json:"last_update,omitempty"`
|
||||
Node1Pub string `protobuf:"bytes,4,opt,name=node1_pub,json=node1Pub,proto3" json:"node1_pub,omitempty"`
|
||||
Node2Pub string `protobuf:"bytes,5,opt,name=node2_pub,json=node2Pub,proto3" json:"node2_pub,omitempty"`
|
||||
@@ -10403,7 +10403,7 @@ func (x *ChannelEdge) GetChanPoint() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *ChannelEdge) GetLastUpdate() uint32 {
|
||||
if x != nil {
|
||||
return x.LastUpdate
|
||||
@@ -11118,12 +11118,12 @@ type NodeUpdate struct {
|
||||
|
||||
// Deprecated, use node_addresses.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Addresses []string `protobuf:"bytes,1,rep,name=addresses,proto3" json:"addresses,omitempty"`
|
||||
IdentityKey string `protobuf:"bytes,2,opt,name=identity_key,json=identityKey,proto3" json:"identity_key,omitempty"`
|
||||
// Deprecated, use features.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
GlobalFeatures []byte `protobuf:"bytes,3,opt,name=global_features,json=globalFeatures,proto3" json:"global_features,omitempty"`
|
||||
Alias string `protobuf:"bytes,4,opt,name=alias,proto3" json:"alias,omitempty"`
|
||||
Color string `protobuf:"bytes,5,opt,name=color,proto3" json:"color,omitempty"`
|
||||
@@ -11165,7 +11165,7 @@ func (*NodeUpdate) Descriptor() ([]byte, []int) {
|
||||
return file_lightning_proto_rawDescGZIP(), []int{121}
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *NodeUpdate) GetAddresses() []string {
|
||||
if x != nil {
|
||||
return x.Addresses
|
||||
@@ -11180,7 +11180,7 @@ func (x *NodeUpdate) GetIdentityKey() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *NodeUpdate) GetGlobalFeatures() []byte {
|
||||
if x != nil {
|
||||
return x.GlobalFeatures
|
||||
@@ -11666,7 +11666,7 @@ type Invoice struct {
|
||||
//
|
||||
// The field is deprecated. Use the state field instead (compare to SETTLED).
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Settled bool `protobuf:"varint,6,opt,name=settled,proto3" json:"settled,omitempty"`
|
||||
// When this invoice was created.
|
||||
// Measured in seconds since the unix epoch.
|
||||
@@ -11713,7 +11713,7 @@ type Invoice struct {
|
||||
SettleIndex uint64 `protobuf:"varint,17,opt,name=settle_index,json=settleIndex,proto3" json:"settle_index,omitempty"`
|
||||
// Deprecated, use amt_paid_sat or amt_paid_msat.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
AmtPaid int64 `protobuf:"varint,18,opt,name=amt_paid,json=amtPaid,proto3" json:"amt_paid,omitempty"`
|
||||
// The amount that was accepted for this invoice, in satoshis. This will ONLY
|
||||
// be set if this invoice has been settled. We provide this field as if the
|
||||
@@ -11828,7 +11828,7 @@ func (x *Invoice) GetValueMsat() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Invoice) GetSettled() bool {
|
||||
if x != nil {
|
||||
return x.Settled
|
||||
@@ -11913,7 +11913,7 @@ func (x *Invoice) GetSettleIndex() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Invoice) GetAmtPaid() int64 {
|
||||
if x != nil {
|
||||
return x.AmtPaid
|
||||
@@ -12303,7 +12303,7 @@ type PaymentHash struct {
|
||||
// Deprecated now that the REST gateway supports base64 encoding of bytes
|
||||
// fields.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
RHashStr string `protobuf:"bytes,1,opt,name=r_hash_str,json=rHashStr,proto3" json:"r_hash_str,omitempty"`
|
||||
// The payment hash of the invoice to be looked up. When using REST, this field
|
||||
// must be encoded as base64.
|
||||
@@ -12342,7 +12342,7 @@ func (*PaymentHash) Descriptor() ([]byte, []int) {
|
||||
return file_lightning_proto_rawDescGZIP(), []int{132}
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *PaymentHash) GetRHashStr() string {
|
||||
if x != nil {
|
||||
return x.RHashStr
|
||||
@@ -12596,15 +12596,15 @@ type Payment struct {
|
||||
PaymentHash string `protobuf:"bytes,1,opt,name=payment_hash,json=paymentHash,proto3" json:"payment_hash,omitempty"`
|
||||
// Deprecated, use value_sat or value_msat.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Value int64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
|
||||
// Deprecated, use creation_time_ns
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
CreationDate int64 `protobuf:"varint,3,opt,name=creation_date,json=creationDate,proto3" json:"creation_date,omitempty"`
|
||||
// Deprecated, use fee_sat or fee_msat.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Fee int64 `protobuf:"varint,5,opt,name=fee,proto3" json:"fee,omitempty"`
|
||||
// The payment preimage
|
||||
PaymentPreimage string `protobuf:"bytes,6,opt,name=payment_preimage,json=paymentPreimage,proto3" json:"payment_preimage,omitempty"`
|
||||
@@ -12670,7 +12670,7 @@ func (x *Payment) GetPaymentHash() string {
|
||||
return ""
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Payment) GetValue() int64 {
|
||||
if x != nil {
|
||||
return x.Value
|
||||
@@ -12678,7 +12678,7 @@ func (x *Payment) GetValue() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Payment) GetCreationDate() int64 {
|
||||
if x != nil {
|
||||
return x.CreationDate
|
||||
@@ -12686,7 +12686,7 @@ func (x *Payment) GetCreationDate() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *Payment) GetFee() int64 {
|
||||
if x != nil {
|
||||
return x.Fee
|
||||
@@ -14285,7 +14285,7 @@ type ForwardingEvent struct {
|
||||
// Timestamp is the time (unix epoch offset) that this circuit was
|
||||
// completed. Deprecated by timestamp_ns.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
Timestamp uint64 `protobuf:"varint,1,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
|
||||
// The incoming channel ID that carried the HTLC that created the circuit.
|
||||
ChanIdIn uint64 `protobuf:"varint,2,opt,name=chan_id_in,json=chanIdIn,proto3" json:"chan_id_in,omitempty"`
|
||||
@@ -14349,7 +14349,7 @@ func (*ForwardingEvent) Descriptor() ([]byte, []int) {
|
||||
return file_lightning_proto_rawDescGZIP(), []int{158}
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in lightning.proto.
|
||||
func (x *ForwardingEvent) GetTimestamp() uint64 {
|
||||
if x != nil {
|
||||
return x.Timestamp
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: lnclipb/lncli.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: neutrinorpc/neutrino.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: peersrpc/peers.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: routerrpc/router.proto
|
||||
|
||||
@@ -448,7 +448,7 @@ type SendPaymentRequest struct {
|
||||
// be taken to the first hop. If zero, any channel may be used (unless
|
||||
// outgoing_chan_ids are set).
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
OutgoingChanId uint64 `protobuf:"varint,8,opt,name=outgoing_chan_id,json=outgoingChanId,proto3" json:"outgoing_chan_id,omitempty"`
|
||||
// The channel ids of the channels are allowed for the first hop. If empty,
|
||||
// any channel may be used.
|
||||
@@ -595,7 +595,7 @@ func (x *SendPaymentRequest) GetFeeLimitMsat() int64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
func (x *SendPaymentRequest) GetOutgoingChanId() uint64 {
|
||||
if x != nil {
|
||||
return x.OutgoingChanId
|
||||
@@ -1642,7 +1642,7 @@ type MissionControlConfig struct {
|
||||
// failures for longer, making mission control less likely to route through
|
||||
// nodes and channels that we have previously recorded failures for.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
HalfLifeSeconds uint64 `protobuf:"varint,1,opt,name=half_life_seconds,json=halfLifeSeconds,proto3" json:"half_life_seconds,omitempty"`
|
||||
// Deprecated, use AprioriParameters. The probability of success mission
|
||||
// control should assign to hop in a route where it has no other information
|
||||
@@ -1650,7 +1650,7 @@ type MissionControlConfig struct {
|
||||
// that we have no information about, lower values will discourage trying these
|
||||
// hops.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
HopProbability float32 `protobuf:"fixed32,2,opt,name=hop_probability,json=hopProbability,proto3" json:"hop_probability,omitempty"`
|
||||
// Deprecated, use AprioriParameters. The importance that mission control
|
||||
// should place on historical results, expressed as a value in [0;1]. Setting
|
||||
@@ -1659,7 +1659,7 @@ type MissionControlConfig struct {
|
||||
// ignores hop probability completely and relies entirely on historical
|
||||
// results, unless none are available.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
Weight float32 `protobuf:"fixed32,3,opt,name=weight,proto3" json:"weight,omitempty"`
|
||||
// The maximum number of payment results that mission control will store.
|
||||
MaximumPaymentResults uint32 `protobuf:"varint,4,opt,name=maximum_payment_results,json=maximumPaymentResults,proto3" json:"maximum_payment_results,omitempty"`
|
||||
@@ -1710,7 +1710,7 @@ func (*MissionControlConfig) Descriptor() ([]byte, []int) {
|
||||
return file_routerrpc_router_proto_rawDescGZIP(), []int{19}
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
func (x *MissionControlConfig) GetHalfLifeSeconds() uint64 {
|
||||
if x != nil {
|
||||
return x.HalfLifeSeconds
|
||||
@@ -1718,7 +1718,7 @@ func (x *MissionControlConfig) GetHalfLifeSeconds() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
func (x *MissionControlConfig) GetHopProbability() float32 {
|
||||
if x != nil {
|
||||
return x.HopProbability
|
||||
@@ -1726,7 +1726,7 @@ func (x *MissionControlConfig) GetHopProbability() float32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in routerrpc/router.proto.
|
||||
func (x *MissionControlConfig) GetWeight() float32 {
|
||||
if x != nil {
|
||||
return x.Weight
|
||||
|
||||
@@ -7,6 +7,7 @@ import (
|
||||
|
||||
"github.com/btcsuite/btcd/chaincfg/chainhash"
|
||||
"github.com/lightningnetwork/lnd/lnwallet"
|
||||
"google.golang.org/protobuf/encoding/protojson"
|
||||
)
|
||||
|
||||
const (
|
||||
@@ -16,6 +17,43 @@ const (
|
||||
RegisterRPCMiddlewareURI = "/lnrpc.Lightning/RegisterRPCMiddleware"
|
||||
)
|
||||
|
||||
var (
|
||||
// ProtoJSONMarshalOpts is a struct that holds the default marshal
|
||||
// options for marshaling protobuf messages into JSON in a
|
||||
// human-readable way. This should only be used in the CLI and in
|
||||
// integration tests.
|
||||
ProtoJSONMarshalOpts = &protojson.MarshalOptions{
|
||||
EmitUnpopulated: true,
|
||||
UseProtoNames: true,
|
||||
Indent: " ",
|
||||
UseHexForBytes: true,
|
||||
}
|
||||
|
||||
// ProtoJSONUnmarshalOpts is a struct that holds the default unmarshal
|
||||
// options for un-marshaling lncli JSON into protobuf messages. This
|
||||
// should only be used in the CLI and in integration tests.
|
||||
ProtoJSONUnmarshalOpts = &protojson.UnmarshalOptions{
|
||||
AllowPartial: false,
|
||||
UseHexForBytes: true,
|
||||
}
|
||||
|
||||
// RESTJsonMarshalOpts is a struct that holds the default marshal
|
||||
// options for marshaling protobuf messages into REST JSON in a
|
||||
// human-readable way. This should be used when interacting with the
|
||||
// REST proxy only.
|
||||
RESTJsonMarshalOpts = &protojson.MarshalOptions{
|
||||
EmitUnpopulated: true,
|
||||
UseProtoNames: true,
|
||||
}
|
||||
|
||||
// RESTJsonUnmarshalOpts is a struct that holds the default unmarshal
|
||||
// options for un-marshaling REST JSON into protobuf messages. This
|
||||
// should be used when interacting with the REST proxy only.
|
||||
RESTJsonUnmarshalOpts = &protojson.UnmarshalOptions{
|
||||
AllowPartial: false,
|
||||
}
|
||||
)
|
||||
|
||||
// RPCTransaction returns a rpc transaction.
|
||||
func RPCTransaction(tx *lnwallet.TransactionDetail) *Transaction {
|
||||
var destAddresses []string
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: signrpc/signer.proto
|
||||
|
||||
@@ -968,7 +968,7 @@ type SharedKeyRequest struct {
|
||||
// If this parameter is not set then the node's identity private key will be
|
||||
// used.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in signrpc/signer.proto.
|
||||
KeyLoc *KeyLocator `protobuf:"bytes,2,opt,name=key_loc,json=keyLoc,proto3" json:"key_loc,omitempty"`
|
||||
// A key descriptor describes the key used for performing ECDH. Either a key
|
||||
// locator or a raw public key is expected, if neither is supplied, defaults to
|
||||
@@ -1015,7 +1015,7 @@ func (x *SharedKeyRequest) GetEphemeralPubkey() []byte {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in signrpc/signer.proto.
|
||||
func (x *SharedKeyRequest) GetKeyLoc() *KeyLocator {
|
||||
if x != nil {
|
||||
return x.KeyLoc
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: stateservice.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: verrpc/verrpc.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: walletrpc/walletkit.proto
|
||||
|
||||
@@ -2597,7 +2597,7 @@ type PendingSweep struct {
|
||||
// rate is only determined once a sweeping transaction for the output is
|
||||
// created, so it's possible for this to be 0 before this.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in walletrpc/walletkit.proto.
|
||||
SatPerByte uint32 `protobuf:"varint,4,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
|
||||
// The number of broadcast attempts we've made to sweep the output.
|
||||
BroadcastAttempts uint32 `protobuf:"varint,5,opt,name=broadcast_attempts,json=broadcastAttempts,proto3" json:"broadcast_attempts,omitempty"`
|
||||
@@ -2609,7 +2609,7 @@ type PendingSweep struct {
|
||||
// Deprecated, use requested_sat_per_vbyte.
|
||||
// The requested fee rate, expressed in sat/vbyte, for this output.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in walletrpc/walletkit.proto.
|
||||
RequestedSatPerByte uint32 `protobuf:"varint,9,opt,name=requested_sat_per_byte,json=requestedSatPerByte,proto3" json:"requested_sat_per_byte,omitempty"`
|
||||
// The fee rate we'll use to sweep the output, expressed in sat/vbyte. The fee
|
||||
// rate is only determined once a sweeping transaction for the output is
|
||||
@@ -2675,7 +2675,7 @@ func (x *PendingSweep) GetAmountSat() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in walletrpc/walletkit.proto.
|
||||
func (x *PendingSweep) GetSatPerByte() uint32 {
|
||||
if x != nil {
|
||||
return x.SatPerByte
|
||||
@@ -2704,7 +2704,7 @@ func (x *PendingSweep) GetRequestedConfTarget() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in walletrpc/walletkit.proto.
|
||||
func (x *PendingSweep) GetRequestedSatPerByte() uint32 {
|
||||
if x != nil {
|
||||
return x.RequestedSatPerByte
|
||||
@@ -2832,7 +2832,7 @@ type BumpFeeRequest struct {
|
||||
// The fee rate, expressed in sat/vbyte, that should be used to spend the input
|
||||
// with.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in walletrpc/walletkit.proto.
|
||||
SatPerByte uint32 `protobuf:"varint,3,opt,name=sat_per_byte,json=satPerByte,proto3" json:"sat_per_byte,omitempty"`
|
||||
// Whether this input must be force-swept. This means that it is swept even
|
||||
// if it has a negative yield.
|
||||
@@ -2888,7 +2888,7 @@ func (x *BumpFeeRequest) GetTargetConf() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in walletrpc/walletkit.proto.
|
||||
func (x *BumpFeeRequest) GetSatPerByte() uint32 {
|
||||
if x != nil {
|
||||
return x.SatPerByte
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: walletunlocker.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: watchtowerrpc/watchtower.proto
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.27.1
|
||||
// protoc-gen-go v1.30.0
|
||||
// protoc v3.6.1
|
||||
// source: wtclientrpc/wtclient.proto
|
||||
|
||||
@@ -344,7 +344,7 @@ type TowerSession struct {
|
||||
// The fee rate, in satoshis per vbyte, that will be used by the watchtower for
|
||||
// the justice transaction in the event of a channel breach.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
SweepSatPerByte uint32 `protobuf:"varint,4,opt,name=sweep_sat_per_byte,json=sweepSatPerByte,proto3" json:"sweep_sat_per_byte,omitempty"`
|
||||
// The fee rate, in satoshis per vbyte, that will be used by the watchtower for
|
||||
// the justice transaction in the event of a channel breach.
|
||||
@@ -404,7 +404,7 @@ func (x *TowerSession) GetMaxBackups() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
func (x *TowerSession) GetSweepSatPerByte() uint32 {
|
||||
if x != nil {
|
||||
return x.SweepSatPerByte
|
||||
@@ -432,19 +432,19 @@ type Tower struct {
|
||||
// correct identifier in the client_type map.
|
||||
// Whether the watchtower is currently a candidate for new sessions.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
ActiveSessionCandidate bool `protobuf:"varint,3,opt,name=active_session_candidate,json=activeSessionCandidate,proto3" json:"active_session_candidate,omitempty"`
|
||||
// Deprecated, use the num_sessions field under the correct identifier
|
||||
// in the client_type map.
|
||||
// The number of sessions that have been negotiated with the watchtower.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
NumSessions uint32 `protobuf:"varint,4,opt,name=num_sessions,json=numSessions,proto3" json:"num_sessions,omitempty"`
|
||||
// Deprecated, use the sessions field under the correct identifier in the
|
||||
// client_type map.
|
||||
// The list of sessions that have been negotiated with the watchtower.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
Sessions []*TowerSession `protobuf:"bytes,5,rep,name=sessions,proto3" json:"sessions,omitempty"`
|
||||
// A list sessions held with the tower.
|
||||
SessionInfo []*TowerSessionInfo `protobuf:"bytes,6,rep,name=session_info,json=sessionInfo,proto3" json:"session_info,omitempty"`
|
||||
@@ -496,7 +496,7 @@ func (x *Tower) GetAddresses() []string {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
func (x *Tower) GetActiveSessionCandidate() bool {
|
||||
if x != nil {
|
||||
return x.ActiveSessionCandidate
|
||||
@@ -504,7 +504,7 @@ func (x *Tower) GetActiveSessionCandidate() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
func (x *Tower) GetNumSessions() uint32 {
|
||||
if x != nil {
|
||||
return x.NumSessions
|
||||
@@ -512,7 +512,7 @@ func (x *Tower) GetNumSessions() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
func (x *Tower) GetSessions() []*TowerSession {
|
||||
if x != nil {
|
||||
return x.Sessions
|
||||
@@ -893,7 +893,7 @@ type PolicyResponse struct {
|
||||
// The fee rate, in satoshis per vbyte, that will be used by watchtowers for
|
||||
// justice transactions in response to channel breaches.
|
||||
//
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
SweepSatPerByte uint32 `protobuf:"varint,2,opt,name=sweep_sat_per_byte,json=sweepSatPerByte,proto3" json:"sweep_sat_per_byte,omitempty"`
|
||||
// The fee rate, in satoshis per vbyte, that will be used by watchtowers for
|
||||
// justice transactions in response to channel breaches.
|
||||
@@ -939,7 +939,7 @@ func (x *PolicyResponse) GetMaxUpdates() uint32 {
|
||||
return 0
|
||||
}
|
||||
|
||||
// Deprecated: Do not use.
|
||||
// Deprecated: Marked as deprecated in wtclientrpc/wtclient.proto.
|
||||
func (x *PolicyResponse) GetSweepSatPerByte() uint32 {
|
||||
if x != nil {
|
||||
return x.SweepSatPerByte
|
||||
|
||||
Reference in new issue
Block a user