Skip to content

Commit 7ecc12e

Browse files
committed
concurrency marked as deprecated, some functions deleted
1 parent 5d3bc06 commit 7ecc12e

13 files changed

+37
-25
lines changed

web3swift/Concurrency/Classes/Web3+Concurrency.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Result
1111

1212
public typealias Callback = ((Result<AnyObject, Web3Error>) -> ())
1313

14+
@available(*, deprecated)
1415
public class OperationDispatcher {
1516
public var MAX_WAIT_TIME: TimeInterval = 0.2
1617
private var provider: Web3Provider
@@ -188,6 +189,7 @@ protocol OperationProtocol{
188189
var error: Web3Error? {get set}
189190
}
190191

192+
@available(*, deprecated)
191193
public class Web3Operation: Operation, OperationProtocol {
192194
var web3: web3
193195

web3swift/Concurrency/Classes/Web3+ConversionOperations.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Foundation
1010
import Result
1111
import BigInt
1212

13+
@available(*, deprecated)
1314
final class ResultUnwrapOperation: Web3Operation {
1415
override func main() {
1516
if (error != nil) {
@@ -28,6 +29,7 @@ final class ResultUnwrapOperation: Web3Operation {
2829
}
2930
}
3031

32+
@available(*, deprecated)
3133
final class ConversionOperation<T>: Web3Operation {
3234
override func main() {
3335
if (error != nil) {
@@ -40,6 +42,7 @@ final class ConversionOperation<T>: Web3Operation {
4042
}
4143
}
4244

45+
@available(*, deprecated)
4346
final class BigUIntConversionOperation: Web3Operation {
4447

4548
override func main() {
@@ -65,6 +68,7 @@ final class BigUIntConversionOperation: Web3Operation {
6568
}
6669
}
6770

71+
@available(*, deprecated)
6872
final class JSONasDataConversionOperation: Web3Operation {
6973

7074
override func main() {
@@ -90,6 +94,7 @@ final class JSONasDataConversionOperation: Web3Operation {
9094
}
9195
}
9296

97+
@available(*, deprecated)
9398
final class DictionaryConversionOperation: Web3Operation {
9499

95100
override func main() {
@@ -112,6 +117,7 @@ final class DictionaryConversionOperation: Web3Operation {
112117
}
113118
}
114119

120+
@available(*, deprecated)
115121
final class StringDictionaryConversionOperation: Web3Operation {
116122

117123
override func main() {
@@ -134,6 +140,7 @@ final class StringDictionaryConversionOperation: Web3Operation {
134140
}
135141
}
136142

143+
@available(*, deprecated)
137144
final class AddressArrayConversionOperation: Web3Operation {
138145

139146
override func main() {
@@ -165,6 +172,7 @@ final class AddressArrayConversionOperation: Web3Operation {
165172
}
166173
}
167174

175+
@available(*, deprecated)
168176
final class DataConversionOperation: Web3Operation {
169177

170178
override func main() {
@@ -190,6 +198,7 @@ final class DataConversionOperation: Web3Operation {
190198
}
191199
}
192200

201+
@available(*, deprecated)
193202
final class StringConversionOperation: Web3Operation {
194203

195204
override func main() {
@@ -212,6 +221,7 @@ final class StringConversionOperation: Web3Operation {
212221
}
213222
}
214223

224+
@available(*, deprecated)
215225
final class JoinOperation: Web3Operation {
216226
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, operations: [Web3Operation]) {
217227
self.init(web3Instance, queue: queue, inputData: operations as AnyObject)

web3swift/Concurrency/Classes/Web3+DataFetchOperation.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import Foundation
1010
import Result
1111

12+
@available(*, deprecated)
1213
final class DataFetchOperation: Web3Operation {
1314

1415
override func main() {
@@ -24,6 +25,7 @@ final class DataFetchOperation: Web3Operation {
2425
}
2526
}
2627

28+
@available(*, deprecated)
2729
final class NoBatchingDataFetchOperation: Web3Operation {
2830

2931
override func main() {

web3swift/Concurrency/Classes/Web3+EthOperations.swift

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Result
1111
import BigInt
1212

1313

14+
@available(*, deprecated)
1415
final class GetAccountsOperation: Web3Operation {
1516
override func main() {
1617
if (error != nil) {
@@ -36,6 +37,7 @@ final class GetAccountsOperation: Web3Operation {
3637
}
3738
}
3839

40+
@available(*, deprecated)
3941
final class GetTransactionCountOperation: Web3Operation {
4042
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, address: EthereumAddress, onBlock: String = "latest") {
4143
let addressString = address.address.lowercased()
@@ -67,6 +69,7 @@ final class GetTransactionCountOperation: Web3Operation {
6769
}
6870
}
6971

72+
@available(*, deprecated)
7073
final class GetBalanceOperation: Web3Operation {
7174
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, address: EthereumAddress, onBlock: String = "latest") {
7275
let addressString = address.address.lowercased()
@@ -98,6 +101,7 @@ final class GetBalanceOperation: Web3Operation {
98101
}
99102
}
100103

104+
@available(*, deprecated)
101105
final class GetBlockNumberOperation: Web3Operation {
102106
override func main() {
103107
if (error != nil) {
@@ -114,6 +118,7 @@ final class GetBlockNumberOperation: Web3Operation {
114118
}
115119
}
116120

121+
@available(*, deprecated)
117122
final class GetGasPriceOperation: Web3Operation {
118123
override func main() {
119124
if (error != nil) {
@@ -130,6 +135,7 @@ final class GetGasPriceOperation: Web3Operation {
130135
}
131136
}
132137

138+
@available(*, deprecated)
133139
final class EstimateGasOperation: Web3Operation {
134140
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, transaction: EthereumTransaction, options: Web3Options?, onBlock: String = "latest") {
135141
self.init(web3Instance, queue: queue, inputData: [transaction, options as Any, onBlock] as AnyObject)
@@ -163,6 +169,7 @@ final class EstimateGasOperation: Web3Operation {
163169
}
164170
}
165171

172+
@available(*, deprecated)
166173
final class CallOperation: Web3Operation {
167174
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, transaction: EthereumTransaction, options: Web3Options?, onBlock: String = "latest") {
168175
self.init(web3Instance, queue: queue, inputData: [transaction, options as Any, onBlock] as AnyObject)
@@ -197,6 +204,7 @@ final class CallOperation: Web3Operation {
197204
}
198205
}
199206

207+
@available(*, deprecated)
200208
final class SendTransactionOperation: Web3Operation {
201209
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, transaction: EthereumTransaction, options: Web3Options?, password:String = "BANKEXFOUNDATION") {
202210
self.init(web3Instance, queue: queue, inputData: [transaction, options as Any, password] as AnyObject)
@@ -250,6 +258,7 @@ final class SendTransactionOperation: Web3Operation {
250258
}
251259
}
252260

261+
@available(*, deprecated)
253262
final class SendRawTransactionOperation: Web3Operation {
254263
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, transaction: EthereumTransaction) {
255264
self.init(web3Instance, queue: queue, inputData: transaction as AnyObject)

web3swift/Concurrency/Classes/Web3+EventOperations.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Foundation
1010
import Result
1111
import BigInt
1212

13+
@available(*, deprecated)
1314
final class ParseBlockForEventsOperation: Web3Operation {
1415

1516
convenience init?(_ web3Instance: web3, queue: OperationQueue? = nil, contract: ContractProtocol, eventName: String, filter: EventFilter? = nil, block: UInt64) {
@@ -86,6 +87,7 @@ final class ParseBlockForEventsOperation: Web3Operation {
8687
}
8788

8889

90+
@available(*, deprecated)
8991
final class ParseTransactionForEventsOperation: Web3Operation {
9092

9193
convenience init?(_ web3Instance: web3, queue: OperationQueue? = nil, contract: ContractProtocol, eventName: String, filter: EventFilter? = nil, transactionHash: Data) {

web3swift/Concurrency/Classes/Web3+NativePrimitivesConversionOperations.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Foundation
1010
import Result
1111
import BigInt
1212

13+
@available(*, deprecated)
1314
final class TransactionReceiptConversionOperation: Web3Operation {
1415

1516
override func main() {
@@ -29,6 +30,7 @@ final class TransactionReceiptConversionOperation: Web3Operation {
2930
}
3031
}
3132

33+
@available(*, deprecated)
3234
final class TransactionDetailsConversionOperation: Web3Operation {
3335

3436
override func main() {
@@ -48,6 +50,7 @@ final class TransactionDetailsConversionOperation: Web3Operation {
4850
}
4951
}
5052

53+
@available(*, deprecated)
5154
final class BlockConversionOperation: Web3Operation {
5255

5356
override func main() {

web3swift/Concurrency/Classes/Web3+PersonalOperations.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import Foundation
1010

11-
11+
@available(*, deprecated)
1212
final class PersonalUnlockAccountOperation: Web3Operation {
1313
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, account: EthereumAddress, password: String = "BANKEXFOUNDATION", seconds: UInt64 = 300) {
1414
let addressString = account.address.lowercased()
@@ -41,6 +41,7 @@ final class PersonalUnlockAccountOperation: Web3Operation {
4141
}
4242
}
4343

44+
@available(*, deprecated)
4445
final class PersonalSignOperation: Web3Operation {
4546

4647
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, message: Data, from: EthereumAddress, password:String = "BANKEXFOUNDATION") {

web3swift/Concurrency/Classes/Web3+TransactionAndBlockDetailsOperations.swift

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import Foundation
1010
import BigInt
1111

12+
@available(*, deprecated)
1213
final class GetTransactionDetailsOperation: Web3Operation {
1314

1415
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, txHash: String) {
@@ -38,7 +39,7 @@ final class GetTransactionDetailsOperation: Web3Operation {
3839
}
3940
}
4041

41-
42+
@available(*, deprecated)
4243
final class GetTransactionReceiptOperation: Web3Operation {
4344

4445
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, txHash: String) {
@@ -68,6 +69,7 @@ final class GetTransactionReceiptOperation: Web3Operation {
6869
}
6970
}
7071

72+
@available(*, deprecated)
7173
final class GetBlockByNumberOperation: Web3Operation {
7274
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, blockNumber: UInt64, fullTransactions: Bool = false) {
7375
let blockNumberString = String(blockNumber, radix: 16).addHexPrefix()
@@ -105,6 +107,7 @@ final class GetBlockByNumberOperation: Web3Operation {
105107
}
106108
}
107109

110+
@available(*, deprecated)
108111
final class GetBlockByHashOperation: Web3Operation {
109112
convenience init(_ web3Instance: web3, queue: OperationQueue? = nil, hash: String, fullTransactions: Bool = false) {
110113
self.init(web3Instance, queue: queue, inputData: [hash, fullTransactions] as AnyObject)

web3swift/Concurrency/Classes/Web3+TransactionOperations.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import Foundation
1010
import Result
1111
import BigInt
1212

13+
@available(*, deprecated)
1314
final class ContractCallOperation: Web3Operation {
1415
var method: String?
1516

@@ -113,6 +114,7 @@ final class ContractCallOperation: Web3Operation {
113114
}
114115

115116

117+
@available(*, deprecated)
116118
final class ContractEstimateGasOperation: Web3Operation {
117119

118120
convenience init?(_ web3Instance: web3, queue: OperationQueue? = nil, contract: web3.web3contract, method: String = "fallback", parameters: [AnyObject] = [], extraData: Data = Data(), options: Web3Options?, onBlock: String = "latest") {
@@ -140,6 +142,7 @@ final class ContractEstimateGasOperation: Web3Operation {
140142
}
141143
}
142144

145+
@available(*, deprecated)
143146
final class ContractSendOperation: Web3Operation {
144147

145148
convenience init?(_ web3Instance: web3, queue: OperationQueue? = nil, contract: web3.web3contract, method: String = "fallback", parameters: [AnyObject] = [], extraData: Data = Data(), options: Web3Options?, onBlock: String = "pending", password: String = "BANKEXFOUNDATION") {

web3swift/Convenience/Classes/CryptoExtensions.swift

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ func toByteArray<T>(_ value: T) -> [UInt8] {
1414
return withUnsafeBytes(of: &value) { Array($0) }
1515
}
1616

17-
func fromByteArray<T>(_ value: [UInt8], _: T.Type) -> T {
18-
return value.withUnsafeBytes {
19-
$0.baseAddress!.load(as: T.self)
20-
}
21-
}
22-
2317
public func scrypt (password: String, salt: Data, length: Int, N: Int, R: Int, P: Int) -> Data? {
2418
let BytesMin = Int(crypto_generichash_bytes_min())
2519
let BytesMax = Int(crypto_generichash_bytes_max())

0 commit comments

Comments
 (0)