Repository Public
1// =============================================================================2// SP BOUCHER | SOFTWARE & RESEARCH3// ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING4// =============================================================================5//6// Project : QYVORA7// File : Tests/QyvoraMigrationTests/MigrationTests.swift8// Module : Tests9// Repository : https://git.spboucher.ai/qyvora10// Project Website : Not specified11// Created : 2026-12-0412// Last Modified : 2026-12-0413//14// Author : Simon-Pierre Boucher15// Position : Professor of Finance16// Institution : Université du Québec en Outaouais (UQO)17// Organization : SP Boucher18// Website : https://spboucher.ai19// Git : https://git.spboucher.ai20//21// Preferred Contact: contact@spboucher.ai22// Development : dev@spboucher.ai23// Support : support@spboucher.ai24// Security/Admin : admin@spboucher.ai25//26// Copyright (c) 202627// Simon-Pierre Boucher28// All rights reserved where applicable. This file is governed by the29// applicable project license, copyright notices and relevant law.30// Existing third-party rights and notices remain unaffected.31//32// License : None specified (no license file in this repository)33//34// Do not embed credentials, private keys, access tokens,35// certificates or confidential personal information.36//37// =============================================================================38// END OF SP BOUCHER SOURCE HEADER39// =============================================================================4041import Testing42@testable import QyvoraMigration4344@Suite struct MigrationTests {45 @Test func nothingProtocolDependentIsEnabled() {46 for c in MigrationEngine.capabilities where c.status != .available {47 #expect(!MigrationEngine.isEnabled(c.id))48 #expect(c.requirement != nil)49 }50 #expect(MigrationEngine.isEnabled("btc.p2wpkh") && MigrationEngine.isEnabled("eth.eip1559"))51 #expect(!MigrationEngine.isEnabled("btc.pq-signature") && !MigrationEngine.isEnabled("unknown"))52 #expect(Set(MigrationEngine.capabilities.map(\.id)).count == MigrationEngine.capabilities.count)53 }5455 @Test func noChainIsQuantumResistantToday() {56 #expect(!MigrationEngine.chainOffersQuantumResistance(.bitcoin))57 #expect(!MigrationEngine.chainOffersQuantumResistance(.ethereum))58 // every quantum-resistant capability waits for a protocol change59 #expect(MigrationEngine.capabilities.filter(\.quantumResistant).allSatisfy { $0.status == .awaitingProtocol })60 }6162 @Test func planSeparatesActionableFromBlocked() {63 let p = MigrationPlan.make(exposedBitcoinUTXOs: 2, reusedBitcoinAddresses: 1, ethereumKeyExposed: true, openApprovals: 3)64 #expect(p.actionable.map(\.id) == ["sweep-btc", "revoke-approvals"])65 #expect(p.blocked.map(\.id) == ["rotate-eth", "btc-pq", "eth-pq"])66 #expect(p.blocked.allSatisfy { $0.blockedBy != nil })67 let clean = MigrationPlan.make(exposedBitcoinUTXOs: 0, reusedBitcoinAddresses: 0, ethereumKeyExposed: false, openApprovals: 0)68 #expect(clean.actionable.isEmpty && clean.steps.count == 2)69 #expect(SignatureSchemes.witnessGrowth(SignatureSchemes.MLDSA65Native.self) > 40)70 }71}72