You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
throwWeb3Error.inputError(desc:"Created EIP712TypedData has a circular dependency amongst it's types. Cycle was first identified in '\(problematicType)'. Review it's uses in 'types'.")
152
-
}
153
-
}
154
-
155
-
/// Checks for a circular dependency among the given types.
156
-
///
157
-
/// If a circular dependency is detected, it returns the name of the type where the cycle was first identified.
158
-
/// Otherwise, it returns `nil`.
159
-
///
160
-
/// - Returns: The type name where a circular dependency is detected, or `nil` if no circular dependency exists.
161
-
/// - Note: The function utilizes depth-first search to identify the circular dependencies.
162
-
func hasCircularDependency()->String?{
163
-
164
-
/// Generates an adjacency list for the given types, representing their dependencies.
165
-
///
166
-
/// - Parameter types: A dictionary mapping type names to their property definitions.
167
-
/// - Returns: An adjacency list representing type dependencies.
@@ -261,9 +211,10 @@ public struct EIP712TypedData {
261
211
throwWeb3Error.processingError(desc:"EIP712. Attempting to encode data for type that doesn't exist in this payload. Given type: \(type). Available types: \(types.values).")
throwWeb3Error.processingError(desc:"EIP712. Type metadata '\(field)' and actual value '\(String(describing: value))' type doesn't match. Cannot cast value to String.")
@@ -276,16 +227,44 @@ public struct EIP712TypedData {
276
227
}
277
228
encTypes.append(.bytes(length:32))
278
229
encValues.append(value.sha3(.keccak256))
279
-
}elseiftypes[field.type]!=nil{
280
-
guardletvalue= value as?[String:AnyObject]else{
281
-
throwWeb3Error.processingError(desc:"EIP712. Custom type metadata '\(field)' and actual value '\(String(describing: value))' type doesn't match. Cannot cast value to [String : AnyObject].")
230
+
}elseif field.isArray{
231
+
guardletvalues= value as?[AnyObject]else{
232
+
throwWeb3Error.processingError(desc:"EIP712. Custom type metadata '\(field)' and actual value '\(String(describing: value))' type doesn't match. Cannot cast value to [AnyObject].")
0 commit comments