Skip to content

Commit

Permalink
Added support for LND 0.16.0 Beta
Browse files Browse the repository at this point in the history
  • Loading branch information
herrvendil committed Mar 30, 2023
1 parent de72ea2 commit 92a62ca
Show file tree
Hide file tree
Showing 17 changed files with 676 additions and 59 deletions.
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ buildscript {
dependencies {
classpath "com.google.protobuf:protobuf-gradle-plugin:0.8.16"

//classpath "org.spockframework:spock-core:1.3-groovy-2.5"

// optional dependencies for using Spock
classpath "org.hamcrest:hamcrest-core:1.3" // only necessary if Hamcrest matchers are used
classpath "net.bytebuddy:byte-buddy:1.9.7" // allows mocking of classes (in addition to interfaces)
Expand All @@ -22,6 +20,7 @@ buildscript {
classpath 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0'
classpath 'com.sun.xml.bind:jaxb-impl:3.0.0'
classpath 'javax.annotation:javax.annotation-api:1.3.2'

}
}

Expand Down
3 changes: 3 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ dependencies {
implementation "io.grpc:grpc-protobuf:$grpcVersion"
implementation "io.grpc:grpc-stub:$grpcVersion"

// CamelCase
implementation 'org.apache.commons:commons-text:1.10.0'

// JAX-B dependencies for JDK 9+
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0'
implementation 'com.sun.xml.bind:jaxb-impl:3.0.0'
Expand Down
17 changes: 16 additions & 1 deletion buildSrc/src/main/groovy/ClassNameUtils.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,22 @@ class ClassNameUtils {
if(!name || name.empty){
return name
}
return name.split("_").collect{ upperCaseFirst(it)}.join("")

return name.split("_").collect{ capitalizeAfterNumber(it.capitalize())}.join("")
}

static String capitalizeAfterNumber(String inputString){
String outputString = ""
for(int i = 0; i < inputString.length(); i++) {
def ch = inputString.charAt(i)
if(ch.isDigit() && i < inputString.length() - 1) {
outputString += ch
outputString += inputString.charAt(++i).toUpperCase()
} else {
outputString += ch
}
}
return outputString
}

/**
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/groovy/ProtocolSettings.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ import org.lightningj.lnd.wrapper.message.FeatureBit;
}
break
case "router":
if(methodName == "sendPaymentV2" || methodName == "trackPaymentV2" || methodName == "sendToRouteV2"){
if(methodName == "sendPaymentV2" || methodName == "trackPaymentV2" || methodName == "sendToRouteV2" || methodName == "trackPayments"){
return "LightningApi"
}
case "dev":
Expand Down
3 changes: 2 additions & 1 deletion docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ to the license agreement can be found link:LICENSE.txt[here].

== Whats New

* 0.15.5-Beta : Genreated agains LND 0.15.5 and fix for NaN issue #79
* 0.16.0-Beta : Generated against LND 0.16.0 API
* 0.15.5-Beta : Generated against LND 0.15.5 and fix for NaN issue #79
* 0.15.3-Beta : Major update, Generated against 0.15.3 and updated Gradle to 7.5.1.
Updated grpc to 1.49.2 and protobuf to 3.21.7. Migrated from jaxb.xml.bind to jakarta.xml.bind.
Done with contribution from rachid-o.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class LNDIntegrationSpec extends Specification{

def "Verify listChannels fetches all channels"(){
when:
ListChannelsResponse channels = synchronousLndAPI.listChannels(false,false,false,false)
ListChannelsResponse channels = synchronousLndAPI.listChannels(false,false,false,false,null,false)

for(Channel o : channels.channels){
assert o != null
Expand Down
19 changes: 14 additions & 5 deletions src/main/proto/chain.notifier.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is fetched from https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto
* And is distributed under LNDs MIT License.
* LND (d6db386) tag : Downloaded 2022-05-29
* LND (4607dff) tag : Downloaded 2022-02-25
*/
syntax = "proto3";

Expand All @@ -18,7 +18,6 @@ service ChainNotifier {
RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
registers an intent for a client to be notified once a confirmation request
has reached its required number of confirmations on-chain.
A confirmation request must have a valid output script. It is also possible
to give a transaction ID. If the transaction ID is not set, a notification
is sent once the output script confirms. If the transaction ID is also set,
Expand All @@ -31,7 +30,6 @@ service ChainNotifier {
RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
intent for a client to be notification once a spend request has been spent
by a transaction that has confirmed on-chain.
A client can specify whether the spend request should be for a particular
outpoint or for an output script by specifying a zero outpoint.
*/
Expand All @@ -43,7 +41,6 @@ service ChainNotifier {
stream will return a hash and height tuple of a block for each new/stale
block in the chain. It is the client's responsibility to determine whether
the tuple returned is for a new or stale block in the chain.
A client can also request a historical backlog of blocks from a particular
point. This allows clients to be idempotent by ensuring that they do not
missing processing a single block within the chain.
Expand Down Expand Up @@ -79,6 +76,12 @@ message ConfRequest {
broadcast height of the transaction/output script.
*/
uint32 height_hint = 4;

/*
If true, then the block that mines the specified txid/script will be
included in eventual the notification event.
*/
bool include_block = 5;
}

message ConfDetails {
Expand All @@ -92,8 +95,14 @@ message ConfDetails {
// in.
uint32 block_height = 3;

// The index of the confirmed transaction within the transaction.
// The index of the confirmed transaction within the block.
uint32 tx_index = 4;

/*
The raw bytes of the block that mined the transaction. Only included if
include_block was set in the request.
*/
bytes raw_block = 5;
}

message Reorg {
Expand Down
6 changes: 2 additions & 4 deletions src/main/proto/invoices.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is fetched from https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto
* And is distributed under LNDs MIT License.
* LND (3f3bc40) tag : Downloaded 2022-08-20
* LND (71f2615) tag : Downloaded 2023-02-25
*/
syntax = "proto3";

Expand Down Expand Up @@ -71,14 +71,12 @@ message AddHoldInvoiceRequest {

/*
The value of this invoice in satoshis
The fields value and value_msat are mutually exclusive.
*/
int64 value = 3;

/*
The value of this invoice in millisatoshis
The fields value and value_msat are mutually exclusive.
*/
int64 value_msat = 10;
Expand All @@ -90,7 +88,7 @@ message AddHoldInvoiceRequest {
*/
bytes description_hash = 4;

// Payment request expiry time in seconds. Default is 3600 (1 hour).
// Payment request expiry time in seconds. Default is 86400 (24 hours).
int64 expiry = 5;

// Fallback on-chain address.
Expand Down

0 comments on commit 92a62ca

Please sign in to comment.