Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,10 @@ final class SDKMethodTests: XCTestCase {
amount: amount,
signer: OpaquePointer(signer)
)
print("✅ Method call succeeded (unexpected)")
XCTFail("transferCredits should fail with dummy data")
} catch {
print("Method call failed with error: \(error)")
print("Error type: \(type(of: error))")
// This is expected since we're using dummy data
// Expected: dummy data causes an error
}

XCTAssertTrue(true)
}

func testSimpleIdentityFetch() async throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,6 @@ final class StateTransitionTests: XCTestCase {
print("✅ SDK initialized successfully")
}

func testSimpleAsync() async throws {
// Test that async tests work at all
print("Starting simple async test")
try await Task.sleep(nanoseconds: 100_000_000) // 0.1 second
print("Simple async test completed")
XCTAssertTrue(true)
}

func testIdentityCreditTransferDebug() async throws {
print("Test started")
Expand Down Expand Up @@ -180,7 +173,6 @@ final class StateTransitionTests: XCTestCase {

// This test just verifies setup is correct
// The actual async transfer would be executed in testIdentityCreditTransferAsync
XCTAssertTrue(true)
}

func testBasicSetup() throws {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,7 @@ final class TransactionTests: XCTestCase {
// SDKTransactionBuilder.addInput takes Input(txid:vout:scriptPubKey:privateKey), not HDUTXO
}

func testTransactionBuilderAddOutput() throws {
let builder = SDKTransactionBuilder(feePerKB: 1000)
let address = "yTsGq4wV8WySdQTYgGqmiUKMxb8RBr6wc6"
let amount: UInt64 = 50_000_000
try builder.addOutput(SDKTransactionBuilder.Output(address: address, amount: amount))
XCTAssertTrue(true)
}

func testTransactionBuilderChangeAddress() throws {
let builder = SDKTransactionBuilder(feePerKB: 1000)
let changeAddress = "yXdUfGBfX6rQmNq5speeNGD5HfL2qkYBNe"
try builder.setChangeAddress(changeAddress)
XCTAssertTrue(true)
}

func testTransactionBuilderInsufficientBalance() throws {
let builder = SDKTransactionBuilder(feePerKB: 1000)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Mock implementation of Swift Dash SDK for testing
// This provides mock implementations of all the C functions
// Test-only C mock implementation of SwiftDashSDK FFI, linked by SwiftTests/Package.swift target `SwiftDashSDKMock`.
// Used by SwiftTests unit tests to exercise Swift wrapper behavior without depending on a real Rust backend.

#include "SwiftDashSDK.h"
#include <stdlib.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ class DataContractTests: XCTestCase {

// Clean up
swift_dash_string_free(jsonString)
} else {
// No history is also valid for test vectors
XCTAssertTrue(true, "Contract history may return nil if no history exists")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ class IdentityTests: XCTestCase {
}

let result = swift_dash_identity_resolve_name(sdk, "dash")
XCTAssertNotNil(result, "Should resolve existing alias")

if let jsonString = result {
let jsonStr = String(cString: jsonString)
Expand All @@ -157,9 +158,6 @@ class IdentityTests: XCTestCase {

// Clean up
swift_dash_string_free(jsonString)
} else {
// Name not found is also valid for test vectors
XCTAssertTrue(true, "Name resolution may return nil if not found in test vectors")
}
}

Expand Down Expand Up @@ -312,4 +310,4 @@ class IdentityTests: XCTestCase {
swift_dash_error_free(error)
}
}
}
}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is that you are adding and removing the same symbol?? Maybe a different char??

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ou, i see, you are removing the \n, does the swift formatter do that??

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good eye — it's a whitespace change from the Swift formatter. The removed line has a trailing newline (\n) and the added line doesn't (or vice versa). The actual symbol content is identical. As you noted in your follow-up comment, the formatter strips the trailing newline.

Loading
Loading