@@ -51,8 +51,7 @@ public extension ENS {
5151 return contract!
5252 } ( )
5353
54- // FIXME: Rewrite this to CodableTransaction
55- lazy var defaultOptions : CodableTransaction = {
54+ lazy var defaultTransaction : CodableTransaction = {
5655 return CodableTransaction . emptyTransaction
5756 } ( )
5857
@@ -107,7 +106,7 @@ public extension ENS {
107106 // FIXME: Rewrite this to CodableTransaction
108107 @available ( * , message: " Available for only owner " )
109108 public func setAddress( forNode node: String , address: EthereumAddress , options: CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
110- var options = options ?? defaultOptions
109+ var options = options ?? defaultTransaction
111110 options. to = self . resolverContractAddress
112111 guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
113112 guard let transaction = self . resolverContract. createWriteOperation ( " setAddr " , parameters: [ nameHash, address] as [ AnyObject ] ) else { throw Web3Error . transactionSerializationError}
@@ -126,7 +125,7 @@ public extension ENS {
126125 // FIXME: Rewrite this to CodableTransaction
127126 @available ( * , message: " Available for only owner " )
128127 func setCanonicalName( forNode node: String , name: String , options: CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
129- var options = options ?? defaultOptions
128+ var options = options ?? defaultTransaction
130129 options. to = self . resolverContractAddress
131130 guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
132131 guard let transaction = self . resolverContract. createWriteOperation ( " setName " , parameters: [ nameHash, name] as [ AnyObject ] ) else { throw Web3Error . transactionSerializationError}
@@ -145,7 +144,7 @@ public extension ENS {
145144 // FIXME: Rewrite this to CodableTransaction
146145 @available ( * , message: " Available for only owner " )
147146 func setContentHash( forNode node: String , hash: String , options: CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
148- var options = options ?? defaultOptions
147+ var options = options ?? defaultTransaction
149148 options. to = self . resolverContractAddress
150149 guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
151150 guard let transaction = self . resolverContract. createWriteOperation ( " setContenthash " , parameters: [ nameHash, hash] as [ AnyObject ] ) else { throw Web3Error . transactionSerializationError}
@@ -166,7 +165,7 @@ public extension ENS {
166165 // FIXME: Rewrite this to CodableTransaction
167166 @available ( * , message: " Available for only owner " )
168167 func setContractABI( forNode node: String , contentType: ENS . Resolver . ContentType , data: Data , options: CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
169- var options = options ?? defaultOptions
168+ var options = options ?? defaultTransaction
170169 options. to = self . resolverContractAddress
171170 guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
172171 guard let transaction = self . resolverContract. createWriteOperation ( " setABI " , parameters: [ nameHash, contentType. rawValue, data] as [ AnyObject ] ) else { throw Web3Error . transactionSerializationError}
@@ -187,7 +186,7 @@ public extension ENS {
187186 // FIXME: Rewrite this to CodableTransaction
188187 @available ( * , message: " Available for only owner " )
189188 public func setPublicKey( forNode node: String , publicKey: PublicKey , options: CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
190- var options = options ?? defaultOptions
189+ var options = options ?? defaultTransaction
191190 options. to = self . resolverContractAddress
192191 let pubkeyWithoutPrefix = publicKey. getComponentsWithoutPrefix ( )
193192 guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
@@ -207,7 +206,7 @@ public extension ENS {
207206 // FIXME: Rewrite this to CodableTransaction
208207 @available ( * , message: " Available for only owner " )
209208 public func setTextData( forNode node: String , key: String , value: String , options: CodableTransaction ? = nil , password: String ) async throws -> TransactionSendingResult {
210- var options = options ?? defaultOptions
209+ var options = options ?? defaultTransaction
211210 options. to = self . resolverContractAddress
212211 guard let nameHash = NameHash . nameHash ( node) else { throw Web3Error . processingError ( desc: " Failed to get name hash " ) }
213212 guard let transaction = self . resolverContract. createWriteOperation ( " setText " , parameters: [ nameHash, key, value] as [ AnyObject ] ) else { throw Web3Error . transactionSerializationError}
0 commit comments