File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
Tests/web3swiftTests/localTests Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -137,7 +137,17 @@ extension String {
137
137
}
138
138
139
139
public var isHex : Bool {
140
- stripHexPrefix ( ) . reduce ( true , { $0 && $1. isHexDigit } )
140
+ var _str = self . trim ( )
141
+ if _str. isEmpty {
142
+ return false
143
+ }
144
+ _str = _str. stripHexPrefix ( )
145
+ for char in _str {
146
+ if !char. isHexDigit {
147
+ return false
148
+ }
149
+ }
150
+ return true
141
151
}
142
152
}
143
153
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ final class ABIDecoderSliceTests: XCTestCase {
80
80
var resultArray = [ BigUInt] ( )
81
81
for i in 0 ..< 2 {
82
82
guard let data = returnData [ i] [ 1 ] as? Data ,
83
- let balance = try ? erc20_balanceof. decodeReturnData ( data) [ " 0 " ] as? BigUInt else {
83
+ let balance = try erc20_balanceof. decodeReturnData ( data) [ " 0 " ] as? BigUInt else {
84
84
resultArray. append ( 0 )
85
85
continue
86
86
}
You can’t perform that action at this time.
0 commit comments