Skip to content

Commit 79f480b

Browse files
committed
Rename LDKFramework to LightningDevKit, and add app target inside the LDK xcodeproject.
1 parent 4cb5360 commit 79f480b

File tree

16 files changed

+4814
-2027
lines changed

16 files changed

+4814
-2027
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"colors" : [
3+
{
4+
"idiom" : "universal"
5+
}
6+
],
7+
"info" : {
8+
"author" : "xcode",
9+
"version" : 1
10+
}
11+
}
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "iphone",
5+
"scale" : "2x",
6+
"size" : "20x20"
7+
},
8+
{
9+
"idiom" : "iphone",
10+
"scale" : "3x",
11+
"size" : "20x20"
12+
},
13+
{
14+
"idiom" : "iphone",
15+
"scale" : "2x",
16+
"size" : "29x29"
17+
},
18+
{
19+
"idiom" : "iphone",
20+
"scale" : "3x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "iphone",
25+
"scale" : "2x",
26+
"size" : "40x40"
27+
},
28+
{
29+
"idiom" : "iphone",
30+
"scale" : "3x",
31+
"size" : "40x40"
32+
},
33+
{
34+
"idiom" : "iphone",
35+
"scale" : "2x",
36+
"size" : "60x60"
37+
},
38+
{
39+
"idiom" : "iphone",
40+
"scale" : "3x",
41+
"size" : "60x60"
42+
},
43+
{
44+
"idiom" : "ipad",
45+
"scale" : "1x",
46+
"size" : "20x20"
47+
},
48+
{
49+
"idiom" : "ipad",
50+
"scale" : "2x",
51+
"size" : "20x20"
52+
},
53+
{
54+
"idiom" : "ipad",
55+
"scale" : "1x",
56+
"size" : "29x29"
57+
},
58+
{
59+
"idiom" : "ipad",
60+
"scale" : "2x",
61+
"size" : "29x29"
62+
},
63+
{
64+
"idiom" : "ipad",
65+
"scale" : "1x",
66+
"size" : "40x40"
67+
},
68+
{
69+
"idiom" : "ipad",
70+
"scale" : "2x",
71+
"size" : "40x40"
72+
},
73+
{
74+
"idiom" : "ipad",
75+
"scale" : "2x",
76+
"size" : "76x76"
77+
},
78+
{
79+
"idiom" : "ipad",
80+
"scale" : "2x",
81+
"size" : "83.5x83.5"
82+
},
83+
{
84+
"idiom" : "ios-marketing",
85+
"scale" : "1x",
86+
"size" : "1024x1024"
87+
}
88+
],
89+
"info" : {
90+
"author" : "xcode",
91+
"version" : 1
92+
}
93+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
//
2+
// ContentView.swift
3+
// DirectlyLinkedBindingsApp
4+
//
5+
// Created by Arik Sosman on 8/20/21.
6+
//
7+
8+
import SwiftUI
9+
10+
struct ContentView: View {
11+
12+
@State private var isRunningTestFlow = false
13+
14+
@State private var multiPeerSimulation: PolarIntegrationSample.MultiPeerSimulator? = nil
15+
16+
var body: some View {
17+
18+
Button(action: {
19+
self.isRunningTestFlow = true
20+
if #available(iOS 15.0, *) {
21+
let sample = PolarIntegrationSample()
22+
Task {
23+
try? await sample.testPolarFlow()
24+
self.isRunningTestFlow = false
25+
}
26+
} else {
27+
// Fallback on earlier versions
28+
}
29+
30+
}, label: {
31+
Text("Hello World")
32+
}).disabled(self.isRunningTestFlow)
33+
34+
if let simulation = self.multiPeerSimulation {
35+
Button {
36+
// self.multiPeerSimulation = nil
37+
Task {
38+
await self.multiPeerSimulation?.interrupt()
39+
40+
// freeing the simulation
41+
// try! await Task.sleep(nanoseconds: 5_000_000_000)
42+
// self.multiPeerSimulation = nil
43+
}
44+
} label: {
45+
Text("Stop multi-peer simulation")
46+
}
47+
} else {
48+
Button {
49+
self.multiPeerSimulation = PolarIntegrationSample.MultiPeerSimulator()
50+
Task {
51+
try? await self.multiPeerSimulation!.simulateMultiplePeers()
52+
}
53+
} label: {
54+
Text("Simulate multiple peers")
55+
}
56+
}
57+
58+
}
59+
60+
/*@StateObject private var experiment = PolarConnectionExperiment()
61+
var body: some View {
62+
if !self.experiment.isMonitoring {
63+
Button("Monitor Chain") {
64+
self.experiment.startMonitoring()
65+
}.padding()
66+
} else {
67+
VStack {
68+
Text("Monitoring…").padding()
69+
if !self.experiment.hasCaughtUpToChainTip {
70+
Text("Complete Sync").padding()
71+
} else if !self.experiment.hasCompletedChainSync {
72+
Button("Complete Sync") {
73+
self.experiment.completeChainSync()
74+
}.padding()
75+
} else {
76+
77+
Text("Sync Complete").padding()
78+
79+
if !self.experiment.isConnectedToAlice {
80+
Button("Connect to Alice") {
81+
self.experiment.connectToAlice()
82+
}.padding()
83+
} else {
84+
Text("Connected to Alice").padding()
85+
86+
if !self.experiment.isChannelWithAliceOpen {
87+
Button("Open Channel w/ Alice") {
88+
self.experiment.openChannelWithAlice()
89+
}.padding()
90+
} else {
91+
Text("Channel w/ Alice Open")
92+
}
93+
}
94+
}
95+
}
96+
}
97+
}*/
98+
}
99+
100+
struct ContentView_Previews: PreviewProvider {
101+
static var previews: some View {
102+
ContentView()
103+
}
104+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// DirectlyLinkedBindingsAppApp.swift
3+
// DirectlyLinkedBindingsApp
4+
//
5+
// Created by Arik Sosman on 7/11/22.
6+
//
7+
8+
import SwiftUI
9+
10+
@main
11+
struct DirectlyLinkedBindingsAppApp: App {
12+
13+
init() {
14+
print("Directly linked bindings app is initialized")
15+
16+
let compiledVersion = Bindings.swift_ldk_get_compiled_version()
17+
print("Compiled version: \(compiledVersion)")
18+
}
19+
20+
var body: some Scene {
21+
WindowGroup {
22+
ContentView()
23+
}
24+
}
25+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"author" : "xcode",
4+
"version" : 1
5+
}
6+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
//
2+
// DirectlyLinkedBindingsAppTests.swift
3+
// DirectlyLinkedBindingsAppTests
4+
//
5+
// Created by Arik Sosman on 7/11/22.
6+
//
7+
8+
import XCTest
9+
@testable import DirectlyLinkedBindingsApp
10+
11+
class DirectlyLinkedBindingsAppTests: XCTestCase {
12+
13+
override func setUpWithError() throws {
14+
// Put setup code here. This method is called before the invocation of each test method in the class.
15+
}
16+
17+
override func tearDownWithError() throws {
18+
// Put teardown code here. This method is called after the invocation of each test method in the class.
19+
}
20+
21+
func testExample() throws {
22+
// This is an example of a functional test case.
23+
// Use XCTAssert and related functions to verify your tests produce the correct results.
24+
// Any test you write for XCTest can be annotated as throws and async.
25+
// Mark your test throws to produce an unexpected failure when your test encounters an uncaught error.
26+
// Mark your test async to allow awaiting for asynchronous code to complete. Check the results with assertions afterwards.
27+
}
28+
29+
func testPerformanceExample() throws {
30+
// This is an example of a performance test case.
31+
self.measure {
32+
// Put the code you want to measure the time of here.
33+
}
34+
}
35+
36+
}

0 commit comments

Comments
 (0)