Skip to content

Commit 737081a

Browse files
committed
Account for ProbabilisticScoringDecayParameters
1 parent 921a052 commit 737081a

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

ci/LDKSwift/Tests/LDKSwiftTests/HumanObjectPeerTestInstance.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,11 @@ public class HumanObjectPeerTestInstance {
316316
scorerGraph = NetworkGraph(network: .Regtest, logger: self.logger)
317317
}
318318

319-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
320-
var probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: scorerGraph, logger: self.logger)
319+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault()
320+
var probabalisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: scorerGraph, logger: self.logger)
321321
if master.configuration.reserializedProbabilisticScorer {
322322
let serializedScorer = probabalisticScorer.write()
323-
let probabalisticScorerResult = ProbabilisticScorer.read(ser: serializedScorer, argA: scoringParams, argB: scorerGraph, argC: self.logger)
323+
let probabalisticScorerResult = ProbabilisticScorer.read(ser: serializedScorer, argA: decayParams, argB: scorerGraph, argC: self.logger)
324324
probabalisticScorer = probabalisticScorerResult.getValue()!
325325
}
326326
let score = probabalisticScorer.asScore()

ci/LDKSwift/Tests/LDKSwiftTests/LDKSwiftTests.swift

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -164,8 +164,8 @@ class LDKSwiftTests: XCTestCase {
164164
let config = UserConfig.initWithDefault()
165165
let networkGraph = NetworkGraph(network: .Bitcoin, logger: logger)
166166

167-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
168-
let probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
167+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault()
168+
let probabalisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: networkGraph, logger: logger)
169169
let score = probabalisticScorer.asScore()
170170
let multiThreadedScorer = MultiThreadedLockableScore(score: score)
171171

@@ -212,8 +212,8 @@ class LDKSwiftTests: XCTestCase {
212212
let lightningNetwork = LDKNetwork_Bitcoin
213213
let networkGraph = NetworkGraph(network: .Bitcoin, logger: logger)
214214

215-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
216-
let probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
215+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault()
216+
let probabalisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: networkGraph, logger: logger)
217217
let score = probabalisticScorer.asScore()
218218
let multiThreadedScorer = MultiThreadedLockableScore(score: score)
219219

@@ -270,8 +270,8 @@ class LDKSwiftTests: XCTestCase {
270270
let lightningNetwork: Bindings.Network = .Bitcoin
271271
let networkGraph = NetworkGraph(network: .Bitcoin, logger: logger)
272272

273-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
274-
let probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
273+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault()
274+
let probabalisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: networkGraph, logger: logger)
275275
let score = probabalisticScorer.asScore()
276276
let multiThreadedScorer = MultiThreadedLockableScore(score: score)
277277

@@ -410,8 +410,8 @@ class LDKSwiftTests: XCTestCase {
410410
print("Network graph size: \(graphBytes.count)! Time: \(elapsedC)s")
411411
*/
412412

413-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
414-
let scorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
413+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault()
414+
let scorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: networkGraph, logger: logger)
415415
let score = scorer.asScore()
416416
// let lockableScore = LockableScore()
417417
// let defaultRouter = DefaultRouter(network_graph: networkGraph, logger: logger, random_seed_bytes: [UInt8](repeating: 0, count: 32), scorer: lockableScore)
@@ -432,7 +432,8 @@ class LDKSwiftTests: XCTestCase {
432432
let firstHops: [ChannelDetails]? = nil
433433
print("STEP B")
434434
let randomSeedBytes: [UInt8] = [UInt8](repeating: 0, count: 32)
435-
let foundRoute = Bindings.findRoute(ourNodePubkey: payerPubkey, routeParams: routeParameters, networkGraph: networkGraph, firstHops: [], logger: logger, scorer: score, randomSeedBytes: randomSeedBytes)
435+
let scoreParams = ProbabilisticScoringFeeParameters.initWithDefault();
436+
let foundRoute = Bindings.findRoute(ourNodePubkey: payerPubkey, routeParams: routeParameters, networkGraph: networkGraph, firstHops: [], logger: logger, scorer: score, scoreParams: scoreParams, randomSeedBytes: randomSeedBytes)
436437
// let foundRoute = router.find_route(payer: payerPubkey, route_params: routeParameters, payment_hash: nil, first_hops: firstHops, inflight_htlcs: <#T##InFlightHtlcs#>)
437438

438439
if let routeError = foundRoute.getError() {

ci/LDKSwift/Tests/LDKSwiftTests/WrappedSignerProviderTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ class WrappedSignerProviderTests: XCTestCase {
5050
let network = Network.Testnet
5151
let netGraph = NetworkGraph(network: network, logger: logger)
5252

53-
let params = ProbabilisticScoringParameters.initWithDefault()
54-
let probabilisticScorer = ProbabilisticScorer(params: params, networkGraph: netGraph, logger: logger)
53+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault()
54+
let probabilisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: netGraph, logger: logger)
5555
let score = probabilisticScorer.asScore()
5656
let scorer = MultiThreadedLockableScore(score: score)
5757

xcode/LDKFramework/DirectlyLinkedBindingsApp/app-batteries/PolarIntegrationSample.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ public class PolarIntegrationSample {
5454
let chaintipHeight = try await rpcInterface.getChaintipHeight()
5555
let networkGraph = NetworkGraph(network: lightningNetwork, logger: logger)
5656

57-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
58-
let probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
57+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault();
58+
let probabalisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: networkGraph, logger: logger)
5959
let score = probabalisticScorer.asScore()
6060
let multiThreadedScorer = MultiThreadedLockableScore(score: score)
6161

@@ -464,8 +464,8 @@ public class PolarIntegrationSample {
464464

465465
print("Genesis hash reversed: \(PolarIntegrationSample.bytesToHexString(bytes: reversedGenesisHash))")
466466

467-
let scoringParams = ProbabilisticScoringParameters.initWithDefault()
468-
let probabalisticScorer = ProbabilisticScorer(params: scoringParams, networkGraph: networkGraph, logger: logger)
467+
let decayParams = ProbabilisticScoringDecayParameters.initWithDefault();
468+
let probabalisticScorer = ProbabilisticScorer(decayParams: decayParams, networkGraph: networkGraph, logger: logger)
469469
let score = probabalisticScorer.asScore()
470470
let multiThreadedScorer = MultiThreadedLockableScore(score: score)
471471

0 commit comments

Comments
 (0)