Skip to content

Commit 84c9885

Browse files
committed
Revert changes to tests
1 parent 1b4c25b commit 84c9885

27 files changed

+415
-426
lines changed

Tests/web3swiftTests/localTests/ABIEncoderSoliditySha3Test.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
import XCTest
1111
@testable import web3swift
1212

13-
class ABIEncoderSoliditySha3Test: LocalTestCase {
13+
class ABIEncoderSoliditySha3Test: XCTestCase {
1414

1515
func test_soliditySha3() throws {
1616
var hex = try ABIEncoder.soliditySha3(true).toHexString().addHexPrefix()

Tests/web3swiftTests/localTests/DataConversionTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import XCTest
1616

1717
// Some base58 test vectors pulled from: https://tools.ietf.org/id/draft-msporny-base58-01.html
1818
// note that one of the return values is incorrect in the reference above, it is corrected here
19-
class DataConversionTests: LocalTestCase {
19+
class DataConversionTests: XCTestCase {
2020
// test an empty input for the base58 decoder & decoder
2121
func testBase58() throws {
2222
let vector = ""

Tests/web3swiftTests/localTests/EIP1559BlockTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import BigInt
44
@testable
55
import web3swift
66

7-
class EIP1559BlockTests: LocalTestCase {
7+
class EIP1559BlockTests: XCTestCase {
88
let uselessBlockPart = (
99
number: BigUInt(12_965_000),
1010
hash: Data(fromHex: "0xef95f2f1ed3ca60b048b4bf67cde2195961e0bba6f70bcbea9a2c4e133e34b46")!, // "hash":

Tests/web3swiftTests/localTests/EIP712Tests.swift

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
import XCTest
22
@testable import web3swift
33

4-
class EIP712Tests: LocalTestCase {
4+
class EIP712Tests: XCTestCase {
55
func testWithoutChainId() throws {
6-
6+
77
let to = EthereumAddress("0x3F06bAAdA68bB997daB03d91DBD0B73e196c5A4d")!
8-
8+
99
let value = EIP712.UInt256(0)
10-
10+
1111
let amountLinen = EIP712.UInt256("0001000000000000000")//
12-
12+
1313
let function = ABI.Element.Function(
1414
name: "approveAndMint",
1515
inputs: [
@@ -18,22 +18,22 @@ class EIP712Tests: LocalTestCase {
1818
outputs: [.init(name: "", type: .bool)],
1919
constant: false,
2020
payable: false)
21-
21+
2222
let object = ABI.Element.function(function)
23-
23+
2424
let safeTxData = object.encodeParameters([
2525
EthereumAddress("0x41B5844f4680a8C38fBb695b7F9CFd1F64474a72")! as AnyObject,
2626
amountLinen as AnyObject
2727
])!
28-
28+
2929
let operation: EIP712.UInt8 = 1
30-
30+
3131
let safeTxGas = EIP712.UInt256(250000)
32-
32+
3333
let baseGas = EIP712.UInt256(60000)
34-
34+
3535
let gasPrice = EIP712.UInt256("20000000000")
36-
36+
3737
let gasToken = EthereumAddress("0x0000000000000000000000000000000000000000")!
3838
print(1)
3939
let refundReceiver = EthereumAddress("0x7c07D32e18D6495eFDC487A32F8D20daFBa53A5e")!
@@ -76,13 +76,13 @@ class EIP712Tests: LocalTestCase {
7676
}
7777

7878
func testWithChainId() throws {
79-
79+
8080
let to = EthereumAddress("0x3F06bAAdA68bB997daB03d91DBD0B73e196c5A4d")!
81-
81+
8282
let value = EIP712.UInt256(0)
83-
83+
8484
let amount = EIP712.UInt256("0001000000000000000")
85-
85+
8686
let function = ABI.Element.Function(
8787
name: "approveAndMint",
8888
inputs: [
@@ -91,28 +91,28 @@ class EIP712Tests: LocalTestCase {
9191
outputs: [.init(name: "", type: .bool)],
9292
constant: false,
9393
payable: false)
94-
94+
9595
let object = ABI.Element.function(function)
96-
96+
9797
let safeTxData = object.encodeParameters([
9898
EthereumAddress("0x41B5844f4680a8C38fBb695b7F9CFd1F64474a72")! as AnyObject,
9999
amount as AnyObject
100100
])!
101-
101+
102102
let operation: EIP712.UInt8 = 1
103-
103+
104104
let safeTxGas = EIP712.UInt256(250000)
105-
105+
106106
let baseGas = EIP712.UInt256(60000)
107-
107+
108108
let gasPrice = EIP712.UInt256("20000000000")
109-
109+
110110
let gasToken = EthereumAddress("0x0000000000000000000000000000000000000000")!
111-
111+
112112
let refundReceiver = EthereumAddress("0x7c07D32e18D6495eFDC487A32F8D20daFBa53A5e")!
113-
113+
114114
let nonce: EIP712.UInt256 = .init(0)
115-
115+
116116
let safeTX = SafeTx(
117117
to: to,
118118
value: value,
@@ -124,24 +124,25 @@ class EIP712Tests: LocalTestCase {
124124
gasToken: gasToken,
125125
refundReceiver: refundReceiver,
126126
nonce: nonce)
127-
127+
128128
let mnemonic = "normal dune pole key case cradle unfold require tornado mercy hospital buyer"
129129
let keystore = try! BIP32Keystore(mnemonics: mnemonic, password: "", mnemonicsPassword: "")!
130-
130+
131131
let verifyingContract = EthereumAddress("0x76106814dc6150b0fe510fbda4d2d877ac221270")!
132-
132+
133133
let account = keystore.addresses?[0]
134134
let password = ""
135135
let chainId: EIP712.UInt256? = EIP712.UInt256(42)
136-
136+
137137
let signature = try Web3Signer.signEIP712(
138138
safeTx: safeTX,
139139
keystore: keystore,
140140
verifyingContract: verifyingContract,
141141
account: account!,
142142
password: password,
143143
chainId: chainId)
144-
144+
145145
XCTAssertEqual(signature.toHexString(), "f1f423cb23efad5035d4fb95c19cfcd46d4091f2bd924680b88c4f9edfa1fb3a4ce5fc5d169f354e3b464f45a425ed3f6203af06afbacdc5c8224a300ce9e6b21b")
146146
}
147147
}
148+

Tests/web3swiftTests/localTests/LocalTestCase.swift

Lines changed: 0 additions & 44 deletions
This file was deleted.

Tests/web3swiftTests/localTests/LocalTests.xctestplan

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
"RemoteParsingTests",
2222
"RemoteTests",
2323
"ST20AndSecurityTokenTests",
24-
"WebsocketTests",
25-
"LocalTestCase"
24+
"WebsocketTests"
2625
],
2726
"target" : {
2827
"containerPath" : "container:web3swift.xcodeproj",

Tests/web3swiftTests/localTests/web3swiftAdvancedABIv2Tests.swift

Lines changed: 68 additions & 61 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)