diff --git a/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h b/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h index d04d0f479..54c439564 120000 --- a/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h +++ b/Pods/Headers/Public/BigInt/BigInt-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap b/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap index 5e3ba93be..5827ffd6f 120000 --- a/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap +++ b/Pods/Headers/Public/BigInt/BigInt-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-iOS/BigInt-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h b/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h index 7c100fb6e..15cd9101e 120000 --- a/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h +++ b/Pods/Headers/Public/BigInt/BigInt-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap b/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap index 309999e26..db0458375 120000 --- a/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap +++ b/Pods/Headers/Public/BigInt/BigInt-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/BigInt-macOS/BigInt-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h index 53d6c211e..38ee2e270 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap index c3e3c3a34..d3c8afa43 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-iOS/CryptoSwift-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h index 1bf7d4d73..4f6598359 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap index 19cb03653..13bb9bda2 120000 --- a/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap +++ b/Pods/Headers/Public/CryptoSwift/CryptoSwift-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/CryptoSwift-macOS/CryptoSwift-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h index 82745e647..372038959 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap index bff509710..ded50b1ab 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-iOS/EthereumABI-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h index c4a703b51..e72800bb6 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap index c270ce50e..99eb1eb31 120000 --- a/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap +++ b/Pods/Headers/Public/EthereumABI/EthereumABI-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumABI-macOS/EthereumABI-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h index 48a0c2378..505dcdba1 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap index 5daa54791..2e8de9c1b 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-iOS/EthereumAddress-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h index ec4284bbd..45c29b7ea 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap index 71f266362..1814f3891 120000 --- a/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap +++ b/Pods/Headers/Public/EthereumAddress/EthereumAddress-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/EthereumAddress-macOS/EthereumAddress-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h b/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h index 54a39550a..384f088cd 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h +++ b/Pods/Headers/Public/PromiseKit/PromiseKit-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap b/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap index 03e17826b..5b105d963 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap +++ b/Pods/Headers/Public/PromiseKit/PromiseKit.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit/PromiseKit.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h index 2202ae821..6026bec84 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h +++ b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap index 377be965b..515bc96ce 120000 --- a/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap +++ b/Pods/Headers/Public/PromiseKit/PromiseKit.root-CorePromise-Foundation.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/PromiseKit.root-CorePromise-Foundation/PromiseKit.root-CorePromise-Foundation.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-iOS-umbrella.h b/Pods/Headers/Public/Result/Result-iOS-umbrella.h index a7f847b9e..5017bcc62 120000 --- a/Pods/Headers/Public/Result/Result-iOS-umbrella.h +++ b/Pods/Headers/Public/Result/Result-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-iOS.modulemap b/Pods/Headers/Public/Result/Result-iOS.modulemap index bc4f23ca4..a9cb518ea 120000 --- a/Pods/Headers/Public/Result/Result-iOS.modulemap +++ b/Pods/Headers/Public/Result/Result-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-iOS/Result-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-macOS-umbrella.h b/Pods/Headers/Public/Result/Result-macOS-umbrella.h index 5c92b47bc..d933679ed 120000 --- a/Pods/Headers/Public/Result/Result-macOS-umbrella.h +++ b/Pods/Headers/Public/Result/Result-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/Result/Result-macOS.modulemap b/Pods/Headers/Public/Result/Result-macOS.modulemap index a1725381e..6ff87c94a 120000 --- a/Pods/Headers/Public/Result/Result-macOS.modulemap +++ b/Pods/Headers/Public/Result/Result-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/Result-macOS/Result-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h b/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h index 909a01c80..736829e4f 120000 --- a/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h +++ b/Pods/Headers/Public/SipHash/SipHash-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap b/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap index 60dbe3748..363bde1c4 120000 --- a/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap +++ b/Pods/Headers/Public/SipHash/SipHash-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-iOS/SipHash-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h b/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h index b1f95e224..c56e6a45b 120000 --- a/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h +++ b/Pods/Headers/Public/SipHash/SipHash-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap b/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap index 5ea25fc9c..835353525 120000 --- a/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap +++ b/Pods/Headers/Public/SipHash/SipHash-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SipHash-macOS/SipHash-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h index b1b552e68..b77347325 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap index 0842d08e1..ae407f989 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-iOS/SwiftRLP-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h index b77715c02..4740a4f84 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap index c5cebdd37..d1421e204 120000 --- a/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap +++ b/Pods/Headers/Public/SwiftRLP/SwiftRLP-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/SwiftRLP-macOS/SwiftRLP-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h b/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h index e82a48440..1c81cd5a7 120000 --- a/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h +++ b/Pods/Headers/Public/scrypt/scrypt-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap b/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap index 082fbbbba..02bd8338d 120000 --- a/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap +++ b/Pods/Headers/Public/scrypt/scrypt-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-iOS/scrypt-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h b/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h index 7a0dabd86..75f99866d 120000 --- a/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h +++ b/Pods/Headers/Public/scrypt/scrypt-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap b/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap index 9ec4c6ed1..2e33aed25 120000 --- a/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap +++ b/Pods/Headers/Public/scrypt/scrypt-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/scrypt-macOS/scrypt-macOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h index 554c654f1..70cc63a67 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap index 44829fb84..c5b6fa265 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-iOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-iOS/secp256k1_swift-iOS.modulemap \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h index 56967ab47..d75b444d6 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS-umbrella.h @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS-umbrella.h \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS-umbrella.h \ No newline at end of file diff --git a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap index 0ec25a913..c0e372d55 120000 --- a/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap +++ b/Pods/Headers/Public/secp256k1_swift/secp256k1_swift-macOS.modulemap @@ -1 +1 @@ -/Users/alexvlasov/Blockchain/web3swift/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS.modulemap \ No newline at end of file +/Users/antongrigorev/Developer/web3swift/Pods/Target Support Files/secp256k1_swift-macOS/secp256k1_swift-macOS.modulemap \ No newline at end of file diff --git a/web3swift.xcodeproj/project.pbxproj b/web3swift.xcodeproj/project.pbxproj index 0d69ba87b..ed32b1f28 100755 --- a/web3swift.xcodeproj/project.pbxproj +++ b/web3swift.xcodeproj/project.pbxproj @@ -176,6 +176,11 @@ E2065FB92181D7D700701068 /* Promise+Web3+Contract+GetIndexedEvents.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81195AAF20D7FF8500ABC6B1 /* Promise+Web3+Contract+GetIndexedEvents.swift */; }; E2065FBA2181D7D700701068 /* Promise+Web3+TxPool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 985BFD4D216E2E0A00B28C14 /* Promise+Web3+TxPool.swift */; }; E2065FBB2181D7D700701068 /* Web3+TxPool.swift in Sources */ = {isa = PBXBuildFile; fileRef = 985BFD49216CE8B100B28C14 /* Web3+TxPool.swift */; }; + E2DCA653218C875100F94FBA /* web3swift_ENS_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 81A7B2782143C978004CD2C7 /* web3swift_ENS_Tests.swift */; }; + E2DCA654218C879900F94FBA /* ENS.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E668CD214F8A7B00C3CC2D /* ENS.swift */; }; + E2DCA655218C879900F94FBA /* ENSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B219DC162154F3EE0035BF94 /* ENSResolver.swift */; }; + E2DCA656218C87A500F94FBA /* ENS.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2E668CD214F8A7B00C3CC2D /* ENS.swift */; }; + E2DCA657218C87A500F94FBA /* ENSResolver.swift in Sources */ = {isa = PBXBuildFile; fileRef = B219DC162154F3EE0035BF94 /* ENSResolver.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -1004,6 +1009,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E2DCA654218C879900F94FBA /* ENS.swift in Sources */, + E2DCA655218C879900F94FBA /* ENSResolver.swift in Sources */, 81C146F71FF274B200AA943E /* Web3+Structures.swift in Sources */, 8104E2281FE82BDC00F952CB /* Web3+Utils.swift in Sources */, 81909D2B218852E2007D2AE5 /* Web3+ERC20.swift in Sources */, @@ -1083,6 +1090,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E2DCA653218C875100F94FBA /* web3swift_ENS_Tests.swift in Sources */, 81909D292188504D007D2AE5 /* web3swift_AdvancedABIv2_Tests.swift in Sources */, 00E5FE8220EA3FF40030E0D6 /* web3swift_infura_Tests.swift in Sources */, 81909D2A21885067007D2AE5 /* web3swift_rinkeby_personalSignature_Tests.swift in Sources */, @@ -1104,6 +1112,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + E2DCA656218C87A500F94FBA /* ENS.swift in Sources */, + E2DCA657218C87A500F94FBA /* ENSResolver.swift in Sources */, E2065FB82181D7D700701068 /* Promise+Web3+Eth+EstimateGas.swift in Sources */, E2065FB92181D7D700701068 /* Promise+Web3+Contract+GetIndexedEvents.swift in Sources */, 81909D2C218852E2007D2AE5 /* Web3+ERC20.swift in Sources */, diff --git a/web3swift/Utils/Classes/ENS.swift b/web3swift/Utils/Classes/ENS.swift index dab9235e1..87a1c4174 100644 --- a/web3swift/Utils/Classes/ENS.swift +++ b/web3swift/Utils/Classes/ENS.swift @@ -33,216 +33,126 @@ public class ENS { return contract! }() - private lazy var defaultOptions: Web3Options = { - return Web3Options.defaultOptions() + private lazy var defaultOptions: TransactionOptions = { + return TransactionOptions.defaultOptions }() //MARK: - Convenience methods - public func getAddress(_ domain: String) -> Result { - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var resolver): - let isAddrSupports = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.addr.hash()) - switch isAddrSupports{ - case .success(let isSupported): - if isSupported { - return resolver.addr(forDomain: domain) - } else { - return Result.failure(Web3Error.dataError) - } - case .failure(let error): - return Result.failure(error) - } - case .failure(let error): - return Result.failure(error) - } + public func getAddress(_ domain: String) throws -> EthereumAddress { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let isAddrSupports = try? resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.addr.hash()) else {throw Web3Error.processingError(desc: "Resolver don't support interface with this ID")} + guard isAddrSupports else {throw Web3Error.processingError(desc: "Address isn't supported")} + guard let addr = try? resolver.addr(forDomain: domain) else {throw Web3Error.processingError(desc: "Can't get address")} + return addr } - public func setAddress(domain: String, address: EthereumAddress, options: Web3Options, password: String? = nil) -> Result{ - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var resolver): - let isSetAddrSupported = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.addr.hash()) - switch isSetAddrSupported { - case .success(let value): - if value { - return resolver.setAddr(node: domain, address: address, options: options, password: password) - } else { - return Result.failure(Web3Error.dataError) - } - case .failure(let error): - return Result.failure(error) - } - case .failure(let error): - return Result.failure(error) - } + public func setAddress(domain: String, address: EthereumAddress, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let isAddrSupports = try? resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.addr.hash()) else {throw Web3Error.processingError(desc: "Resolver don't support interface with this ID")} + guard isAddrSupports else {throw Web3Error.processingError(desc: "Address isn't supported")} + guard let result = try? resolver.setAddr(node: domain, address: address, options: options, password: password) else {throw Web3Error.processingError(desc: "Can't get result")} + return result } - public func getPubkey(domain: String) -> Result { - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var resolver): - let isPubkeySupports = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.pubkey.hash()) - switch isPubkeySupports { - case .success(let value): - if value { - return resolver.pubkey(node: domain) - } else { - return Result.failure(Web3Error.dataError) - } - case .failure(let error): - return Result.failure(error) - } - - case .failure(let error): - return Result.failure(error) - } + public func getPubkey(domain: String) throws -> PublicKey { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let isPubkeySupports = try? resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.pubkey.hash()) else {throw Web3Error.processingError(desc: "Resolver don't support interface with this ID")} + guard isPubkeySupports else {throw Web3Error.processingError(desc: "Pubkey isn't supported")} + guard let pubkey = try? resolver.pubkey(node: domain) else {throw Web3Error.processingError(desc: "Can't get pubkey")} + return pubkey } - public func setPubkey(domain: String, x: String, y: String, options: Web3Options, password: String? = nil) -> Result { - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var value): - return value.setPubkey(node: domain, x: x, y: y, options: options, password: password) - case .failure(let error): - return Result.failure(error) - } + public func setPubkey(domain: String, x: String, y: String, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let result = try? resolver.setPubkey(node: domain, x: x, y: y, options: options, password: password) else {throw Web3Error.processingError(desc: "Can't get result")} + return result } - public func getContent(domain: String) -> Result { - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var value): - return value.content(node: domain) - case .failure(let error): - return Result.failure(error) - } + public func getContent(domain: String) throws -> String { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let content = try? resolver.content(node: domain) else {throw Web3Error.processingError(desc: "Can't get content")} + return content } - public func setContent(domain: String, hash: String, options: Web3Options, password: String? = nil) -> Result { - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var value): - return value.setContent(node: domain, hash: hash, options: options, password: password) - case .failure(let error): - return Result.failure(error) - } + public func setContent(domain: String, hash: String, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let result = try? resolver.setContent(node: domain, hash: hash, options: options, password: password) else {throw Web3Error.processingError(desc: "Can't get result")} + return result } - - public func getMultihash(domain: String) -> Result { - let resolver = self.resolver(forDomain: domain) - switch resolver { - case .success(var value): - return value.multihash(node: domain) - case .failure(let error): - return Result.failure(error) - } + public func getMultihash(domain: String) throws -> Data { + guard var resolver = try? self.resolver(forDomain: domain) else {throw Web3Error.processingError(desc: "Failed to get resolver for domain")} + guard let multihash = try? resolver.multihash(node: domain) else {throw Web3Error.processingError(desc: "Can't get multihash")} + return multihash } //MARK: - Returns resolver for the given domain - public func resolver(forDomain domain: String) -> Result { - guard let nameHash = NameHash.nameHash(domain) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("resolver", parameters: [nameHash as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let res): - guard let resolverAddress = res["0"] as? EthereumAddress else { return Result.failure(Web3Error.dataError) } - return Result(ResolverENS(web3: self.web3, resolverAddress: resolverAddress)) - case .failure(let error): - return Result.failure(error) - } + public func resolver(forDomain domain: String) throws -> ResolverENS { + guard let nameHash = NameHash.nameHash(domain) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.registryContract.read("resolver", parameters: [nameHash as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let resolverAddress = result["0"] as? EthereumAddress else {throw Web3Error.processingError(desc: "No address in result")} + return ResolverENS(web3: self.web3, resolverAddress: resolverAddress) } //Returns node's owner address - public func owner(node: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("owner", parameters: [nameHash as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let value): - guard let address = value["0"] as? EthereumAddress else { return Result.failure(Web3Error.dataError) } - return Result(address) - case .failure(let error): - return Result.failure(error) - } + public func owner(node: String) throws -> EthereumAddress { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.registryContract.read("owner", parameters: [nameHash as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let address = result["0"] as? EthereumAddress else {throw Web3Error.processingError(desc: "No address in result")} + return address } //Untested - public func ttl(node: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("ttl", parameters: [nameHash as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let value): - guard let ans = value["0"] as? BigUInt else { return Result.failure(Web3Error.dataError) } - return Result(ans) - case .failure(let error): - return Result.failure(error) - } + public func ttl(node: String) throws -> BigUInt { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.registryContract.read("ttl", parameters: [nameHash as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let ans = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "No answer in result")} + return ans } // function setOwner(bytes32 node, address owner); - public func setOwner(node: String, owner: EthereumAddress, options: Web3Options, password: String? = nil) -> Result { + public func setOwner(node: String, owner: EthereumAddress, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("setOwner", parameters: [nameHash, owner] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError)} - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) - switch result { - case .failure(let error): - return Result.failure(error) - case .success(let value): - return Result(value) - } + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.registryContract.write("setOwner", parameters: [nameHash, owner] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} + return result } // function setSubnodeOwner(bytes32 node, bytes32 label, address owner); - public func setSubnodeOwner(node: String, label: String, owner: EthereumAddress, options: Web3Options, password: String? = nil) -> Result { + public func setSubnodeOwner(node: String, label: String, owner: EthereumAddress, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let labelHash = NameHash.nameHash(label) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("setSubnodeOwner", parameters: [nameHash, labelHash, owner] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError)} - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) - switch result { - case .success(let value): - return Result(value) - case .failure(let error): - return Result.failure(error) - } + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let labelHash = NameHash.nameHash(label) else {throw Web3Error.processingError(desc: "Failed to get label hash")} + guard let transaction = self.registryContract.write("setSubnodeOwner", parameters: [nameHash, labelHash, owner] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} + return result } // function setResolver(bytes32 node, address resolver); - public func setResolver(node: String, resolver: EthereumAddress, options: Web3Options, password: String? = nil) -> Result { + public func setResolver(node: String, resolver: EthereumAddress, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("setResolver", parameters: [nameHash, resolver] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) - switch result { - case .success(let value): - return Result(value) - case .failure(let error): - return Result.failure(error) - } - + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.registryContract.write("setResolver", parameters: [nameHash, resolver] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} + return result } // function setTTL(bytes32 node, uint64 ttl); - public func setTTL(node: String, ttl: BigUInt, options: Web3Options, password: String? = nil) -> Result { + public func setTTL(node: String, ttl: BigUInt, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.registryContract.method("setTTL", parameters: [nameHash, ttl] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) - switch result { - case .failure(let error): - return Result.failure(error) - case .success(let value): - return Result(value) - } + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.registryContract.write("setTTL", parameters: [nameHash, ttl] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} + return result } - private func getOptions(_ options: Web3Options) -> Web3Options { + private func getOptions(_ options: TransactionOptions) -> TransactionOptions { var options = options options.to = self.ensContractAddress return options diff --git a/web3swift/Utils/Classes/ENSResolver.swift b/web3swift/Utils/Classes/ENSResolver.swift index e37cd38ec..9b2b9ae3d 100644 --- a/web3swift/Utils/Classes/ENSResolver.swift +++ b/web3swift/Utils/Classes/ENSResolver.swift @@ -47,8 +47,8 @@ public struct ResolverENS { return contract! }() - private lazy var defaultOptions: Web3Options = { - return Web3Options.defaultOptions() + private lazy var defaultOptions: TransactionOptions = { + return TransactionOptions.defaultOptions }() init(web3: web3, resolverAddress: EthereumAddress) { @@ -56,175 +56,138 @@ public struct ResolverENS { self.resolverAddress = resolverAddress } - mutating public func supportsInterface(interfaceID: Data) -> Result { - return supportsInterface(interfaceID: interfaceID.toHexString()) + mutating public func supportsInterface(interfaceID: Data) throws -> Bool { + guard let supports = try? supportsInterface(interfaceID: interfaceID.toHexString()) else {throw Web3Error.processingError(desc: "Can't get answer")} + return supports } //MARK: - returns true if the contract supports given interface - mutating public func supportsInterface(interfaceID: String) -> Result { - guard let transaction = self.resolverContract.method("supportsInterface", parameters: [interfaceID as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let res): - guard let supports = res["0"] as? Bool else { return Result.failure(Web3Error.dataError) } - return Result(supports) - case .failure(let error): - return Result.failure(error) - } + mutating public func supportsInterface(interfaceID: String) throws -> Bool { + guard let transaction = self.resolverContract.read("supportsInterface", parameters: [interfaceID as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let supports = result["0"] as? Bool else {throw Web3Error.processingError(desc: "Can't get answer")} + return supports } //MARK: - returns address for the given domain at given resolver - mutating public func addr(forDomain domain: String) -> Result { - guard let nameHash = NameHash.nameHash(domain) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("addr", parameters: [nameHash as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.dataError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let res): - return Result(res["0"] as! EthereumAddress) - case .failure(let error): - return Result.failure(error) - } + mutating public func addr(forDomain domain: String) throws -> EthereumAddress { + guard let nameHash = NameHash.nameHash(domain) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("addr", parameters: [nameHash as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let address = result["0"] as? EthereumAddress else {throw Web3Error.processingError(desc: "Can't get address")} + return address } //function setAddr(bytes32 node, address addr) - mutating public func setAddr(node: String, address: EthereumAddress, options: Web3Options, password: String? = nil) -> Result { + mutating public func setAddr(node: String, address: EthereumAddress, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError)} - guard let transaction = self.resolverContract.method("setAddr", parameters: [nameHash, address] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setAddr", parameters: [nameHash, address] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } //MARK: - returns corresponding ENS to the requested node - mutating public func name(node: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("name", parameters: [nameHash as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError)} - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let res): - return Result(res["0"] as! String) - case .failure(let error): - return Result.failure(error) - } + mutating public func name(node: String) throws -> String { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("name", parameters: [nameHash as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let name = result["0"] as? String else {throw Web3Error.processingError(desc: "Can't get name")} + return name } - mutating func setName(node: String, name: String, options: Web3Options, password: String? = nil) -> Result{ + mutating func setName(node: String, name: String, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("setName", parameters: [nameHash, name] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setName", parameters: [nameHash, name] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } //MARK: - returns ABI in the requested encodings - mutating public func ABI(node: String, contentType: BigUInt) -> Result<(BigUInt, Data), Web3Error> { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("ABI", parameters: [nameHash, contentType] as [AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let res): - guard let encoding = res["0"] as? BigUInt else { return Result.failure(Web3Error.dataError) } - guard let data = res["1"] as? Data else { return Result.failure(Web3Error.dataError) } - return Result((encoding, data)) - case .failure(let error): - return Result.failure(error) - } + mutating public func ABI(node: String, contentType: BigUInt) throws -> (BigUInt, Data) { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("ABI", parameters: [nameHash, contentType] as [AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let encoding = result["0"] as? BigUInt else {throw Web3Error.processingError(desc: "Can't get encoding")} + guard let data = result["1"] as? Data else {throw Web3Error.processingError(desc: "Can't get data")} + return (encoding, data) } - mutating func setABI(node: String, contentType: BigUInt, data: Data, options: Web3Options, password: String? = nil) -> Result { + mutating func setABI(node: String, contentType: BigUInt, data: Data, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("setABI", parameters: [nameHash, contentType, data] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setABI", parameters: [nameHash, contentType, data] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } //MARK: - returns x and y coordinates - mutating public func pubkey(node: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("pubkey", parameters: [nameHash as AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let value): - print(value) - guard let x = value["x"] as? Data else { return Result.failure(Web3Error.dataError) } - guard let y = value["y"] as? Data else { return Result.failure(Web3Error.dataError) } - return Result(PublicKey(x: "0x" + x.toHexString(), y: "0x" + y.toHexString())) - case .failure(let error): - return Result.failure(error) - } + mutating public func pubkey(node: String) throws -> PublicKey { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("pubkey", parameters: [nameHash as AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let x = result["x"] as? Data else {throw Web3Error.processingError(desc: "Can't get x")} + guard let y = result["y"] as? Data else {throw Web3Error.processingError(desc: "Can't get y")} + let pubkey = PublicKey(x: "0x" + x.toHexString(), y: "0x" + y.toHexString()) + return pubkey } - mutating public func setPubkey(node: String, x: String, y: String, options: Web3Options, password: String? = nil) -> Result { + mutating public func setPubkey(node: String, x: String, y: String, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("getPubkey", parameters: [nameHash, x, y] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setPubkey", parameters: [nameHash, x, y] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } - mutating func content(node: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("content", parameters: [nameHash] as [AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let value): - guard let value = value["0"] as? String else { return Result.failure(Web3Error.dataError) } - return Result(value) - case .failure(let error): - return Result.failure(error) - } + mutating func content(node: String) throws -> String { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("content", parameters: [nameHash] as [AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let content = result["0"] as? String else {throw Web3Error.processingError(desc: "Can't get content")} + return content } - mutating func setContent(node: String, hash: String, options: Web3Options, password: String? = nil) -> Result { + mutating func setContent(node: String, hash: String, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("setContent", parameters: [nameHash, hash] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setContent", parameters: [nameHash, hash] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } //function multihash(bytes32 node) public view returns (bytes) - mutating public func multihash(node: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.transactionSerializationError) } - guard let transaction = self.resolverContract.method("multihash", parameters: [nameHash] as [AnyObject], options: self.defaultOptions) else { return Result.failure(Web3Error.dataError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .success(let value): - guard let hash = value["0"] as? Data else { return Result.failure(Web3Error.dataError) } - return Result(hash) - case .failure(let error): - return Result.failure(error) - } + mutating public func multihash(node: String) throws -> Data { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("multihash", parameters: [nameHash] as [AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let multihash = result["0"] as? Data else {throw Web3Error.processingError(desc: "Can't get multihash")} + return multihash } //function setMultihash(bytes32 node, bytes hash) public only_owner(node) - mutating public func setMultihash(node: String, hash: Data, options: Web3Options, password: String? = nil) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.transactionSerializationError) } + mutating public func setMultihash(node: String, hash: Data, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { let options = getOptions(options) - guard let transaction = self.resolverContract.method("setMultihash", parameters: [nameHash, hash] as [AnyObject], options: options) else { return Result.failure(Web3Error.dataError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setMultihash", parameters: [nameHash, hash] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } //function text(bytes32 node, string key) public view returns (string) - mutating public func text(node: String, key: String) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("text", parameters: [nameHash, key] as [AnyObject], options: defaultOptions) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = transaction.call(options: defaultOptions) - switch result { - case .failure(let error): - return Result.failure(error) - case .success(let value): - guard let ans = value["0"] as? String else { return Result.failure(Web3Error.dataError) } - return Result(ans) - } + mutating public func text(node: String, key: String) throws -> String { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.read("text", parameters: [nameHash, key] as [AnyObject], extraData: Data(), transactionOptions: defaultOptions) else {throw Web3Error.transactionSerializationError} + guard let result = try? transaction.call(transactionOptions: defaultOptions) else {throw Web3Error.processingError(desc: "Can't call transaction")} + guard let text = result["0"] as? String else {throw Web3Error.processingError(desc: "Can't get text")} + return text } //function setText(bytes32 node, string key, string value) public only_owner(node) - mutating public func setText(node: String, key: String, value: String, options: Web3Options, password: String? = nil) -> Result { - guard let nameHash = NameHash.nameHash(node) else { return Result.failure(Web3Error.dataError) } - guard let transaction = self.resolverContract.method("setText", parameters: [nameHash, key, value] as [AnyObject], options: options) else { return Result.failure(Web3Error.transactionSerializationError) } - let result = password == nil ? transaction.send() : transaction.send(password: password!, options: options) + mutating public func setText(node: String, key: String, value: String, options: TransactionOptions, password: String? = nil) throws -> TransactionSendingResult { + guard let nameHash = NameHash.nameHash(node) else {throw Web3Error.processingError(desc: "Failed to get name hash")} + guard let transaction = self.resolverContract.write("setText", parameters: [nameHash, key, value] as [AnyObject], extraData: Data(), transactionOptions: options) else {throw Web3Error.transactionSerializationError} + guard let result = password == nil ? try? transaction.send() : try? transaction.send(password: password!, transactionOptions: options) else {throw Web3Error.processingError(desc: "Can't send transaction")} return result } - private func getOptions(_ options: Web3Options) -> Web3Options { + private func getOptions(_ options: TransactionOptions) -> TransactionOptions { var options = options options.to = self.resolverAddress return options diff --git a/web3swift/Web3/Classes/Web3+MutatingTransaction.swift b/web3swift/Web3/Classes/Web3+MutatingTransaction.swift index 2b6de16fd..2ddaa9ccc 100644 --- a/web3swift/Web3/Classes/Web3+MutatingTransaction.swift +++ b/web3swift/Web3/Classes/Web3+MutatingTransaction.swift @@ -158,5 +158,7 @@ public class WriteTransaction: ReadTransaction { } } - + public func send(password:String = "web3swift", transactionOptions: TransactionOptions? = nil) throws -> TransactionSendingResult { + return try self.sendPromise(password: password, transactionOptions: transactionOptions).wait() + } } diff --git a/web3swiftTests/web3swift_ENS_Tests.swift b/web3swiftTests/web3swift_ENS_Tests.swift index 1ec86aa36..bf78562cc 100644 --- a/web3swiftTests/web3swift_ENS_Tests.swift +++ b/web3swiftTests/web3swift_ENS_Tests.swift @@ -22,87 +22,114 @@ class web3swift_ENS_Tests: XCTestCase { } func testResolverAddress() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - guard case .success(let resolver) = ens.resolver(forDomain: "somename.eth") else { XCTAssert(false); return } - XCTAssertEqual(resolver.resolverAddress.address.lowercased(), "0x5ffc014343cd971b7eb70732021e26c35b744cc4") + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + let resolver = try ens.resolver(forDomain: domain) + XCTAssertEqual(resolver.resolverAddress.address.lowercased(), "0x5ffc014343cd971b7eb70732021e26c35b744cc4") + } catch { + XCTFail() + } } func testResolver() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(var resolver) = ens.resolver(forDomain: domain) else { XCTAssert(false); return } - guard case .success(let address) = resolver.addr(forDomain: domain) else { XCTAssert(false); return } - XCTAssertEqual(address.address.lowercased(), "0x3487acfb1479ad1df6c0eb56ae743d34897798ac") - + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + var resolver = try ens.resolver(forDomain: domain) + let address = try resolver.addr(forDomain: domain) + XCTAssertEqual(address.address.lowercased(), "0x3487acfb1479ad1df6c0eb56ae743d34897798ac") + } catch { + XCTFail() + } } func testSupportsInterface() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(var resolver) = ens.resolver(forDomain: domain) else { XCTAssert(false); return } - guard case .success(let isAddrSupports) = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.addr.hash()) else { XCTAssert(false); return } - XCTAssertEqual(isAddrSupports, true) - guard case .success(let isNameSupports) = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.name.hash()) else { XCTAssert(false); return } - XCTAssertEqual(isNameSupports, true) - guard case .success(let isABIsupports) = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.ABI.hash()) else { XCTAssert(false); return } - XCTAssertEqual(isABIsupports, true) - guard case .success(let isPubkeySupports) = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.pubkey.hash()) else { XCTAssert(false); return } - XCTAssertEqual(isPubkeySupports, true) + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + var resolver = try ens.resolver(forDomain: domain) + let isAddrSupports = try resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.addr.hash()) + let isNameSupports = try resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.name.hash()) + let isABIsupports = try resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.ABI.hash()) + let isPubkeySupports = try resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.pubkey.hash()) + XCTAssertEqual(isAddrSupports, true) + XCTAssertEqual(isNameSupports, true) + XCTAssertEqual(isABIsupports, true) + XCTAssertEqual(isPubkeySupports, true) + } catch { + XCTFail() + } } func testABI() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(var resolver) = ens.resolver(forDomain: domain) else { XCTAssert(false); return } - guard case .success(let isABIsupported) = resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.ABI.hash()) else { XCTAssert(false); return } - if isABIsupported { - guard case .success(let res) = resolver.ABI(node: domain, contentType: 2) else { XCTAssert(false); return } - XCTAssert(res.0 == 0) - XCTAssert(res.1.count == 0) + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + var resolver = try ens.resolver(forDomain: domain) + let isABIsupported = try resolver.supportsInterface(interfaceID: ResolverENS.InterfaceName.ABI.hash()) + if isABIsupported { + let res = try resolver.ABI(node: domain, contentType: 2) + XCTAssert(res.0 == 0) + XCTAssert(res.1.count == 0) + } else { + XCTFail() + } + } catch { + XCTFail() } } func testOwner() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(let result) = ens.owner(node: domain) else { XCTAssert(false); return } - XCTAssertEqual("0xc67247454e720328714c4e17bec7640572657bee", result.address.lowercased()) + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + let owner = try ens.owner(node: domain) + XCTAssertEqual("0xc67247454e720328714c4e17bec7640572657bee", owner.address.lowercased()) + } catch { + XCTFail() + } } func testTTL() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(let result) = ens.ttl(node: domain) else { XCTAssert(false); return } - print(result) + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + let ttl = try ens.ttl(node: domain) + print(ttl) + } catch { + XCTFail() + } } func testGetAddress() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(let address) = ens.getAddress(domain) else { XCTAssert(false); return } - XCTAssertEqual(address.address.lowercased(), "0x3487acfb1479ad1df6c0eb56ae743d34897798ac") + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + let address = try ens.getAddress(domain) + XCTAssertEqual(address.address.lowercased(), "0x3487acfb1479ad1df6c0eb56ae743d34897798ac") + } catch { + XCTFail() + } } func testGetPubkey() { - let web = web3(provider: InfuraProvider(Networks.Mainnet)!) - var ens = ENS(web3: web) - let domain = "somename.eth" - guard case .success(let point) = ens.getPubkey(domain: domain) else { XCTAssert(false); return } - XCTAssert(point.x == "0x0000000000000000000000000000000000000000000000000000000000000000") - XCTAssert(point.y == "0x0000000000000000000000000000000000000000000000000000000000000000") + do { + let web = web3(provider: InfuraProvider(Networks.Mainnet)!) + let ens = ENS(web3: web) + let domain = "somename.eth" + let pubkey = try ens.getPubkey(domain: domain) + XCTAssert(pubkey.x == "0x0000000000000000000000000000000000000000000000000000000000000000") + XCTAssert(pubkey.y == "0x0000000000000000000000000000000000000000000000000000000000000000") + } catch { + XCTFail() + } } - - - - - - - }