Skip to content
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

Rules for Roles #286

Merged
merged 72 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
985ece1
[no ci] WIP Rules for Roles
Sajjon Nov 30, 2024
56419c3
fix most tests
Sajjon Nov 30, 2024
04d4fc3
sargon works
Sajjon Nov 30, 2024
38acdc7
[no ci] WIP
Sajjon Dec 1, 2024
93f9e55
[no ci] WIP
Sajjon Dec 1, 2024
698277e
[no ci] WIP
Sajjon Dec 1, 2024
2020100
[no ci] WIP
Sajjon Dec 1, 2024
562fae8
[no ci] WIP
Sajjon Dec 1, 2024
3c8d574
[no ci] WIP
Sajjon Dec 1, 2024
22958f8
TODO: Error conversion for roles and matrices
Sajjon Dec 1, 2024
07800a0
fix
Sajjon Dec 1, 2024
6dfbc66
moar tests
Sajjon Dec 1, 2024
e3ddb6a
more tests
Sajjon Dec 1, 2024
76fbb62
bump typos and fix typos
Sajjon Dec 1, 2024
895caf4
swiftformat
Sajjon Dec 1, 2024
7507b7d
error converesion
Sajjon Dec 1, 2024
738cb52
[no ci] WIP
Sajjon Dec 2, 2024
a7cbdef
[no ci] wip
CyonAlexRDX Dec 2, 2024
7a9f659
[no ci] wip
Sajjon Dec 2, 2024
4d42794
[no ci] build does not consume
CyonAlexRDX Dec 2, 2024
43b75bf
[no ci] revert
CyonAlexRDX Dec 2, 2024
cf50004
understandable generic names
CyonAlexRDX Dec 2, 2024
eab4b5e
[no ci] WIP
Sajjon Dec 2, 2024
b958ef1
[no ci] wip
CyonAlexRDX Dec 2, 2024
3d941de
[no ci] wip
CyonAlexRDX Dec 2, 2024
1b38550
[no ci] WIP
Sajjon Dec 2, 2024
2f512f9
[no ci] WIP
Sajjon Dec 3, 2024
d2a1b50
[no ci] wip
CyonAlexRDX Dec 3, 2024
81d8d93
[no ci] wip
CyonAlexRDX Dec 3, 2024
60182e5
[no ci] wip
CyonAlexRDX Dec 3, 2024
b742d20
IMPORTANT BUG FIX: fix bug where we accidentally allowed an invalid s…
Sajjon Dec 3, 2024
8797880
[no ci] moar tests
Sajjon Dec 3, 2024
81a04ef
bump version, try fix swift. What about kotlin failures 'MethodTooLar…
Sajjon Dec 3, 2024
58615f8
merge main
CyonAlexRDX Dec 3, 2024
a36ea14
Try fix MethodTooLargeException: remove field `reason_if_invalid` fro…
CyonAlexRDX Dec 3, 2024
a18cf2d
Try to fix MethodTooLargeException by adding repr(u32) to SecurityShi…
CyonAlexRDX Dec 3, 2024
16086ce
Try to fix `MethodTooLargeException` by temporarily not compiling the…
CyonAlexRDX Dec 3, 2024
2647f72
Fixed??? the MethodTooLargeException by using Arc<Self> ? Ive comment…
CyonAlexRDX Dec 3, 2024
146f392
Prevented MethodTooLargeException still? add more methods... is the `…
CyonAlexRDX Dec 3, 2024
3ecd795
Still working? MethodTooLargeException....(kotlin) trying to fix swift
CyonAlexRDX Dec 3, 2024
a75bdf5
Still working? MethodTooLargeException....(kotlin) trying to fix swift
CyonAlexRDX Dec 3, 2024
55056ef
Still working? MethodTooLargeException....(kotlin) trying to fix swif…
CyonAlexRDX Dec 3, 2024
331982d
still valid? MethodTooLargeException not triggered?
CyonAlexRDX Dec 3, 2024
c89f8e0
still valid? MethodTooLargeException not triggered? added the last me…
CyonAlexRDX Dec 3, 2024
64b67be
still valid? MethodTooLargeException not triggered? readding `reason_…
CyonAlexRDX Dec 3, 2024
5a5a19c
still compiles? WIP MethodTooLargeException
Sajjon Dec 3, 2024
4abaf86
still compiles? WIP MethodTooLargeException - change `FactorSourceVal…
Sajjon Dec 3, 2024
aac1f8c
still compiles? WIP MethodTooLargeException: re-introduce build
Sajjon Dec 3, 2024
80e2c23
still compiles? WIP MethodTooLargeException - `self: Arc<Self>` back …
Sajjon Dec 3, 2024
092f9bb
still compiles? WIP MethodTooLargeException - reintroduce tests
Sajjon Dec 3, 2024
8c944c1
still compiles? WIP MethodTooLargeException - add String to FactorSou…
Sajjon Dec 3, 2024
ac9550f
CannotSetThreshold err into BasicViolation only
Sajjon Dec 4, 2024
c890bc1
polish
Sajjon Dec 4, 2024
7256713
Change to const for marker if AbstractRoleBuilderOrBuilt and Abstract…
Sajjon Dec 4, 2024
881a80c
swiftformat
Sajjon Dec 4, 2024
87b7ab0
polish
Sajjon Dec 4, 2024
ec2e65c
fmt
Sajjon Dec 4, 2024
810d35d
doc
Sajjon Dec 4, 2024
65f473c
polish
Sajjon Dec 4, 2024
c686653
Automatically bump threshold on primary role if we add a factorsource…
Sajjon Dec 4, 2024
e002aed
more swift tests
Sajjon Dec 4, 2024
7c1f671
Add reset_primary_and_confirmation_role_state to Uniffi ShieldBuilder.
CyonAlexRDX Dec 4, 2024
007758e
(temp) try fix `MethodTooLargeException` by commenting out method `re…
CyonAlexRDX Dec 4, 2024
2f3de0c
reintroduce reset_recovery_and_confirmation_role_state - will result …
CyonAlexRDX Dec 4, 2024
e69d9bd
Fix MethodTooLargeException by lowering method amount by 2.
CyonAlexRDX Dec 5, 2024
3ee614f
Simplify macro_rules impl which declared `MatrixOFFactor***` with `pr…
CyonAlexRDX Dec 5, 2024
9f66118
Check prerequisites for building a Security Shield (#292)
matiasbzurovski Dec 6, 2024
4c2566f
merge main
CyonAlexRDX Dec 6, 2024
aa4b2ce
reintroduce [too many for JNA] methods
CyonAlexRDX Dec 6, 2024
fcdaccb
Fix JDK bug with my fork of UniFFI - will do a PR to UniFFI later.
CyonAlexRDX Dec 6, 2024
2f7ae45
bump UniFFI (Sajjon fork)
CyonAlexRDX Dec 6, 2024
e2476b1
bump uniffi (sajjon fork)
CyonAlexRDX Dec 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ default_install_hook_types: [pre-push]
default_stages: [pre-push]
repos:
- repo: https://github.com/crate-ci/typos
rev: v1.22.7
rev: v1.28.1
hooks:
- id: typos
- repo: local
Expand Down
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SargonUniFFI

// MARK: - FileManager + @unchecked Sendable
// MARK: - FileManager + Sendable
extension FileManager: @unchecked Sendable {}

// Makes it possible to type `.shared` on an initalizer/func taking
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ extension LogLevel: CaseIterable {
public static let allCases: [Self] = rustLoggerGetAllLevels()
}

// MARK: - Logger + @unchecked Sendable
// MARK: - Logger + Sendable
extension Logger: @unchecked Sendable {}

extension OSLogType {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SargonUniFFI

public typealias ProfileStateChangeEventPublisher = EventPublisher<ProfileState>

// MARK: - ProfileStateChangeEventPublisher + ProfileStateChangeDriver
// MARK: ProfileStateChangeDriver
extension ProfileStateChangeEventPublisher: ProfileStateChangeDriver {
public static let shared = ProfileStateChangeEventPublisher()

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Foundation
import SargonUniFFI

// MARK: - UserDefaults + @unchecked Sendable
// MARK: - UserDefaults + Sendable
extension UserDefaults: @unchecked Sendable {}

// Makes it possible to type `.shared` on an initalizer/func taking
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
import Foundation
import SargonUniFFI

extension SecurityStructureOfFactorSources {
public init(
metadata: SecurityStructureMetadata,
numberOfDaysUntilAutoConfirmation: UInt16,
matrixOfFactors: MatrixOfFactorSources
) {
assert(matrixOfFactors.primaryRole.thresholdFactors.count >= matrixOfFactors.primaryRole.threshold)
assert(matrixOfFactors.recoveryRole.thresholdFactors.count >= matrixOfFactors.recoveryRole.threshold)
assert(matrixOfFactors.confirmationRole.thresholdFactors.count >= matrixOfFactors.confirmationRole.threshold)
self = newSecurityStructureOfFactorSourcesAutoInDays(
metadata: metadata,
numberOfDaysUntilAutoConfirmation: numberOfDaysUntilAutoConfirmation,
matrixOfFactors: matrixOfFactors
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ extension TransactionManifest {
}

public var summary: ManifestSummary {
get throws {
try transactionManifestSummary(manifest: self)
}
transactionManifestSummary(manifest: self)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import SargonUniFFI

public typealias BIP39Language = Bip39Language

// MARK: - BIP39Language + SargonModel
// MARK: SargonModel
extension BIP39Language: SargonModel {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SargonUniFFI

public typealias BIP39WordCount = Bip39WordCount

// MARK: - BIP39WordCount + SargonModel
// MARK: SargonModel
extension BIP39WordCount: SargonModel {
public static let sample: Self = .twentyFour
public static let sampleOther: Self = .twelve
Expand All @@ -15,15 +15,15 @@ extension BIP39WordCount {
}
}

// MARK: - BIP39WordCount + Identifiable
// MARK: Identifiable
extension BIP39WordCount: Identifiable {
public typealias ID = RawValue
public var id: ID {
rawValue
}
}

// MARK: - BIP39WordCount + Comparable
// MARK: Comparable
extension BIP39WordCount: Comparable {
public static func < (lhs: Self, rhs: Self) -> Bool {
lhs.rawValue < rhs.rawValue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import SargonUniFFI

public typealias BIP39Word = Bip39Word

// MARK: - BIP39Word + SargonModel
// MARK: SargonModel
extension BIP39Word: SargonModel {}

// MARK: - BIP39Word + Identifiable
// MARK: Identifiable
extension BIP39Word: Identifiable {
public typealias ID = U11

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SargonUniFFI

public typealias BIP44LikePath = Bip44LikePath

// MARK: - BIP44LikePath + SargonModel, DerivationPathProtocol
// MARK: SargonModel, DerivationPathProtocol
extension BIP44LikePath: SargonModel, DerivationPathProtocol {
public var asGeneral: DerivationPath {
.bip44Like(value: self)
Expand All @@ -14,7 +14,7 @@ extension BIP44LikePath: SargonModel, DerivationPathProtocol {
}
}

// MARK: - BIP44LikePath + CustomStringConvertible
// MARK: CustomStringConvertible
extension BIP44LikePath: CustomStringConvertible {
public var description: String {
toString()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ import SargonUniFFI

public typealias SLIP10Curve = Slip10Curve

// MARK: - SLIP10Curve + SargonModel
// MARK: SargonModel
extension SLIP10Curve: SargonModel {}

// MARK: - SLIP10Curve + Identifiable
// MARK: Identifiable
extension SLIP10Curve: Identifiable {
public typealias ID = String
public var id: ID {
toString()
}
}

// MARK: - SLIP10Curve + CustomStringConvertible
// MARK: CustomStringConvertible
extension SLIP10Curve: CustomStringConvertible {
public var description: String {
toString()
Expand All @@ -26,5 +26,5 @@ extension SLIP10Curve {
}
}

// MARK: - SLIP10Curve + SargonStringCodable
// MARK: SargonStringCodable
extension SLIP10Curve: SargonStringCodable {}
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import SargonUniFFI

public typealias NetworkID = NetworkId

// MARK: - NetworkID + SargonModel
// MARK: SargonModel
extension NetworkID: SargonModel {}

// MARK: - NetworkID + CustomStringConvertible
// MARK: CustomStringConvertible
extension NetworkID: CustomStringConvertible {
public var description: String {
toString()
}
}

// MARK: - NetworkID + Codable
// MARK: Codable
extension NetworkID: Codable {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import SargonUniFFI

public typealias NonFungibleGlobalID = NonFungibleGlobalId

// MARK: - NonFungibleGlobalID + IdentifiableByStringProtocol
// MARK: IdentifiableByStringProtocol
extension NonFungibleGlobalID: IdentifiableByStringProtocol {
public var localID: NonFungibleLocalID {
nonFungibleLocalId
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import SargonUniFFI

public typealias NonFungibleLocalID = NonFungibleLocalId

// MARK: - NonFungibleLocalID + IdentifiableByStringProtocol
// MARK: IdentifiableByStringProtocol
extension NonFungibleLocalID: IdentifiableByStringProtocol {}

// MARK: - NonFungibleLocalID + ExpressibleByIntegerLiteral
// MARK: ExpressibleByIntegerLiteral
extension NonFungibleLocalID: ExpressibleByIntegerLiteral {
public init(integerLiteral value: UInt64) {
self.init(integer: value)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SargonUniFFI

public typealias NonFungibleLocalIDString = NonFungibleLocalIdString

// MARK: - NonFungibleLocalIDString + SargonModel
// MARK: SargonModel
extension NonFungibleLocalIDString: SargonModel {}

#if DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,24 @@ import SargonUniFFI

public typealias SargonError = CommonError

// MARK: - SargonError + SargonModel
// MARK: SargonModel
extension SargonError: SargonModel {}

// MARK: - SargonError + CustomDebugStringConvertible
// MARK: CustomDebugStringConvertible
extension SargonError: CustomDebugStringConvertible {
public var debugDescription: String {
"\(errorCode): \(errorMessage)"
}
}

// MARK: - SargonError + CustomStringConvertible
// MARK: CustomStringConvertible
extension SargonError: CustomStringConvertible {
public var description: String {
errorMessage
}
}

// MARK: - SargonError + LocalizedError
// MARK: LocalizedError
extension SargonError: LocalizedError {
public var errorDescription: String? {
let errorCodeFormatted = "Error code: \(errorCode)"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@ import SargonUniFFI

public typealias AppearanceID = AppearanceId

// MARK: - AppearanceID + SargonModel
// MARK: SargonModel
extension AppearanceID: SargonModel {}

// MARK: - AppearanceID + Identifiable
// MARK: Identifiable
extension AppearanceID: Identifiable {
public typealias ID = UInt8
public var id: ID {
value
}
}

// MARK: - AppearanceID + CustomStringConvertible
// MARK: CustomStringConvertible
extension AppearanceID: CustomStringConvertible {
public var description: String {
value.description
}
}

// MARK: - AppearanceID + Codable
// MARK: Codable
extension AppearanceID: Codable {
public func encode(to encoder: Encoder) throws {
var container = encoder.singleValueContainer()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ import SargonUniFFI

public typealias FactorSourceID = FactorSourceId

// MARK: - FactorSourceID + SargonModel
// MARK: SargonModel
extension FactorSourceID: SargonModel {}

// MARK: - FactorSourceID + CustomStringConvertible
// MARK: CustomStringConvertible
extension FactorSourceID: CustomStringConvertible {
public var description: String {
toString()
}
}

// MARK: - FactorSourceID + FactorSourceIDProtocol
// MARK: FactorSourceIDProtocol
extension FactorSourceID: FactorSourceIDProtocol {
public var asGeneral: FactorSourceID {
self
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import SargonUniFFI

public typealias FactorSourceIDFromAddress = FactorSourceIdFromAddress

// MARK: - FactorSourceIDFromAddress + SargonModel
// MARK: SargonModel
extension FactorSourceIDFromAddress: SargonModel {}

// MARK: - FactorSourceIDFromAddress + SargonObjectCodable
// MARK: SargonObjectCodable
extension FactorSourceIDFromAddress: SargonObjectCodable {}

// MARK: - FactorSourceIDFromAddress + FactorSourceIDSpecificProtocol
// MARK: FactorSourceIDSpecificProtocol
extension FactorSourceIDFromAddress: FactorSourceIDSpecificProtocol {
public var asGeneral: FactorSourceID {
.address(value: self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ import SargonUniFFI

public typealias FactorSourceIDFromHash = FactorSourceIdFromHash

// MARK: - FactorSourceIDFromHash + SargonModel
// MARK: SargonModel
extension FactorSourceIDFromHash: SargonModel {}

// MARK: - FactorSourceIDFromHash + SargonObjectCodable
// MARK: SargonObjectCodable
extension FactorSourceIDFromHash: SargonObjectCodable {}

// MARK: - FactorSourceIDFromHash + FactorSourceIDSpecificProtocol
// MARK: FactorSourceIDSpecificProtocol
extension FactorSourceIDFromHash: FactorSourceIDSpecificProtocol {
public var asGeneral: FactorSourceID {
.hash(value: self)
Expand Down
Loading