-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-signatures collector integration (#235)
* Transfer SignaturesCollectorDependencies into sargon * WIP * Add passphrase factor source kind * Add passphrase factor source * Add FactorSourceIDFromHash samples * Implement custom HDFactorSourceIdFromHash to keep track of the factor source id and the mnemonic it was created with * Remove custom struct * Add petition_for_factors * Add Implement a general role with hd factor instances * Add securified variant in EntitySecurityState * Fix tests in petition_for_entity * Transfer petition_for_transaction * WIP more files * Transfer SignaturesCollectorPreprocessor * Implement transaction intent initializer that accepts account and identity addresses requiring auth * Allow signing inputs in tests from associated mnemonics * Transfer signatures collector tests * Transfer remaining signatures_collector tests * Include integration tests * Rebase with main * Remove Ord impl for Persona and Account * Address todo comments * Format code * Fix errors in swift tests * Remove comment * Fix ide errors * Add doc * Add doc * Remove doc * Associate entity samples with entity address samples * Add doc * Rename * Remove doc * Destructure value * Hide from function * Rename function * Rename general role samples * Create HDFactorInstance directly from derivation path's params * Rename parameter * Expose role kind * Add new constructor * Return result when creating a new role * Add apple tests for passphrase factor source * Add doc * Bump version * Fix test * Run clippy * Run fmt
- Loading branch information
1 parent
b9d9995
commit 8540902
Showing
123 changed files
with
9,716 additions
and
188 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
...e/Sources/Sargon/Extensions/Methods/Profile/Factor/PassphraseFactorSource+Functions.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// | ||
// File.swift | ||
// | ||
// | ||
// Created by Alexander Cyon on 2024-06-02. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension PassphraseFactorSource { | ||
|
||
public init( | ||
mnemonicWithPassphrase mwp: MnemonicWithPassphrase | ||
) { | ||
self = newPassphraseFactorSourceFromMnemonicWithPassphrase(mwp: mwp) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
...nsions/SampleValues/Profile/Factor/FactorSource/PassphraseFactorSource+SampleValues.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// PassphraseFactorSource+SampleValues.swift | ||
// | ||
// | ||
// Created by Michael Bakogiannis on 7/10/24. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
#if DEBUG | ||
extension PassphraseFactorSource { | ||
public static let sample: Self = newPassphraseFactorSourceSample() | ||
|
||
public static let sampleOther: Self = newPassphraseFactorSourceSampleOther() | ||
} | ||
|
||
#endif // DEBUG | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...Extensions/Swiftified/Profile/Factor/FactorSource/PassphraseFactorSource+Swiftified.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// PassphraseFactorSource+Swiftified.swift | ||
// | ||
// | ||
// Created by Michael Bakogiannis on 7/10/24. | ||
// | ||
|
||
import Foundation | ||
import SargonUniFFI | ||
|
||
extension PassphraseFactorSource: SargonModel {} | ||
extension PassphraseFactorSource: Identifiable { | ||
public typealias ID = FactorSourceIDFromHash | ||
} | ||
|
||
extension PassphraseFactorSource: FactorSourceProtocol { | ||
public static let kind: FactorSourceKind = .passphrase | ||
|
||
public static func extract(from someFactorSource: some BaseFactorSourceProtocol) -> Self? { | ||
guard case let .passphrase(factorSource) = someFactorSource.asGeneral else { return nil } | ||
return factorSource | ||
} | ||
|
||
public var asGeneral: FactorSource { | ||
.passphrase(value: self) | ||
} | ||
|
||
public var factorSourceID: FactorSourceID { | ||
id.asGeneral | ||
} | ||
|
||
public var factorSourceKind: FactorSourceKind { | ||
.passphrase | ||
} | ||
|
||
public var supportsOlympia: Bool { asGeneral.supportsOlympia } | ||
public var supportsBabylon: Bool { asGeneral.supportsBabylon } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.