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 all 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
34 changes: 22 additions & 12 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,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
@@ -0,0 +1,45 @@
import SargonUniFFI

extension SecurityShieldBuilder {
public typealias Factor = FactorSourceID

/// Confirmation Role
public var numberOfDaysUntilAutoConfirm: UInt16 {
get { getNumberOfDaysUntilAutoConfirm() }
set {
precondition(newValue > 0, "Number of days until auto confirm must be greater than zero.")
setNumberOfDaysUntilAutoConfirm(numberOfDays: UInt16(newValue))
}
}

public var threshold: UInt8 {
get { getPrimaryThreshold() }
set { setThreshold(threshold: newValue) }
}

public var primaryRoleThresholdFactors: [Factor] {
getPrimaryThresholdFactors()
}

public var primaryRoleOverrideFactors: [Factor] {
getPrimaryOverrideFactors()
}

public var recoveryRoleFactors: [Factor] {
getRecoveryFactors()
}

public var confirmationRoleFactors: [Factor] {
getConfirmationFactors()
}

/// Name of the shield
public var name: String {
get {
getName()
}
set {
setName(name: newValue)
}
}
}
6 changes: 3 additions & 3 deletions apple/Tests/TestCases/Prelude/Decimal192Tests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ final class Decimal192Tests: Test<Decimal192> {
// Every number multiplied by zero, is zero...
XCTAssertEqual(item * SUT.zero, SUT.zero)
}
// ... incliding `max` and `min`
// ... including `max` and `min`
XCTAssertEqual(SUT.max * 0, 0)
XCTAssertEqual(SUT.min * 0, 0)

Expand All @@ -239,7 +239,7 @@ final class Decimal192Tests: Test<Decimal192> {
// All numbers divided by themselves equals `one`...
XCTAssertEqual(item / item, SUT.one)
}
// ... incliding `max` and `min`
// ... including `max` and `min`
XCTAssertEqual(SUT.max / SUT.max, SUT.one)
XCTAssertEqual(SUT.min / SUT.min, SUT.one)
}
Expand Down Expand Up @@ -481,7 +481,7 @@ final class Decimal192Tests: Test<Decimal192> {
try largeDecimalsStrings.forEach(testLarge)

XCTAssertLessThan(SUT.min.asDouble, SUT.max.asDouble)
XCTAssertNoThrow(try SUT("12345678987654321.000000000000000001").asDouble)
XCTAssertNoThrow(SUT("12345678987654321.000000000000000001").asDouble)
}

private var smallDecimalStrings: [String] {
Expand Down
Loading
Loading