Skip to content

Commit af66469

Browse files
chore: removed redundant parameters: [] in read operation
1 parent a49f771 commit af66469

File tree

11 files changed

+16
-16
lines changed

11 files changed

+16
-16
lines changed

Sources/web3swift/Tokens/ERC1155/Web3+ERC1155.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public class ERC1155: IERC1155 {
6969
}
7070
guard contract.contract.address != nil else {return}
7171

72-
guard let tokenIdPromise = try await contract.createReadOperation("id", parameters: [])?.callContractMethod() else {return}
72+
guard let tokenIdPromise = try await contract.createReadOperation("id")?.callContractMethod() else {return}
7373

7474
guard let tokenId = tokenIdPromise["0"] as? BigUInt else {return}
7575
self._tokenId = tokenId

Sources/web3swift/Tokens/ERC1376/Web3+ERC1376.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ public class ERC1376: IERC1376, ERC20BaseProperties {
298298
func increaseNonce(from: EthereumAddress) throws -> WriteOperation {
299299
transaction.callOnBlock = .latest
300300
updateTransactionAndContract(from: from)
301-
let tx = contract.createWriteOperation("increaseNonce", parameters: [])!
301+
let tx = contract.createWriteOperation("increaseNonce")!
302302
return tx
303303
}
304304

Sources/web3swift/Tokens/ERC1400/Web3+ERC1400.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,14 @@ extension ERC1400: IERC777 {
596596
}
597597

598598
public func getGranularity() async throws -> BigUInt {
599-
let result = try await contract.createReadOperation("granularity", parameters: [])!.callContractMethod()
599+
let result = try await contract.createReadOperation("granularity")!.callContractMethod()
600600

601601
guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
602602
return res
603603
}
604604

605605
public func getDefaultOperators() async throws -> [EthereumAddress] {
606-
let result = try await contract.createReadOperation("defaultOperators", parameters: [])!.callContractMethod()
606+
let result = try await contract.createReadOperation("defaultOperators")!.callContractMethod()
607607

608608
guard let res = result["0"] as? [EthereumAddress] else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
609609
return res

Sources/web3swift/Tokens/ERC1410/Web3+ERC1410.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,14 +474,14 @@ extension ERC1410: IERC777 {
474474
}
475475

476476
public func getGranularity() async throws -> BigUInt {
477-
let result = try await contract.createReadOperation("granularity", parameters: [])!.callContractMethod()
477+
let result = try await contract.createReadOperation("granularity")!.callContractMethod()
478478

479479
guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
480480
return res
481481
}
482482

483483
public func getDefaultOperators() async throws -> [EthereumAddress] {
484-
let result = try await contract.createReadOperation("defaultOperators", parameters: [])!.callContractMethod()
484+
let result = try await contract.createReadOperation("defaultOperators")!.callContractMethod()
485485

486486
guard let res = result["0"] as? [EthereumAddress] else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
487487
return res

Sources/web3swift/Tokens/ERC1633/Web3+ERC1633.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,14 +138,14 @@ public class ERC1633: IERC1633, ERC20BaseProperties {
138138
}
139139

140140
func parentToken() async throws -> EthereumAddress {
141-
let result = try await contract.createReadOperation("parentToken", parameters: [])!.callContractMethod()
141+
let result = try await contract.createReadOperation("parentToken")!.callContractMethod()
142142

143143
guard let res = result["0"] as? EthereumAddress else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
144144
return res
145145
}
146146

147147
func parentTokenId() async throws -> BigUInt {
148-
let result = try await contract.createReadOperation("parentTokenId", parameters: [])!.callContractMethod()
148+
let result = try await contract.createReadOperation("parentTokenId")!.callContractMethod()
149149

150150
guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
151151
return res

Sources/web3swift/Tokens/ERC1643/Web3+ERC1643.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ public class ERC1643: IERC1643, ERC20BaseProperties {
161161
}
162162

163163
public func getAllDocuments() async throws -> [Data] {
164-
let result = try await contract.createReadOperation("getAllDocuments", parameters: [])!.callContractMethod()
164+
let result = try await contract.createReadOperation("getAllDocuments")!.callContractMethod()
165165

166166
guard let res = result["0"] as? [Data] else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
167167
return res

Sources/web3swift/Tokens/ERC721x/Web3+ERC721x.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public class ERC721x: IERC721x {
7676
guard contract.contract.address != nil else {return}
7777
transaction.callOnBlock = .latest
7878

79-
guard let tokenIdPromise = try await contract.createReadOperation("tokenId", parameters: [])?.callContractMethod() else {return}
79+
guard let tokenIdPromise = try await contract.createReadOperation("tokenId")?.callContractMethod() else {return}
8080

8181
guard let tokenId = tokenIdPromise["0"] as? BigUInt else {return}
8282
self._tokenId = tokenId
@@ -201,7 +201,7 @@ public class ERC721x: IERC721x {
201201
}
202202

203203
func implementsERC721X() async throws -> Bool {
204-
let result = try await contract.createReadOperation("implementsERC721X", parameters: [])!.callContractMethod()
204+
let result = try await contract.createReadOperation("implementsERC721X")!.callContractMethod()
205205

206206
guard let res = result["0"] as? Bool else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
207207
return res

Sources/web3swift/Tokens/ERC777/Web3+ERC777.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ public class ERC777: IERC777, ERC20BaseProperties {
5757
}
5858

5959
public func getGranularity() async throws -> BigUInt {
60-
let result = try await contract.createReadOperation("granularity", parameters: [])!.callContractMethod()
60+
let result = try await contract.createReadOperation("granularity")!.callContractMethod()
6161

6262
guard let res = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
6363
return res
6464
}
6565

6666
public func getDefaultOperators() async throws -> [EthereumAddress] {
67-
let result = try await contract.createReadOperation("defaultOperators", parameters: [])!.callContractMethod()
67+
let result = try await contract.createReadOperation("defaultOperators")!.callContractMethod()
6868

6969
guard let res = result["0"] as? [EthereumAddress] else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
7070
return res

Sources/web3swift/Tokens/ST20/Web3+ST20.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public class ST20: IST20, ERC20BaseProperties {
5050
}
5151

5252
func tokenDetails() async throws -> [UInt32] {
53-
let result = try await contract.createReadOperation("tokenDetails", parameters: [])!.callContractMethod()
53+
let result = try await contract.createReadOperation("tokenDetails")!.callContractMethod()
5454

5555
guard let res = result["0"] as? [UInt32] else {throw Web3Error.processingError(desc: "Failed to get result of expected type from the Ethereum node")}
5656
return res

Sources/web3swift/Utils/ENS/ENSReverseRegistrar.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public extension ENS {
6666
}
6767

6868
public func getDefaultResolver() async throws -> EthereumAddress {
69-
guard let transaction = self.contract.createReadOperation("defaultResolver", parameters: []) else {throw Web3Error.transactionSerializationError}
69+
guard let transaction = self.contract.createReadOperation("defaultResolver") else {throw Web3Error.transactionSerializationError}
7070

7171
guard let result = try? await transaction.callContractMethod() else {throw Web3Error.processingError(desc: "Can't call transaction")}
7272
guard let address = result["0"] as? EthereumAddress else {throw Web3Error.processingError(desc: "Can't get answer")}

0 commit comments

Comments
 (0)