File tree Expand file tree Collapse file tree 1 file changed +12
-14
lines changed
Tests/web3swiftTests/localTests Expand file tree Collapse file tree 1 file changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -22,28 +22,26 @@ class BasicLocalNodeTests: LocalTestCase {
22
22
let contract = web3. contract ( abiString, at: nil , abiVersion: 2 ) !
23
23
24
24
let parameters = [ ] as [ AnyObject ]
25
- // MARK: Writing Data flow
25
+
26
26
let deployTx = contract. prepareDeploy ( bytecode: bytecode, parameters: parameters) !
27
27
deployTx. transaction. from = allAddresses [ 0 ]
28
28
deployTx. transaction. gasLimitPolicy = . manual( 3000000 )
29
29
30
30
let result = try await deployTx. writeToChain ( password: " web3swift " )
31
31
let txHash = result. hash. stripHexPrefix ( )
32
32
33
- Thread . sleep ( forTimeInterval: 1.0 )
34
-
35
- let receipt = try await web3. eth. transactionReceipt ( Data . fromHex ( txHash) !)
36
- print ( receipt)
37
-
38
- switch receipt. status {
39
- case . notYetProcessed:
40
- return
41
- default :
42
- break
33
+ while true {
34
+ let receipt = try await web3. eth. transactionReceipt ( Data . fromHex ( txHash) !)
35
+ switch receipt. status {
36
+ case . notYetProcessed:
37
+ continue
38
+ case . failed:
39
+ XCTFail ( " Failed to deploy a contract! " )
40
+ case . ok:
41
+ XCTAssertNotNil ( receipt. contractAddress)
42
+ return
43
+ }
43
44
}
44
-
45
- let details = try await web3. eth. transactionDetails ( Data . fromHex ( txHash) !)
46
- print ( details)
47
45
}
48
46
49
47
func testEthSendExampleWithRemoteSigning( ) async throws {
You can’t perform that action at this time.
0 commit comments