diff --git a/E2E/e2eTests/Source/Abilities/OpenEnterpriseAPI.swift b/E2E/e2eTests/Source/Abilities/OpenEnterpriseAPI.swift index 27fdd6e7..edfc2131 100644 --- a/E2E/e2eTests/Source/Abilities/OpenEnterpriseAPI.swift +++ b/E2E/e2eTests/Source/Abilities/OpenEnterpriseAPI.swift @@ -424,7 +424,7 @@ class OpenEnterpriseAPI: Ability { ) ]), name: "proof_req_1", - nonce: "1103253414365527824079144", + nonce: Utils.generateNonce(length: 25), version: "1.0" ) @@ -447,7 +447,6 @@ class OpenEnterpriseAPI: Ability { default: throw Error.WrongResponse(response) } - } func getPresentation(_ presentationId: String) async throws -> Components.Schemas.PresentationStatus { diff --git a/E2E/e2eTests/Source/Utils.swift b/E2E/e2eTests/Source/Utils.swift new file mode 100644 index 00000000..17d97a44 --- /dev/null +++ b/E2E/e2eTests/Source/Utils.swift @@ -0,0 +1,20 @@ +import Foundation +import XCTest + +class Utils { + static func generateNonce(length: Int) -> String { + var result: String = "" + + while (result.count < length) { + var randomByte: UInt8 = 0 + _ = SecRandomCopyBytes(kSecRandomDefault, 1, &randomByte) + if (randomByte >= 250) { + continue + } + let randomDigit = randomByte % 10 + result += String(randomDigit) + } + return result + } +} +