-
Notifications
You must be signed in to change notification settings - Fork 466
Fix typos #744
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix typos #744
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,15 +8,15 @@ | |
import Foundation | ||
import BigInt | ||
|
||
extension Int: LiteralInitiableFromString { } | ||
extension Int: LiteralInitableFromString { } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please undo this changes, as they affecting code, rather then comments and should be reviewed separately. |
||
|
||
extension UInt: LiteralInitiableFromString { } | ||
extension UInt: LiteralInitableFromString { } | ||
|
||
extension BigInt: LiteralInitiableFromString { } | ||
extension BigInt: LiteralInitableFromString { } | ||
|
||
extension BigUInt: LiteralInitiableFromString { } | ||
extension BigUInt: LiteralInitableFromString { } | ||
|
||
extension Data: LiteralInitiableFromString { | ||
extension Data: LiteralInitableFromString { | ||
public static func fromHex(_ hex: String) -> Data? { | ||
let string = hex.lowercased().stripHexPrefix() | ||
let array = [UInt8](hex: string) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,15 +17,15 @@ extension String: APIResultType { } | |
/// | ||
/// You better not use it in any other part of a bit of code except `APIResponse<T>` decoding. | ||
/// | ||
/// This protocols intention is to work around that Ethereum API cases, when almost all numbers are comming as strings. | ||
/// This protocols intention is to work around that Ethereum API cases, when almost all numbers are coming as strings. | ||
/// More than that their notation (e.g. 0x12d) are don't fit with the default Numeric decoders behaviours. | ||
/// So to work around that for generic cases we're going to force decode `APIResponse.result` field as `String` | ||
/// and then initiate it | ||
protocol LiteralInitiableFromString: APIResultType { | ||
protocol LiteralInitableFromString: APIResultType { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please undo this changes, as they affecting code, rather then comments and should be reviewed separately. |
||
init?(from hexString: String) | ||
} | ||
|
||
extension LiteralInitiableFromString where Self: IntegerInitableWithRadix { | ||
extension LiteralInitableFromString where Self: IntegerInitableWithRadix { | ||
/// This initializer is intended to init `(U)Int` from hex string with `0x` prefix. | ||
init?(from hexString: String) { | ||
guard hexString.hasPrefix("0x") else { return nil } | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,9 +64,9 @@ public struct IBAN { | |
|
||
internal static func decodeToInts(_ iban: String) -> String { | ||
let uppercasedIBAN = iban.replacingOccurrences(of: " ", with: "").uppercased() | ||
let begining = String(uppercasedIBAN[0..<4]) | ||
let beginning = String(uppercasedIBAN[0..<4]) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please undo this changes, as they affecting code, rather then comments and should be reviewed separately. |
||
let end = String(uppercasedIBAN[4...]) | ||
let IBAN = end + begining | ||
let IBAN = end + beginning | ||
var arrayOfInts = [Int]() | ||
for ch in IBAN { | ||
guard let dataPoint = String(ch).data(using: .ascii) else {return ""} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please undo this changes, as they affecting code, rather then comments and should be reviewed separately.