Skip to content

Commit

Permalink
[CI]: Add debug messages to android-ci and ios-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
satoshiotomakan committed Oct 23, 2023
1 parent 78f7bc4 commit 0a5f71c
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ endif ()

find_host_package(Boost REQUIRED)
message("Path to Boost: " ${Boost_INCLUDE_DIRS})
execute_process(COMMAND ls
WORKING_DIRECTORY ${Boost_INCLUDE_DIRS}/boost
OUTPUT_VARIABLE LS_OUTPUT)
MESSAGE( STATUS "CMD_OUTPUT:" ${LS_OUTPUT})

include(ExternalProject)

Expand Down
23 changes: 23 additions & 0 deletions swift/Tests/Keystore/KeyStoreTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class KeyStoreTests: XCTestCase {
var keyDirectory: URL!

override func setUp() {
print("setUp()")
super.setUp()

let fileManager = FileManager.default
Expand Down Expand Up @@ -76,12 +77,14 @@ class KeyStoreTests: XCTestCase {
}

func testLoadKeyStore() {
print("testLoadKeyStore()")
let keyStore = try! KeyStore(keyDirectory: keyDirectory)
XCTAssertEqual(keyStore.wallets.count, 4)
XCTAssertEqual(keyStore.watches.count, 1)
}

func testCreateHDWallet() throws {
print("testCreateHDWallet()")
let coins = [CoinType.ethereum, .binance, .smartChain]
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let newWallet = try keyStore.createWallet(name: "name", password: "password", coins: coins)
Expand All @@ -94,6 +97,7 @@ class KeyStoreTests: XCTestCase {
}

func testUpdateKey() throws {
print("testUpdateKey()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let coins = [CoinType.ethereum, .callisto, .poanetwork]
let wallet = try keyStore.createWallet(name: "name", password: "password", coins: coins)
Expand All @@ -114,6 +118,7 @@ class KeyStoreTests: XCTestCase {
}

func testUpdateName() throws {
print("testUpdateName()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let coins = [CoinType.ethereum, .callisto, .poanetwork]
let wallet = try keyStore.createWallet(name: "name", password: "password", coins: coins)
Expand All @@ -134,6 +139,7 @@ class KeyStoreTests: XCTestCase {
}

func testAddAccounts() throws {
print("testAddAccounts()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let wallet = keyStore.hdWallet!
_ = try keyStore.addAccounts(wallet: wallet, coins: [.ethereum, .callisto, .poanetwork], password: "password")
Expand All @@ -144,6 +150,7 @@ class KeyStoreTests: XCTestCase {
}

func testRemoveAccounts() throws {
print("testRemoveAccounts()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let coins = [CoinType.ethereum, .callisto, .poanetwork, .bitcoin]
let wallet = try keyStore.createWallet(name: "name", password: "password", coins: coins)
Expand All @@ -157,20 +164,23 @@ class KeyStoreTests: XCTestCase {
}

func testDeleteKey() throws {
print("testDeleteKey()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let wallet = keyStore.keyWallet!
try keyStore.delete(wallet: wallet, password: "testpassword")
XCTAssertNil(keyStore.keyWallet)
}

func testDeleteWallet() throws {
print("testDeleteWallet()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let wallet = keyStore.hdWallet!
try keyStore.delete(wallet: wallet, password: "password")
XCTAssertNil(keyStore.hdWallet)
}

func testImportKey() throws {
print("testImportKey()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let privateKeyData = Data(hexString: "9cdb5cab19aec3bd0fcd614c5f185e7a1d97634d4225730eba22497dc89a716c")!
let key = StoredKey.importPrivateKey(privateKey: privateKeyData, name: "name", password: Data("password".utf8), coin: .ethereum)!
Expand All @@ -185,6 +195,7 @@ class KeyStoreTests: XCTestCase {
}

func testImportPrivateKeyAES256() throws {
print("testImportPrivateKeyAES256()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let privateKeyData = Data(hexString: "9cdb5cab19aec3bd0fcd614c5f185e7a1d97634d4225730eba22497dc89a716c")!
let key = StoredKey.importPrivateKeyWithEncryption(privateKey: privateKeyData, name: "name", password: Data("password".utf8), coin: .ethereum, encryption: StoredKeyEncryption.aes256Ctr)!
Expand All @@ -199,6 +210,7 @@ class KeyStoreTests: XCTestCase {
}

func testImportPrivateKey() throws {
print("testImportPrivateKey()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let privateKey = PrivateKey(data: Data(hexString: "9cdb5cab19aec3bd0fcd614c5f185e7a1d97634d4225730eba22497dc89a716c")!)!

Expand All @@ -214,6 +226,7 @@ class KeyStoreTests: XCTestCase {
}

func testImportWallet() throws {
print("testImportWallet()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let wallet = try keyStore.import(mnemonic: mnemonic, name: "name", encryptPassword: "newPassword", coins: [.ethereum])
let storedData = wallet.key.decryptMnemonic(password: Data("newPassword".utf8))
Expand All @@ -224,6 +237,7 @@ class KeyStoreTests: XCTestCase {
}

func testImportWalletAES256() throws {
print("testImportWalletAES256()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let wallet = try keyStore.import(mnemonic: mnemonic, name: "name", encryptPassword: "newPassword", coins: [.ethereum], encryption: .aes256Ctr)
let storedData = wallet.key.decryptMnemonic(password: Data("newPassword".utf8))
Expand All @@ -234,6 +248,7 @@ class KeyStoreTests: XCTestCase {
}

func testImportJSON() throws {
print("testImportJSON()")

let expected = """
{
Expand Down Expand Up @@ -327,6 +342,7 @@ class KeyStoreTests: XCTestCase {
}

func testExportMnemonic() throws {
print("testExportMnemonic()")
let keyStore = try KeyStore(keyDirectory: keyDirectory)
let wallet = try keyStore.import(mnemonic: mnemonic, name: "name", encryptPassword: "newPassword", coins: [.ethereum])
let exported = try keyStore.exportMnemonic(wallet: wallet, password: "newPassword")
Expand All @@ -335,6 +351,7 @@ class KeyStoreTests: XCTestCase {
}

func testFileName() {
print("testFileName()")
let keyStore = try! KeyStore(keyDirectory: keyDirectory)

let timeZone = TimeZone(secondsFromGMT: -480)!
Expand All @@ -345,6 +362,7 @@ class KeyStoreTests: XCTestCase {
}

func testFileNameUTC() {
print("testFileNameUTC()")
let keyStore = try! KeyStore(keyDirectory: keyDirectory)

let timeZone = TimeZone(abbreviation: "UTC")!
Expand All @@ -355,6 +373,7 @@ class KeyStoreTests: XCTestCase {
}

func testDeriveActiveAccounts() {
print("testDeriveActiveAccounts()")
let keyStore = try! KeyStore(keyDirectory: keyDirectory)
let wallet = try! keyStore.import(mnemonic: mnemonic, name: "name", encryptPassword: "newPassword", coins: [.ethereum])
let coins = CoinType.allCases
Expand All @@ -368,6 +387,7 @@ class KeyStoreTests: XCTestCase {
}

func testMissingBitcoinAddressDerivation() {
print("testMissingBitcoinAddressDerivation()")
let keyStore = try! KeyStore(keyDirectory: keyDirectory)
let wallet = keyStore.bitcoinWallet
let coins = CoinType.allCases
Expand All @@ -383,6 +403,7 @@ class KeyStoreTests: XCTestCase {
}

func testSave() throws {
print("testSave()")
let dir = try createTempDirURL()
let keyStore = try KeyStore(keyDirectory: dir)
try keyStore.watch([
Expand All @@ -395,6 +416,7 @@ class KeyStoreTests: XCTestCase {
}

func testImportError() throws {
print("testStestImportErrorave()")
let url = try createTempDirURL()
let keystore = try KeyStore(keyDirectory: url)

Expand Down Expand Up @@ -424,6 +446,7 @@ class KeyStoreTests: XCTestCase {
}

func testCreateMultiAccount() throws {
print("testCreateMultiAccount()")
let mnemonic = "team engine square letter hero song dizzy scrub tornado fabric divert saddle"
let password = "password"
let keyStore = try KeyStore(keyDirectory: keyDirectory)
Expand Down
2 changes: 1 addition & 1 deletion tools/ios-test
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ xcodebuild -workspace TrustWalletCore.xcworkspace \
-scheme WalletCore \
-sdk iphonesimulator \
-destination "platform=iOS Simulator,name=iPhone 14" \
test | xcbeautify
test

popd

0 comments on commit 0a5f71c

Please sign in to comment.