Skip to content

Commit 21d7cf6

Browse files
Split tests to two targets:
- remote and local Move EIP712Tests to local_tests/ .
1 parent 6fecb56 commit 21d7cf6

File tree

4 files changed

+29
-125
lines changed

4 files changed

+29
-125
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
- name: Resolve dependencies
3838
run: swift package resolve
3939
- name: Test
40-
run: swift test # --skip-build
40+
run: swift test --filter localTests

Package.swift

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,25 @@ let package = Package(
4040
]
4141
),
4242
.testTarget(
43-
name: "web3swiftTests",
43+
name: "localTests",
4444
dependencies: ["web3swift"],
45+
path: "Tests/web3swiftTests/local_tests",
4546
resources: [
46-
.copy("../../TestToken/Helpers/SafeMath/SafeMath.sol"),
47-
.copy("../../TestToken/Helpers/TokenBasics/ERC20.sol"),
48-
.copy("../../TestToken/Helpers/TokenBasics/IERC20.sol"),
49-
.copy("../../TestToken/Token/Web3SwiftToken.sol")
47+
.copy("../../../TestToken/Helpers/SafeMath/SafeMath.sol"),
48+
.copy("../../../TestToken/Helpers/TokenBasics/ERC20.sol"),
49+
.copy("../../../TestToken/Helpers/TokenBasics/IERC20.sol"),
50+
.copy("../../../TestToken/Token/Web3SwiftToken.sol")
51+
]
52+
),
53+
.testTarget(
54+
name: "remoteTests",
55+
dependencies: ["web3swift"],
56+
path: "Tests/web3swiftTests/infura_tests",
57+
resources: [
58+
.copy("../../../TestToken/Helpers/SafeMath/SafeMath.sol"),
59+
.copy("../../../TestToken/Helpers/TokenBasics/ERC20.sol"),
60+
.copy("../../../TestToken/Helpers/TokenBasics/IERC20.sol"),
61+
.copy("../../../TestToken/Token/Web3SwiftToken.sol")
5062
]
5163
),
5264
]

Tests/web3swiftTests/web3swift_EIP712_Tests.swift renamed to Tests/web3swiftTests/local_tests/web3swift_EIP712_Tests.swift

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ class EIP712Tests: XCTestCase {
3535
let gasPrice = EIP712.UInt256("20000000000")
3636

3737
let gasToken = EthereumAddress("0x0000000000000000000000000000000000000000")!
38-
38+
print(1)
3939
let refundReceiver = EthereumAddress("0x7c07D32e18D6495eFDC487A32F8D20daFBa53A5e")!
40-
40+
print(2)
4141
let nonce: EIP712.UInt256 = .init(6)
42-
42+
print(3)
4343
let safeTX = SafeTx(
4444
to: to,
4545
value: value,
@@ -51,24 +51,27 @@ class EIP712Tests: XCTestCase {
5151
gasToken: gasToken,
5252
refundReceiver: refundReceiver,
5353
nonce: nonce)
54-
54+
print(4)
5555
let password = ""
56+
print(5)
5657
let chainId: EIP712.UInt256? = nil
58+
print(6)
5759
let verifyingContract = EthereumAddress("0x40c21f00Faafcf10Cc671a75ea0de62305199DC1")!
58-
60+
print(7)
5961
let mnemonic = "normal dune pole key case cradle unfold require tornado mercy hospital buyer"
62+
print(8)
6063
let keystore = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "")!
61-
64+
print(9)
6265
let account = keystore.addresses?[0]
63-
66+
print(10)
6467
let signature = try Web3Signer.signEIP712(
6568
safeTx: safeTX,
6669
keystore: keystore,
6770
verifyingContract: verifyingContract,
6871
account: account!,
6972
password: password,
7073
chainId: chainId)
71-
74+
print(11)
7275
XCTAssertEqual(signature.toHexString(), "bf3182a3f52e65b416f86e76851c8e7d5602aef28af694f31359705b039d8d1931d53f3d5088ac7195944e8a9188d161ba3757877d08105885304f65282228c71c")
7376
}
7477

0 commit comments

Comments
 (0)