Skip to content

Commit d41f35b

Browse files
committed
fix ExtrinsicGuarantees
1 parent a24bc84 commit d41f35b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Blockchain/Sources/Blockchain/Types/ExtrinsicGuarantees.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ extension ExtrinsicGuarantees: Validate {
7676
case invalidCoreIndex
7777
case invalidValidatorIndex
7878
case credentialsNotSorted
79+
case invalidCredentialCount
7980
case duplicatedWorkPackageHash
8081
}
8182

@@ -91,6 +92,12 @@ extension ExtrinsicGuarantees: Validate {
9192
throw Error.invalidCoreIndex
9293
}
9394

95+
do {
96+
try guarantee.credential.validateThrowing()
97+
} catch {
98+
throw Error.invalidCredentialCount
99+
}
100+
94101
guard guarantee.credential.isSortedAndUnique(by: { $0.index < $1.index }) else {
95102
throw Error.credentialsNotSorted
96103
}

0 commit comments

Comments
 (0)