Skip to content

Commit 3256a6c

Browse files
author
Mark Barrasso
authored
Update ETHRegistrarController.swift
Unable to cast getRentPrice result as UInt. Fixed by casting to BigUInt.
1 parent 358d2a2 commit 3256a6c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/web3swift/Utils/ENS/ETHRegistrarController.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ public extension ENS {
3030
self.address = address
3131
}
3232

33-
public func getRentPrice(name: String, duration: UInt) throws -> UInt {
33+
public func getRentPrice(name: String, duration: UInt) throws -> BigUInt {
3434
guard let transaction = self.contract.read("rentPrice", parameters: [name, duration] as [AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError}
3535
guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")}
36-
guard let price = result["0"] as? UInt else {throw Web3Error.processingError(desc: "Can't get answer")}
36+
guard let price = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Can't get answer")}
3737
return price
3838
}
3939

0 commit comments

Comments
 (0)