Skip to content

Commit da689f6

Browse files
committed
move const variable to class var, fix warrnings
1 parent df07245 commit da689f6

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Tests/web3swiftTests/web3swift_keystores_Tests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import CryptoSwift
1111

1212
class web3swift_Keystores_tests: XCTestCase {
1313

14+
let mnemonic = "fruit wave dwarf banana earth journey tattoo true farm silk olive fence"
15+
1416
func testBIP39 () {
1517
var entropy = Data.fromHex("00000000000000000000000000000000")!
1618
var phrase = BIP39.generateMnemonicsFromEntropy(entropy: entropy)
@@ -88,7 +90,6 @@ class web3swift_Keystores_tests: XCTestCase {
8890
}
8991

9092
func testBIP32keystoreMatching() {
91-
let mnemonic = "fruit wave dwarf banana earth journey tattoo true farm silk olive fence"
9293
let keystore = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "banana")
9394
XCTAssertNotNil(keystore)
9495
let account = keystore!.addresses![0]
@@ -98,15 +99,13 @@ class web3swift_Keystores_tests: XCTestCase {
9899
}
99100

100101
func testBIP32keystoreMatchingRootNode() {
101-
let mnemonic = "fruit wave dwarf banana earth journey tattoo true farm silk olive fence"
102102
let keystore = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "banana")
103103
XCTAssertNotNil(keystore)
104104
let rootNode = try! keystore!.serializeRootNodeToString(password: "")
105105
XCTAssert(rootNode == "xprvA2KM71v838kPwE8Lfr12m9DL939TZmPStMnhoFcZkr1nBwDXSG7c3pjYbMM9SaqcofK154zNSCp7W7b4boEVstZu1J3pniLQJJq7uvodfCV")
106106
}
107107

108108
func testBIP32keystoreCustomPathMatching() {
109-
let mnemonic = "fruit wave dwarf banana earth journey tattoo true farm silk olive fence"
110109
let keystore = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "banana", prefixPath:"m/44'/60'/0'/0")
111110
XCTAssertNotNil(keystore)
112111
let account = keystore!.addresses![0]
@@ -156,8 +155,8 @@ class web3swift_Keystores_tests: XCTestCase {
156155
print(recreatedStore!.addresses![0].address)
157156
print(recreatedStore!.addresses![1].address)
158157
// This will fail. It wont fail if use scrypt from pod 'scrypt', '2.0', not from CryptoSwift
159-
XCTAssert(keystore?.addresses![0] == recreatedStore?.addresses![1])
160-
XCTAssert(keystore?.addresses![1] == recreatedStore?.addresses![0])
158+
XCTAssert(keystore?.addresses![1] == recreatedStore?.addresses![1])
159+
XCTAssert(keystore?.addresses![0] == recreatedStore?.addresses![0])
161160
}
162161

163162
// func testPBKDF2() {

web3swift.xcodeproj/project.pbxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1406,7 +1406,7 @@
14061406
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
14071407
MTL_FAST_MATH = YES;
14081408
ONLY_ACTIVE_ARCH = YES;
1409-
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=150";
1409+
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=350";
14101410
SDKROOT = macosx;
14111411
SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos";
14121412
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
@@ -1468,7 +1468,7 @@
14681468
MACOSX_DEPLOYMENT_TARGET = 10.11;
14691469
MTL_ENABLE_DEBUG_INFO = NO;
14701470
MTL_FAST_MATH = YES;
1471-
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=150";
1471+
OTHER_SWIFT_FLAGS = "-Xfrontend -warn-long-expression-type-checking=350";
14721472
SDKROOT = macosx;
14731473
SUPPORTED_PLATFORMS = "macosx iphonesimulator iphoneos";
14741474
SWIFT_COMPILATION_MODE = wholemodule;

0 commit comments

Comments
 (0)