Skip to content

Commit 39c3b20

Browse files
Merge pull request #120 from matter-labs/fix/removeDeprecated
Fix/remove deprecated
2 parents e86c10b + 095a51c commit 39c3b20

37 files changed

+276
-1727
lines changed

web3swift.xcodeproj/project.pbxproj

Lines changed: 30 additions & 232 deletions
Large diffs are not rendered by default.

web3swift/Contract/Classes/EthereumContract.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import EthereumAddress
99
import EthereumABI
1010

1111
public struct EthereumContract:ContractProtocol {
12-
public var options: Web3Options? = Web3Options.defaultOptions()
1312
public var transactionOptions: TransactionOptions? = TransactionOptions.defaultOptions
1413
public var address: EthereumAddress? = nil
1514

web3swift/HookedFunctions/Classes/Web3+BrowserFunctions.swift

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,7 @@ extension web3.BrowserFunctions {
6868

6969
public func sendTransaction(_ transactionJSON: [String: Any], password: String = "web3swift") -> [String:Any]? {
7070
guard let transaction = EthereumTransaction.fromJSON(transactionJSON) else {return nil}
71-
guard let options = Web3Options.fromJSON(transactionJSON) else {return nil}
72-
var transactionOptions = TransactionOptions()
73-
transactionOptions.from = options.from
74-
transactionOptions.to = options.to
75-
transactionOptions.value = options.value
76-
transactionOptions.gasLimit = options.gasLimit != nil ? .limited(options.gasLimit!) : .automatic
77-
transactionOptions.gasPrice = options.gasPrice != nil ? .manual(options.gasPrice!) : .automatic
71+
guard let transactionOptions = TransactionOptions.fromJSON(transactionJSON) else {return nil}
7872
return self.sendTransaction(transaction, transactionOptions: transactionOptions, password: password)
7973
}
8074

@@ -89,13 +83,7 @@ extension web3.BrowserFunctions {
8983

9084
public func estimateGas(_ transactionJSON: [String: Any]) -> BigUInt? {
9185
guard let transaction = EthereumTransaction.fromJSON(transactionJSON) else {return nil}
92-
guard let options = Web3Options.fromJSON(transactionJSON) else {return nil}
93-
var transactionOptions = TransactionOptions()
94-
transactionOptions.from = options.from
95-
transactionOptions.to = options.to
96-
transactionOptions.value = options.value
97-
transactionOptions.gasLimit = .automatic
98-
transactionOptions.gasPrice = options.gasPrice != nil ? .manual(options.gasPrice!) : .automatic
86+
guard let transactionOptions = TransactionOptions.fromJSON(transactionJSON) else {return nil}
9987
return self.estimateGas(transaction, transactionOptions: transactionOptions)
10088
}
10189

@@ -134,13 +122,7 @@ extension web3.BrowserFunctions {
134122

135123
public func signTransaction(_ transactionJSON: [String: Any], password: String = "web3swift") -> String? {
136124
guard let transaction = EthereumTransaction.fromJSON(transactionJSON) else {return nil}
137-
guard let options = Web3Options.fromJSON(transactionJSON) else {return nil}
138-
var transactionOptions = TransactionOptions()
139-
transactionOptions.from = options.from
140-
transactionOptions.to = options.to
141-
transactionOptions.value = options.value
142-
transactionOptions.gasLimit = options.gasLimit != nil ? .limited(options.gasLimit!) : .automatic
143-
transactionOptions.gasPrice = options.gasPrice != nil ? .manual(options.gasPrice!) : .automatic
125+
guard var transactionOptions = TransactionOptions.fromJSON(transactionJSON) else {return nil}
144126
if let nonceString = transactionJSON["nonce"] as? String, let nonce = BigUInt(nonceString.stripHexPrefix(), radix: 16) {
145127
transactionOptions.nonce = .manual(nonce)
146128
} else {

web3swift/PrecompiledContracts/ERC1155/Web3+ERC1155.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ protocol IERC1155Metadata {
3232

3333
public class ERC1155: IERC1155 {
3434

35-
@available(*, deprecated, renamed: "transactionOptions")
36-
public var options: Web3Options = .init()
37-
3835
private var _tokenId: BigUInt? = nil
3936
private var _hasReadProperties: Bool = false
4037

web3swift/PrecompiledContracts/ERC1376/Web3+ERC1376.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,6 @@ protocol IERC1376: IERC20 {
6969

7070
public class ERC1376: IERC1376 {
7171

72-
@available(*, deprecated, renamed: "transactionOptions")
73-
public var options: Web3Options = .init()
74-
7572
private var _name: String? = nil
7673
private var _symbol: String? = nil
7774
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1400/Web3+ERC1400.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@ protocol IERC1400: IERC20 {
6666
// can be imperatively read and saved
6767
public class ERC1400: IERC1400 {
6868

69-
@available(*, deprecated, renamed: "transactionOptions")
70-
public var options: Web3Options = .init()
71-
7269
private var _name: String? = nil
7370
private var _symbol: String? = nil
7471
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1410/Web3+ERC1410.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,6 @@ protocol IERC1410: IERC20 {
4444

4545
public class ERC1410: IERC1410 {
4646

47-
@available(*, deprecated, renamed: "transactionOptions")
48-
public var options: Web3Options = .init()
49-
5047
private var _name: String? = nil
5148
private var _symbol: String? = nil
5249
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1594/Web3+ERC1594.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ protocol IERC1594: IERC20 {
3434

3535
public class ERC1594: IERC1594 {
3636

37-
@available(*, deprecated, renamed: "transactionOptions")
38-
public var options: Web3Options = .init()
39-
4037
private var _name: String? = nil
4138
private var _symbol: String? = nil
4239
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1633/Web3+ERC1633.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,6 @@ protocol IERC1633: IERC20, IERC165 {
2121

2222
public class ERC1633: IERC1633 {
2323

24-
@available(*, deprecated, renamed: "transactionOptions")
25-
public var options: Web3Options = .init()
26-
2724
private var _name: String? = nil
2825
private var _symbol: String? = nil
2926
private var _decimals: UInt8? = nil

web3swift/PrecompiledContracts/ERC1643/Web3+ERC1643.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ protocol IERC1643: IERC20 {
2323
}
2424

2525
public class ERC1643: IERC1643 {
26-
@available(*, deprecated, renamed: "transactionOptions")
27-
public var options: Web3Options = .init()
2826

2927
private var _name: String? = nil
3028
private var _symbol: String? = nil

0 commit comments

Comments
 (0)