Add LND test wallet

This commit is contained in:
adrianaepure
2023-06-08 09:36:06 +03:00
commit 1313d727cf
251 changed files with 57518 additions and 0 deletions

22
walletTests/Info.plist Normal file
View File

@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>

View File

@ -0,0 +1,52 @@
//
// walletTests.swift
// walletTests
//
// Created by Jason on 8/12/20.
// Copyright © 2020 Jason. All rights reserved.
//
import XCTest
@testable import wallet
class walletTests: XCTestCase {
override func setUp() {
// Put setup code here. This method is called before the invocation of each test method in the class.
}
override func tearDown() {
// Put teardown code here. This method is called after the invocation of each test method in the class.
}
func testPublicKey() {
XCTAssertNoThrow(_ = try NodePublicKey("03236a685d30096b26692dce0cf0fa7c8528bdf61dbf5363a3ef6d5c92733a3016"))
XCTAssertNoThrow(_ = try NodePublicKey("02346504c3bf5891949a3ff350585042557486c1fdb227639d7bb999e940c62c3a"))
XCTAssertThrowsError(_ = try NodePublicKey("13236a685d30096b26692dce0cf0fa7c8528bdf61dbf5363a3ef6d5c92733a3016"))
XCTAssertThrowsError(_ = try NodePublicKey("03236a685d30096b26692dce0cf0fa7c8528bdf61dbf5363a3ef6d5c92733a301"))
XCTAssertThrowsError(_ = try NodePublicKey("lol"))
}
func testLND() {
return //TODO figure out why LND can't be started from tests
Lightning.shared.purge()
let startExpectation = expectation(description: "LND started")
let rpcExpectation = expectation(description: "LND RPC became ready")
Lightning.shared.start({ (error) in
XCTAssertNil(error, "Start LND error")
startExpectation.fulfill()
}) { (error) in
XCTAssertNil(error, "Start RPC error")
rpcExpectation.fulfill()
}
waitForExpectations(timeout: 10) { error in
if let error = error {
XCTFail(error.localizedDescription)
}
}
}
}