Skip to content

Commit

Permalink
Fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lmcmz committed Feb 15, 2022
1 parent fcd6915 commit 64cbac7
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions Sources/Flow/Models/FlowDomainTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ import Foundation
public extension Flow {
/// The prefix when encoding transaction and user with RLP
enum DomainTag {

public typealias RawValue = String

/// The tag for transaction
case transaction

/// The tag for user
case user

/// Custom domain tag
case custom(String)

Expand All @@ -40,17 +39,17 @@ public extension Flow {
return "FLOW-V0.0-transaction"
case .user:
return "FLOW-V0.0-user"
case .custom(let tag):
case let .custom(tag):
return tag
}
}

/// Init a domain tag by string
/// If it's not the default one, then it will return a .custom(string) type
public init?(rawValue: String) {
self = [DomainTag.user, DomainTag.transaction].first{ $0.rawValue == rawValue } ?? .custom(rawValue)
self = [DomainTag.user, DomainTag.transaction].first { $0.rawValue == rawValue } ?? .custom(rawValue)
}

/// Convert tag string into data with `.uft8` format
/// And padding zero to right until 32 bytes long.
public var normalize: Data {
Expand Down

0 comments on commit 64cbac7

Please sign in to comment.