-
Notifications
You must be signed in to change notification settings - Fork 9
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
[ABW-1599] Change FactorSource into enum #534
Conversation
e20310a
to
128d315
Compare
Sources/Features/ImportMnemonic/OffDeviceMnemonicInfo/OffDeviceMnemonicInfo+View.swift
Show resolved
Hide resolved
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.
Looks good. I don't have time to understand all the use sites, but it seems that it doesn't complicate things, and I trust you are using it correctly. The only thing is that would probably have a requirement func updateLastUsed(date: Date)
so that var Common
can be get
only.
import Foundation | ||
|
||
// MARK: - BaseFactorSourceProtocol | ||
public protocol BaseFactorSourceProtocol { |
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.
Not sure this needs to include "Base"
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.
it is a protocol BELOW FactorSourceProtocol
which enum FactorSource
conforms to. That enum cannot conform to FactorSourceProtocol
since it cannot have static var kind: FactorSourceKind
. Do you have a better name for it? :)
ABW-1599
Before this PR we had to load the whole factor source from
factorSourcesClient
in order to know theFactorSourceKind
of a Factor Source for a certainFactorInstance
, this PR makes it possible to know theFactorSourceKind
directly from theFactorSourceID
.The primary concern I had earlier with using an enum for
FactorSource
was that each individual FactorSource type (struct ***FactorSource
) would contain a lot of duplication of properties. This PR solves that by putting all the shared properties intocommon: Common
, which seems like an OK trade off.offDeviceMnemonic